Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,642,199
Community Members
 
Community Events
196
Community Groups

How to view the values of secured Repository variables?

Below is the path of the variable that I'm trying to view:

Repository settings (on left vertical menu) -> Pipelines (submenu) -> Repository variables


Here it contains few secured variables whose values we are trying to fetch, any suggestions/help is appreciated.

 

 

2 answers

1 accepted

2 votes
Answer accepted
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Nov 03, 2022

Hey Rishabh,

Unfortunately - you cannot view these values once they have been set - and these are obscured from the build log if you try to echo these. This is by design as secure variables are stored as encrypted valuesIf you want to edit a secure variable, you can only give it a new value or delete it.

More information regarding this can be found here:
https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/

 

Cheers!

- Ben (Bitbucket Cloud Support)

I tried below and it worked.

- step:

    script:

      - echo $VAR >> var.txt

    artifacts:

      - var.txt

You can see the value on var.txt file.

I‘m curious that secure variables are really secure. It could be exported to a file and this file could be downloaded!

Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 21, 2023

Hey ,

 

I've just tested on my end with a secured variable - the value of the variable is not actually printed, it prints the variable name without the value - do you see the same output?

 - step:

   script:

   - echo $testvar >> var.txt

   - cat var.txt

Oh, you cannot see the value with 'cat', because the bitbucket automatically erase every string, which is same with secured variable.

So you should save it as a artifacts and download it to see the value.

Like Danila Lelyaev likes this
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 23, 2023

Hey 남성식,

You're right actually, I've just tested this on my end.

I've raised a bug ticket - thank you for that, that's a great find:
https://jira.atlassian.com/browse/BCLOUD-22556

Cheers!

- Ben (Bitbucket Cloud Support)

Hey Ben,

As I think, this is the answer for your question: https://community.atlassian.com/t5/Bitbucket-questions/Are-secured-variables-really-secure/qaq-p/2306410#M91721

I was also wondering why these secured variables are viewable to developers, but these developers have already right to read and write this repository.

If you have other tokens, which has more right that just writing and reading the repo, then you should use deployment variable to save it and make that deployment environment to be restricted for admins only. Then developers can not trigger deployment step, so they couldn't download the artifacts which they generated with the script above.

btw. my name is pronounced Sungsik Nam. I'm pretty sure it was a bit(!) hard to pronounce.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events