diff options
author | Wild Kat <wk@users.noreply.github.com> | 2018-05-06 14:36:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-06 14:36:05 +0200 |
commit | b61a6aeef7baccd24f260f13b6618f14a8bd37ae (patch) | |
tree | 40a9a5cb630536c2de55d9841bf7e9258b9c7e92 /lib/oxidized | |
parent | a56ae15a4c0adb0870a752c955d1319c82c627da (diff) | |
parent | 752760ba9c8be464553c1742313575889477ea46 (diff) |
Merge pull request #1331 from z00nx/pfsense
Added removal of secrets to pfsense
Diffstat (limited to 'lib/oxidized')
-rw-r--r-- | lib/oxidized/model/pfsense.rb | 6 |
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>/, '' |