GIT Leaks

Overview

  • Rule ID: gitleaks

  • Applicable Languages: N/A

  • Weakness ID: CWE-798

Description

Hard-coding secrets in a project poses a risk of inadvertent leakage. This rule utilizes the Gitleaks library to scan for common secret types like keys, tokens, and passwords, ensuring they are not embedded directly in the codebase. It is a pivotal component of the language-agnostic secrets scanner.

Risks

This is an example of an external hard-coded password on the client-side of a connection. This code will run successfully, but anyone who has access to it will have access to the password. Once the program has shipped, there is no going back from the database user "scott" with a password of "tiger" unless the program is patched. A devious employee with access to this information can use it to break into the system. Even worse, if attackers have access to the bytecode for application, they can use the javap -c command to access the disassembled code, which will contain the values of the passwords used.

Remediation Guidelines

Do not hard-code secrets in committed code. Instead, utilize environment variables alongside a dedicated secret management system.

References

Configuration

This is a built in rule that represents findings from the secrets scanner.

To omit this rule during a scan, and to provide you with continuous 24/7 code-level scanning, you can employ our SAST TOOL

Last updated