-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
126 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
__all__ = ["arp_inspection", "cdp", "console_vty", "dhcp_snooping", "dtp", "ip_global", "mode", "port_security", | ||
__all__ = ["arp_inspection","arp_proxy", "cdp", "console_vty", "dhcp_snooping", "dtp", "ip_global", "mode", "port_security", | ||
"services", "storm_control", "stp", "stp_global", "users","port_security","source_guard","vtp", "mop", "ipv6","lldp"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# ARP-proxy options check | ||
# Input: | ||
# interface dictionary | ||
# interface type from vlanmap | ||
# Output: | ||
# result dictionary | ||
# {'ARP-proxy': {'ARP-proxy': [severity(int), 'message', 'best practice']} | ||
# | ||
|
||
def global_check(global_dct): | ||
if 'arp_proxy' in global_dct: | ||
if global_dct['arp_proxy']=='disable': | ||
return 1,{'ARP-proxy': {'ARP-proxy': [2,'DISABLED']}} | ||
else: | ||
return 0, {'ARP-proxy': {'ARP-proxy': [0, 'enabled','ghj']}} | ||
return 0, 0 | ||
|
||
|
||
def _iface_check__proxy_check(iface_dct,result,scale): | ||
if 'arp_proxy' in iface_dct: | ||
if iface_dct['arp_proxy']=='no': | ||
return {'ARP-proxy':[scale[1],'ENABLED']} | ||
else: | ||
return {'ARP-proxy': [scale[0], 'DISABLED','ARP-proxy should be disabled']} | ||
|
||
|
||
|
||
|
||
def iface_check(iface_dct, vlanmap_type): | ||
result = {} | ||
|
||
# If this network segment is TRUSTED - enabled cdp is not a red type of threat, it will be colored in orange | ||
if vlanmap_type == 'TRUSTED': | ||
return _iface_check__proxy_check(iface_dct, result, [1, 2]) | ||
|
||
# Otherwise if network segment is CRITICAL or UNKNOWN or vlanmap is not defined - enabled cdp is a red type of threat | ||
else: | ||
return _iface_check__proxy_check(iface_dct, result, [0, 2]) | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters