read secrets from secret manager like this:
version: 0.2
env:
secrets-manager:
APACHE_PASSWORD: "arn:aws:secretsmanager:eu-central-1:XXXX:secret:APACHE-otkMOp:password"
phases:
pre_build:
commands:
- echo $APACHE_PASSWORD
But the echo command will print *** (3 stars). How to get actual values?
I even passed the secrets to a dockerfile and inside the dockerfile it was ***
This is by design, so that you not leak the password to cloudwatch log. The environment variable already contain the required password. Just use it where it suppose to be use
https://stackoverflow.com/questions/72609587/secrets-manager-environment-variables-in-aws-codebuild-echoing-as-in-the-b
I know that, But to be sure I have the right info I want to get the actuall value I tried to pass it into a dockerfile and echo them on dockerfile, the same result happened
I even tried to write them to a file and the cat the file, the same result: FROM XXXX.dkr.ecr.eu-central-1.amazonaws.com/python:3.9.19-slim-bullseye WORKDIR /app ARG USER ARG PASSWORD ARG TEST ENV USER_ENV=$USER ENV PASSWORD_ENV=$PASSWORD ENV TEST_ENV=$TEST RUN echo "Starting" && \ echo $USER_ENV && \ echo $PASSWORD_ENV && \ echo $TEST_ENV && \ echo "String written to file $USER_ENV $PASSWORD_ENV $TEST_ENV" > file.txt && \ cat file.txt How to get actual values?
Follow the solution given in StackOverflow above. Echo to file and then upload the file to S3. You cannot see the password if you are still inside CodeBuild environment
If everything is set up correctly you won't be able to
Dude can you describe the actual problem you try to solve with this kind of solution
In fact there’s a way to show passwords
But do you really want passwords in plain text in your logs
I once made a password rotation tools in sync with GitHub secrets
Обсуждают сегодня