Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Remove detect-secrets #613

Merged
merged 1 commit into from
Jan 19, 2021
Merged

Remove detect-secrets #613

merged 1 commit into from
Jan 19, 2021

Conversation

barrucadu
Copy link
Contributor

We installed this pre-commit hook to help prevent us from leaking
production secrets, but the benefit hasn't outweighed the pain. I
think we already solve this problem with good practices:

  1. We don't share secrets between production and development/test
    envs.

  2. We specify our production secrets in environment variables.

So we've never been in the habit of committing real secrets to the
repo. It seems strange that we'd slip up and do so now.

Furthermore, as this is only a pre-commit hook, and not a pre-receive
hook, it doesn't actually prevent someone from pushing a secret to
GitHub! Since we have the same vulnerability whether have this hook
or not, I don't think the potential gain (someone gets access to a
production secret, hard-codes it, and then has that commit rejected
before pushing it) is worth the effort (needing to keep the baseline
and pragma comments up to date).


If this PR is accepted, I'll go through our other repos and remove it.

We installed this pre-commit hook to help prevent us from leaking
production secrets, but the benefit hasn't outweighed the pain.  I
think we already solve this problem with good practices:

1. We don't share secrets between production and development/test
envs.

2. We specify our production secrets in environment variables.

So we've never been in the habit of committing real secrets to the
repo.  It seems strange that we'd slip up and do so now.

Furthermore, as this is only a pre-commit hook, and not a pre-receive
hook, it doesn't actually prevent someone from pushing a secret to
GitHub!  Since we have the same vulnerability whether have this hook
or not, I don't think the potential gain (someone gets access to a
production secret, hard-codes it, and then has that commit rejected
before pushing it) is worth the effort (needing to keep the baseline
and pragma comments up to date).
Copy link
Member

@brucebolt brucebolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be very happy to see this go. Hopefully others feel the same!

@huwd
Copy link
Member

huwd commented Jan 19, 2021

Yeah, I was up for this when we started out and were setting up a lot of things.
But since then I haven't really touched anything resembling a production secret.

Given the infrequency of the thing this was supposed to help with, and the amount of daily friction it adds. I think we could:

  • Remove this gem
  • Do "point and call" by asking each other on slack to sense check anything that might veer close to a secret before we push it
  • Be clear in the team (Team Manual?) about how we'd rotate secrets if we did ever accidentially push something?

@huwd
Copy link
Member

huwd commented Jan 19, 2021

So I don't want to abandon safeguards, but I think we can do a bit more work to have ones that aren't so daily annoying...
... plus with this gone I can uninstall python...

@barrucadu
Copy link
Contributor Author

Be clear in the team (Team Manual?) about how we'd rotate secrets if we did ever accidentially push something?

Yeah, it'd be good to have a bit of documentation on what sorts of secrets we have and how one could go about rotating them.

@barrucadu barrucadu merged commit 7e69b8c into main Jan 19, 2021
@barrucadu barrucadu deleted the msw/remove-detect-secrets branch January 19, 2021 14:28
barrucadu added a commit to alphagov/govuk-attribute-service-prototype that referenced this pull request Jan 19, 2021
barrucadu added a commit that referenced this pull request Jan 27, 2021
We decided this was more trouble than it's worth, see #613
barrucadu added a commit to alphagov/govuk-account-team-manual that referenced this pull request Jan 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants