Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@ In the above example, the first secret section is `db/sqlusername|sql_username`.

The second secret section is `db/sql_password`. When no name is given for the environment variable, the Conjur Variable Name will be used. In this example, the value would be set to `SQL_PASSWORD` as the environment variable name.

### Multiline
```
secrets: |
db/sqlusername|sql_username;
db/sql_password;
```
For improved readability the secret section accepts multiline values. The `|` separates the Conjur Variable ID from the environment variable that will contain the value of the Conjur Variable's value. `;` and `newline` separate the secrets sections.

## Security

### Protecting Arguments
Expand Down
8 changes: 6 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ conjur_authn() {
}

array_secrets() {
IFS=';'
read -ra SECRETS <<< "$INPUT_SECRETS" # [0]=db/sqlusername | sql_username [1]=db/sql_password
IFS=$'\n' read -r -d '' -a array <<< "$INPUT_SECRETS"
for i in "${!array[@]}"; do
# trim whitespace and trailing ";"
line=$(echo "${array[$i]}"|sed 's/^[[:space:]]*//;s/[[:space:];]*$//')
SECRETS+=($line)
done
}

set_secrets() {
Expand Down
Loading