summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2017-02-16 15:37:58 +0200
committerGitHub <noreply@github.com>2017-02-16 15:37:58 +0200
commitde81fdfad86f12318d6ca057018b67102b53b4c0 (patch)
tree63aee7154725f5281385b0066ded3a7176caac86
parent84921f07587efe8c92f3e4576ba6ac016b33a951 (diff)
parent261e6d41f1daa6f37c2a0c5e3b059cbfd77dc895 (diff)
Merge pull request #727 from mediumo/fortios
fortiOS updates: secret removal, autoupdate messages
-rw-r--r--lib/oxidized/model/fortios.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/oxidized/model/fortios.rb b/lib/oxidized/model/fortios.rb
index cdb50d5..2415537 100644
--- a/lib/oxidized/model/fortios.rb
+++ b/lib/oxidized/model/fortios.rb
@@ -15,7 +15,8 @@ class FortiOS < Oxidized::Model
end
cmd :secret do |cfg|
- cfg.gsub! /(set (?:passwd|password)).*/, '\\1 <configuration removed>'
+ cfg.gsub! /(set (?:passwd|password|psksecret)).*/, '\\1 <configuration removed>'
+ cfg.gsub! /(set private-key).*-+END ENCRYPTED PRIVATE KEY-*"$/m , '\\1 <configuration removed>'
cfg
end
@@ -30,14 +31,18 @@ class FortiOS < Oxidized::Model
cfg << cmd('config global') if @vdom_enabled
cfg << cmd('get hardware status') do |cfg|
- comment cfg
+ comment cfg
end
- cfg << cmd('diagnose autoupdate version') do |cfg|
- comment cfg.each_line.reject { |line| line.match /Last Update|Result/ }.join
+ #default behaviour: include autoupdate output (backwards compatibility)
+ #do not include if variable "show_autoupdate" is set to false
+ if defined?(vars(:fortios_autoupdate)).nil? || vars(:fortios_autoupdate)
+ cfg << cmd('diagnose autoupdate version') do |cfg|
+ comment cfg.each_line.reject { |line| line.match /Last Update|Result/ }.join
+ end
end
- cfg << cmd('end') if @vdom_enabled
+cfg << cmd('end') if @vdom_enabled
cfg << cmd('show')
cfg.join "\n"
@@ -53,3 +58,4 @@ class FortiOS < Oxidized::Model
end
end
+