Created
December 3, 2013 14:48
-
-
Save jgarber/7770354 to your computer and use it in GitHub Desktop.
Find Heroku apps that haven't been patched for CVE-2013-4164
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GOOD_VERSIONS = %w[1.8.7p375 1.9.2p321 1.9.3p484 2.0.0p353] | |
apps = `heroku apps`.split("\n") | |
apps.each do |app| | |
next if app.include? "My Apps" | |
app = app.split(" ")[0] | |
output = `heroku run "ruby -v" -a #{app} 2>&1` | |
match = output.match(/ruby ([\d.p]+)/) | |
version = match ? match[1] : "unknown" | |
puts "#{app}\t#{version}\t#{GOOD_VERSIONS.include?(version) ? "OK" : "UPGRADE"}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment