You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ bundle-audit
Insecure Source URI found: git://github.com/rails/turbolinks.git
Vulnerabilities found!
Note that the command is bundle-audit instead of bundler-audit.
bundler-audit is warning us that an "Insecure Source URI" has been found, and that's because a gem is installed from an insecure source git://github.com which could be subjected to MITM attacks.
The solution is to either install the gem from https:// or use a released gem.
How does bundler-audit knows about all the vulnerabilities?
Beneath the hood, bundler-audit is using data from ruby-advisory-db to check your Gemfile.lock. And while bundler-audit comes with a vendored data, you should update the ruby-advisory-db data everytime before you run bundle-audit:
$ bundle-audit update
Hook bundler-audit to your CI Workflow
It's easy to integrate bundler-audit as part of your CI workflow,
and the following steps work for any Ruby projects (doesn't have to be Rails).
First, add a rake Task:
$ touch lib/bundler/audit/task.rb
With following content:
require"rake/tasklib"moduleBundlermoduleAuditclassTask < Rake::TaskLibdefinitializedefineendprotecteddefdefinenamespace:bundledodesc"Updates the ruby-advisory-db then runs bundle-audit"task:auditdorequire"bundler/audit/cli"%w(updatecheck).eachdo |command|
Bundler::Audit::CLI.start[command]endendendendendendend
If you run your specs or tests with rake, add this to Rakefile:
bundler-audit
bundler-audit is a gem which provides patch-level verification for Bundler.
When you use Bundler, a lockfile
Gemfile.lock
will be generated in your project,and bundler-audit scans your
Gemfile.lock
to see if you are:http://
orgit@
Let's see how we can use bundler-audit.
First, install bundler-audit:
Let's take a look at an example. The following is the output ran against jollygoodcode/dasherize's Gemfile@
1eaf973
:$ bundle-audit Insecure Source URI found: git://github.com/rails/turbolinks.git Vulnerabilities found!
Note that the command is
bundle-audit
instead ofbundler-audit
.bundler-audit is warning us that an "Insecure Source URI" has been found, and that's because a gem is installed from an insecure source
git://github.com
which could be subjected to MITM attacks.The solution is to either install the gem from
https://
or use a released gem.How does bundler-audit knows about all the vulnerabilities?
Beneath the hood, bundler-audit is using data from ruby-advisory-db to check your Gemfile.lock. And while
bundler-audit
comes with a vendored data, you should update the ruby-advisory-db data everytime before you runbundle-audit
:Hook bundler-audit to your CI Workflow
It's easy to integrate bundler-audit as part of your CI workflow,
and the following steps work for any Ruby projects (doesn't have to be Rails).
First, add a
rake
Task:With following content:
If you run your specs or tests with
rake
, add this toRakefile
:Or any other form of rake file:
rakefile
,Rakefile
,rakefile.rb
,Rakefile.rb
.Now when you run
rake
with this new rake task,rake
will first run your tests,and then update
ruby-advisory-db
before executingbundle-audit
.Secure your app with bundler-audit today!
The bundler-audit is brought to you by rubysec, kudos to @rubysec & @postmodern.
Thanks for reading!
@JuanitoFatas ✏️ Jolly Good Code
About Jolly Good Code
We specialise in Agile practices and Ruby, and we love contributing to open source.
Speak to us about your next big idea, or check out our projects.
The text was updated successfully, but these errors were encountered: