Skip to content

Commit 3f09c7e

Browse files
committed
Use audited fork that allows reading encrypted attrs
Audited automatically replaces entries in the `audited_changes` field on audits with `[FILTERED]` for attributes that are encrypted. This is designed to prevent leaking of sensitive information in `audited_changes` which is an unencrypted field. The downside to this is that the `audited_changes` field now provides less information about what the audit actually changed. To solve this, collectiveidea/audited#694 adds additional configuration attributes: - `Audited.filter_encrypted_attributes = false` disables the automatic replacement with `[FILTERED]` - `Audited.encrypt_audited_changes = true` encrypts the actual entire `audited_changes` field, ensuring that sensitive information isn't leaked See: - collectiveidea/audited#690 - collectiveidea/audited#694
1 parent 1fc39c2 commit 3f09c7e

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
44
ruby "3.3.0"
55
gem "rails", "~> 7.1.3"
66

7-
gem "audited"
7+
gem "audited", git: "https://github.com/tvararu/audited", branch: "encryption"
88
gem "awesome_print"
99
gem "bootsnap", require: false
1010
gem "config"

Gemfile.lock

+10-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ GIT
66
capybara_accessible_selectors (0.11.0)
77
capybara (~> 3.36)
88

9+
GIT
10+
remote: https://github.com/tvararu/audited
11+
revision: 1a419bfcdb72d6e642e9481a4ea06799c3504c60
12+
branch: encryption
13+
specs:
14+
audited (5.6.0)
15+
activerecord (>= 5.2, < 7.2)
16+
activesupport (>= 5.2, < 7.2)
17+
918
GEM
1019
remote: https://rubygems.org/
1120
specs:
@@ -97,9 +106,6 @@ GEM
97106
asciidoctor-diagram-ditaamini (1.0.3)
98107
asciidoctor-diagram-plantuml (1.2024.0)
99108
ast (2.4.2)
100-
audited (5.6.0)
101-
activerecord (>= 5.2, < 7.2)
102-
activesupport (>= 5.2, < 7.2)
103109
awesome_print (1.9.2)
104110
backport (1.2.0)
105111
base64 (0.2.0)
@@ -549,7 +555,7 @@ DEPENDENCIES
549555
annotate
550556
asciidoctor
551557
asciidoctor-diagram
552-
audited
558+
audited!
553559
awesome_print
554560
bootsnap
555561
brakeman

config/initializers/audited.rb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# See https://github.com/collectiveidea/audited/pull/694
2+
Audited.filter_encrypted_attributes = false
3+
Audited.encrypt_audited_changes = true

0 commit comments

Comments
 (0)