#2 – [GG_Shield] – Multiple ways to scan the complete GIT repository (incl. history) for Secrets!

If you haven’t setup GitGuardian workspace and GGshield installation , Please go through the below post and follow the steps 1-9 for GG Shield setup

Type – 1 : Scan your local git repository

Step – 1 : Navigate to the root folder of your git repository and open GitBash.
Step -2 – Execute the below command to run the scan for the given repository
ggshield scan repo .

Here in the above scan, it scans through all of the commits and provide the secrets and occurences available in the repository including the history

So by finding the files showing in the above terminal one can go individually for each file through commit id or file path and can proceed with the plan of removing the traces.

Okay so what if you want to export the incidents and secrets explicitly into a file, so that you can solve the incidents one by one. In that case use the below type.

Type – 2 – Scan the repository for secrets and export the incidents and secrets to a JSON file.

Execute the below command in your project root folder.

ggshield scan --show-secrets --json --output D:\\secrets.json repo .

Type – 3 : Scan the remote repository for secrets without cloning into your local

ggshield scan --show-secrets --json --output D:\\all.json repo https://github.com/vigneshram20/SecretsRemovalTest.git

Type – 4 : Scan the particular path recursively for the secrets inside your repository

ggshield scan path GitGuardianDemo/src/ --recursive

Type – 5 : Scan the particular file in your repository for secrets

ggshield scan path GitGuardianDemo/src/ClassWithSecrets.java
Vigneshram Sundaramoorthy
Vigneshram Sundaramoorthy

Hello World!
I am a tech enthusiast who believes in smart stuff, working as an SDET , I like to learn, create new approaches, I am someone who strive to think in a different perspective.

Articles: 10

Leave a Reply

Your email address will not be published. Required fields are marked *