summaryrefslogtreecommitdiff
path: root/lib/oxidized/model
diff options
context:
space:
mode:
authorAdam Smith <zero1three@gmail.com>2018-03-15 01:54:55 -0700
committerAdam Smith <zero1three@gmail.com>2018-03-15 01:54:55 -0700
commit577128f962f02e81ce7664e32fb97a46f2c220e8 (patch)
tree07daa74e8cd4d04ae1b56288041c3efb7da06fb1 /lib/oxidized/model
parent5a879372227bbacffdccab94349ec44aab47a26f (diff)
add removal of secrets in edgeos, vyatta
Diffstat (limited to 'lib/oxidized/model')
-rw-r--r--lib/oxidized/model/edgeos.rb4
-rw-r--r--lib/oxidized/model/vyatta.rb4
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/oxidized/model/edgeos.rb b/lib/oxidized/model/edgeos.rb
index bb0aab5..aa7a197 100644
--- a/lib/oxidized/model/edgeos.rb
+++ b/lib/oxidized/model/edgeos.rb
@@ -9,6 +9,10 @@ class Edgeos < Oxidized::Model
end
cmd :secret do |cfg|
+ cfg.gsub! /encrypted-password (\S+).*/, 'encrypted-password <secret removed>'
+ cfg.gsub! /plaintext-password (\S+).*/, 'plaintext-password <secret removed>'
+ cfg.gsub! /password (\S+).*/, 'password <secret removed>'
+ cfg.gsub! /pre-shared-secret (\S+).*/, 'pre-shared-secret <secret removed>'
cfg.gsub! /community (\S+) {/, 'community <hidden> {'
cfg
end
diff --git a/lib/oxidized/model/vyatta.rb b/lib/oxidized/model/vyatta.rb
index aa0bc74..57ec9d3 100644
--- a/lib/oxidized/model/vyatta.rb
+++ b/lib/oxidized/model/vyatta.rb
@@ -9,6 +9,10 @@ class Vyatta < Oxidized::Model
end
cmd :secret do |cfg|
+ cfg.gsub! /encrypted-password (\S+).*/, 'encrypted-password <secret removed>'
+ cfg.gsub! /plaintext-password (\S+).*/, 'plaintext-password <secret removed>'
+ cfg.gsub! /password (\S+).*/, 'password <secret removed>'
+ cfg.gsub! /pre-shared-secret (\S+).*/, 'pre-shared-secret <secret removed>'
cfg.gsub! /community (\S+) {/, 'community <hidden> {'
cfg
end