summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <oh@onsteroids.net>2017-02-06 16:38:08 +0100
committerroot <oh@onsteroids.net>2017-02-06 16:38:08 +0100
commit19546b8b8cc672aa69474ab2c92a9d5714c81a7c (patch)
treeb263363bee7a23f24a365616c4c1e698956c1f70
parentb74e638066e0f0efeeb27042b8c0fde9839e721c (diff)
added secret removal for fortiOS
-rw-r--r--lib/oxidized/model/fortios.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/oxidized/model/fortios.rb b/lib/oxidized/model/fortios.rb
index cd379b7..43374d5 100644
--- a/lib/oxidized/model/fortios.rb
+++ b/lib/oxidized/model/fortios.rb
@@ -14,6 +14,12 @@ 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 password).*/, '\\1 <configuration removed>'
+ cfg.gsub! /(set passwd).*/, '\\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')