Skip to main content

A command-line tool to clone configuration objects between Palo Alto Networks Strata Cloud Manager (SCM) tenants.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

SCM Config Clone

Banner Image

Build Status PyPI version Python versions License

scm-config-clone is a command-line tool designed to seamlessly clone configuration objects between Palo Alto Networks Strata Cloud Manager (SCM) tenants. From addresses and tags to application groups and security rules, this tool streamlines migration tasks and reduces manual errors.

Table of Contents

Features

  • Simple Setup: Store credentials and defaults in a settings.yaml file for reuse.
  • Robust Cloning: Supports multiple object types (addresses, tags, services, security rules, IKE & IPsec VPN configurations, and more).
  • Extensive Filters: Exclude specific folders, snippets, or devices to narrow down cloned objects.
  • Flexible Controls: Run in dry-run mode, auto-approve changes, suppress console output, and create reports.
  • Commit & Push: Automatically commit changes after objects are cloned.

Installation

Requirements:

  • Python 3.10 or higher

Install directly from PyPI:

pip install scm-config-clone

Docker

Build Locally

# From repository root
docker build -t scm-config-clone -f ./docker/Dockerfile .

Pull from GitHub Container Registry

docker pull ghcr.io/cdot65/scm-config-clone:latest

Run the CLI

docker run --rm ghcr.io/cdot65/scm-config-clone --help

Create a settings.yaml (Windows example)

scm-clone stores credentials in a settings.yaml. If you prefer, copy settings.example.yaml to settings.yaml and edit manually.

To generate it interactively, mount the current working directory into /app inside the container:

# PowerShell (directory on Windows drive, e.g. C:)
docker run -it --rm -v "${PWD}:/app" ghcr.io/cdot65/scm-config-clone settings

# Windows CMD
docker run --rm -v "%cd%":/app ghcr.io/cdot65/scm-config-clone settings

A settings.yaml will be generated in your current directory. Subsequent commands should include the same mount so the CLI can read the file.

Working example (clone addresses)

PS C:\Users\cdot\Documents> docker run -it --rm -v "${PWD}:/app" ghcr.io/cdot65/scm-config-clone addresses
๐Ÿš€ Starting address objects cloning...
Name of source folder where objects are located: Austin
Name of destination folder where objects will go: Texas
INFO:scm_config_clone.commands.objects.address:Authenticated with source SCM tenant: 1527824794
INFO:scm_config_clone.commands.objects.address:Authenticated with destination SCM tenant: 1540792209
INFO:scm_config_clone.commands.objects.address:Retrieved 47 address objects from source folder 'Austin'.
INFO:scm_config_clone.commands.objects.address:Retrieved 15248 objects from destination folder 'Texas'
โ•’โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•คโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ••
โ”‚ Name               โ”‚ Destination Status   โ”‚
โ•žโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ก
โ”‚ snippet-object-1-1 โ”‚ x                    โ”‚
โ”‚ snippet-object-1   โ”‚ x                    โ”‚
โ”‚ snippet-object-2   โ”‚ x                    โ”‚
โ”‚ snippet-object-3   โ”‚ x                    โ”‚
โ”‚ dhcp_pool          โ”‚ x                    โ”‚
โ”‚ bulk_address_1     โ”‚ x                    โ”‚
โ”‚ bulk_address_2     โ”‚ x                    โ”‚
โ”‚ bulk_address_3     โ”‚ x                    โ”‚
โ”‚ bulk_address_4     โ”‚ x                    โ”‚
โ”‚ bulk_address_5     โ”‚ x                    โ”‚
โ”‚ bulk_address_6     โ”‚ x                    โ”‚
โ”‚ bulk_address_7     โ”‚ x                    โ”‚
โ”‚ bulk_address_8     โ”‚ x                    โ”‚
โ”‚ bulk_address_9     โ”‚ x                    โ”‚
โ”‚ bulk_address_10    โ”‚ x                    โ”‚
โ”‚ bulk_address_11    โ”‚ x                    โ”‚
โ”‚ bulk_address_12    โ”‚ x                    โ”‚
โ”‚ bulk_address_13    โ”‚ x                    โ”‚
โ”‚ bulk_address_14    โ”‚ x                    โ”‚
โ”‚ bulk_address_15    โ”‚ x                    โ”‚
โ”‚ bulk_address_16    โ”‚ x                    โ”‚
โ”‚ bulk_address_17    โ”‚ x                    โ”‚
โ”‚ bulk_address_18    โ”‚ x                    โ”‚
โ”‚ bulk_address_19    โ”‚ x                    โ”‚
โ”‚ bulk_address_20    โ”‚ x                    โ”‚
โ”‚ bulk_address_21    โ”‚ x                    โ”‚
โ”‚ bulk_address_22    โ”‚ x                    โ”‚
โ”‚ bulk_address_23    โ”‚ x                    โ”‚
โ”‚ bulk_address_24    โ”‚ x                    โ”‚
โ”‚ bulk_address_25    โ”‚ x                    โ”‚
โ”‚ bulk_address_26    โ”‚ x                    โ”‚
โ”‚ bulk_address_27    โ”‚ x                    โ”‚
โ”‚ bulk_address_28    โ”‚ x                    โ”‚
โ”‚ bulk_address_29    โ”‚ x                    โ”‚
โ”‚ bulk_address_30    โ”‚ x                    โ”‚
โ”‚ bulk_address_31    โ”‚ x                    โ”‚
โ”‚ bulk_address_32    โ”‚ x                    โ”‚
โ”‚ bulk_address_33    โ”‚ x                    โ”‚
โ”‚ bulk_address_34    โ”‚ x                    โ”‚
โ”‚ bulk_address_35    โ”‚ x                    โ”‚
โ”‚ bulk_address_36    โ”‚ x                    โ”‚
โ”‚ bulk_address_37    โ”‚ x                    โ”‚
โ”‚ bulk_address_38    โ”‚ x                    โ”‚
โ”‚ bulk_address_39    โ”‚ x                    โ”‚
โ”‚ bulk_address_40    โ”‚ x                    โ”‚
โ”‚ bulk_address_41    โ”‚ x                    โ”‚
โ”‚ bulk_address_42    โ”‚ x                    โ”‚
โ•˜โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•งโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•›
Do you want to proceed with creating these objects in the destination tenant? [y/N]: y
INFO:scm_config_clone.commands.objects.address:No new address objects were created, skipping commit.
๐ŸŽ‰ Address objects cloning completed successfully! ๐ŸŽ‰

Interactive settings file creation (full flow)

PS C:\Users\you\Documents> docker run -it --rm -v "${PWD}:/app" ghcr.io/cdot65/scm-config-clone settings
# ...interactive prompts...
๐ŸŽ‰ Setup complete! ๐ŸŽ‰

Docker Usage

From this point forward, you will need to mount your local settings.yaml file into the container at /app/settings.yaml.

PS C:\Users\you\Documents> docker run -it --rm -v "${PWD}:/app" ghcr.io/cdot65/scm-config-clone addresses --source-folder "Texas"

Basic Usage

Once installed, the primary command is scm-clone. Running --help displays global options and available sub-commands:

scm-clone --help

Youโ€™ll see a list of commands like addresses, tags, services, security-rules, and settings.

Creating the Settings File

Before cloning, create a settings.yaml file to store SCM credentials and defaults:

scm-clone settings

Youโ€™ll be prompted for source/destination credentials, logging level, and defaults for auto_approve, create_report, dry_run, and quiet. Once done, settings.yaml will be created in the current directory. Subsequent commands read from it, eliminating the need to re-enter credentials or defaults.

Cloning Objects

With settings.yaml ready, cloning objects typically involves specifying a folder and object type. For example, to clone address objects:

scm-clone addresses --source-folder "Texas"

If auto_approve is disabled by default in settings.yaml, youโ€™ll be prompted before actual creation. If you wish to override this at runtime:

scm-clone addresses --source-folder "Texas" -A

This command auto-approves without prompting. Similarly, to run in dry-run mode or commit after creation:

scm-clone addresses --source-folder "Texas" -D --commit-and-push

This simulates the creation without applying changes (-D) and would commit changes if actually applied. Remove -D to run it for real.

Testing

The project includes a comprehensive test suite with both unit and integration tests. Tests are written using pytest and use Factory Boy for creating test objects.

To run the tests:

# Install development dependencies
poetry install

# Run all tests with coverage
./run_tests.sh

# Run only unit tests
./run_tests.sh unit

# Run only integration tests
./run_tests.sh integration

For more details about the test suite, see tests/README.md.

Further Reading

  • Commands Reference: Detailed command flags, workflows, and parameters.
  • Examples: Practical, real-world usage patterns and integrations.
  • Getting Started: Step-by-step guide to initial setup and cloning workflows.

Contributing

Contributions are welcome! Please see the CONTRIBUTING file for guidelines.

License

scm-config-clone is licensed under the Apache 2.0 License. See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scm_config_clone-0.3.2.tar.gz (41.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scm_config_clone-0.3.2-py3-none-any.whl (160.0 kB view details)

Uploaded Python 3

File details

Details for the file scm_config_clone-0.3.2.tar.gz.

File metadata

  • Download URL: scm_config_clone-0.3.2.tar.gz
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Darwin/24.5.0

File hashes

Hashes for scm_config_clone-0.3.2.tar.gz
Algorithm Hash digest
SHA256 a0c1f9fdfc5fa86f3c3eeb2fc582e75bc662408465fb0e81011d19ff545761bc
MD5 26f5bc43266c4e6c203f11c7b40302c4
BLAKE2b-256 e22324f23deca2b7aa56d38e62f60f0e7f0e9f5bbfec390eec75da58f23a3aac

See more details on using hashes here.

File details

Details for the file scm_config_clone-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: scm_config_clone-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 160.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Darwin/24.5.0

File hashes

Hashes for scm_config_clone-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 decab3557abdc979afad08bacbe34653cd5a2192fe44bd1ee48db7e0f81208eb
MD5 941e43c9b3bb68fc8f75c0b38b064f09
BLAKE2b-256 668821293782567e6d600567af136c5119a2edb803e910e02780c599d96c664d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page