I got secrets in my history. Any way to remove them?
I know about the regexes, but I’m guessing they are only to prevent the secrets from being imported.
I got secrets in my history. Any way to remove them?
I know about the regexes, but I’m guessing they are only to prevent the secrets from being imported.
Have a look at the search
command search | Atuin Docs, in particular the --delete
switch allows to remove the entries matching your query
Thanks everyone, I was able to do:
atuin search | gitleaks detect --pipe -r report.json
cat report.json | jq -r '.[] | " atuin search --delete " + .Secret' | sort -u
shred --remove report.json
and
cat ~/.local/share/zsh/history | gitleaks detect --pipe -r report.json
cat report.json | jq -r '.[] | " sed -i '\''/" + .Secret + "/d'\'' ~/.local/share/zsh/history"' | sort -u
shred --remove report.json
FWIW I had to add --limit 10000000 --filter-mode global
to ensure I got everything. But thanks for that - TIL that gitleaks
is a thing! ;]
If this is something you run into a bunch, Atuin has a few features that may help
I’d actually love contributions there! New cases should be very easy to add