Backup and Restore Container Security
Note: These steps apply only to Tenable Enclave Security versions 1.6 and earlier. For later versions, see External PostgreSQL with Tenable Security Center in the Tenable Security Center user guide
These steps describe how to back up the data on disk for Container Security and restore it on the same instance or a different instance.
You must perform the following backup and restore steps for both the tes-consec-scan pod and the tes-consec-tvdl pod.
Note: If you do not back up this data, the following impacts apply:
-
Registry scans may take longer because some of the data on this disk is used as an optimization to skip images previously scanned.
-
Opt-in live scans will not work if you enable the feature in Tenable Enclave Security.
Backup Container Security in Tenable Enclave Security
To backup Container Security disk data to a backup file:
-
Scale down the tes-consec-api deployment to 0 replicas. This prevents traffic from flowing to Container Security during the backup.
Copykubectl scale deploy -n tenable-enclave-security tes-consec-api --replicas 0 -
Back up data for the tes-consec-scan pod:
-
Execute a shell within the tes-consec-scan pod.
Copykubectl exec -it tes-consec-scan-0 -n tenable-enclave-security -- /bin/bash -
Create a backup .tar.gz file. Replace tenable-enclave-security in the following command with the namespace where Tenable Enclave Security is installed.
Copytar -Ppzcf /var/tes_consec_scan_backup.tar.gz /var/tenable-enclave-securityNote: The.tar file switches are case-sensitive.
-
Copy the backup file to your local directory. Replace /backup/directory in the following command with the local path for the backup file.
Copykubectl exec -n tenable-enclave-security tes-consec-scan-0 -- tar cf - /var/tes_consec_scan_backup.tar.gz | tar xf - -C /backup/directory -
Log back into the pod and remove the backup file from the persistent volume.
-
-
Back up data for the tes-consec-tvdl pod:
-
Execute a shell within the tes-consec-tvdl pod.
Copykubectl exec -it tes-consec-tvdl-0 -n tenable-enclave-security -- /bin/bash -
Create a backup .tar.gz file. Replace tenable-enclave-security in the following command with the namespace where Tenable Enclave Security is installed.
Copytar -Ppzcf /data/tes_consec_tvdl_backup.tar.gz /data/tenable-enclave-securityNote: The.tar file switches are case-sensitive.
-
Copy the backup file to your local directory. Replace /backup/directory in the following command with the local path for the backup file.
Copykubectl exec -n tenable-enclave-security tes-consec-scan-0 -- tar cf - /data/tes_consec_tvdl_backup.tar.gz | tar xf - -C /backup/directoryNote: Ensure your local directory has enough space for the backup file.
-
Log back into the pod and remove the backup file from the persistent volume.
-
-
Scale up the tes-consec-api deployment to 2 replicas to resume traffic to the service.
Copykubectl scale deploy -n tenable-enclave-security tes-consec-api --replicas 2Caution: Do not perform this step if you are moving Tenable Enclave Security to a new instance. Resume traffic in the new instance after you restore the data from the backup.
Restore Container Security in Tenable Enclave Security
To restore Container Security disk data from a backup file:
-
Install a fresh instance of Tenable Enclave Security.
Note: Ensure you install the same version of Tenable Enclave Security as the version in your backup file and use the same namespace name as the previous installation.
-
Scale down the tes-consec-api deployment to 0 replicas. This prevents traffic from flowing to Container Security during the restore process.
Copykubectl scale deploy -n tenable-enclave-security tes-consec-api --replicas 0 -
Restore data for the tes-consec-scan pod:
-
Execute a shell within the tes-consec-scan pod.
Copykubectl exec -it tes-consec-scan-0 -n tenable-enclave-security -- /bin/bash -
Copy the backup file to the pod. Run the following command from your /backup/directory where the backup file, tes_consec_scan_backup.tar.gz, is located.
Copytar cf - tes_consec_scan_backup.tar.gz | kubectl exec -i -n tenable-enclave-security tes-consec-scan-0 -- tar xf - -C /var -
Restore the tes-consec-scan data from the backup file.
Copycd /var
tar -Pxvf /var/tes_consec_scan_backup.tar.gz -
Remove the backup file from the /var directory.
Copyrm /var/tes_consec_scan_backup.tar.gz
-
-
Restore data for the tes-consec-tvdl pod:
-
Execute a shell within the tes-consec-tvdl pod.
Copykubectl exec -it tes-consec-tvdl-0 -n tenable-enclave-security -- /bin/bash -
Copy the backup file to the pod. Run the following command from your /backup/directory where the backup file, tes_consec_tvdl_backup.tar.gz, is located.
Copytar cf - tes_consec_tvdl_backup.tar.gz | kubectl exec -i -n tenable-enclave-security tes-consec-tvdl-0 -- tar xf - -C /data -
Restore the tes-consec-tvdl data from the backup file.
Copycd /data
tar -Pxvf /data/tes_consec_tvdl_backup.tar.gz -
Remove the backup file from the /data directory.
Copyrm /data/tes_consec_tvdl_backup.tar.gz
-
-
Scale up the tes-consec-api deployment to 2 replicas to resume traffic to the new instance.
Copykubectl scale deploy -n tenable-enclave-security tes-consec-api --replicas 2