summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/pfsense.rb
diff options
context:
space:
mode:
authorWild Kat <wk@users.noreply.github.com>2018-05-06 14:36:05 +0200
committerGitHub <noreply@github.com>2018-05-06 14:36:05 +0200
commitb61a6aeef7baccd24f260f13b6618f14a8bd37ae (patch)
tree40a9a5cb630536c2de55d9841bf7e9258b9c7e92 /lib/oxidized/model/pfsense.rb
parenta56ae15a4c0adb0870a752c955d1319c82c627da (diff)
parent752760ba9c8be464553c1742313575889477ea46 (diff)
Merge pull request #1331 from z00nx/pfsense
Added removal of secrets to pfsense
Diffstat (limited to 'lib/oxidized/model/pfsense.rb')
-rw-r--r--lib/oxidized/model/pfsense.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/oxidized/model/pfsense.rb b/lib/oxidized/model/pfsense.rb
index 278a126..13a6370 100644
--- a/lib/oxidized/model/pfsense.rb
+++ b/lib/oxidized/model/pfsense.rb
@@ -5,6 +5,12 @@ class PfSense < Oxidized::Model
cfg.each_line.to_a[1..-1].join
end
+ cmd :secret do |cfg|
+ cfg.gsub! /(\s+<bcrypt-hash>)[^<]+(<\/bcrypt-hash>)/, '\\1<secret hidden>\\2'
+ cfg.gsub! /(\s+<password>)[^<]+(<\/password>)/, '\\1<secret hidden>\\2'
+ cfg
+ end
+
cmd 'cat /cf/conf/config.xml' do |cfg|
cfg.gsub! /\s<revision>\s*<time>\d*<\/time>\s*.*\s*.*\s*<\/revision>/, ''
cfg.gsub! /\s<last_rule_upd_time>\d*<\/last_rule_upd_time>/, ''