Skip to content

Conversation

ATIC-Yugandhar
Copy link
Contributor

@ATIC-Yugandhar ATIC-Yugandhar commented Mar 31, 2025

Description

According to Python packaging standards, .dist-info directories contain only metadata files such as version, license, and entry points. These directories are typically placed alongside installed packages in site-packages.

Since Trivy's secret scanner does not need to scan these metadata files, doing so can lead to false positives. Therefore, we can safely exclude .dist-info directories using a built-in allow rule.

Reference:

"Each project installed from a distribution must, in addition to files, install a .dist-info directory located alongside importable modules and packages (commonly, the site-packages directory)."

Changes

  • Added a new built-in allow rule to exclude .dist-info/ directories from secret scanning
  • The rule follows the existing MustCompile pattern used for other excluded paths

Related Links

Fixes

Fixes #8212

Checklist

@CLAassistant
Copy link

CLAassistant commented Mar 31, 2025

CLA assistant check
All committers have signed the CLA.

@ATIC-Yugandhar ATIC-Yugandhar marked this pull request as ready for review March 31, 2025 11:08
Copy link
Contributor

@DmitriyLewen DmitriyLewen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ATIC-Yugandhar Thanks for your work!
LGTM

@DmitriyLewen DmitriyLewen enabled auto-merge April 1, 2025 05:14
@DmitriyLewen DmitriyLewen added this pull request to the merge queue Apr 7, 2025
Merged via the queue into aquasecurity:main with commit a032ad6 Apr 7, 2025
12 checks passed
@aqua-bot aqua-bot mentioned this pull request Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(secret): ignore .dist-info directory for Python projects
3 participants