-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(snap): Add implementation for set up Consul ACL (#3223)
- Add token for consul secret engine in snap - Add env. for ACL enable: ENABLE_REGISTRY_ACL: true - Add env. for consul secret engine admin token: SECRETSTORE_CONSULSECRETSADMINTOKENPATH - Add logic for copying the needed configuration toml from security-bootstrapper - Add consul-bootstrapper one-shot service for setting up Consul's ACL - Add feature flag logic in start_consul.sh shell script - Add env. overrides for consul-bootstrapper - Make consul-bootstrapper use shell script as command to run setupRegistryACL Closes: #3222 Signed-off-by: Jim Wang <[email protected]>
- Loading branch information
1 parent
be0d14e
commit eeaee6b
Showing
4 changed files
with
84 additions
and
12 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# note: -e flag is not used in this one-shot service | ||
# we don't want to exit out the whole Consul process when ACL bootstrapping failed, just that | ||
# Consul won't have ACL to be used | ||
|
||
echo "$(date) in setup-consul-acl.sh: ENABLE_REGISTRY_ACL = ${ENABLE_REGISTRY_ACL}" | ||
|
||
if [ "${ENABLE_REGISTRY_ACL}" == "true" ]; then | ||
# setup Consul's ACL via security-bootstrapper's subcommand | ||
"$SNAP"/bin/security-bootstrapper -confdir "$SNAP_DATA"/config/security-bootstrapper/res setupRegistryACL | ||
setupACL_code=$? | ||
if [ "${setupACL_code}" -ne 0 ]; then | ||
echo "$(date) failed to set up Consul ACL" | ||
fi | ||
else | ||
echo "$(date) ACL not enabled, skip Consul's ACL setup" | ||
fi |
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