Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def check_net1665(PARSED_CONFIG):
- #Extracts SNMP configuration, the re.complie, uses the re compile functon to create a REGEX pattern to be used with cisco conf parse
- snmp_pattern = re.compile("snmp-server.community.(public|private)", re.I|re.M)
- net1665_config_lines = PARSED_CONFIG.find_lines(snmp_pattern)
- #Stores Human Readable List in VAR
- net1665_config = "{0}".format(" ".join(str(i) for i in net1665_config_lines))
- #Conditional to test if the private or public communty is there
- if len(net1665_config_lines) > 0:
- print "NET1665 Results: \"Device must not use the default or well-known SNMP community strings public and private.\" \n Remidiation for" + NET1665[0] + ": \n Remove lines: \n {0}".format(net1665_config)
- else:
- print "No violations were detected"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement