Skip to content

Commit

Permalink
Merge pull request #262 from jmcgill298/asa_xlate
Browse files Browse the repository at this point in the history
CISCO ASA SHOW XLATE: Add new template
  • Loading branch information
jmcgill298 authored Oct 11, 2018
2 parents 40446c9 + d0bccdd commit 3c1ee82
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
33 changes: 33 additions & 0 deletions templates/cisco_asa_show_xlate.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Value SOURCE_INTF (\S+)
Value List SOURCE ([0-9a-fA-F:\./]{7,})
Value DESTINATION_INTF (\S+)
Value List DESTINATION ([0-9a-fA-F:\./]{7,})

Start
^\d+\s+in\s+use
^Flags:
^\S+\s+-\s+\S+
^NAT\s+from\s+${SOURCE_INTF}:${SOURCE} -> Continue
^NAT\s+from\s+\S+:[0-9a-fA-F:\./]+,\s+${SOURCE} -> Continue
^NAT\s+from\s+\S+:(?:[0-9a-fA-F:\./]+,\s+){2}${SOURCE},\s*$$
^NAT\s+from\s+\S+:(?:[0-9a-fA-F:\./]+,\s+){2}${SOURCE} -> Continue
^${SOURCE} -> Continue
^[0-9a-fA-F:\./]+,\s+${SOURCE} -> Continue
^(?:[0-9a-fA-F:\./]+,\s+){2}${SOURCE}
^.+to\s+${DESTINATION_INTF}:${DESTINATION}\s*$$ -> Dest
^.+to\s+${DESTINATION_INTF}:${DESTINATION} -> Continue
^.+to\s+\S+:[0-9a-fA-F:\./]+\s+${DESTINATION}\s*$$ -> Dest
^.+to\s+\S+:[0-9a-fA-F:\./]+\s+${DESTINATION} -> Continue
^.+to\s+\S+:(?:[0-9a-fA-F:\./]+\s+){2}${DESTINATION}\s*$$ -> Dest
^.*flags -> Record
^\s*$$
^. -> Error

Dest
^${DESTINATION} -> Continue
^[0-9a-fA-F:\./]+,\s+${DESTINATION} -> Continue
^(?:[0-9a-fA-F:\./]+,\s+){2}${DESTINATION}\s*$$
^(?:[0-9a-fA-F:\./]+,\s+){2}${DESTINATION}
^.*flags -> Record Start
^\s*$$
^. -> Error
1 change: 1 addition & 0 deletions templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ cisco_asa_show_inventory.template, .*, cisco_asa, sh[[ow]] inven[[tory]]
cisco_asa_show_failover.template, .*, cisco_asa, sh[[ow]] fa[[ilover]]
cisco_asa_show_version.template, .*, cisco_asa, sh[[ow]] ver[[sion]]
cisco_asa_show_route.template, .*, cisco_asa, sh[[ow]] ro[[ute]]
cisco_asa_show_xlate.template, .*, cisco_asa, sh[[ow]] x[[late]]
cisco_asa_show_name.template, .*, cisco_asa, sh[[ow]] nam[[e]]
cisco_asa_dir.template, .*, cisco_asa, dir

Expand Down
26 changes: 26 additions & 0 deletions tests/cisco_asa/show_xlate/cisco_asa_show_xlate.parsed
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
parsed_sample:
- source_intf: "any"
source: ["10.90.67.2"]
destination_intf: "any"
destination: ["10.9.1.0/24"]
- source_intf: "any"
source: ["10.1.1.0/24"]
destination_intf: "any"
destination: ["172.16.1.0/24"]
- source_intf: "any"
source: ["10.90.67.2"]
destination_intf: "any"
destination: ["10.86.94.0"]
- source_intf: "any"
source: ["10.9.0.9", "10.9.0.10/31", "10.9.0.12/30", "10.9.0.16/28", "10.9.0.32/29", "10.9.0.40/30", "10.9.0.44/31"]
destination_intf: "any"
destination: ["0.0.0.0"]
- source_intf: "any"
source: ["10.1.1.0/24"]
destination_intf: "any"
destination: ["172.16.1.0/24"]
- source_intf: "inside"
source: ["192.168.1.150"]
destination_intf: "outside"
destination: ["172.18.254.252"]
16 changes: 16 additions & 0 deletions tests/cisco_asa/show_xlate/cisco_asa_show_xlate.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
5 in use, 5 most used
Flags: D - DNS, i - dynamic, r - portmap, s - static, I - identity, T - twice
e - extended
NAT from any:10.90.67.2 to any:10.9.1.0/24
flags idle 277:05:26 timeout 0:00:00
NAT from any:10.1.1.0/24 to any:172.16.1.0/24
flags idle 277:05:26 timeout 0:00:00
NAT from any:10.90.67.2 to any:10.86.94.0
flags idle 277:05:26 timeout 0:00:00
NAT from any:10.9.0.9, 10.9.0.10/31, 10.9.0.12/30,
10.9.0.16/28, 10.9.0.32/29, 10.9.0.40/30,
10.9.0.44/31 to any:0.0.0.0
flags idle 277:05:26 timeout 0:00:00
NAT from any:10.1.1.0/24 to any:172.16.1.0/24
flags idle 277:05:14 timeout 0:00:00
NAT from inside:192.168.1.150 to outside:172.18.254.252 flags s idle 0:01:37 timeout 0:00:00

0 comments on commit 3c1ee82

Please sign in to comment.