2017-03-31 02:02 PM
Since I no longer have access to my previous post sa_backup-1.0.9 - backup tool for Security Analytics 10.3, 10.4, 10.5 and a built-in backup feature is still pending on RSA I would like to share an updated script.
sa_backup is a tool to take a backup of configurations and some data of all Security Analytics components available on the appliance.
Tested with versions 10.3, 10.4, 10.5, 10.6.
The script is attached and also available on the GitHub: https://github.com/Jazzmax/rsa_sa_backup
The direct GitHub link to the script: https://raw.githubusercontent.com/Jazzmax/rsa_sa_backup/master/sa_backup.sh so can be grabbed using wget.
This has been tested when restoring on the same appliance and a fresh/re-imaged appliance (RMA-like scenario).
The following components are backed up:
After taking a backup the tool restores the original service status (start/stop)
Logs the progress to a file
Logs fatal errors to syslog
Checks if the tool is already running
Removes archives older than "n" days.
Rotates log file
Command line arguments - see the usage information.
Inline or file configuration to enable/disable backup of components
Option to backup custom user files
Test mode
Remote backup to NFS
The tool does NOT do:
- Backup of packets, meta, sessions or index data.
- Backup of a license server (fneserver).
Usage: ./sa_backup.sh
[OPTION...]
Please
modify the configuration section in the script or use an external configuration file. Examples: sa_backup --config=backup.conf --verbose sa_backup --backuponly=CORE
Main operation mode: -c, --config=CONFIG_FILE Use configuration file -b, --backuponly=COMPONENTS Backup only specified components: CORE - Core services SYS - OS configuration PUPPET - puppet master/agent configuration RABBITMQ - rabbitmq configuration MONGO - MongoDB/tokumx dump JETTY - SA application server settings RE - Reporting Engine MALWARE - Malware Analysis configuration ESA - Event Stream Analysis configuration IM - Incidint Management configuration IMDB - Incidint Management DB SMS - System Management System LC - Log collector WHC - Warehouse connector PGQSL - PostgreSQL database -t, --test Test mode; no backup performed -v, --verbose tar verbose switch -?, -h, --help Give this help list
Edit the configuration section in the script before running it.
BACKUPPATH=/root/sabackups # Local backup directory LOG=sa_backup.log # The backup log file LOG_MAX_DIM=10000000 # Max size of log file in bytes - 10MB RETENTION_DAYS=1 # Local backups retention in days (0 - no cleanup) # System files SYS_ENABLED=true # SA server / Jetty server SASERVER_ENABLED=false # Reporting engine RE_ENABLED=false RE_FULLBACKUP=0 # 0 - backup only RE configuration; # 1 - full RE backup . . .
This script must be run as "root" user.
Restoring is manual yet. You need to extract all tar.gz files using:
tar -C / -xvphzf backup.tar.gz
To restore MongoDB extract the mongo dump directory and run:
mongorestore -v --drop mongodb-dump.2015-06-07-22-40
Note: on ESA appliance to be able to restore the entire db dump you would need to temporarily disable the authentication in /etc/tokumx.conf:
sed -i "s/\(auth *= *\).*/\1false/" /etc/tokumx.conf
service tokumx restart
After the restore has been done enable the authentication back:
sed -i "s/\(auth *= *\).*/\1true/" /etc/tokumx.conf
service tokumx restart
2017-03-31 02:15 PM
in version 1.0.15
+ Added Incident Management remote database backup
* Fixed --backuponly option, other minor fixes
* Let SA 10.6 backup
* check_SAVersion checks the sarelease file first
2017-03-31 02:36 PM
Thanks Maxim. You'll be happy to know that RSA is planning to release a backup and restore tool with Netwitness Logs and Packets version 10.6.3. Release date and other information will be published on the RSA Link website when it's official.
2017-04-04 04:34 PM
To all customers reading this post:
Please note that any backup or restore script that is not an RSA official script, such as this one, cannot be supported by RSA Netwitness Support. You use these scripts at your own risk. If you have any issues with any of the unofficial scripts found within RSA Link, please reach out to their owners as RSA Netwitness Support will not be able to assist you. As mentioned in the comment above an official RSA Netwitness backup and restore script is scheduled to be available in 10.6.3 and above. If you have any questions about the official scripts please contact RSA Netwitness Support.
Thank you