Scripts for platform management
Script execution
Scripts are executed in the platform backend service:
- for Docker Compose:
- for Helm:
All usage examples are provided for docker-compose but can also be run in k8s. To do so, replace docker with kubectl.
Arguments passed to the script are strictly positional and are specified with the --script-arg key. Optional arguments are enclosed in square brackets.
Available commands
update_cwes
Updates CWE (Common Weakness Enumeration) and vulnerability data in the installation database. An optional argument can be used to control the date from which the update will be performed; by default, the update date and offset will be taken from the cache of the last successful update.
Syntax
load_licenses
Updates license data in the installation database. An optional argument can be used to control the date from which the update will be performed; by default, the update date and offset will be taken from the cache of the last successful update.
Syntax
set_new_secret_key
This command sets a new value for the SECRET_KEY environment variable. To avoid issues with encoding, aliases, or other unexpected console behavior, it is recommended to copy the NEW_SECRET_KEY value from the terminal output after the script has finished.
Syntax
Usage examples
-
Changing from explicitly specified
OLD_SECRET_KEYto explicitly specifiedNEW_SECRET_KEY. This is required when theSECRET_KEYenvironment variable value during platform launch differs fromOLD_SECRET_KEY.This command will re-encrypt all sensitive fields from the given
OLD_SECRET_KEYtoNEW_SECRET_KEY.ImportantIf the
SECRET_KEYvariable at the moment of script execution does not match theNEW_SECRET_KEY, after successful script completion you must update theSECRET_KEYvariable toNEW_SECRET_KEYand restart the platform. -
Changing to explicitly specified
NEW_SECRET_KEYwithout specifyingOLD_SECRET_KEY. This is required whenOLD_SECRET_KEYmatches the one defined insettings.SECRET_KEY.This command will re-encrypt all sensitive fields from the key set in
settings.SECRET_KEYtoNEW_SECRET_KEY.After successful script completion you must update the
SECRET_KEYvariable toNEW_SECRET_KEYand restart the platform.
