<?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: why we can't push the configuration by CLI in FTD? in Network Security</title>
    <link>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5002541#M1108240</link>
    <description>&lt;P&gt;It is possible to configure the FTD from the CLI, however this is only useful for small configuration changes, for example adding a static route in the instance where an incorrect static route is deployed from the FMC and access between FMC and FTD has been lost.&amp;nbsp; In these cases you would also be required to make the same changes in the FMC GUI as this configuration will be overwritten during the next deployment push.&lt;/P&gt;
&lt;P&gt;You can use API to add these objects to the FTD (https://&amp;lt;FMC IP&amp;gt;/api/api-explorer), or you can use the import Network Objects option in the GUI under Objects &amp;gt; Network and click on add network.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-01-22 at 14.45.11.png" style="width: 400px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/208178i14F994D012F51F10/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-01-22 at 14.45.11.png" alt="Screenshot 2024-01-22 at 14.45.11.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Mon, 22 Jan 2024 13:50:29 GMT</pubDate>
    <dc:creator>Marius Gunnerud</dc:creator>
    <dc:date>2024-01-22T13:50:29Z</dc:date>
    <item>
      <title>why we can't push the configuration by CLI in FTD?</title>
      <link>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5002356#M1108235</link>
      <description>&lt;P&gt;we have many deterrent FW, all of types I worked in have two options for the configuration, GUI of CLI&lt;/P&gt;&lt;P&gt;but in Cisco FTD there is no CLI option, which is make it very hard to add a long object of dynamic template for example&lt;/P&gt;&lt;P&gt;any solution for this weak point?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 08:42:06 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5002356#M1108235</guid>
      <dc:creator>Sudqi</dc:creator>
      <dc:date>2024-01-22T08:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: why we can't push the configuration by CLI in FTD?</title>
      <link>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5002376#M1108236</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/880401"&gt;@Sudqi&lt;/a&gt; no you cannot push configuration from CLI. You do have the option to use dynamic objects which can be uploaded via RestAPI and do not require a policy to be pushed.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://integratingit.wordpress.com/2021/06/19/ftd-dynamic-objects/" target="_blank"&gt;https://integratingit.wordpress.com/2021/06/19/ftd-dynamic-objects/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=Azvc7HR_cmo" target="_blank"&gt;https://www.youtube.com/watch?v=Azvc7HR_cmo&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 09:21:01 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5002376#M1108236</guid>
      <dc:creator>Rob Ingram</dc:creator>
      <dc:date>2024-01-22T09:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: why we can't push the configuration by CLI in FTD?</title>
      <link>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5002381#M1108237</link>
      <description>&lt;P&gt;Thanks Rob,&lt;/P&gt;&lt;P&gt;I mean the long object-group, and the dynamic template, and this is an example, I need to know the value for deny the CLI configuration in the FTD?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 09:33:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5002381#M1108237</guid>
      <dc:creator>Sudqi</dc:creator>
      <dc:date>2024-01-22T09:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: why we can't push the configuration by CLI in FTD?</title>
      <link>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5002541#M1108240</link>
      <description>&lt;P&gt;It is possible to configure the FTD from the CLI, however this is only useful for small configuration changes, for example adding a static route in the instance where an incorrect static route is deployed from the FMC and access between FMC and FTD has been lost.&amp;nbsp; In these cases you would also be required to make the same changes in the FMC GUI as this configuration will be overwritten during the next deployment push.&lt;/P&gt;
&lt;P&gt;You can use API to add these objects to the FTD (https://&amp;lt;FMC IP&amp;gt;/api/api-explorer), or you can use the import Network Objects option in the GUI under Objects &amp;gt; Network and click on add network.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-01-22 at 14.45.11.png" style="width: 400px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/208178i14F994D012F51F10/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-01-22 at 14.45.11.png" alt="Screenshot 2024-01-22 at 14.45.11.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 13:50:29 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5002541#M1108240</guid>
      <dc:creator>Marius Gunnerud</dc:creator>
      <dc:date>2024-01-22T13:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: why we can't push the configuration by CLI in FTD?</title>
      <link>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5002547#M1108242</link>
      <description>&lt;P&gt;&lt;A href="https://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;rct=j&amp;amp;opi=89978449&amp;amp;url=https://www.cisco.com/c/en/us/support/docs/security/firepower-management-center/215972-push-objects-in-bulk-to-fmc-using-rest-a.pdf&amp;amp;ved=2ahUKEwiZrL_tkvGDAxUURvEDHVuAAnAQFnoECAoQAQ&amp;amp;usg=AOvVaw2Uhq6uvymesiUcjX3tKdSq" target="_blank"&gt;https://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;rct=j&amp;amp;opi=89978449&amp;amp;url=https://www.cisco.com/c/en/us/support/docs/security/firepower-management-center/215972-push-objects-in-bulk-to-fmc-using-rest-a.pdf&amp;amp;ved=2ahUKEwiZrL_tkvGDAxUURvEDHVuAAnAQFnoECAoQAQ&amp;amp;usg=AOvVaw2Uhq6uvymesiUcjX3tKdSq&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Check this friend&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MHM&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 13:56:15 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5002547#M1108242</guid>
      <dc:creator>MHM Cisco World</dc:creator>
      <dc:date>2024-01-22T13:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: why we can't push the configuration by CLI in FTD?</title>
      <link>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5002605#M1108244</link>
      <description>&lt;P&gt;You may also find CSDAC useful, depending on your use case.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://secure.cisco.com/secure-firewall/docs/cisco-secure-dynamic-attribute-connector" target="_blank"&gt;https://secure.cisco.com/secure-firewall/docs/cisco-secure-dynamic-attribute-connector&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 14:55:39 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5002605#M1108244</guid>
      <dc:creator>Marvin Rhoads</dc:creator>
      <dc:date>2024-01-22T14:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: why we can't push the configuration by CLI in FTD?</title>
      <link>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5003124#M1108281</link>
      <description>&lt;P&gt;Unfortunately Marius, this method to import will import an object, not object group, so if we have 10,000 line, there will be 10,000 object,&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 06:32:19 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5003124#M1108281</guid>
      <dc:creator>Sudqi</dc:creator>
      <dc:date>2024-01-23T06:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: why we can't push the configuration by CLI in FTD?</title>
      <link>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5003437#M1108297</link>
      <description>&lt;P&gt;Then your only option would be to use API to do this.&lt;/P&gt;
&lt;P&gt;Here is a script you can use as a starting point for adding an object group to the FMC.&amp;nbsp; You will need to add some logic to it to parse through your object group and add it to the _object dictionary as needed.&amp;nbsp; You will also need to update the DOMAIN_UUID value to the FMC domain UUID.&lt;/P&gt;
&lt;P&gt;As always, before using the script in your production environment be sure to test it in a lab to make sure it does what you are expecting it to do.&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;#!/usr/bin/env python3

import json
from pprint import pprint
import requests
from requests.auth import HTTPBasicAuth
import sys

address = "10.10.10.10"
username = "user"
password = "password"
DOMAIN_UUID = "e276abec-e0f2-11e3-8169-6d9ed49b625f"

headers = {'Content-Type' : 'application/json'}

verify = False
if not verify:
    from requests.packages.urllib3.exceptions import InsecureRequestWarning
    requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

def get_auth_token(address, username, password):
    try:
        _api_uri = "/api/fmc_platform/v1/auth/generatetoken"
        _url = "https://" + address + _api_uri
        _response = requests.request("POST", _url, verify=False, auth=HTTPBasicAuth(username, password))
        accesstoken = _response.headers["X-auth-access-token"]
        refreshtoken = _response.headers["X-auth-refresh-token"]
        DOMAIN_UUID = _response.headers["DOMAIN_UUID"]

        return {"X-auth-access-token" : accesstoken, "X-auth-refresh-token" : refreshtoken, "DOMAIN_UUID" : DOMAIN_UUID}

    except Exception as err:
        print("Error in generating auth token --&amp;gt; " + str(err))
        sys.exit()

def send_data(action, api_uri, rule_data):
    try:
        _api_uri = api_uri
        _url = _api_uri

        #print(rule_data)

        _response = requests.request(f"{action}", _url, data=json.dumps(rule_data), verify = False, headers=headers)
        _status_code = _response.status_code
        _resp = _response.text
        json_rest = json.loads(_resp)
        print(json.dumps(json_rest,sort_keys=True,indent=4, separators=(",", ": ")))
        print()

        if _status_code == 201 or _status_code == 202:
            print(f"### {action} successful #### ")
            print()
            print()

        else:
            _response.raise_for_status()
            print(f"Error occured in {action} --&amp;gt; " + _resp)
            print()
    except requests.exceptions.HTTPError as _err:
        print("Error in connection --&amp;gt; " + str(_err))
        print()
        print()

def objectGroup():
    _object = {
        "name" : "NewObjectGroup",
        "type" : "NetworkGroup",
        "literals": [
            {"type": "Network",
            "value": "1.2.3.0/24"
            },
            {
            "type": "Host",
            "value": "1.2.3.4"
            }
        ],
        "objects": [
            {
            "type": "Network",
            "id": "1dcefdd8-07f7-438a-9221-97d63710614e"
            },
            {
            "type": "Host",
            "id": "04ea3f1f-f5a9-4eca-b051-487ebeb4c97f"
            }
        ]
    }
    return _object

#############
# MAIN CODE #
#############

response = get_auth_token(address, username, password)
headers["X-auth-access-token"] = response["X-auth-access-token"]
headers["X-auth-refresh-token"] = response["X-auth-refresh-token"]

netObjGrp_url = f"https://{address}/api/fmc_config/v1/domain/{DOMAIN_UUID}/object/networkgroups"

send_data("POST", netObjGrp_url, objectGroup())&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 11:41:42 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/why-we-can-t-push-the-configuration-by-cli-in-ftd/m-p/5003437#M1108297</guid>
      <dc:creator>Marius Gunnerud</dc:creator>
      <dc:date>2024-01-23T11:41:42Z</dc:date>
    </item>
  </channel>
</rss>

