This repository contains two Python scripts that facilitate the cloning of rules and rate limit rules within the Signal Sciences dashboard from one site to another.
Before you begin, ensure you have the following:
- Python 3.x installed on your system.
- The
requests
library installed in Python. You can install it withpip install requests
. - Your Signal Sciences API credentials (API user and API token).
Clone this repository to your local machine using the following command:
git clone https://github.com/yourusername/signalsciences-rule-cloner.git
cd signalsciences-rule-cloner
The scripts require Signal Sciences API credentials and the IDs of the source and destination sites to function correctly.
python3 rule_cloner.py <api_user> <api_token> <corp> --source_site <source_site_id> --destination_site <destination_site_id> --show_rules
# example
python3 rule_cloner.py [email protected] 12345-abcdefg-000-fffff --source_site staging --destination_site production --show_rules
To copy a single rule from one site to another, you can run rule_cloner.py with the --rule_id argument to specify which rule to copy.
python3 rule_cloner.py <api_user> <api_token> <corp> --source_site <source_site_id> --destination_site <destination_site_id> --rule_id <rule_id>
# example
python3 rule_cloner.py [email protected] 12345-abcdefg-000-fffff --source_site staging --destination_site production --rule_id 699effd2lop3daf55
python3 rule_cloner.py <api_user> <api_token> <corp> --source_site <source_site_id> --destination_site <destination_site_id>
# example
python3 rule_cloner.py [email protected] 12345-abcdefg-000-fffff --source_site staging --destination_site production
Please note that the tools and scripts provided in this repository are not officially supported by Fastly. They are developed and maintained on a voluntary basis. As such, we offer no guarantees regarding their reliability or suitability for any specific purpose.
Users are advised to utilize these scripts at their own risk. Updates and improvements will be made as and when possible, but no fixed timelines can be committed to. We appreciate your understanding and encourage users to contribute or report any issues they encounter.