oxidized 0.21.0 → 0.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/no-response.yml +13 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +37 -0
- data/.rubocop_todo.yml +714 -0
- data/.travis.yml +7 -1
- data/CHANGELOG.md +341 -243
- data/Dockerfile +44 -16
- data/LICENSE +201 -0
- data/README.md +114 -82
- data/Rakefile +19 -0
- data/TODO.md +29 -23
- data/bin/oxidized +1 -2
- data/docs/Configuration.md +71 -31
- data/docs/Creating-Models.md +78 -0
- data/docs/Hooks.md +145 -41
- data/docs/Model-Notes/AireOS.md +12 -0
- data/docs/Model-Notes/ArbOS.md +12 -0
- data/docs/Model-Notes/Comware.md +14 -0
- data/docs/Model-Notes/EOS.md +9 -0
- data/docs/Model-Notes/JunOS.md +34 -0
- data/docs/Model-Notes/Netgear.md +68 -0
- data/docs/Model-Notes/README.md +19 -0
- data/docs/{VRP-Huawei.md → Model-Notes/VRP-Huawei.md} +10 -2
- data/docs/Model-Notes/XGS4600-Zyxel.md +39 -0
- data/docs/Outputs.md +27 -28
- data/docs/Ruby-API.md +38 -18
- data/docs/Sources.md +78 -16
- data/docs/Supported-OS-Types.md +171 -148
- data/extra/oxidized.logrotate +7 -0
- data/extra/oxidized.service +1 -1
- data/extra/rest_client.rb +4 -5
- data/extra/syslog.rb +16 -16
- data/lib/oxidized/cli.rb +3 -3
- data/lib/oxidized/config.rb +7 -4
- data/lib/oxidized/core.rb +3 -3
- data/lib/oxidized/hook.rb +64 -65
- data/lib/oxidized/hook/awssns.rb +2 -3
- data/lib/oxidized/hook/ciscosparkdiff.rb +49 -0
- data/lib/oxidized/hook/exec.rb +5 -5
- data/lib/oxidized/hook/githubrepo.rb +20 -14
- data/lib/oxidized/hook/slackdiff.rb +38 -19
- data/lib/oxidized/hook/xmppdiff.rb +58 -0
- data/lib/oxidized/input/cli.rb +5 -6
- data/lib/oxidized/input/ftp.rb +8 -7
- data/lib/oxidized/input/http.rb +39 -0
- data/lib/oxidized/input/ssh.rb +24 -22
- data/lib/oxidized/input/telnet.rb +38 -32
- data/lib/oxidized/jobs.rb +3 -4
- data/lib/oxidized/manager.rb +9 -4
- data/lib/oxidized/model/acos.rb +15 -16
- data/lib/oxidized/model/acsw.rb +3 -8
- data/lib/oxidized/model/aen.rb +1 -2
- data/lib/oxidized/model/aireos.rb +3 -5
- data/lib/oxidized/model/alteonos.rb +16 -18
- data/lib/oxidized/model/alvarion.rb +0 -4
- data/lib/oxidized/model/aos.rb +2 -4
- data/lib/oxidized/model/aos7.rb +2 -3
- data/lib/oxidized/model/aosw.rb +13 -15
- data/lib/oxidized/model/apc_aos.rb +0 -3
- data/lib/oxidized/model/arbos.rb +26 -0
- data/lib/oxidized/model/aricentiss.rb +51 -0
- data/lib/oxidized/model/asa.rb +33 -35
- data/lib/oxidized/model/asyncos.rb +41 -44
- data/lib/oxidized/model/audiocodes.rb +4 -8
- data/lib/oxidized/model/awplus.rb +84 -0
- data/lib/oxidized/model/boss.rb +6 -5
- data/lib/oxidized/model/br6910.rb +43 -45
- data/lib/oxidized/model/c4cmts.rb +3 -5
- data/lib/oxidized/model/cambium.rb +22 -0
- data/lib/oxidized/model/catos.rb +0 -2
- data/lib/oxidized/model/cisconga.rb +1 -3
- data/lib/oxidized/model/ciscosma.rb +37 -40
- data/lib/oxidized/model/ciscosmb.rb +7 -4
- data/lib/oxidized/model/comnetms.rb +43 -0
- data/lib/oxidized/model/comware.rb +9 -9
- data/lib/oxidized/model/coriant8600.rb +3 -5
- data/lib/oxidized/model/coriantgroove.rb +3 -5
- data/lib/oxidized/model/corianttmos.rb +1 -3
- data/lib/oxidized/model/cumulus.rb +26 -32
- data/lib/oxidized/model/datacom.rb +0 -2
- data/lib/oxidized/model/dcnos.rb +46 -0
- data/lib/oxidized/model/dlink.rb +1 -1
- data/lib/oxidized/model/dnos.rb +9 -5
- data/lib/oxidized/model/edgecos.rb +45 -0
- data/lib/oxidized/model/edgeos.rb +5 -3
- data/lib/oxidized/model/edgeswitch.rb +1 -3
- data/lib/oxidized/model/enterasys.rb +1 -3
- data/lib/oxidized/model/eos.rb +6 -8
- data/lib/oxidized/model/fabricos.rb +3 -5
- data/lib/oxidized/model/firewareos.rb +2 -5
- data/lib/oxidized/model/fortios.rb +21 -17
- data/lib/oxidized/model/ftos.rb +2 -4
- data/lib/oxidized/model/fujitsupy.rb +2 -4
- data/lib/oxidized/model/gaiaos.rb +6 -10
- data/lib/oxidized/model/gcombnps.rb +82 -0
- data/lib/oxidized/model/hatteras.rb +8 -5
- data/lib/oxidized/model/hirschmann.rb +8 -10
- data/lib/oxidized/model/hpebladesystem.rb +19 -17
- data/lib/oxidized/model/hpemsa.rb +0 -3
- data/lib/oxidized/model/ios.rb +54 -55
- data/lib/oxidized/model/iosxe.rb +5 -0
- data/lib/oxidized/model/iosxr.rb +1 -3
- data/lib/oxidized/model/ipos.rb +1 -3
- data/lib/oxidized/model/ironware.rb +12 -15
- data/lib/oxidized/model/isam.rb +4 -5
- data/lib/oxidized/model/junos.rb +8 -7
- data/lib/oxidized/model/masteros.rb +1 -3
- data/lib/oxidized/model/mlnxos.rb +3 -4
- data/lib/oxidized/model/model.rb +15 -7
- data/lib/oxidized/model/mtrlrfs.rb +1 -4
- data/lib/oxidized/model/ndms.rb +24 -0
- data/lib/oxidized/model/netgear.rb +3 -4
- data/lib/oxidized/model/netscaler.rb +0 -2
- data/lib/oxidized/model/nos.rb +1 -3
- data/lib/oxidized/model/nxos.rb +13 -3
- data/lib/oxidized/model/oneos.rb +6 -8
- data/lib/oxidized/model/openbsd.rb +76 -0
- data/lib/oxidized/model/opengear.rb +3 -5
- data/lib/oxidized/model/openwrt.rb +77 -0
- data/lib/oxidized/model/opnsense.rb +19 -0
- data/lib/oxidized/model/outputs.rb +1 -3
- data/lib/oxidized/model/panos.rb +1 -2
- data/lib/oxidized/model/pfsense.rb +9 -5
- data/lib/oxidized/model/planet.rb +8 -12
- data/lib/oxidized/model/powerconnect.rb +6 -9
- data/lib/oxidized/model/procurve.rb +18 -4
- data/lib/oxidized/model/quantaos.rb +3 -5
- data/lib/oxidized/model/routeros.rb +3 -2
- data/lib/oxidized/model/saos.rb +0 -1
- data/lib/oxidized/model/screenos.rb +3 -5
- data/lib/oxidized/model/sgos.rb +2 -3
- data/lib/oxidized/model/siklu.rb +0 -2
- data/lib/oxidized/model/slxos.rb +59 -0
- data/lib/oxidized/model/sros.rb +117 -0
- data/lib/oxidized/model/stoneos.rb +32 -0
- data/lib/oxidized/model/supermicro.rb +6 -41
- data/lib/oxidized/model/timos.rb +6 -114
- data/lib/oxidized/model/tmos.rb +1 -3
- data/lib/oxidized/model/tplink.rb +7 -11
- data/lib/oxidized/model/trango.rb +6 -7
- data/lib/oxidized/model/ucs.rb +0 -1
- data/lib/oxidized/model/voltaire.rb +3 -6
- data/lib/oxidized/model/voss.rb +1 -2
- data/lib/oxidized/model/vrp.rb +4 -5
- data/lib/oxidized/model/vyatta.rb +6 -4
- data/lib/oxidized/model/weos.rb +1 -3
- data/lib/oxidized/model/xos.rb +6 -5
- data/lib/oxidized/model/zhoneolt.rb +2 -2
- data/lib/oxidized/model/zynos.rb +1 -3
- data/lib/oxidized/model/zynoscli.rb +36 -0
- data/lib/oxidized/node.rb +11 -11
- data/lib/oxidized/node/stats.rb +15 -2
- data/lib/oxidized/nodes.rb +8 -8
- data/lib/oxidized/output/file.rb +41 -42
- data/lib/oxidized/output/git.rb +113 -115
- data/lib/oxidized/output/gitcrypt.rb +241 -242
- data/lib/oxidized/output/http.rb +23 -27
- data/lib/oxidized/output/output.rb +1 -2
- data/lib/oxidized/source/csv.rb +44 -45
- data/lib/oxidized/source/http.rb +52 -49
- data/lib/oxidized/source/source.rb +6 -7
- data/lib/oxidized/source/sql.rb +55 -51
- data/lib/oxidized/string.rb +3 -4
- data/lib/oxidized/version.rb +17 -1
- data/lib/oxidized/worker.rb +12 -3
- data/oxidized.gemspec +19 -13
- metadata +139 -51
- data/.ruby-version +0 -1
- data/Gemfile.lock +0 -44
@@ -0,0 +1,46 @@
|
|
1
|
+
# DCNOS is a ZebOS derivative by DCN (http://www.dcnglobal.com/)
|
2
|
+
# In addition to products by DCN (now Yunke China), this OS type
|
3
|
+
# powers a number of re-branded OEM devices.
|
4
|
+
|
5
|
+
# Developed against SNR S2950-24G 7.0.3.5
|
6
|
+
|
7
|
+
class DCNOS < Oxidized::Model
|
8
|
+
comment '! '
|
9
|
+
|
10
|
+
cmd :all do |cfg|
|
11
|
+
cfg.each_line.to_a[1..-1].join
|
12
|
+
end
|
13
|
+
|
14
|
+
cmd 'show version' do |cfg|
|
15
|
+
cfg.gsub! /\s(Uptime is).*/, ''
|
16
|
+
comment cfg
|
17
|
+
end
|
18
|
+
|
19
|
+
cmd 'show boot-files' do |cfg|
|
20
|
+
comment cfg
|
21
|
+
end
|
22
|
+
|
23
|
+
cmd 'show flash' do |cfg|
|
24
|
+
comment cfg
|
25
|
+
end
|
26
|
+
|
27
|
+
cmd 'show running-config' do |cfg|
|
28
|
+
cfg
|
29
|
+
end
|
30
|
+
|
31
|
+
cfg :telnet do
|
32
|
+
username /^login:/i
|
33
|
+
password /^password:/i
|
34
|
+
end
|
35
|
+
|
36
|
+
cfg :telnet, :ssh do
|
37
|
+
if vars :enable
|
38
|
+
post_login do
|
39
|
+
send "enable\n"
|
40
|
+
cmd vars(:enable)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
post_login 'terminal length 0'
|
44
|
+
pre_logout 'exit'
|
45
|
+
end
|
46
|
+
end
|
data/lib/oxidized/model/dlink.rb
CHANGED
@@ -11,7 +11,7 @@ class Dlink < Oxidized::Model
|
|
11
11
|
end
|
12
12
|
|
13
13
|
cmd :all do |cfg|
|
14
|
-
cfg.each_line.to_a[2..-2].map{|line|line.delete("\r").rstrip}.join("\n") + "\n"
|
14
|
+
cfg.each_line.to_a[2..-2].map { |line| line.delete("\r").rstrip }.join("\n") + "\n"
|
15
15
|
end
|
16
16
|
|
17
17
|
cmd 'show switch' do |cfg|
|
data/lib/oxidized/model/dnos.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
-
class DNOS
|
2
|
-
|
1
|
+
class DNOS < Oxidized::Model
|
3
2
|
# Force10 DNOS model #
|
4
3
|
|
5
4
|
comment '! '
|
6
5
|
|
7
6
|
cmd :all do |cfg|
|
7
|
+
cfg.gsub! /^% Invalid input detected at '\^' marker\.$|^\s+\^$/, ''
|
8
|
+
cfg.gsub! /^Dell Networking OS uptime is\s.+/, '' # Omit constantly changing uptime info
|
8
9
|
cfg.each_line.to_a[2..-2].join
|
9
10
|
end
|
10
11
|
|
11
|
-
cmd :secret do |cfg|
|
12
|
+
cmd :secret do |cfg|
|
12
13
|
cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
|
13
14
|
cfg.gsub! /secret (\d+) (\S+).*/, '<secret hidden>'
|
14
15
|
cfg
|
@@ -22,6 +23,10 @@ class DNOS < Oxidized::Model
|
|
22
23
|
comment cfg
|
23
24
|
end
|
24
25
|
|
26
|
+
cmd 'show version' do |cfg|
|
27
|
+
comment cfg
|
28
|
+
end
|
29
|
+
|
25
30
|
cmd 'show running-config' do |cfg|
|
26
31
|
cfg = cfg.each_line.to_a[3..-1].join
|
27
32
|
cfg
|
@@ -42,7 +47,6 @@ class DNOS < Oxidized::Model
|
|
42
47
|
post_login 'terminal length 0'
|
43
48
|
post_login 'terminal width 0'
|
44
49
|
pre_logout 'exit'
|
45
|
-
pre_logout 'exit'
|
50
|
+
pre_logout 'exit'
|
46
51
|
end
|
47
|
-
|
48
52
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
class EdgeCOS < Oxidized::Model
|
2
|
+
comment '! '
|
3
|
+
|
4
|
+
cmd :secret do |cfg|
|
5
|
+
cfg.gsub!(/password \d+ (\S+).*/, '<secret removed>')
|
6
|
+
cfg.gsub!(/community (\S+)/, 'community <hidden>')
|
7
|
+
cfg
|
8
|
+
end
|
9
|
+
|
10
|
+
cmd :all do |cfg|
|
11
|
+
cfg.each_line.to_a[2..-2].join
|
12
|
+
end
|
13
|
+
|
14
|
+
cmd 'show running-config'
|
15
|
+
|
16
|
+
cmd 'show access-list tcam-utilization' do |cfg|
|
17
|
+
comment cfg
|
18
|
+
end
|
19
|
+
|
20
|
+
cmd 'show memory' do |cfg|
|
21
|
+
comment cfg
|
22
|
+
end
|
23
|
+
|
24
|
+
cmd 'show system' do |cfg|
|
25
|
+
comment cfg
|
26
|
+
end
|
27
|
+
|
28
|
+
cmd 'show version' do |cfg|
|
29
|
+
comment cfg
|
30
|
+
end
|
31
|
+
|
32
|
+
cmd 'show watchdog' do |cfg|
|
33
|
+
comment cfg
|
34
|
+
end
|
35
|
+
|
36
|
+
cfg :telnet do
|
37
|
+
username /^Username:/
|
38
|
+
password /^Password:/
|
39
|
+
end
|
40
|
+
|
41
|
+
cfg :telnet, :ssh do
|
42
|
+
post_login 'terminal length 0'
|
43
|
+
pre_logout 'exit'
|
44
|
+
end
|
45
|
+
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
class Edgeos < Oxidized::Model
|
2
|
-
|
3
2
|
# EdgeOS #
|
4
3
|
|
5
4
|
prompt /\@.*?\:~\$\s/
|
@@ -9,11 +8,15 @@ class Edgeos < Oxidized::Model
|
|
9
8
|
end
|
10
9
|
|
11
10
|
cmd :secret do |cfg|
|
11
|
+
cfg.gsub! /encrypted-password (\S+).*/, 'encrypted-password <secret removed>'
|
12
|
+
cfg.gsub! /plaintext-password (\S+).*/, 'plaintext-password <secret removed>'
|
13
|
+
cfg.gsub! /password (\S+).*/, 'password <secret removed>'
|
14
|
+
cfg.gsub! /pre-shared-secret (\S+).*/, 'pre-shared-secret <secret removed>'
|
12
15
|
cfg.gsub! /community (\S+) {/, 'community <hidden> {'
|
13
16
|
cfg
|
14
17
|
end
|
15
18
|
|
16
|
-
cmd 'show configuration | no-more'
|
19
|
+
cmd 'show configuration commands | no-more'
|
17
20
|
|
18
21
|
cfg :telnet do
|
19
22
|
username /login:\s/
|
@@ -23,5 +26,4 @@ class Edgeos < Oxidized::Model
|
|
23
26
|
cfg :telnet, :ssh do
|
24
27
|
pre_logout 'exit'
|
25
28
|
end
|
26
|
-
|
27
29
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
class Enterasys < Oxidized::Model
|
2
|
-
|
3
2
|
# Enterasys B3/C3 models #
|
4
3
|
|
5
4
|
prompt /^.+\w\(su\)->\s?$/
|
@@ -7,7 +6,7 @@ class Enterasys < Oxidized::Model
|
|
7
6
|
comment '!'
|
8
7
|
|
9
8
|
cmd :all do |cfg|
|
10
|
-
|
9
|
+
cfg.each_line.to_a[2..-3].map { |line| line.delete("\r").rstrip }.join("\n") + "\n"
|
11
10
|
end
|
12
11
|
|
13
12
|
cmd 'show system hardware' do |cfg|
|
@@ -26,5 +25,4 @@ class Enterasys < Oxidized::Model
|
|
26
25
|
cfg :ssh do
|
27
26
|
pre_logout 'exit'
|
28
27
|
end
|
29
|
-
|
30
28
|
end
|
data/lib/oxidized/model/eos.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
class EOS < Oxidized::Model
|
2
|
-
|
3
2
|
# Arista EOS model #
|
4
3
|
|
5
4
|
prompt /^.+[#>]\s?$/
|
@@ -7,15 +6,15 @@ class EOS < Oxidized::Model
|
|
7
6
|
comment '! '
|
8
7
|
|
9
8
|
cmd :all do |cfg|
|
10
|
-
|
9
|
+
cfg.each_line.to_a[1..-2].join
|
11
10
|
end
|
12
11
|
|
13
12
|
cmd :secret do |cfg|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
|
14
|
+
cfg.gsub! /username (\S+) privilege (\d+) (\S+).*/, '<secret hidden>'
|
15
|
+
cfg.gsub! /^(enable secret).*/, '\\1 <configuration removed>'
|
16
|
+
cfg.gsub! /^(tacacs-server key \d+).*/, '\\1 <configuration removed>'
|
17
|
+
cfg
|
19
18
|
end
|
20
19
|
|
21
20
|
cmd 'show inventory | no-more' do |cfg|
|
@@ -41,5 +40,4 @@ class EOS < Oxidized::Model
|
|
41
40
|
end
|
42
41
|
pre_logout 'exit'
|
43
42
|
end
|
44
|
-
|
45
43
|
end
|
@@ -1,22 +1,20 @@
|
|
1
1
|
class FabricOS < Oxidized::Model
|
2
|
-
|
3
2
|
# Brocade Fabric OS model #
|
4
3
|
## FIXME: Only ssh exec mode support, no telnet, no ssh screenscraping
|
5
4
|
|
6
5
|
prompt /^([\w]+:+[\w]+[>]\s)$/
|
7
|
-
comment
|
6
|
+
comment '# '
|
8
7
|
|
9
8
|
cmd 'chassisShow' do |cfg|
|
10
9
|
comment cfg.each_line.reject { |line| line.match /Time Awake:/ or line.match /Power Usage \(Watts\):/ or line.match /Time Alive:/ or line.match /Update:/ }.join
|
11
10
|
end
|
12
11
|
|
13
12
|
cmd 'configShow -all' do |cfg|
|
14
|
-
cfg = cfg.each_line.reject { |line| line.match /date = /}.join
|
13
|
+
cfg = cfg.each_line.reject { |line| line.match /date = / }.join
|
15
14
|
cfg
|
16
15
|
end
|
17
16
|
|
18
17
|
cfg :ssh do
|
19
|
-
exec true
|
18
|
+
exec true # don't run shell, run each command in exec channel
|
20
19
|
end
|
21
|
-
|
22
20
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
class FirewareOS < Oxidized::Model
|
2
|
-
|
3
|
-
prompt /^([\w.@-]+[#>]\s?)$/
|
2
|
+
prompt /^\[?\w*\]?\w*?(<\w*>)?(#|>)\s*$/
|
4
3
|
comment '-- '
|
5
4
|
|
6
5
|
cmd :all do |cfg|
|
@@ -15,7 +14,7 @@ class FirewareOS < Oxidized::Model
|
|
15
14
|
|
16
15
|
cmd 'show sysinfo' do |cfg|
|
17
16
|
# avoid commits due to uptime
|
18
|
-
cfg = cfg.each_line.
|
17
|
+
cfg = cfg.each_line.reject { |line| line.match /(.*time.*)|(.*memory.*)|(.*cpu.*)/ }
|
19
18
|
cfg = cfg.join
|
20
19
|
comment cfg
|
21
20
|
end
|
@@ -25,6 +24,4 @@ class FirewareOS < Oxidized::Model
|
|
25
24
|
cfg :ssh do
|
26
25
|
pre_logout 'exit'
|
27
26
|
end
|
28
|
-
|
29
27
|
end
|
30
|
-
|
@@ -1,6 +1,5 @@
|
|
1
1
|
class FortiOS < Oxidized::Model
|
2
|
-
|
3
|
-
comment '# '
|
2
|
+
comment '# '
|
4
3
|
|
5
4
|
prompt /^([-\w\.\~]+(\s[\(\w\-\.\)]+)?\~?\s?[#>$]\s?)$/
|
6
5
|
|
@@ -15,15 +14,22 @@ class FortiOS < Oxidized::Model
|
|
15
14
|
end
|
16
15
|
|
17
16
|
cmd :secret do |cfg|
|
18
|
-
|
19
|
-
cfg.gsub! /(set
|
20
|
-
cfg.gsub! /(
|
17
|
+
# ENC indicates an encrypted password, and secret indicates a secret string
|
18
|
+
cfg.gsub! /(set .+ ENC) .+/, '\\1 <configuration removed>'
|
19
|
+
cfg.gsub! /(set .*secret) .+/, '\\1 <configuration removed>'
|
20
|
+
# A number of other statements also contains sensitive strings
|
21
|
+
cfg.gsub! /(set (?:passwd|password|key|group-password|auth-password-l1|auth-password-l2|rsso|history0|history1)) .+/, '\\1 <configuration removed>'
|
22
|
+
cfg.gsub! /(set private-key).*-+END ENCRYPTED PRIVATE KEY-*"$/m, '\\1 <configuration removed>'
|
23
|
+
cfg.gsub! /(set ca ).*-+END CERTIFICATE-*"$/m, '\\1 <configuration removed>'
|
24
|
+
cfg.gsub! /(set csr ).*-+END CERTIFICATE REQUEST-*"$/m, '\\1 <configuration removed>'
|
25
|
+
cfg.gsub! /(Cluster uptime:).*/, '\\1 <stripped>'
|
21
26
|
cfg
|
22
27
|
end
|
23
28
|
|
24
29
|
cmd 'get system status' do |cfg|
|
25
30
|
@vdom_enabled = cfg.include? 'Virtual domain configuration: enable'
|
26
31
|
cfg.gsub!(/(System time: )(.*)/, '\1<stripped>\3')
|
32
|
+
cfg.gsub! /(Virus-DB|Extended DB|IPS-DB|IPS-ETDB|APP-DB|INDUSTRIAL-DB|Botnet DB|IPS Malicious URL Database).*/, '\\1 <db version stripped>'
|
27
33
|
comment cfg
|
28
34
|
end
|
29
35
|
|
@@ -32,21 +38,21 @@ class FortiOS < Oxidized::Model
|
|
32
38
|
cfg << cmd('config global') if @vdom_enabled
|
33
39
|
|
34
40
|
cfg << cmd('get hardware status') do |cfg|
|
35
|
-
|
41
|
+
comment cfg
|
36
42
|
end
|
37
43
|
|
38
|
-
#default behaviour: include autoupdate output (backwards compatibility)
|
39
|
-
#do not include if variable "show_autoupdate" is set to false
|
40
|
-
if
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
44
|
+
# default behaviour: include autoupdate output (backwards compatibility)
|
45
|
+
# do not include if variable "show_autoupdate" is set to false
|
46
|
+
if defined?(vars(:fortios_autoupdate)).nil? || vars(:fortios_autoupdate)
|
47
|
+
cfg << cmd('diagnose autoupdate version') do |cfg|
|
48
|
+
cfg.gsub! /(FDS Address\n---------\n).*/, '\\1IP Address removed'
|
49
|
+
comment cfg.each_line.reject { |line| line.match /Last Update|Result/ }.join
|
50
|
+
end
|
45
51
|
end
|
46
52
|
|
47
|
-
cfg << cmd('end') if @vdom_enabled
|
53
|
+
cfg << cmd('end') if @vdom_enabled
|
48
54
|
|
49
|
-
cfg << cmd('show')
|
55
|
+
cfg << cmd('show full-configuration | grep .')
|
50
56
|
cfg.join "\n"
|
51
57
|
end
|
52
58
|
|
@@ -58,6 +64,4 @@ cfg << cmd('end') if @vdom_enabled
|
|
58
64
|
cfg :telnet, :ssh do
|
59
65
|
pre_logout "exit\n"
|
60
66
|
end
|
61
|
-
|
62
67
|
end
|
63
|
-
|
data/lib/oxidized/model/ftos.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
class FTOS
|
2
|
-
|
1
|
+
class FTOS < Oxidized::Model
|
3
2
|
# Force10 FTOS model #
|
4
3
|
|
5
4
|
comment '! '
|
@@ -8,7 +7,7 @@ class FTOS < Oxidized::Model
|
|
8
7
|
cfg.each_line.to_a[2..-2].join
|
9
8
|
end
|
10
9
|
|
11
|
-
cmd :secret do |cfg|
|
10
|
+
cmd :secret do |cfg|
|
12
11
|
cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
|
13
12
|
cfg.gsub! /secret (\d+) (\S+).*/, '<secret hidden>'
|
14
13
|
cfg
|
@@ -45,5 +44,4 @@ class FTOS < Oxidized::Model
|
|
45
44
|
end
|
46
45
|
pre_logout 'exit'
|
47
46
|
end
|
48
|
-
|
49
47
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
class FujitsuPY < Oxidized::Model
|
2
|
-
|
3
2
|
prompt /^(\([\w.-]*\)\s#|^\S+\#\s)$/
|
4
3
|
comment '! '
|
5
4
|
|
@@ -7,13 +6,13 @@ class FujitsuPY < Oxidized::Model
|
|
7
6
|
cfg.each_line.to_a[1..-2].join
|
8
7
|
end
|
9
8
|
|
10
|
-
# 1Gbe switch
|
9
|
+
# 1Gbe switch
|
11
10
|
cmd 'show version' do |cfg|
|
12
11
|
cfg.gsub! /^(<ERROR> : 2 : format error)$/, ''
|
13
12
|
comment cfg
|
14
13
|
end
|
15
14
|
|
16
|
-
# 10Gbe switch
|
15
|
+
# 10Gbe switch
|
17
16
|
cmd 'show system information' do |cfg|
|
18
17
|
cfg.gsub! /^Current-time : [\w\s:]*$/, ''
|
19
18
|
cfg.gsub! /^(\s{33}\^)$/, ''
|
@@ -38,5 +37,4 @@ class FujitsuPY < Oxidized::Model
|
|
38
37
|
send "n\n"
|
39
38
|
end
|
40
39
|
end
|
41
|
-
|
42
40
|
end
|
@@ -1,25 +1,23 @@
|
|
1
1
|
class GaiaOS < Oxidized::Model
|
2
|
-
|
3
2
|
# CheckPoint - Gaia OS Model
|
4
|
-
|
3
|
+
|
5
4
|
# Gaia Prompt
|
6
5
|
prompt /^([\[\]\w.@:-]+[#>]\s?)$/
|
7
6
|
|
8
7
|
# Comment tag
|
9
8
|
comment '# '
|
10
9
|
|
11
|
-
|
12
10
|
cmd :all do |cfg|
|
13
11
|
cfg = cfg.each_line.to_a[1..-2].join
|
14
12
|
end
|
15
13
|
|
16
14
|
cmd :secret do |cfg|
|
17
15
|
cfg.gsub! /^(set expert-password-hash ).*/, '\1<EXPERT PASSWORD REMOVED>'
|
18
|
-
cfg.gsub! /^(set user \S+ password-hash ).*/,'\1<USER PASSWORD REMOVED>'
|
19
|
-
cfg.gsub! /^(set ospf .* secret ).*/,'\1<OSPF KEY REMOVED>'
|
20
|
-
cfg.gsub! /^(set snmp community )(.*)( read-only.*)/,'\1<SNMP COMMUNITY REMOVED>\3'
|
21
|
-
cfg.gsub! /^(add snmp .* community )(.*)(\S?.*)/,'\1<SNMP COMMUNITY REMOVED>\3'
|
22
|
-
cfg.gsub! /(auth|privacy)(-pass-phrase-hashed )(\S*)/,'\1-pass-phrase-hashed <SNMP PASS-PHRASE REMOVED>'
|
16
|
+
cfg.gsub! /^(set user \S+ password-hash ).*/, '\1<USER PASSWORD REMOVED>'
|
17
|
+
cfg.gsub! /^(set ospf .* secret ).*/, '\1<OSPF KEY REMOVED>'
|
18
|
+
cfg.gsub! /^(set snmp community )(.*)( read-only.*)/, '\1<SNMP COMMUNITY REMOVED>\3'
|
19
|
+
cfg.gsub! /^(add snmp .* community )(.*)(\S?.*)/, '\1<SNMP COMMUNITY REMOVED>\3'
|
20
|
+
cfg.gsub! /(auth|privacy)(-pass-phrase-hashed )(\S*)/, '\1-pass-phrase-hashed <SNMP PASS-PHRASE REMOVED>'
|
23
21
|
cfg
|
24
22
|
end
|
25
23
|
|
@@ -36,11 +34,9 @@ class GaiaOS < Oxidized::Model
|
|
36
34
|
cfg
|
37
35
|
end
|
38
36
|
|
39
|
-
|
40
37
|
cfg :ssh do
|
41
38
|
# User shell must be /etc/cli.sh
|
42
39
|
post_login 'set clienv rows 0'
|
43
40
|
pre_logout 'exit'
|
44
41
|
end
|
45
|
-
|
46
42
|
end
|