I have been requested to create a backup of a server. The server is Linux Ubuntu 22.04.2 where the core application (nodejs) + management software (nodejs / bash scripts) + monitoring (nodejs / net-snmp) are running. A second server will be present ready to take over (still under design by others in the team).
Due to imposed constraints by the final customer the backup is a single .zip file, which includes everything (files and folder), that must be uploaded to a backup server somewhere in the customer's network via sftp.
The backup must contains: configuration files/folder of running softwares (core app/management/monitoring) + dump of the database. The backup must be restored in the server (or its twin) in order to have it working again if something happen. I guess the backup process and the restore process will be executed as root user.
Some configuration files contain passwords which have been encrypted with a symmetric key algorithms. Those passwords concern external services the server must connect to. The key is a random string, called "secret", stored in a single file placed in a specific path outside all running softwares (es: /etc/secret). The file with the secret is owned by root user and it's read only. The file secret is accessed by more than one softwares.
My dilemma concerns if the file with the secret must be included in the backup or not. I'm facing two options/considerations:
- if the file with the secret is not included in the backup, the backup must be restored only in the same server where it was generated. Moreover, if the server will not work anymore the backup can't be restored at all.
- if the file with the secret is included in the backup, the backup can be restored to different servers, but the backup contains both the encrypted passwords and the key to decrypt them. (So I guess it is less secure from a cybersecurity point of view)
Can someone give me an advice/best practise? Or point me to some documentation? The file which holds the secret must be included in the backup (with all other files) or no?
Thanks!!