Skip to content

Commit 5553ce8

Browse files
committed
Add brakeman with GitHub action pipeline
For new Rails apps, brakeman is enabled by default
1 parent 3359b74 commit 5553ce8

4 files changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,25 @@ jobs:
150150
name: Slim-Lint Report
151151
title: Analyze Slim templates for linting issues
152152
path: checkstyle-result.xml
153+
154+
scan_ruby:
155+
runs-on: ubuntu-latest
156+
157+
steps:
158+
- name: Checkout code
159+
uses: actions/checkout@v4
160+
161+
- name: Set up Ruby
162+
uses: ruby/setup-ruby@v1
163+
with:
164+
ruby-version: .ruby-version
165+
bundler-cache: true
166+
167+
- name: Scan for common Rails security vulnerabilities using static analysis
168+
uses: reviewdog/action-brakeman@v2
169+
with:
170+
filter_mode: nofilter
171+
reporter: github-check
172+
skip_install: true
173+
use_bundler: true
174+
fail_on_error: true

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ gem 'sentry-ruby'
6565
group :development do
6666
gem 'better_errors'
6767
gem 'binding_of_caller'
68+
gem 'brakeman'
6869
gem 'i18n-tasks'
6970
gem 'letter_opener'
7071
gem 'listen'

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ GEM
9696
msgpack (~> 1.2)
9797
bootstrap-will_paginate (1.0.0)
9898
will_paginate
99+
brakeman (6.2.1)
100+
racc
99101
builder (3.3.0)
100102
bunny (2.23.0)
101103
amq-protocol (~> 2.3, >= 2.3.1)
@@ -605,6 +607,7 @@ DEPENDENCIES
605607
binding_of_caller
606608
bootsnap
607609
bootstrap-will_paginate
610+
brakeman
608611
capybara
609612
coffee-rails (>= 5.0.0)
610613
config

bin/brakeman

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
require 'rubygems'
5+
require 'bundler/setup'
6+
7+
ARGV.unshift('--ensure-latest')
8+
9+
load Gem.bin_path('brakeman', 'brakeman')

0 commit comments

Comments
 (0)