Can i choose which files to exclude from scanning in the git-secrets-scan pipe?

Abdelmassih Abdelmassih
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 13, 2025

I can not find any documentation regarding files/folders exclusion from git-secrets-scan pipe in bitbuckets pipelines

2 answers

0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 14, 2025

Hi @Abdelmassih AbdelmassihPlease, check the docs.
You should add paths under [allowlist] section in gitleaks.toml file.
Example:

# This is a global allowlist which has a higher order of precedence than rule-specific allowlists.
# If a commit listed in the `commits` field below is encountered then that commit will be skipped and no
# secrets will be detected for said commit. The same logic applies for regexes and paths.
[allowlist]
description = "global allow list"
commits = [ "commit-A", "commit-B", "commit-C"]
paths = [
  '''gitleaks\.toml''',
  '''(.*?)(jpg|gif|doc)'''
]

Regards, Igor

0 votes
Sahir Maharaj
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 13, 2025

Hello @Abdelmassih Abdelmassih

Based on my experience, the git-secrets-scan pipe in Bitbucket Pipelines currently doesn’t seem to have explicit documentation or built-in options for excluding specific files or folders.

However, you can achieve this indirectly by modifying your pipeline configuration to exclude certain paths from being scanned. This could involve creating a .gitignore-like file or customizing the script that invokes the pipe to filter files.

Opening a ticket with Atlassian support at https://support.atlassian.com/contact/#/ may provide clarity or a workaround.

 

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events