summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2017-04-15 14:30:48 +0300
committerGitHub <noreply@github.com>2017-04-15 14:30:48 +0300
commit4a5a654b3fe899c90dd26876177e2ded89811d70 (patch)
tree45e60f1d83942ac93daa2dcfc37d1b86ef7ba6c1
parented21e240eca0c1fafbce40ff71b8d827e9eeedb6 (diff)
parenta07b05d8685ba07380121e23757bb3631fffbe2a (diff)
Merge pull request #801 from drbild/improve-ios-secret-handling
Improve IOS secret handling
-rw-r--r--lib/oxidized/model/ios.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/oxidized/model/ios.rb b/lib/oxidized/model/ios.rb
index 0596f90..c3d5543 100644
--- a/lib/oxidized/model/ios.rb
+++ b/lib/oxidized/model/ios.rb
@@ -26,14 +26,15 @@ class IOS < Oxidized::Model
cmd :secret do |cfg|
cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
- cfg.gsub! /username (\S+) privilege (\d+) (\S+).*/, '<secret hidden>'
- cfg.gsub! /^username \S+ password \d \S+/, '<secret hidden>'
- cfg.gsub! /^username \S+ secret \d \S+/, '<secret hidden>'
- cfg.gsub! /^enable (password|secret) \d \S+/, '<secret hidden>'
+ cfg.gsub! /^(username \S+ privilege \d+) (\S+).*/, '\\1 <secret hidden>'
+ cfg.gsub! /^(username \S+ password \d) (\S+)/, '\\1 <secret hidden>'
+ cfg.gsub! /^(username \S+ secret \d) (\S+)/, '\\1 <secret hidden>'
+ cfg.gsub! /^(enable (password|secret) \d) (\S+)/, '\\1 <secret hidden>'
cfg.gsub! /^(\s+(?:password|secret)) (?:\d )?\S+/, '\\1 <secret hidden>'
- cfg.gsub! /wpa-psk ascii \d \S+/, '<secret hidden>'
- cfg.gsub! /key 7 \d.+/, '<secret hidden>'
- cfg.gsub! /^tacacs-server key \d \S+/, '<secret hidden>'
+ cfg.gsub! /^(.*wpa-psk ascii \d) (\S+)/, '\\1 <secret hidden>'
+ cfg.gsub! /^(.*key 7) (\d.+)/, '\\1 <secret hidden>'
+ cfg.gsub! /^(tacacs-server key \d) (\S+)/, '\\1 <secret hidden>'
+ cfg.gsub! /^(crypto isakmp key) (\S+) (.*)/, '\\1 <secret hidden> \\3'
cfg
end