Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added handling of more ios-xe and nxos secrets #3320

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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