Author Archives: cyruslab

[tufin]adding generic routes

Tufin securetrack is incapable of detecting routes that use policy based routing, a possible solution to include routes of policy based routing is to add generic routes. This can be found in this https://forum.tufin.com/support/kc/latest/index.htm?toc.htm?10626.htm you need to create a csv file … Continue reading

Posted in General stuffs | Tagged , | Leave a comment

[python]Comparing missing ip addresses between original inventory with object group

An inventory list is kept to record hostnames and ip addresses, this inventory list (inventory.xlsx) is currently maintained by automation. For every virtual machine created, the hostname and its corresponding ip address are recorded in the list, automation will update … Continue reading

Posted in Python, Scripting | Tagged , , , , , | Leave a comment

[python]Excluding ip addresses belonging a subnet

suppose if you need to enumerate ip addresses from a list, but want to exclude ip addresses belonging to a subnet here’s a solution which you can do with netaddr module. Supposed ip_from_inventory is the list of ip addresses you … Continue reading

Posted in Python, Scripting | Tagged , | Leave a comment

[python]Writing to temporary file

Supposed you have collected a list item known as ip_collections, and you want to write the list to a temp file. Need to convert the string in byte, the tf.seek(0) is to re-wind the pointer back to the start of … Continue reading

Posted in Python, Scripting | Tagged , | Leave a comment

[python]DNS resolution webapp with flask

Very simple webapp, I still need to do some styling with CSS… this is a simple concept. here’s an example: The output will be: Here are the jinja2 templates: Here’s the code.

Posted in Python, Scripting | Tagged , , | 2 Comments

[python] resolve a list of items from file

The list can be ip address, ip address range, ip subnet, firewall objects or hostname. The objective: If item is resolvable, resolve it and collect the ip address. If item is unresolvable, will collect it as it is. The list … Continue reading

Posted in Python, Scripting | Tagged , , | Leave a comment

[python]Resolve dns if hostname is resolvable else send as is

There are times which you need to try to resolve valid hostnames, however on user’s input there could be a possibility that the input contains ip addres, firewall objects or firewall object groups that are not resolvable. here’s a solution … Continue reading

Posted in Python, Scripting | Tagged , | Leave a comment