Skip to content

Commit

Permalink
kas-container(aws): support OAuth 2.0 workflow
Browse files Browse the repository at this point in the history
This patch adds support for the OAuth 2.0 based authentication for aws
inside the kas container. The corresponding web token file is copied
into the configuration landing site inside the container and the ARN
role variable is forwarded.

Signed-off-by: Felix Moessbauer <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
  • Loading branch information
fmoessbauer authored and jan-kiszka committed Dec 12, 2023
1 parent dda93a6 commit 365cec1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions kas-container
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,15 @@ if [ -n "${KAS_AWS_DIR}" ] ; then
-e AWS_CONFIG_FILE="${AWS_CONFIG_FILE:-/var/kas/userdata/.aws/config}" \
-e AWS_SHARED_CREDENTIALS_FILE="${AWS_SHARED_CREDENTIALS_FILE:-/var/kas/userdata/.aws/credentials}"
fi
if [ -n "${AWS_WEB_IDENTITY_TOKEN_FILE}" ] ; then
if [ ! -f "${AWS_WEB_IDENTITY_TOKEN_FILE}" ]; then
echo "Passed AWS_WEB_IDENTITY_TOKEN_FILE '${AWS_WEB_IDENTITY_TOKEN_FILE}' is not a directory"
exit 1
fi
set -- "$@" -v "$(readlink -fv "${AWS_WEB_IDENTITY_TOKEN_FILE}")":/var/kas/userdata/.aws/web_identity_token:ro \
-e AWS_WEB_IDENTITY_TOKEN_FILE="${AWS_CONFIG_FILE:-/var/kas/userdata/.aws/web_identity_token}" \
-e AWS_ROLE_ARN="${AWS_ROLE_ARN}"
fi

KAS_GIT_CREDENTIAL_HELPER_DEFAULT=""

Expand Down

0 comments on commit 365cec1

Please sign in to comment.