Skip to content

Add pre-commit hooks to catch linting issues and prevent credential leaks #2069

@varunsh-coder

Description

@varunsh-coder

https://github.com/pre-commit/pre-commit is a framework for managing and maintaining multi-language pre-commit hooks.

It is very popular, and one of the important use cases is to detect and prevent credentials from being pushed. This is important because the cost of dealing with a cred leak is much higher once it is already pushed.

Using a PR, we should add a pre-commit configuration .pre-commit-config.yaml as a best practice. If the file already exists, then we should suggest adding specific hooks related to security.

Here is an example of such a file
https://github.com/aws-samples/aws-deployment-pipeline-reference-architecture/blob/1329e3cb20f3ef782fca907ddce39d94a8b4c813/examples/cdk-application-pipeline/.pre-commit-config.yaml

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions