Skip to content

Commit b2ddce6

Browse files
committed
Add Audit Your Ruby Project For Any CVEs as a Ruby TIL
1 parent 63a57c6 commit b2ddce6

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
1010

1111
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
1212

13-
_1404 TILs and counting..._
13+
_1405 TILs and counting..._
1414

1515
---
1616

@@ -1089,6 +1089,7 @@ _1404 TILs and counting..._
10891089
- [Add Progress Reporting To Long-Running Script](ruby/add-progress-reporting-to-long-running-script.md)
10901090
- [Are They All True?](ruby/are-they-all-true.md)
10911091
- [Assert About An Object's Attributes With RSpec](ruby/assert-about-an-objects-attributes-with-rspec.md)
1092+
- [Audit Your Ruby Project For Any CVEs](ruby/audit-your-ruby-project-for-any-cves.md)
10921093
- [Assoc For Hashes](ruby/assoc-for-hashes.md)
10931094
- [Block Comments](ruby/block-comments.md)
10941095
- [Build HTTP And HTTPS URLs](ruby/build-http-and-https-urls.md)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Audit Your Ruby Project For Any CVEs
2+
3+
The [`bundler-audit` gem](https://github.com/rubysec/bundler-audit) is a handy
4+
tool that you can run manually or integrate into your CI workflow to warn you
5+
about any CVEs in your dependencies.
6+
7+
Running this tool without any arguments will perform a check of your
8+
`Gemfile.lock` file. It will check against the
9+
[`ruby-advisory-db`](https://github.com/rubysec/ruby-advisory-db) for any CVEs
10+
linked to your dependencies, down to the patch-level.
11+
12+
```bash
13+
$ bundle exec bundler-audit
14+
15+
Name: puma
16+
Version: 4.3.12
17+
CVE: CVE-2024-21647
18+
GHSA: GHSA-c2f4-cvqm-65w2
19+
Criticality: Medium
20+
URL: https://github.com/puma/puma/security/advisories/GHSA-c2f4-cvqm-65w2
21+
Title: Puma HTTP Request/Response Smuggling vulnerability
22+
Solution: upgrade to '~> 5.6.8', '>= 6.4.2'
23+
24+
Vulnerabilities found!
25+
```
26+
27+
In this example run, a vulnerability was found in the currently installed
28+
version of the `puma` gem.
29+
30+
I believe a standard `bundler-audit` command will make sure the advisory DB is
31+
up-to-date, but to be sure, you can run the `update` command.
32+
33+
```bash
34+
$ bundle exec bundler-audit update
35+
36+
Updating ruby-advisory-db ...
37+
From https://github.com/rubysec/ruby-advisory-db
38+
* branch master -> FETCH_HEAD
39+
Already up to date.
40+
Updated ruby-advisory-db
41+
ruby-advisory-db:
42+
advisories: 884 advisories
43+
last updated: 2024-03-26 16:27:16 -0700
44+
commit: 840f21aeeb8a06a93a3c3bf1e2a92d7167029992
45+
```

0 commit comments

Comments
 (0)