You have accidentally committed a file containing sensitive data.
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.
You should take the following actions as soon as possible:
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
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/
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/#/)
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
Rotate any passwords, keys or other credentials to avoid any malicious use following the exposure.
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.
Some further reading on this topic:
Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...
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