Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Configuring Git secrets scan


I'm trying to integrate the AWS Git secrets scan pipe in my pipeline (; however, I can't get the `FILES` filter to work, and the documentation doesn't give much help.

My simple pipeline builds a .NET Core 2.2 application, and checks for hardcoded AWS secrets in the source code:


name: Build
- dotnetcore
- dotnet build
- step:
name: Analyse
- pipe: atlassian/git-secrets-scan:0.4.1
FILES: '*.cs'

However, when the pipeline runs, I see the following:

INFO: Executing the pipe...Traceback (most recent call last):  File "/", line 112, in <module>    main()  File "/", line 104, in main    raise Exception(result.stderr)Exception: grep: *.cs: No such file or directory

If I remove the FILES setting (so it scans all files) then the pipeline runs correctly, although the Git secrets pipe fails with false positives on a project file (which is why I wanted the file filter in the first place).

Have I set up the pipe correctly? And how can I add other file types to the filter expression?

1 answer

1 accepted

1 vote
Answer accepted

@David Keaveny thanks for using the pipe!


I checked git secrets scan and such error is appearing when you do not have files with this extension.

For example, at the snippet below  command scanning txt files gives nothing, so it is all right and searching for *.cs files does not work, because such do not exist

$ ls test.txt 

$ git secrets --scan *.txt
$ git secrets --scan *.cs
grep: *.cs: No such file or directory
$ ls *.cs
ls: *.cs: No such file or directory

If you propose to catch this , to ensure that nothing sensitive does not appear during the build (when such files could be created), we can discuss it as a proposition for the future improvement.

For now I just would like to understand your case

Hi Galyna,

Thanks for your response!

The *.cs files will be in subfolders of the project root, so I'm guessing that it's not searching recursively?


As a side question, if I wanted to search *.cs and *.json files, would I configure it as:

FILES: '*.cs;*.json'


@David Keaveny hello, we released new version of git-secrets-scan 0.4.3, there is a fix of wildcard issue, indeed , subprocess tool did not work with wildcard *.

Now it should work in 0.4.3 and your example

FILES: '*.cs;*.json'

also will work, but you need specify this variable like this:

FILES: '*.cs *.json'

 without semicolon.

Regards, Galyna

Hi @Galyna Zholtkevych ,

I gave the 0.4.3 image a go, and it seems to be ignoring the `FILES` parameter, as it is giving a false positive on a .DotSettings file. My configuration is now:

- step:
name: Analyse
- pipe: atlassian/git-secrets-scan:0.4.3
FILES: '*.cs *.json'

@David Keaveny yes, this is because you are trying to find files in no-root directories.

In python glob that we use there is such specific to search recursively:

- pipe: atlassian/git-secrets-scan:0.4.3
FILES: "**/*.txt **/*.json"

 This is not obvious, see how it should work in our doc: Git Secrets Scan, Advanced examples .

Also, check your dot settings extension. If you suspect sensitive string to be found in such files as *.DotSettings , include this, too.

Ah yes, that fixed it, many thanks!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

329 views 3 14
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you