summaryrefslogtreecommitdiff
path: root/lib/oxidized/model
diff options
context:
space:
mode:
authorz00nx 0 <z00nx0@gmail.com>2018-05-06 18:10:38 +1000
committerz00nx 0 <z00nx0@gmail.com>2018-05-06 18:10:38 +1000
commit752760ba9c8be464553c1742313575889477ea46 (patch)
treeff01bc033ee2356b2af3fb9e76bdbb2285dc801a /lib/oxidized/model
parente97a7707c45f30390d721d752d76fdb5d701c72d (diff)
Added removal of secrets to pfsense
Diffstat (limited to 'lib/oxidized/model')
-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>/, ''