Skip to content

Commit 98f940e

Browse files
committed
Add security audit CI workflow and contributing docs
Introduces a non-blocking GitHub Actions workflow that runs bundler-audit and ruby-audit on dependency changes, weekly schedule, and manual dispatch. Documents local and CI usage in CONTRIBUTING.md.
1 parent 3f3dbf9 commit 98f940e

File tree

2 files changed

+89
-0
lines changed

2 files changed

+89
-0
lines changed

.github/workflows/audit.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Security Audit
3+
4+
on:
5+
pull_request:
6+
paths:
7+
- 'Gemfile'
8+
- 'Gemfile.lock'
9+
- '*.gemspec'
10+
push:
11+
branches:
12+
- main
13+
paths:
14+
- 'Gemfile'
15+
- 'Gemfile.lock'
16+
- '*.gemspec'
17+
schedule:
18+
- cron: '0 8 * * MON'
19+
workflow_dispatch: {}
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
audit:
26+
name: Dependency & Ruby Audit
27+
runs-on: ubuntu-24.04
28+
continue-on-error: true
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v6
32+
- name: Setup Ruby
33+
uses: ruby/setup-ruby@v1
34+
with:
35+
ruby-version: "3.4"
36+
bundler-cache: true
37+
- name: Run bundler-audit
38+
id: bundler_audit
39+
continue-on-error: true
40+
run: bundle exec bundler-audit check --update
41+
- name: Run ruby-audit
42+
id: ruby_audit
43+
continue-on-error: true
44+
run: bundle exec ruby-audit check
45+
- name: Audit summary
46+
run: |
47+
echo "## Security Audit Results" >> "$GITHUB_STEP_SUMMARY"
48+
echo "" >> "$GITHUB_STEP_SUMMARY"
49+
if [ "${{ steps.bundler_audit.outcome }}" = "success" ]; then
50+
echo "- **bundler-audit**: No vulnerabilities found" >> "$GITHUB_STEP_SUMMARY"
51+
else
52+
echo "- **bundler-audit**: Vulnerabilities detected — review output above" >> "$GITHUB_STEP_SUMMARY"
53+
fi
54+
if [ "${{ steps.ruby_audit.outcome }}" = "success" ]; then
55+
echo "- **ruby-audit**: No vulnerabilities found" >> "$GITHUB_STEP_SUMMARY"
56+
else
57+
echo "- **ruby-audit**: Vulnerabilities detected — review output above" >> "$GITHUB_STEP_SUMMARY"
58+
fi

CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,37 @@ up` to create a `Windows Server 2016 Core` VM, and run tests with
188188
189189
$ BOLT_WINRM_PORT=35985 BOLT_WINRM_SMB_PORT=3445 BOLT_WINRM_USER=vagrant BOLT_WINRM_PASSWORD=vagrant bundle exec rake ci:windows:agentful
190190
191+
## Security Auditing
192+
193+
OpenBolt includes [bundler-audit](https://github.com/rubysec/bundler-audit) and
194+
[ruby_audit](https://github.com/civisanalytics/ruby_audit) for scanning gem
195+
dependencies and the Ruby runtime against known CVEs.
196+
197+
### Running locally
198+
199+
Install the audit gems (included in the `:audit` Gemfile group) and run:
200+
201+
$ bundle exec bundler-audit check --update
202+
$ bundle exec ruby-audit check
203+
204+
`bundler-audit` scans the `Gemfile.lock` against the
205+
[ruby-advisory-db](https://github.com/rubysec/ruby-advisory-db).
206+
`ruby-audit` checks the running Ruby and RubyGems versions for known
207+
vulnerabilities.
208+
209+
### CI workflow
210+
211+
The `.github/workflows/audit.yaml` workflow runs both tools automatically:
212+
213+
- On pull requests and pushes to `main` when `Gemfile`, `Gemfile.lock`, or
214+
`*.gemspec` files change.
215+
- On a weekly schedule (Monday 08:00 UTC) to catch newly disclosed advisories.
216+
- Via manual dispatch.
217+
218+
The workflow is **non-blocking** — vulnerabilities are reported in the GitHub
219+
Actions job summary but do not prevent merges. This allows the team to triage
220+
and address findings without halting development.
221+
191222
### `rubocop` on Windows
192223
193224
To use `rubocop` on Windows, you must have a ruby install with a configured

0 commit comments

Comments
 (0)