Skip to content

Commit 71fc5fd

Browse files
tomconteshiranr
andauthored
Update secret detection content (microsoft#939)
* Deprecation of secret-detection.md * Fix link * Fix link * Minor changes * Add pre-commit instructions * Remove secret-detection.md --------- Co-authored-by: Shiran Rubin <[email protected]>
1 parent edaa95a commit 71fc5fd

File tree

6 files changed

+23
-115
lines changed

6 files changed

+23
-115
lines changed

docs/continuous-integration/dev-sec-ops/secret-management/credential_scanning.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ To implement credential scanning for a project, consider the following:
2323

2424
Recipes and Scenarios-
2525

26-
1. [Detect-secrets](./recipes/detect-secrets.md) - detect-secrets is an aptly named module for detecting secrets within a code base.
27-
1. [detect-secrets inside Azure DevOps Pipeline](./recipes/detect-secrets-ado.md)
26+
1. [detect-secrets](./recipes/detect-secrets.md) is an aptly named module for detecting secrets within a code base.
27+
1. Use [detect-secrets inside Azure DevOps Pipeline](./recipes/detect-secrets-ado.md)
2828
1. [Microsoft Security Code Analysis extension](https://learn.microsoft.com/en-us/azure/security/develop/security-code-analysis-overview)
2929

3030
Additional Tools -

docs/continuous-integration/dev-sec-ops/secret-management/recipes/detect-secrets-ado.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Detecting Secrets in your Azure DevOps Pipeline with YELP detect-secrets
1+
# Running detect-secrets in Azure DevOps Pipelines
22

33
## Overview
44

docs/continuous-integration/dev-sec-ops/secret-management/recipes/detect-secrets.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,24 @@ python3 -m pip install detect-secrets
2828
detect-secrets scan > .secrets.baseline
2929
```
3030

31-
## Usage
31+
## Pre-commit hook
32+
33+
It is recommended to use `detect-secrets` in your development environment as a Git pre-commit hook.
34+
35+
First, follow the [`pre-commit` installation instructions](https://pre-commit.com/#install) to install the tool in your development environment.
36+
37+
Then, add the following to your `.pre-commit-config.yaml`:
38+
39+
```yaml
40+
repos:
41+
- repo: https://github.com/Yelp/detect-secrets
42+
rev: v1.4.0
43+
hooks:
44+
- id: detect-secrets
45+
args: ['--baseline', '.secrets.baseline']
46+
```
47+
48+
## Usage in CI pipelines
3249
3350
```sh
3451
# backup the list of known secrets

docs/security/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ When requesting a security review for your application, please make sure you hav
1313
- [Secure Coding Practices Quick Reference](https://owasp.org/www-pdf-archive/OWASP_SCP_Quick_Reference_Guide_v2.pdf)
1414
- [Web Application Security Quick Reference](https://owasp.org/www-pdf-archive//OWASP_Web_Application_Security_Quick_Reference_Guide_0.3.pdf)
1515
- [Security Mindset/Creating a Security Program Quick Start](https://github.com/OWASP/Quick-Start-Guide/blob/master/OWASP%20Quick%20Start%20Guide.pdf?raw=true)
16-
- [Automated Secret Detection](./secret-detection.md)
16+
- [Credential Scanning / Secret Detection](../continuous-integration/dev-sec-ops/secret-management/credential_scanning.md)
1717
- [Threat Modelling](./threat-modelling.md)
1818

1919
## Azure DevOps Security

docs/security/secret-detection.md

-109
This file was deleted.

docs/source-control/secrets-management.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ E.g. the following pattern will exclude all files with the extension `.private.c
1010

1111
For more details on proper management of credentials and secrets in source control, and handling an accidental commit of secrets to source control, please refer to the [Secrets Management](../continuous-delivery/secrets-management/README.md) document which has further information, split by language as well.
1212

13-
As an extra security measure, apply [credential scanning](../continuous-integration/dev-sec-ops/secret-management/recipes/detect-secrets.md) in your CI/CD pipeline.
13+
As an extra security measure, apply [credential scanning](../continuous-integration/dev-sec-ops/secret-management/credential_scanning.md) in your CI/CD pipeline.

0 commit comments

Comments
 (0)