diff options
| author | ytti <saku@ytti.fi> | 2017-02-16 15:37:58 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-16 15:37:58 +0200 | 
| commit | de81fdfad86f12318d6ca057018b67102b53b4c0 (patch) | |
| tree | 63aee7154725f5281385b0066ded3a7176caac86 /lib/oxidized | |
| parent | 84921f07587efe8c92f3e4576ba6ac016b33a951 (diff) | |
| parent | 261e6d41f1daa6f37c2a0c5e3b059cbfd77dc895 (diff) | |
Merge pull request #727 from mediumo/fortios
fortiOS updates: secret removal, autoupdate messages
Diffstat (limited to 'lib/oxidized')
| -rw-r--r-- | lib/oxidized/model/fortios.rb | 16 | 
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 + | 
