Skip to content

Commit 4622c7e

Browse files
Added .gitallowed and updated Readme accordingly (#145)
* Added .gitallowed and updated Readme accordingly * Removed js map files from secret scan allowed list * Update nhsd-git-secrets/.gitallowed-base Co-authored-by: JohnEllwoodBJSS <[email protected]> Co-authored-by: JohnEllwoodBJSS <[email protected]>
1 parent 3f3dd53 commit 4622c7e

File tree

4 files changed

+25
-19
lines changed

4 files changed

+25
-19
lines changed

nhsd-git-secrets/.gitallowed-base

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.*git-secrets/.*:*
2+
.*terraform.tfstate.*:*
3+
.*.svg:*
4+
.*.jquery.*.js:*
5+
.*engine_version*
6+
.*127.0.0.1*
7+
.*assembly: AssemblyVersion*
8+
.*assembly: AssemblyFileVersion*
9+
.*Version=*

nhsd-git-secrets/README-mac-workstation.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,32 @@ Ensure you have the pre-commit framework set up first:
44

55
https://pre-commit.com/
66

7-
TL;DR:
7+
## TL;DR
88

9-
* pre-commit --version (to check whether it's installed)
10-
* brew install pre-commit
11-
* cd <texasd infra repo root>
12-
* pre-commit install
9+
* `pre-commit --version` (to check whether it's installed)
10+
* `brew install pre-commit`
11+
* `cd <project repo root>`
12+
* `pre-commit install`
1313

14-
Once you have pre-commit installed then:
14+
## Setup
1515

16-
* cd nhsd-git-secrets
17-
* cp git-secrets ..
16+
Make sure to copy the nhd-git-secrets folder into the root of the project repository, and then navigate the terminal to the repo root
17+
18+
* `cd nhsd-git-secrets`
19+
* `cp git-secrets ..`
20+
* `cp .gitallowed-base ../.gitallowed`
1821

1922
Then if you don't have an existing .pre-commit-config.yaml in the root of your repo:
2023

21-
* cp .pre-commit-config.example.yaml ../.pre-commit-config.yaml
24+
* `cp .pre-commit-config.example.yaml ../.pre-commit-config.yaml`
2225

2326
Otherwise integrate the git-secrets example config into your existing file.
2427

2528
Then:
2629

27-
* cd ..
28-
* pre-commit install
29-
* git add .pre-commit-config.yaml
30+
* `cd ..`
31+
* `pre-commit install`
32+
* `git add .pre-commit-config.yaml`
3033

3134
Next time you do a commit the git secrets hook should be invoked.
3235

@@ -37,9 +40,7 @@ Next time you do a commit the git secrets hook should be invoked.
3740

3841
`git secrets --add-provider -- cat git-secrets/nhsd-rules.txt`
3942

40-
* Add file/dir excludes within wrapper.sh e.g.
41-
42-
`git secrets --add --allowed '.*terraform.tfstate.*:*'`
43+
* Add file/dir excludes within .gitallowed, e.g. `.*terraform.tfstate.*:*`
4344

4445
* Control full scan vs staged files scan within wrapper.sh by commenting/uncommenting the mode to run e.g.:
4546

nhsd-git-secrets/pre-commit-mac.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
# These only need to be run once per workstation but are included to try and ensure they are present
66
./git-secrets --add-provider -- cat nhsd-git-secrets/nhsd-rules-linux-mac.txt
7-
./git-secrets --add --allowed '.*git-secrets/.*:*'
8-
./git-secrets --add --allowed '.*terraform.tfstate.*:*'
97

108
# Just scan the files changed in this commit
119
./git-secrets --pre_commit_hook

nhsd-git-secrets/scan-repo-linux-mac.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ export PATH=$PATH:.
77
# # These only need to be run once per workstation/slave/agent but are included to try and ensure they are present
88
./git-secrets --register-aws
99
./git-secrets --add-provider -- cat nhsd-git-secrets/nhsd-rules-linux-mac.txt
10-
./git-secrets --add --allowed '.*git-secrets/.*:*'
11-
./git-secrets --add --allowed '.*terraform.tfstate.*:*'
1210

1311
# Scan all files within this repo for this commit
1412
./git-secrets --scan

0 commit comments

Comments
 (0)