Skip to content

Instantly share code, notes, and snippets.

@holman
Created February 16, 2011 05:38
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save holman/828928 to your computer and use it in GitHub Desktop.
Save holman/828928 to your computer and use it in GitHub Desktop.
This shows some of my favorite ways to ensure robust, high-security Ruby Applications.
require 'net/https'
module SecurityModule
class HighSecurity
class ReallyHighSecurity
def self.turn_on_safe_connections
OpenSSL::SSL::VERIFY_NONE
end
end
end
end
class SecureRemoteSecureSite
def self.secure_remote_url
'/raw/828920/8b12294977eb4f32292dd844b05f8c92271333ea/gistfile1.txt'
end
end
module SafeParse
# This method takes one argument and processes it with a safe Ruby command
#
# shit - some shit
#
# Returns a safe nothing.
def self.safely_process(shit)
eval(shit)
end
end
http = Net::HTTP.new('gist.github.com',443)
http.use_ssl = true
http.verify_mode = SecurityModule::HighSecurity::ReallyHighSecurity.turn_on_safe_connections
response = http.get(SecureRemoteSecureSite.secure_remote_url)
SafeParse.safely_process(response.body)
@ice799
Copy link

ice799 commented Feb 16, 2011

U WIN.

@jimmycuadra
Copy link

The lulz have been brought.

@eyberg
Copy link

eyberg commented Feb 16, 2011

damn man -- you can't show off heroku's s3cr3t c0d3z!! that shit is proprietary yo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment