This repository contains tools designed to help network operations staff save and restore the configuration from their F5 Distributed Cloud tenant. These tools are scripts to run on a Linux server to create a backup file of the configuration settings (backup function) or to apply those settings to a system (restore function).
Prerequisites
Installation
Usage
Example Output
Important
The script in this repository will support the following configuration objects from F5 Distributed Cloud for backup and restore functions:
- HTTP Load Balancer
- TCP Load Balancer
- Origin Servers and Pools
- Health Check
- App Firewalls with it WAF exclusion policy
- API Definition
- Service Policy
- Rate Limiter Policy
- Malicious User Policy
- User Identification Policy
- IP Prefix Set
- Forward Proxy Policy
- Alert Policy
- Alert Receiver
- Global Log Receiver
- Certificate Management
- Certificate Management Chain
- Service Discovery
Before using these tools, you need to have the following:
- Python 3.x: This is the programming language in which the script is written. You need to have it installed on your system to run the script.
- F5 Distributed Cloud Tenant URL: This is the web address of your specific F5 Distributed Cloud tenant.
- F5 Distributed Cloud API Token: This is a credential that allows the script to modify settings inside your F5 Distributed Cloud tenant. You can obtain an API Token by following the instructions provided in the F5 documentation here.
- F5 Distributed Cloud Namespace: Before running any restore operations with the script, make sure the namespace (a specific area within your tenant where settings are applied) exists.
Refer to INSTALL.md for installation instructions.
Refer to USAGE.md for usage instructions.
The following is an example of output from a backup:
$ python3 f5xc-backup-restore.py -a backup -p /var/backup -n mcn-sample
======================================================================================================================
[STARTED] Date: 2024-02-21 07:05:26 UTC Tenant: f5xc-testdrive TASK: BACKUP Namespace: mcn-sample
======================================================================================================================
[mcn-sample] Backing up HTTP Loadbalancer object [mcn-sample-lb] ..... DONE
[mcn-sample] Backing up Origin Pool object [mcn-sample-originpool] ..... DONE
[mcn-sample] Backing up Health Check object [mcn-sample-hc] ..... DONE
[mcn-sample] Backing up App Firewall object [mcn-sample-appfw] ..... DONE
[mcn-sample] Backing up Malicious User Mitigation object [mcn-sample-maluser-policy] ..... DONE
================================================================================================================
[COMPLETED] Date: 2024-02-21 07:05:58 UTC Tenant: f5xc-testdrive
================================================================================================================
The following is an example of output from a restore:
$ python3 f5xc-backup-restore.py -a restore -p /var/backup/f5xc-backup-20240221_070526/ -n mcn-sample
==================================================================================================================================
[STARTED] Date: 2024-02-21 07:09:50 UTC Tenant: f5xc-testdrive TASK: RESTORE Namespace: mcn-sample
====================================================================================================================================
[mcn-sample] Restoring Health Check object from file [ mcn-sample_healthcheck-mcn-sample-hc.json ] ..... DONE
[mcn-sample] Restoring Origin Pool object from file [ mcn-sample_origin_pool-mcn-sample-originpool.json ] ..... DONE
[mcn-sample] Restoring App Firewall object from file [ mcn-sample_app_fw-mcn-sample-appfw.json ] ..... DONE
[mcn-sample] Restoring HTTP LoadBalancer object from file [ mcn-sample_http_lb-mcn-sample-lb.json ] ..... DONE
[mcn-sample] Restoring Malicious User Policy object from file [ mcn-sample_malicioususer_policy-mcn-sample-maluser-policy.json ] ..... DONE
================================================================================================================
[COMPLETED] Date: 2024-02-21 07:10:20 UTC Tenant: f5xc-testdrive
================================================================================================================