<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Disabling multiple unused rules through the FMC API in Network Security</title>
    <link>https://community.cisco.com/t5/network-security/disabling-multiple-unused-rules-through-the-fmc-api/m-p/5232404#M1117968</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/169850"&gt;@Oliver Kaiser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to the whole API thing and just started using Postman to try a few things from a branch created from their FMC library.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I've reached your step 3 using the request called Read Hitcounts for Device"&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;GET: {{protocol}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;://&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;{{hostname}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/api/fmc_config/v1/domain/&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;{{domain_id}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/policy/accesspolicies/&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;{{accesspolicy_id}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/operational/hitcounts?filter=deviceId:&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;{{device_id}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;expanded=True&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Would you be able to elaborate how do I do step 4 and 5?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2024 12:42:20 GMT</pubDate>
    <dc:creator>atsukane</dc:creator>
    <dc:date>2024-12-04T12:42:20Z</dc:date>
    <item>
      <title>Disabling multiple unused rules through the FMC API</title>
      <link>https://community.cisco.com/t5/network-security/disabling-multiple-unused-rules-through-the-fmc-api/m-p/4284489#M1078011</link>
      <description>&lt;P&gt;Can multiple rules be referenced in the API script to disable those that are unused? &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 16:57:38 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/disabling-multiple-unused-rules-through-the-fmc-api/m-p/4284489#M1078011</guid>
      <dc:creator>Scott_22</dc:creator>
      <dc:date>2021-02-02T16:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling multiple unused rules through the FMC API</title>
      <link>https://community.cisco.com/t5/network-security/disabling-multiple-unused-rules-through-the-fmc-api/m-p/4284716#M1078020</link>
      <description>&lt;P&gt;Yes, this is possible. but how are you identifying the unused ACP rules? and will you be doing this through a script or using Postman, etc.?&lt;/P&gt;
&lt;P&gt;depending on how you are doing this, you may (or may not) need to add ?bulk=true to the end of the POST URL you will be using.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 21:33:20 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/disabling-multiple-unused-rules-through-the-fmc-api/m-p/4284716#M1078020</guid>
      <dc:creator>Marius Gunnerud</dc:creator>
      <dc:date>2021-02-02T21:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling multiple unused rules through the FMC API</title>
      <link>https://community.cisco.com/t5/network-security/disabling-multiple-unused-rules-through-the-fmc-api/m-p/4284734#M1078022</link>
      <description>&lt;P&gt;6.4.0 introduced an api endpoint for hitcounts. You could do the following to disable all rules without hitcount&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. PUT to&amp;nbsp;/policy/accesspolicies/{container_uuid}/operational/hitcounts) to update hitcounts (no payload needed)&lt;BR /&gt;2. GETto&amp;nbsp;/policy/accesspolicies/{container_uuid}/operational/hitcounts to get all hitcount data&lt;/P&gt;&lt;P&gt;3. GET to&amp;nbsp;/policy/accesspolicies/{container_uuid}/accessrules to read all accessruled&lt;/P&gt;&lt;P&gt;4. Loop through all hitcounts, check if hitcount = 0, edit the corresponding accessrule to set state to DISABLED (as fetched via step 3)&amp;nbsp;&lt;/P&gt;&lt;P&gt;5. PUT to&amp;nbsp;/policy/accesspolicies/{container_uuid}/accessrules?bulk=True with the list of rules that you want to change&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a python library to interface with FMC, maybe that will be helpful to you: &lt;A href="https://github.com/kaisero/fireREST" target="_blank"&gt;https://github.com/kaisero/fireREST&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There is also another cool project called fmcapi that you could look into&amp;nbsp;&lt;A href="https://github.com/daxm/fmcapi" target="_blank"&gt;https://github.com/daxm/fmcapi&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 22:06:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/disabling-multiple-unused-rules-through-the-fmc-api/m-p/4284734#M1078022</guid>
      <dc:creator>Oliver Kaiser</dc:creator>
      <dc:date>2021-02-02T22:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling multiple unused rules through the FMC API</title>
      <link>https://community.cisco.com/t5/network-security/disabling-multiple-unused-rules-through-the-fmc-api/m-p/5232404#M1117968</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/169850"&gt;@Oliver Kaiser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to the whole API thing and just started using Postman to try a few things from a branch created from their FMC library.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I've reached your step 3 using the request called Read Hitcounts for Device"&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;GET: {{protocol}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;://&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;{{hostname}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/api/fmc_config/v1/domain/&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;{{domain_id}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/policy/accesspolicies/&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;{{accesspolicy_id}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/operational/hitcounts?filter=deviceId:&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;{{device_id}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;expanded=True&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Would you be able to elaborate how do I do step 4 and 5?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 12:42:20 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/disabling-multiple-unused-rules-through-the-fmc-api/m-p/5232404#M1117968</guid>
      <dc:creator>atsukane</dc:creator>
      <dc:date>2024-12-04T12:42:20Z</dc:date>
    </item>
  </channel>
</rss>

