Migrating FDM-managed device to Cisco Secure Firewall Threat Defense Using Firewall Migration Manager

PDF

Migrating FDM-managed device to Cisco Secure Firewall Threat Defense Using Firewall Migration Manager

Export the FDM-managed device configuration file

Want to summarize with AI?

Log in

Follow these steps to export and download the configuration file for an FDM-managed device.


This task is only required if you want to manually upload an FDM-managed device configuration file. The configuration file from the device manager can be exported using the threat defense API. When the configuration is exported, the system creates a ZIP file. The ZIP file can be downloaded to the local workstation. The configuration itself is represented as objects defined using attribute-value pairs in a JSON-formatted text file.

When you do an export, you must specify which configurations to be included in the export file. A full export includes all the configuration in the export zip file.

The export zip file might include the following:

  • Attribute-value pairs that define each configured object. All configurable items are modeled as objects, not just those which are called “objects” in the device manager.

  • Remote Access VPN, the AnyConnect packages, and any other referenced files such as the Client profile XML files, the DAP XML file, and Hostscan packages.

  • Referenced clean list or custom detection list if you have configured custom file policies.

Procedure

  1. Create the JSON object body for the export.

    Example:

    Following is an example of the JSON object.
    
      "diskFileName": "string",
      "encryptionKey": "*********",
      "doNotEncrypt": false,
      "configExportType": "FULL_EXPORT",
      "deployedObjectsOnly": true,
      "entityIds": [
        "string"
      ],
      "jobName": "string",
      "type": "scheduleconfigexport"
    }
    

    The attributes are,

    • diskFileName—(Optional) The name of the export zip file. If you do not specify a name, the system generates a name by default. Even if you specify a name, the system might append characters to the name to ensure uniqueness. The name has a maximum length of 60 characters.

    • encryptionKey—An encryption key for the zip file. If you do not want to encrypt the file, skip this field, and specify doNotEncrypt: true instead. If you specify a key, use the key to open the zip file after you download it to your local machine. The exported configuration file exposes the secret keys, passwords, and other sensitive data in clear text (otherwise they cannot be imported). In this case you might want to apply an encryption key to protect sensitive data. The system uses AES 256 encryption.

    • doNotEncrypt—(Optional) Whether the export file should be encrypted (false), or not encrypted (true). The default is false, which means you must specify a non-empty encryption key attribute. If you specify true, then the encryption key attribute is ignored.

    • configExportType—You can select any of the following export types for exporting the configuration files:

      • FULL_EXPORT—Includes the entire configuration in the export file. This is the default option and should be selected for migration.

    • deployedObjectsOnly—(Optional) Whether to include objects in the export file only if they have been deployed. The default is false, which means all pending changes are included in the export. Specify true to exclude pending changes.

    • entityIds—A comma-separated list of the identities with a set of starting-point objects enclosed in [brackets]. The list is required for a PARTIAL_EXPORT job. Each item the list could be either a UUID value or an attribute-value pair matching patterns like "id=uuid-value", "type=object-type" or "name=object-name". For example, "type=networkobject"

      • The type can be a leaf entity, such as network object, or an alias of a set of leaf types. Some typical type aliases are: network (NetworkObject and NetworkObjectGroup), port (all TCP/UDP/ICMP port, protocol and group types), url (URL objects and groups), ikepolicy (IKE V1/V2 policies), ikeproposal (Ike V1/V2 proposals), identitysource (all identity sources), certificate (all certificate types), object (all object/group types that would be listed in the device manager on the Objects page), interface (all network interfaces, s2svpn (all site-to-site VPN related types), ravpn (all RA VPN related types), vpn (both s2svpn and ravpn).

      • All the objects and their outgoing referential descendants will be included in the PARTIAL_EXPORT output file. All the unexportable objects will be excluded from the output even if you specify their identities. Use the GET method for the appropriate resource types to obtain the UUIDs, types, or names for the target objects.

      For example, to export all network objects, plus an access rule named myaccessrule, and two objects identified by UUID, you can specify:

      "entityIds": [
         "type=networkobject", 
         "id=bab3e3cd-8c70-11e9-930a-1f12ee87d473", 
         "name=myaccessrule", 
         "acc2e3cd-8c70-11e9-930a-1f12ee87b286"
         ]",
    • jobName—(Optional) Giving the export job a name will make it easier to find it when you retrieve job status.

    • type—The job type is always scheduleconfigexport.

  2. Post the object.

    Example:

    The curl command would look like the following:
    
      curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ 
       "configExportType": "FULL_EXPORT", \ 
       "type": "scheduleconfigexport" \ 
    }' 'https://10.89.5.38/api/fdm/latest/action/configexport'
    
  3. Verify the response.

    You should get a response code of 200. If you posted the minimum JSON object, the successful response body would look like the following:

    {
      "version": null,
      "scheduleType": "IMMEDIATE",
      "user": "admin",
      "forceOperation": false,
      "jobHistoryUuid": "c7a8ba61-629a-11e9-8b8d-0fcc3c9d6d0b",
      "ipAddress": "10.24.5.177",
      "diskFileName": "export-config-1",
      "encryptionKey": null,
      "doNotEncrypt": true
      "configExportType": "FULL_EXPORT",
      "deployedObjectsOnly": false,
      "entityIds": null,
      "jobName": "Config Export",
      "id": "c79be920-629a-11e9-8b8d-85231be77de0",
      "type": "scheduleconfigexport",
      "links": {
        "self": "https://10.89.5.38/api/fdm/latest
    /action/configexport/c79be920-629a-11e9-8b8d-85231be77de0"
      }
    }
    
  4. Check the status of configuration export.

    It takes some time for an export to complete. The larger the configuration, the more time the job will require. Check the job status to ensure it completes successfully before you try to download the file.

    The simplest way to retrieve status is to use GET /jobs/configexportstatus. For example, the curl command would look like the following:

    curl -X GET --header 'Accept: application/json' 
    'https://10.89.5.38/api/fdm/latest/jobs/configexportstatus'
    
    A successfully completed job diplays the following status:
    {
      "version": "hdy62yf5xp3vf",
      "jobName": "Config Export",
      "jobDescription": null,
      "user": "admin",
      "startDateTime": "2019-04-19 13:14:54Z",
      "endDateTime": "2019-04-19 13:14:56Z",
      "status": "SUCCESS",
      "statusMessage": "The configuration was exported successfully",
      "scheduleUuid": "1ef502ad-62a5-11e9-8b8d-074ebc750708",
      "diskFileName": "export-config-1.zip",
      "messages": [],
      "configExportType": "FULL_EXPORT",
      "deployedObjectsOnly": false,
      "entityIds": null,
      "id": "1f0aad8e-62a5-11e9-8b8d-bb1ebb4d1300",
      "type": "configexportjobstatus",
      "links": {
        "self": "https://10.89.5.38/api/fdm/latest
    /jobs/configexportstatus/1f0aad8e-62a5-11e9-8b8d-bb1ebb4d1300"
      }
    }
    
  5. Download the export file.

    When an export job completes, the export file is written to the system disk and is called a configuration file. You can download this export file to your local machine using the GET /action/downloadconfigfile/{objId}.

    To get a list of the available files, use the GET /action/configfiles method.
    curl -X GET --header 'Accept: application/json' 
    'https://10.89.5.38/api/fdm/latest/action/configfiles'
    
    The response would show a list of items, each of which is a configuration file. For example, the following list shows 2 files. The id for all files are default and as a best practice you can ignore the ID and use the diskFileName instead.
    {
      "items": [
        {
          "diskFileName": "export-config-2.zip",
          "dateModified": "2019-04-19 13:32:28Z",
          "sizeBytes": 10182,
          "id": "default",
          "type": "configimportexportfileinfo",
          "links": {
            "self": "https://10.89.5.38/api/fdm/latest/action/configfiles/default"
          }
        },
        {
          "diskFileName": "export-config-1.zip",
          "dateModified": "2019-04-19 13:14:56Z",
          "sizeBytes": 10083,
          "id": "default",
          "type": "configimportexportfileinfo",
          "links": {
            "self": "https://10.89.5.38/api/fdm/latest/action/configfiles/default"
          }
        }
      ],
    
    Download the file using the diskFileName as the object ID.
    curl -X GET --header 'Accept: application/octet-stream' 
    'https://10.89.5.38/api/fdm/latest/action/downloadconfigfile/export-config-2.zip'
    

    The file is downloaded to your default downloads folder. If you are issuing the GET method from the API Explorer, and your browser is configured to prompt for download location, you will be prompted to save the file.

    Note

    A successful download will result in a 200 return code and no response body.