Skip to content

f5devcentral/f5xc-backup-restore-utils

F5 Distributed Cloud Backup and Restore Operations

Project Status: Active – The project has reached a stable, usable state and is being actively developed. GitHub branch checks state GitHub commit activity

powered by semgrep

Introduction

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).

Contents

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

Prerequisites

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.

Installation

Refer to INSTALL.md for installation instructions.

Usage

Refer to USAGE.md for usage instructions.

Example Output

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
================================================================================================================

About

Python script to backup and restore F5XC configuration objects

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages