From 05e1d505f2cc30e87b1cdcf90db966690882f610 Mon Sep 17 00:00:00 2001 From: Adam Smith Date: Thu, 15 Mar 2018 02:18:38 -0700 Subject: add secrets to sanitize in JunOS --- lib/oxidized/model/junos.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/oxidized/model/junos.rb') diff --git a/lib/oxidized/model/junos.rb b/lib/oxidized/model/junos.rb index 2f59414..4652ab1 100644 --- a/lib/oxidized/model/junos.rb +++ b/lib/oxidized/model/junos.rb @@ -13,7 +13,9 @@ class JunOS < Oxidized::Model end cmd :secret do |cfg| - cfg.gsub!(/encrypted-password (\S+).*/, '') + cfg.gsub!(/encrypted-password (\S+).*/, 'encrypted-password ') + cfg.gsub!(/pre-shared-key ascii-text (\S+).*/, 'pre-shared-key ascii-text ') + cfg.gsub!(/authentication-key (\S+).*/, 'authentication-key ') cfg.gsub!(/community (\S+) {/, 'community {') cfg end -- cgit v1.2.1 From 227f1af00c6d43e9627fa2803d90617bebcd1d83 Mon Sep 17 00:00:00 2001 From: Adam Smith Date: Thu, 15 Mar 2018 02:23:45 -0700 Subject: add hexadecimal for junos pre-shared-secret --- lib/oxidized/model/junos.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/oxidized/model/junos.rb') diff --git a/lib/oxidized/model/junos.rb b/lib/oxidized/model/junos.rb index 4652ab1..2ea0179 100644 --- a/lib/oxidized/model/junos.rb +++ b/lib/oxidized/model/junos.rb @@ -15,6 +15,7 @@ class JunOS < Oxidized::Model cmd :secret do |cfg| cfg.gsub!(/encrypted-password (\S+).*/, 'encrypted-password ') cfg.gsub!(/pre-shared-key ascii-text (\S+).*/, 'pre-shared-key ascii-text ') + cfg.gsub!(/pre-shared-key hexadecimal (\S+).*/, 'pre-shared-key hexadecimal ') cfg.gsub!(/authentication-key (\S+).*/, 'authentication-key ') cfg.gsub!(/community (\S+) {/, 'community {') cfg -- cgit v1.2.1 From 21e3d6490496573f25ef77fe8172766ac7d1a736 Mon Sep 17 00:00:00 2001 From: Wild Kat Date: Sat, 21 Apr 2018 13:27:05 +0200 Subject: the great makeover - standardize layout, alignment, indentation --- lib/oxidized/model/junos.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/oxidized/model/junos.rb') diff --git a/lib/oxidized/model/junos.rb b/lib/oxidized/model/junos.rb index 2ea0179..737a000 100644 --- a/lib/oxidized/model/junos.rb +++ b/lib/oxidized/model/junos.rb @@ -1,6 +1,5 @@ class JunOS < Oxidized::Model - - comment '# ' + comment '# ' def telnet @input.class.to_s.match(/Telnet/) @@ -8,7 +7,7 @@ class JunOS < Oxidized::Model cmd :all do |cfg| cfg = cfg.lines.to_a[1..-2].join if screenscrape - cfg.gsub!(/ scale-subscriber (\s+)(\d+)/,' scale-subscriber ') + cfg.gsub!(/ scale-subscriber (\s+)(\d+)/, ' scale-subscriber ') cfg.lines.map { |line| line.rstrip }.join("\n") + "\n" end @@ -32,7 +31,7 @@ class JunOS < Oxidized::Model out = '' case @model when 'mx960' - out << cmd('show chassis fabric reachability') { |cfg| comment cfg } + out << cmd('show chassis fabric reachability') { |cfg| comment cfg } when /^(ex22|ex33|ex4|ex8|qfx)/ out << cmd('show virtual-chassis') { |cfg| comment cfg } end @@ -49,7 +48,7 @@ class JunOS < Oxidized::Model end cfg :ssh do - exec true # don't run shell, run each command in exec channel + exec true # don't run shell, run each command in exec channel end cfg :telnet, :ssh do @@ -57,5 +56,4 @@ class JunOS < Oxidized::Model post_login 'set cli screen-width 0' pre_logout 'exit' end - end -- cgit v1.2.1