Skip to content

Commit a87d160

Browse files
allmightyspiffGitHub Enterprise
authored andcommitted
Merge pull request #850 from SoftLayer/issues849
Added detect-secrets properly to travis build
2 parents 9ed5018 + 3ef4246 commit a87d160

3 files changed

Lines changed: 44 additions & 24 deletions

File tree

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This is an example configuration to enable detect-secrets in the pre-commit hook.
2+
# Add this file to the root folder of your repository.
3+
#
4+
# Read pre-commit hook framework https://pre-commit.com/ for more details about the structure of config yaml file and how git pre-commit would invoke each hook.
5+
#
6+
# This line indicates we will use the hook from ibm/detect-secrets to run scan during committing phase.
7+
repos:
8+
- repo: https://github.com/ibm/detect-secrets
9+
# 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.
10+
# You are encouraged to use static refs such as tags, instead of branch name
11+
#
12+
# Running "pre-commit autoupdate" automatically updates rev to latest tag
13+
rev: 0.13.1+ibm.62.dss
14+
hooks:
15+
- id: detect-secrets # pragma: whitelist secret
16+
# Add options for detect-secrets-hook binary. You can run `detect-secrets-hook --help` to list out all possible options.
17+
# You may also run `pre-commit run detect-secrets` to preview the scan result.
18+
# when "--baseline" without "--use-all-plugins", pre-commit scan with just plugins in baseline file
19+
# when "--baseline" with "--use-all-plugins", pre-commit scan with all available plugins
20+
# add "--fail-on-unaudited" to fail pre-commit for unaudited potential secrets
21+
args: [--baseline, .secrets.baseline, --use-all-plugins]

.secrets.baseline

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "(.*test.*)|(vendor)|(go.sum)|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2023-08-29T21:40:56Z",
6+
"generated_at": "2024-04-18T01:39:58Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -70,7 +70,7 @@
7070
"hashed_secret": "82e725817f214b04e55d8136779d09dde4195560",
7171
"is_secret": false,
7272
"is_verified": false,
73-
"line_number": 307,
73+
"line_number": 327,
7474
"type": "Hex High Entropy String",
7575
"verified_result": null
7676
}
@@ -312,23 +312,23 @@
312312
"hashed_secret": "d3ac7a4ef1a838b4134f2f6e7f3c0d249d74b674",
313313
"is_secret": false,
314314
"is_verified": false,
315-
"line_number": 120,
315+
"line_number": 148,
316316
"type": "Secret Keyword",
317317
"verified_result": null
318318
},
319319
{
320320
"hashed_secret": "bbccdf2efb33b52e6c9d0a14dd70b2d415fbea6e",
321321
"is_secret": false,
322322
"is_verified": false,
323-
"line_number": 4743,
323+
"line_number": 5115,
324324
"type": "Secret Keyword",
325325
"verified_result": null
326326
},
327327
{
328328
"hashed_secret": "7d44c33cf9a82ab9bd5300d266784504e9772177",
329329
"is_secret": false,
330330
"is_verified": false,
331-
"line_number": 4744,
331+
"line_number": 5116,
332332
"type": "Secret Keyword",
333333
"verified_result": null
334334
}
@@ -338,7 +338,7 @@
338338
"hashed_secret": "bbccdf2efb33b52e6c9d0a14dd70b2d415fbea6e",
339339
"is_secret": false,
340340
"is_verified": false,
341-
"line_number": 5148,
341+
"line_number": 5120,
342342
"type": "Secret Keyword",
343343
"verified_result": null
344344
}
@@ -348,23 +348,23 @@
348348
"hashed_secret": "3efd4c0fe185135dd2c584b9698f506803cfaf81",
349349
"is_secret": false,
350350
"is_verified": false,
351-
"line_number": 120,
351+
"line_number": 148,
352352
"type": "Secret Keyword",
353353
"verified_result": null
354354
},
355355
{
356356
"hashed_secret": "bbccdf2efb33b52e6c9d0a14dd70b2d415fbea6e",
357357
"is_secret": false,
358358
"is_verified": false,
359-
"line_number": 4743,
359+
"line_number": 5115,
360360
"type": "Secret Keyword",
361361
"verified_result": null
362362
},
363363
{
364364
"hashed_secret": "8927bd748f26a7258a01e318a7e1e7585458a228",
365365
"is_secret": false,
366366
"is_verified": false,
367-
"line_number": 4744,
367+
"line_number": 5116,
368368
"type": "Secret Keyword",
369369
"verified_result": null
370370
}
@@ -374,7 +374,7 @@
374374
"hashed_secret": "bbccdf2efb33b52e6c9d0a14dd70b2d415fbea6e",
375375
"is_secret": false,
376376
"is_verified": false,
377-
"line_number": 4743,
377+
"line_number": 5115,
378378
"type": "Secret Keyword",
379379
"verified_result": null
380380
}
@@ -384,7 +384,7 @@
384384
"hashed_secret": "bbccdf2efb33b52e6c9d0a14dd70b2d415fbea6e",
385385
"is_secret": false,
386386
"is_verified": false,
387-
"line_number": 4743,
387+
"line_number": 5115,
388388
"type": "Secret Keyword",
389389
"verified_result": null
390390
}
@@ -394,15 +394,15 @@
394394
"hashed_secret": "bbccdf2efb33b52e6c9d0a14dd70b2d415fbea6e",
395395
"is_secret": false,
396396
"is_verified": false,
397-
"line_number": 4747,
397+
"line_number": 5115,
398398
"type": "Secret Keyword",
399399
"verified_result": null
400400
},
401401
{
402402
"hashed_secret": "d3ac7a4ef1a838b4134f2f6e7f3c0d249d74b674",
403403
"is_secret": false,
404404
"is_verified": false,
405-
"line_number": 4748,
405+
"line_number": 5116,
406406
"type": "Secret Keyword",
407407
"verified_result": null
408408
}
@@ -412,15 +412,15 @@
412412
"hashed_secret": "bbccdf2efb33b52e6c9d0a14dd70b2d415fbea6e",
413413
"is_secret": false,
414414
"is_verified": false,
415-
"line_number": 4743,
415+
"line_number": 5115,
416416
"type": "Secret Keyword",
417417
"verified_result": null
418418
},
419419
{
420420
"hashed_secret": "d3ac7a4ef1a838b4134f2f6e7f3c0d249d74b674",
421421
"is_secret": false,
422422
"is_verified": false,
423-
"line_number": 4744,
423+
"line_number": 5116,
424424
"type": "Secret Keyword",
425425
"verified_result": null
426426
}
@@ -430,7 +430,7 @@
430430
"hashed_secret": "bbccdf2efb33b52e6c9d0a14dd70b2d415fbea6e",
431431
"is_secret": false,
432432
"is_verified": false,
433-
"line_number": 4743,
433+
"line_number": 5115,
434434
"type": "Secret Keyword",
435435
"verified_result": null
436436
}
@@ -440,7 +440,7 @@
440440
"hashed_secret": "bbccdf2efb33b52e6c9d0a14dd70b2d415fbea6e",
441441
"is_secret": false,
442442
"is_verified": false,
443-
"line_number": 4743,
443+
"line_number": 5115,
444444
"type": "Secret Keyword",
445445
"verified_result": null
446446
}
@@ -450,7 +450,7 @@
450450
"hashed_secret": "bbccdf2efb33b52e6c9d0a14dd70b2d415fbea6e",
451451
"is_secret": false,
452452
"is_verified": false,
453-
"line_number": 4743,
453+
"line_number": 5115,
454454
"type": "Secret Keyword",
455455
"verified_result": null
456456
}
@@ -460,7 +460,7 @@
460460
"hashed_secret": "bbccdf2efb33b52e6c9d0a14dd70b2d415fbea6e",
461461
"is_secret": false,
462462
"is_verified": false,
463-
"line_number": 259,
463+
"line_number": 260,
464464
"type": "Secret Keyword",
465465
"verified_result": null
466466
}
@@ -470,13 +470,13 @@
470470
"hashed_secret": "c2a6b03f190dfb2b4aa91f8af8d477a9bc3401dc",
471471
"is_secret": false,
472472
"is_verified": false,
473-
"line_number": 372,
473+
"line_number": 373,
474474
"type": "Secret Keyword",
475475
"verified_result": null
476476
}
477477
]
478478
},
479-
"version": "0.13.1+ibm.61.dss",
479+
"version": "0.13.1+ibm.62.dss",
480480
"word_list": {
481481
"file": null,
482482
"hash": null

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ addons:
1111
install:
1212
# Required to install detect-secrets
1313
- echo -e "machine github.ibm.com\n login $CI_USER_TOKEN" > ~/.netrc
14-
#- sudo chmod o+rwx /usr/lib/python3/dist-packages/
1514
- sudo python3 -m pip install -U pip
1615
- sudo pip3 install pyOpenSSL --upgrade
1716
- sudo pip3 install --upgrade "git+https://github.com/ibm/detect-secrets.git@master#egg=detect-secrets"
@@ -21,8 +20,8 @@ before_script:
2120
- bash bin/generate-i18n-resources.sh
2221
- go vet $(go list ./... | grep -v "fixtures" | grep -v "vendor")
2322
- go test $(go list ./... | grep -v "fixtures" | grep -v "vendor")
24-
- python3 bin/detect_secrets.py
25-
23+
- detect-secrets scan --update .secrets.baseline
24+
- detect-secrets audit .secrets.baseline --report --fail-on-unaudited --omit-instructions
2625
- gosec -exclude-dir=fixture -exclude-dir=plugin/resources -quiet ./...
2726
script:
2827
- go build

0 commit comments

Comments
 (0)