summaryrefslogtreecommitdiff
path: root/lib/oxidized/model
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-07-18 16:31:43 +0300
committerGitHub <noreply@github.com>2016-07-18 16:31:43 +0300
commitd515ce4fda8557c58d90bc29177ac602a3e2e3d7 (patch)
tree53609d54ea396308df6bd9050d9faafdd2a8a85e /lib/oxidized/model
parent42ff6564f09a7316c032faff6da9e03a755dafca (diff)
parent6369c9c88c831919a4bbfbe722d808be6fb4b356 (diff)
Merge pull request #501 from totosh/master
Added model for Check Point GaiaOS
Diffstat (limited to 'lib/oxidized/model')
-rw-r--r--lib/oxidized/model/gaiaos46
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/oxidized/model/gaiaos b/lib/oxidized/model/gaiaos
new file mode 100644
index 0000000..434e774
--- /dev/null
+++ b/lib/oxidized/model/gaiaos
@@ -0,0 +1,46 @@
+class GaiaOS < Oxidized::Model
+
+ # CheckPoint - Gaia OS Model
+
+ # Gaia Prompt
+ prompt /^([\[\]\w.@:-]+[#>]\s?)$/
+
+ # Comment tag
+ comment '# '
+
+
+ cmd :all do |cfg|
+ cfg = cfg.each_line.to_a[1..-2].join
+ end
+
+ cmd :secret do |cfg|
+ cfg.gsub! /^(set expert-password-hash ).*/, '\1<EXPERT PASSWORD REMOVED>'
+ cfg.gsub! /^(set user \S+ password-hash ).*/,'\1<USER PASSWORD REMOVED>'
+ cfg.gsub! /^(set ospf .* secret ).*/,'\1<OSPF KEY REMOVED>'
+ cfg.gsub! /^(set snmp community )(.*)( read-only.*)/,'\1<SNMP COMMUNITY REMOVED>\3'
+ cfg.gsub! /^(add snmp .* community )(.*)(\S?.*)/,'\1<SNMP COMMUNITY REMOVED>\3'
+ cfg.gsub! /(auth|privacy)(-pass-phrase-hashed )(\S*)/,'\1-pass-phrase-hashed <SNMP PASS-PHRASE REMOVED>'
+ cfg
+ end
+
+ cmd 'show asset all' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show version all' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show configuration' do |cfg|
+ cfg.gsub! /^# Exported by \S+ on .*/, '# '
+ cfg
+ end
+
+
+ cfg :ssh do
+ # User shell must be /etc/cli.sh
+ post_login 'set clienv rows 0'
+ pre_logout 'exit'
+ end
+
+end