Skip to content

Commit

Permalink
Merge pull request #3320 from ollewilhelm/ios-nxos-secrets
Browse files Browse the repository at this point in the history
Added handling of more ios-xe and nxos secrets
  • Loading branch information
robertcheramy authored Nov 15, 2024
2 parents 2d3d91f + 431576b commit 04eafd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/oxidized/model/ios.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class IOS < Oxidized::Model
cfg.gsub! /^( +dot1x username \S+ password \d) (.*)$/, '\\1 <secret hidden>'
cfg.gsub! /^( +mgmtuser username \S+ password \d) (.*) (secret \d) (.*)$/, '\\1 <secret hidden> \\3 <secret hidden>'
cfg.gsub! /^( +client \S+ server-key \d) (.*)$/, '\\1 <secret hidden>'
cfg.gsub! /^( +domain-password) \S+ ?(.*)/, '\\1 <secret hidden> \\2'
cfg.gsub! /^( +pre-shared-key).*/, '\\1 <configuration removed>'
cfg
end

Expand Down
3 changes: 2 additions & 1 deletion lib/oxidized/model/nxos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ def filter(cfg)
cfg.gsub! /^(snmp-server community).*/, '\\1 <secret hidden>'
cfg.gsub! /^(snmp-server user (\S+) (\S+) auth (\S+)) (\S+) (priv) (\S+)/, '\\1 <secret hidden> '
cfg.gsub! /^(snmp-server host.*? )\S+( udp-port \d+)?$/, '\\1<secret hidden>\\2'
cfg.gsub! /^(snmp-server mib community-map) \S+ ?(.*)/, '\\1 <secret hidden> \\2'
cfg.gsub! /(password \d+) (\S+)/, '\\1 <secret hidden>'
cfg.gsub! /^(radius-server key).*/, '\\1 <secret hidden>'
cfg.gsub! /^(radius-server .*key(?: \d+)?) \S+/, '\\1 <secret hidden>'
cfg.gsub! /^(tacacs-server .*key(?: \d+)?) \S+/, '\\1 <secret hidden>'
cfg
end
Expand Down

0 comments on commit 04eafd1

Please sign in to comment.