summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2017-02-06 17:59:58 +0200
committerGitHub <noreply@github.com>2017-02-06 17:59:58 +0200
commit86830621575d605ed2515e8c1df1fc0c6a87ab5b (patch)
tree4eaacc9c1a2ee5c4b2608b5cfca3c3c4ad573d01
parentb74e638066e0f0efeeb27042b8c0fde9839e721c (diff)
parent5d739943be7c696ce88e70b3d137833dc0be5f8c (diff)
Merge pull request #698 from mediumo/master
added secret removal for fortiOS
-rw-r--r--lib/oxidized/model/fortios.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/oxidized/model/fortios.rb b/lib/oxidized/model/fortios.rb
index cd379b7..fa8fd33 100644
--- a/lib/oxidized/model/fortios.rb
+++ b/lib/oxidized/model/fortios.rb
@@ -14,6 +14,11 @@ class FortiOS < Oxidized::Model
new_cfg << cfg.each_line.to_a[1..-2].map { |line| line.gsub(/(conf_file_ver=)(.*)/, '\1<stripped>\3') }.join
end
+ cmd :secret do |cfg|
+ cfg.gsub! /(set (?:passwd|password)).*/, '\\1 <configuration removed>'
+ cfg
+ end
+
cmd 'get system status' do |cfg|
@vdom_enabled = cfg.include? 'Virtual domain configuration: enable'
cfg.gsub!(/(System time: )(.*)/, '\1<stripped>\3')