01-06-2020 10:44 AM
Posting an update from an earlier post where I mentioned an automation idea utilizing ISE Monitoring APIs in an attempt to gather assistance or suggestions, and help others:
The idea is for an IA member to move a computer object in AD to another security group (quarantine for ex.) upon desire/need to quarantine, run the py script, answer two questions, either shut port or re-auth an endpoint via ISE coa and move them into quarantine based on different authz results in ISE. The questions are:
1- Do you wish to terminate session or force re-auth?
2- Enter the endpoint MAC
Depending on user input the scipt runs different functions (Term_Sess or CoA_Reauth). It then parses the returned xml output to provide feedback to the IA user.
Where I am still working is the Sess_Update part. The goal here would be to provide the IA user with some sort of update that the endpoint session status was successful with actual verification of a vlan or ip move. Two tags I am working on targeting are:
<vlan>
<framed_ip_address>
This way the IA user can identify that a host has now moved to quarantine. The Sess_Update function needs work and is currently not working. However, when issuing a session update get request using curl I see returned xml output. The curl command used to identify the above tags I would like to reference is:
curl -k --include --user <USER/PASS> --request GET https://<ISE NODE>/admin/API/mnt/Session/MACAddress/XX:XX:XX:XX:XX:XX
See attached for script.
Thoughts? Any other ideas for endpoint update for IA user? Thanks!
Solved! Go to Solution.
01-14-2020 05:35 AM
Yes. Thank you for your response. I have the script working the way I expect it to work, but I am working with TAC for a CoA issue at the moment. For the IP check::
import re
....Skipping lines....
regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(
25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(
25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(
25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)'''
IP_ADDR = raw_input("Enter IP Address: ")
if (re.search(regex, IP_ADDR)):
print IP_ADDR
else:
print ("Invalid IP")
01-06-2020 10:49 AM
01-07-2020 10:43 AM
01-13-2020 08:07 PM
I hope you already found the answer yourself.
The net says, validate IP addresses and python - How do I validate the format of a MAC address? - Stack Overflow
I am not using Python enough to be proficient on it.
01-14-2020 05:35 AM
Yes. Thank you for your response. I have the script working the way I expect it to work, but I am working with TAC for a CoA issue at the moment. For the IP check::
import re
....Skipping lines....
regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(
25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(
25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(
25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)'''
IP_ADDR = raw_input("Enter IP Address: ")
if (re.search(regex, IP_ADDR)):
print IP_ADDR
else:
print ("Invalid IP")
01-14-2020 07:43 PM
Great to learn you are able to resolve it yourself. As CoA itself is separate and you are working with TAC, I will close this thread.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide