Skip to content

[enhancement] Allow setting DETECT_SECRETS_SECURITY_TEAM via a command-line argument #436

@ExplodingCabbage

Description

@ExplodingCabbage

In #283, @0atman added the DETECT_SECRETS_SECURITY_TEAM environment variable. Trouble is, it's hard to set environment variables via pre-commit (and pre-commit is one of the officially suggested ways of running detect-secrets, per the README). As far as I've been able to find, pre-commit has no support at all for configuring environment variables in pre-commit.yaml, and you have to resort to a hack like overriding the hook's entry in pre-commit.yaml to be something like

env DETECT_SECRETS_SECURITY_TEAM='in #infosec' detect-secrets-hook

which is a bit ugly and more importantly isn't a trivial workaround to come up with - you need to have at least a little bit of knowledge of how pre-commit works to even know that entry: is a thing and that it's possible to override it, and then you need to look into this repo to discover that the default entry is the detect-secrets-hook executable, and you need to have sufficient unix knowledge to know that you can use env to run another program with added environment variables.

It'd probably be easier for people to use this feature if there were also a --security-team command-line argument that could be used instead, rather than setting an environment variable being the only way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThe issue is related to improving a certain aspect of the project.triagedThe issue has been reviewed but has not been solved yet.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions