forked from vmware/container-service-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[VCDA-1362] Edit cse.service and cse.sh to consider config encryption (…
…vmware#505) Added clear security recommendations in cse.sh to run CSE using an encrypted config file, where the password is provided as an environment variable.
- Loading branch information
Showing
2 changed files
with
20 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
USER_DIR=/home/vmware | ||
PYTHONPATH=$USER_DIR/.local/lib/python3.6/site-packages | ||
$USER_DIR/.local/bin/cse run $USER_DIR/config.yaml | ||
#$USER_DIR/.local/bin/cse run $USER_DIR/config.yaml --pks-config $USER_DIR/pks.yaml | ||
### recommended to use a virtual environment | ||
# CSE_VENV_PATH=/root/cse-venv | ||
# source $CSE_VENV_PATH/bin/activate | ||
|
||
### CSE config file should be encrypted for security (using `cse encrypt` command) | ||
### Encryption password should be stored in the environment variable `CSE_CONFIG_PASSWORD` | ||
### Environment variable can be declared 2 ways: | ||
### (1) Plaintext in this script | ||
# export CSE_CONFIG_PASSWORD=mypassword | ||
### (2) Create a file to store the environment variable. The file should contain the line: `CSE_CONFIG_PASSWORD=mypassword` | ||
### Add `EnvironmentFile=/path/to/file` under `[Service]` in `cse.service` | ||
### Note: If `EnvironmentFile=/path/to/file` exists under `[Service]` in `cse.service` but the file does not exist, CSE will fail to start | ||
|
||
### Edit this with your CSE config file path | ||
CSE_CONFIG_PATH=/root/cse-config.yaml | ||
### To use a plaintext CSE config file, add `-s` to the `cse run` command | ||
cse run $CSE_CONFIG_PATH |