Ace the Google Cloud Certified Associate Engineer Exam 2025 – Skyrocket Your Cloud Skills!

Question: 1 / 400

While looking at your application's source code in your private Github repo, you've noticed that a service account key has been committed to git. What steps should you take next?

Revoke the key, remove the key from Git, purge the Git history to remove all traces of the file, ensure the key is added to the .gitignore file.

The appropriate action to take when a service account key has been inadvertently committed to a private GitHub repository involves several important steps to ensure security. Revoke the key immediately to prevent any unauthorized access to resources until the situation is addressed. This is crucial because once the key is in your repository, it could potentially be exposed even if the repository is private, especially if the key is shared or the repository's privacy settings are changed in the future.

After revocation, the next step is to remove the key from the Git history. Even if you delete the file in the latest commit, Git retains the commit history, which means the key could still be accessible in earlier commits. Purging the Git history ensures that there are absolutely no traces of the key left in the repository.

Lastly, adding the key to the .gitignore file prevents this issue from happening again in the future by ensuring that the key is not tracked by Git, thus preventing accidental commits.

In contrast, deleting the project and creating a new one is not a practical solution as it involves unnecessary overhead and exercises a lack of control over addressing the immediate security issue. Doing nothing is dangerous, as relying on the privacy of the repository does not guarantee the safety of sensitive information. Contacting Google Cloud

Get further explanation with Examzify DeepDiveBeta

Delete the project and create a new one.

Do nothing. Git is fine for keys if the repo is private.

Contact Google Cloud Support

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy