this post was submitted on 18 Aug 2024
74 points (97.4% liked)

Programming

17325 readers
173 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
 

I know that pushing a commit with an API key is something for which a developer should have his balls cut off, but...

...I'm wondering what I should do if, somehow, I accidentally commit an API key or other sensitive information, an environment variable to the repo.

Should I just revoke the access and leave it as is, or maybe locally remove this commit and force-push a new one without the key? How do you guys handle this situation in a professional environment?

you are viewing a single comment's thread
view the rest of the comments
[–] Kaboom@reddthat.com 62 points 2 months ago (1 children)

Rotate the keys, the old one is on the Internet forever

[–] Shadow@lemmy.ca 17 points 2 months ago (2 children)

This is the only answer. Git history is forever.

[–] SwordInStone@lemmy.world -1 points 2 months ago (2 children)
[–] WhatAmLemmy@lemmy.world 12 points 2 months ago

If you upload anything to the internet unencrypted, it's always best to assume it'll be publicly accessible forever.

[–] anzo@programming.dev -2 points 2 months ago

s/git/github please