10-11-2023 08:01 AM
I'm attempting to pull our access policy rules and get the allowed networks and port numbers using REST API. When trying to run the GET request {{baseURL}}/api/fmc_config/v1/domain/{{domainUUID}}/policy/accesspolicies/{{???}}/accessrules I keep getting a
11-01-2023 10:51 PM - edited 11-02-2023 11:17 PM
Rest API document: {{protocol}}://{{hostname}}/api/api-explorer/
For example:https://1.2.3.4/api/api-explorer/ (1.2.3.4 is FMC IP address or you can input FMC hostname here)
--------------------------
Device_id is FMC ID which can be found in the browser address after you access 'System>Health>Monitor>FMC'.
Container_uuid is the access control policy id which can be found in the browser address after you access 'Policies>Access Control>click one of your policies'.
I tested in lab to retrieve access control rules and took screenshots for your reference.
Step1: Generate Token
{{protocol}}://{{hostname}}/api/fmc_platform/v1/auth/generatetoken
Then you can find ‘token’ and ‘DOMAIN_UUI’ in headers after you click button ‘Send’
‘token’ and ‘DOMAIN_UUI’ will be used in next step.
Step2: Get Access Policy ID which is ‘Container ID’ .
option1: operate in FMC GUI directly
Container_uuid is the access control policy id which can be found in the browser address after you access 'Policies>Access Control>click one of your policies'.
option2: operate in postman
{{protocol}}://{{hostname}}/api/fmc_config/v1/domain/{{domain_id}}/policy/accesspolicies?limit=1000
Input the DOMAIN_UUID generated in last step and other required information in the screenshot, click ‘Send’ button, then we can get ‘id’ which is ‘policy id’ and we also call it ‘Container ID’ in the response body.
Step3: get access control rules
{{protocol}}://{{hostname}}/api/fmc_config/v1/domain/{{domain_id}}/policy/accesspolicies/{{accesspolicy_id}}/accessrules
Input ‘Domian_id’ which was generated in step1 and ‘accesspolicy_id’ (‘Container_uuid’) which was generated in step2, along with authentication and token information, click ‘Try’ button.
Then we can get Access Control Rules information in response body.
12-04-2023 09:42 AM
I'm going to try this in my lab. Will update.
11-02-2023 10:18 PM
This is pretty detailed!
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