Skip to content

Commit

Permalink
improve gitleaks / handle-secrets function
Browse files Browse the repository at this point in the history
- fix missing new-line at the beginning when dealing with pre-existing content
- add gitleaks 8.20.0 feature to decode base64 value during scan for inspection
  • Loading branch information
Okeanos committed Oct 12, 2024
1 parent fb95818 commit d200045
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stow/shell/.config/bash/functions
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ function handle-secrets {
echo "Scanning: ${target_directory}"
if [[ -f "${target_directory}/.gitleaksignore" ]]; then
ignore_file_contents=$(< "${target_directory}/.gitleaksignore")
ignore_file_contents+="\n"
fi
gitleaks git --verbose --report-format=json --report-path="${report_file}" --exit-code=0 "${target_directory}" &>/dev/null
gitleaks git --verbose --report-format=json --report-path="${report_file}" --max-decode-depth 1 --exit-code=0 "${target_directory}" &>/dev/null

if [[ -f ${report_file} ]]; then
if [[ $(jq length "${report_file}") == 0 ]]; then
Expand Down

0 comments on commit d200045

Please sign in to comment.