Codesake::Dawn is a source code scanner designed to review your code for security issues. Basically a static analysis security scanner for ruby written web applications.
Codesake::Dawn is able to scan your ruby standalone programs but its main usage is to deal with web applications. It supports applications written using majors MVC (Model View Controller) frameworks, like Ruby on Rails, Sinatra & Padrino.
When you run Codesake::Dawn on your code it parses your project Gemfile.lock looking for the gems used and it tries to detect the ruby interpreter version you are using or you declared in your ruby version management tool you like most (RVM, rbenv, …).
Then the tool tries to detect the MVC framework your web application uses and it applies the security check accordingly. There checks designed to match rails application or checks that are appliable to any ruby code.
Codesake::Dawn can also understand the code in your views and to backtrack sinks to spot cross site scripting and sql injections introduced by the code you actually wrote. In the project roadmap this is the code most of the future development effort will be focused on.
Codesake::Dawn security scan result is a list of vulnerabilities with some mitigation actions you want to follow in order to build a stronger web application.
Usage: dawn [options] target_directory
$ dawn a_sinatra_webapp_directory
$ dawn -C the_rails_blog_engine
$ dawn -C --json a_sinatra_webapp_directory
$ dawn --ascii-tabular-report my_rails_blog_ecommerce
$ dawn --html -F my_report.html my_rails_blog_ecommerce
-r, --rails force dawn to consider the target a rails application
-s, --sinatra force dawn to consider the target a sinatra application
-p, --padrino force dawn to consider the target a padrino application
-G, --gem-lock force dawn to scan only for vulnerabilities affecting dependencies in Gemfile.lock
-a, --ascii-tabular-report cause dawn to format findings using table in ascii art
-j, --json cause dawn to format findings using json
-C, --count-only dawn will only count vulnerabilities (useful for scripts)
-z, --exit-on-warn dawn will return number of found vulnerabilities as exit code
-F, --file filename tells dawn to write output to filename
-c, --config-file filename tells dawn to load configuration from filename
Disable security check family
--disable-cve-bulletins disable all CVE security checks
--disable-code-quality disable all code quality checks
--disable-code-style disable all code style checks
--disable-owasp-ror-cheatsheet disable all Owasp Ruby on Rails cheatsheet checks
--disable-owasp-top-10 disable all Owasp Top 10 checks
Flags useful to query Codesake::Dawn
-S, --search-knowledge-base [check_name] search check_name in the knowledge base
--list-knowledge-base list knowledge-base content
--list-known-families list security check families contained in dawn's knowledge base
--list-known-framework list ruby MVC frameworks supported by dawn
-D, --debug enters dawn debug mode
-V, --verbose the output will be more verbose
-v, --version show version information
-h, --help show this help
codesake-dawn rubygem is cryptographically signed. To be sure the gem you install hasn’t been tampered, you must first add firstname.lastname@example.org public signing certificate as trusted to your gem specific keyring.
gem cert --add <(curl -Ls https://raw.githubusercontent.com/codesake/codesake-dawn/master/certs/paolo_at_codesake_dot_com.pem)
You can install latest Codesake::Dawn version, fetching it from Rubygems by typing:
gem install codesake-dawn -P MediumSecurity
Or read more here.