Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes 387. Added a context firewall raw input, and added parsing for … #388

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions templates/cisco_asa_show_version.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Value VERSION (\S+)
Value DEVICE_MGR_VERSION (\S+)
Value COMPILE_DATE (\d+-\w+-\d+)
Value IMAGE (\S+)
Value HOSTNAME (\S+)
Value UPTIME (.+)
Expand All @@ -19,9 +20,10 @@ Value LAST_MOD (.+)
Start
^.*Software\sVersion\s${VERSION}
^Device.+\s${DEVICE_MGR_VERSION}
^Compiled on \w+\s+${COMPILE_DATE}.*
jvanderaa marked this conversation as resolved.
Show resolved Hide resolved
^System image file.+"${IMAGE}"
^${HOSTNAME} up ${UPTIME}
^Hardware:\s+${HARDWARE},
^Hardware:\s+${HARDWARE}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you keep the hardware line you deleted above the one you changed for hardware? This allows us to capture both instances without adding the extra comma.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checks fail with removing the comma on the raw2 file if I recall properly. I can retest again though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the no comma is needed for the use case found on the raw2 file. Take a peak at the couple of build attempts on #470. @FragmentedPacket

^Model Id:\s+${MODEL}
^Internal.+Flash,\s${FLASH}
^ \d+:.\S+\s${INTERFACES}.*
Expand All @@ -33,4 +35,3 @@ Start
^Cluster\s+:\s${CLUSTER}
^Serial Number:\s${SERIAL}
^.+last modified by\s${LAST_MOD}

Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ parsed_sample:

- version: '9.5(2)204'
device_mgr_version: '7.5(2)'
compile_date: '15-Feb-16'
image: 'boot:/asa952-204-smp-k8.bin'
hostname: 'asa1'
uptime: '41 days 19 hours'
hardware: 'ASAv, 2048 MB RAM, CPU Pentium II 1800 MHz'
hardware: 'ASAv, 2048 MB RAM, CPU Pentium II 1800 MHz,'
model: 'ASAv10'
flash: '8192MB'
interfaces:
Expand Down
21 changes: 21 additions & 0 deletions tests/cisco_asa/show_version/cisco_asa_show_version2.parsed
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
parsed_sample:

- version: '9.8(3)21'
device_mgr_version: '7.8(2)'
compile_date: '07-Aug-18'
image: ''
hostname: 'fw002'
uptime: '114 days 18 hours'
hardware: 'FPR4K-SM-12'
model: ''
flash: ''
interfaces: []
license_mode: 'Smart Licensing'
license_state: ''
max_intf: ''
max_vlans: ''
failover: 'Active/Active'
cluster: 'Enabled'
serial: ''
last_mod: 'thatperson at 09:15:45.959 EST Mon Dec 12 2018'
40 changes: 40 additions & 0 deletions tests/cisco_asa/show_version/cisco_asa_show_version2.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

Cisco Adaptive Security Appliance Software Version 9.8(3)21 <context>
Firepower Extensible Operating System Version 2.4(1.103)
Device Manager Version 7.8(2)

Compiled on Tue 07-Aug-18 23:18 PDT by builders

fw002 up 114 days 18 hours
failover cluster up 700 days 16 hours

Hardware: FPR4K-SM-12

License mode: Smart Licensing

Licensed features for this user context:
Failover : Active/Active
Encryption-DES : Enabled
Encryption-3DES-AES : Enabled
Carrier : Disabled
AnyConnect Premium Peers : 0
Other VPN Peers : 500
AnyConnect for Mobile : Enabled
AnyConnect for Cisco VPN Phone : Enabled
Advanced Endpoint Assessment : Enabled
Cluster : Enabled


Failover cluster licensed features for this user context:
Failover : Active/Active
Encryption-DES : Enabled
Encryption-3DES-AES : Enabled
Carrier : Disabled
AnyConnect Premium Peers : 0
Other VPN Peers : 500
AnyConnect for Mobile : Enabled
AnyConnect for Cisco VPN Phone : Enabled
Advanced Endpoint Assessment : Enabled
Cluster : Enabled

Configuration last modified by thatperson at 09:15:45.959 EST Mon Dec 12 2018