Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit 7afdeb6

Browse files
Added detect-secret pre-commit hook
1 parent b1c2a2f commit 7afdeb6

File tree

3 files changed

+104
-2
lines changed

3 files changed

+104
-2
lines changed

.github/workflows/validate_terraform.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ jobs:
2525
-
2626
name: Install pre-commit
2727
run: pip install pre-commit
28+
-
29+
name: Upgrade hooks
30+
run: pre-commit autoupdate
2831
-
2932
name: Run pre-commit command
3033
run: pre-commit run -a

.pre-commit-config.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,26 @@ default_stages: [commit]
66
# Terraform Validate : Validates the configuration files in a directory, referring only to the configuration and not accessing any remote services such as remote state, provider APIs, etc
77
repos:
88
- repo: git://github.com/antonbabenko/pre-commit-terraform
9-
rev: v1.45.0
9+
rev: v1.52.0
1010
hooks:
1111
- id: terraform_fmt
1212
- repo: git://github.com/pre-commit/pre-commit-hooks
13-
rev: v3.4.0
13+
rev: v4.0.1
1414
hooks:
1515
- id: check-merge-conflict
1616
- id: trailing-whitespace
1717
- id: detect-private-key
18+
- repo: https://github.com/ibm/detect-secrets
19+
# If you desire to use a specific version of detect-secrets, you can replace `master` with other git revisions such as branch, tag or commit sha.
20+
# You are encouraged to use static refs such as tags, instead of branch name
21+
#
22+
# Running "pre-commit autoupdate" would automatically updates rev to latest tag
23+
rev: 0.13.1+ibm.46.dss
24+
hooks:
25+
- id: detect-secrets # pragma: whitelist secret
26+
# Add options for detect-secrets-hook binary. You can run `detect-secrets-hook --help` to list out all possible options.
27+
# You may also run `pre-commit run detect-secrets` to preview the scan result.
28+
# when "--baseline" without "--use-all-plugins", pre-commit scan with just plugins in baseline file
29+
# when "--baseline" with "--use-all-plugins", pre-commit scan with all available plugins
30+
# add "--fail-on-non-audited" to fail pre-commit for unaudited potential secrets
31+
args: [--baseline, .secrets.baseline, --use-all-plugins ]

.secrets.baseline

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"exclude": {
3+
"files": "^.secrets.baseline$",
4+
"lines": null
5+
},
6+
"generated_at": "2021-10-12T12:36:29Z",
7+
"plugins_used": [
8+
{
9+
"name": "AWSKeyDetector"
10+
},
11+
{
12+
"name": "ArtifactoryDetector"
13+
},
14+
{
15+
"name": "AzureStorageKeyDetector"
16+
},
17+
{
18+
"base64_limit": 4.5,
19+
"name": "Base64HighEntropyString"
20+
},
21+
{
22+
"name": "BasicAuthDetector"
23+
},
24+
{
25+
"name": "BoxDetector"
26+
},
27+
{
28+
"name": "CloudantDetector"
29+
},
30+
{
31+
"ghe_instance": "github.ibm.com",
32+
"name": "GheDetector"
33+
},
34+
{
35+
"name": "GitHubTokenDetector"
36+
},
37+
{
38+
"hex_limit": 3,
39+
"name": "HexHighEntropyString"
40+
},
41+
{
42+
"name": "IbmCloudIamDetector"
43+
},
44+
{
45+
"name": "IbmCosHmacDetector"
46+
},
47+
{
48+
"name": "JwtTokenDetector"
49+
},
50+
{
51+
"keyword_exclude": null,
52+
"name": "KeywordDetector"
53+
},
54+
{
55+
"name": "MailchimpDetector"
56+
},
57+
{
58+
"name": "NpmDetector"
59+
},
60+
{
61+
"name": "PrivateKeyDetector"
62+
},
63+
{
64+
"name": "SlackDetector"
65+
},
66+
{
67+
"name": "SoftlayerDetector"
68+
},
69+
{
70+
"name": "SquareOAuthDetector"
71+
},
72+
{
73+
"name": "StripeDetector"
74+
},
75+
{
76+
"name": "TwilioKeyDetector"
77+
}
78+
],
79+
"results": {},
80+
"version": "0.13.1+ibm.46.dss",
81+
"word_list": {
82+
"file": null,
83+
"hash": null
84+
}
85+
}

0 commit comments

Comments
 (0)