summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2018-03-17 15:57:09 +0200
committerGitHub <noreply@github.com>2018-03-17 15:57:09 +0200
commit1062037bd1d2d269449c7374f52c9957c666b7d5 (patch)
treea3782ab1c001a9d988e0b8ed3173f05ac51a2c61
parentbeacfeaea9b12a7844796921b5807e531db5468c (diff)
parent577128f962f02e81ce7664e32fb97a46f2c220e8 (diff)
Merge pull request #1222 from yzguy/yzguy/edgeos_vyatta_secret_removal
add removal of secrets in edgeos, vyatta
-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