From 0dec0790f6e41cbeaf76de8fed106f7e845cd176 Mon Sep 17 00:00:00 2001 From: Nick Bailey Date: Fri, 6 Jul 2018 09:55:16 -0600 Subject: Changes to secret filtering: Fixed greedy regex's which would eat much of configuration. --- lib/oxidized/model/fortios.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/fortios.rb b/lib/oxidized/model/fortios.rb index 7269568..e9ccbc4 100644 --- a/lib/oxidized/model/fortios.rb +++ b/lib/oxidized/model/fortios.rb @@ -19,9 +19,9 @@ class FortiOS < Oxidized::Model cfg.gsub! /(set .*secret) .+/, '\\1 ' # A number of other statements also contains sensitive strings cfg.gsub! /(set (?:passwd|password|key|group-password|auth-password-l1|auth-password-l2|rsso|history0|history1)) .+/, '\\1 ' - cfg.gsub! /(set private-key).*-+END ENCRYPTED PRIVATE KEY-*"$/m, '\\1 ' - cfg.gsub! /(set ca ).*-+END CERTIFICATE-*"$/m, '\\1 ' - cfg.gsub! /(set csr ).*-+END CERTIFICATE REQUEST-*"$/m, '\\1 ' + cfg.gsub! /(set private-key ).*?-+END ENCRYPTED PRIVATE KEY-*"$/m, '\\1' + cfg.gsub! /(set ca ).*?-+END CERTIFICATE-*"$/m, '\\1' + cfg.gsub! /(set csr ).*?-+END CERTIFICATE REQUEST-*"$/m, '\\1' cfg.gsub! /(Cluster uptime:).*/, '\\1 ' cfg end -- cgit v1.2.1