Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

What to do if you've committed sensitive data to a Bitbucket Cloud repository

Problem

You have accidentally committed a file containing sensitive data.

Background

Security researchers and threat actors alike are actively scanning hosted git repositories like yours, looking for passwords, secrets, and other useful configuration info potentially hiding in your data.

There are several free and openly available tools to automate the discovery of sensitive data across services like Bitbucket Cloud.

Using information found in publicly accessible repositories, attackers can then access and compromise your services and systems, often without your knowledge.

Unfortunately, the process to backtrack a mistake like this is not as straightforward as removing the lines or files in question, so we've outlined some steps for you below.

Solution

You should take the following actions as soon as possible:

  1. Remove the file with the sensitive content from repository, for more details please refer to: https://stackoverflow.com/questions/2047465/how-can-i-delete-a-file-from-a-git-repository

  2. Once the file is removed, you need to make sure you remove it from the repository history as well, it can be done by using the BFG repo cleaner: https://rtyley.github.io/bfg-repo-cleaner/

  3. Push the cleaned repository to Bitbucket remote and raise a support ticket for us to run the GC on the repository (https://support.atlassian.com/contact/#/)

  4. To avoid adding and committing sensitive files back to the repository in the future, we highly recommend adding those file to .gitignore, that way you are sure you do not expose your credentials publicly: https://www.atlassian.com/git/tutorials/saving-changes/gitignore

  5. Rotate any passwords, keys or other credentials to avoid any malicious use following the exposure.

  6. Perform thorough review of all your repositories to ensure any sensitive keys, passwords or other data have been removed. If necessary repeat the steps above to remove any additional files and re-write the repository history.

 

Further Reading

Some further reading on this topic:

1 comment

DPK J Community Leader Feb 05, 2020

Horrible things can happen sometimes :-)

Like # people like this

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

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...

636 views 7 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you