Skip to content

Instantly share code, notes, and snippets.

@jgarber
Created December 3, 2013 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgarber/7770354 to your computer and use it in GitHub Desktop.
Save jgarber/7770354 to your computer and use it in GitHub Desktop.
Find Heroku apps that haven't been patched for CVE-2013-4164
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