You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
I'm trying to build a pipeline to deploy our serverless architecture. Ideally I can right into a local .env file including all several secured environment variables. I'm assuming the entire docker image is flushed after the pipeline is done deploying so this is really not a security concern.
However, when I try to write into the file, all env vars write ok except the secured ones. Any idea how to make this work?
script:
# setup local .env file
- touch .env
- echo "DEV_DB_DATABASE=$DEV_DB_DATABASE" >> .env
- echo "DEV_DB_USERNAME=$DEV_DB_USERNAME" >> .env
- echo "DEV_DB_PASSWORD=$DEV_DB_PASSWORD" >> .env
- echo "DEV_DB_HOST=$DEV_DB_HOST" >> .env
- echo "DB_LOGGING=true" >> .env
- echo "SLS_DEBUG=*" >> .env
Where ```$DEV_DB_PASSWORD``` is a secured variable.
Thank you!
Oh Yes. No errors. What actually happens is all the normal environment variables gets written as expected. The secured ones translate into the string itself,
so this line:
DEV_DB_DATABASE=$DEV_DB_DATABASE
will show as the following line:
DEV_DB_DATABASE=<name of the db from the env var>
BUT this line:
DEV_DB_PASSWORD=$DEV_DB_PASSWORD
will result in the following line literally:
DEV_DB_PASSWORD=$DEV_DB_PASSWORD
I'm assuming this is some sort of a security mechanism to not 'log' the secured vars but I wonder if there's a way around it or if I'm just doing something wrong. Ideally we actually write the value of the secured vars into the same file so we can then use it in our deploys.
Thanks!
How are you verifying the contents of the file? If you're running "$ cat .env" (or something similar) within Pipelines, then we will be masking the variable when it is printing from the file. But it should still be in the file as the correct value.
I've tested out a similar example here:
https://bitbucket.org/phodder/prod-test/addon/pipelines/home#!/results/1387
The value of "$SECRET" is "cat". (When I do echo "$SECRET" | wc -m, there's is also a new line character which is why it's 4 and not 3).
Does any of that help?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, this helped. Yes, I was checking with 'cat' - that was confusing.
I changed it a bit and it is now working the way we need it. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you explain more on the problem you're having with the secured variables? Are you getting an error when you write it into the file?
Thanks,
Phil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi everyone, We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.