Skip to content

fix: scrub more Xray secret false positives + universal METADATA trun…#207

Merged
dimittal merged 1 commit intomainfrom
fix/jfrog-xray-security-violations
Apr 27, 2026
Merged

fix: scrub more Xray secret false positives + universal METADATA trun…#207
dimittal merged 1 commit intomainfrom
fix/jfrog-xray-security-violations

Conversation

@dimittal
Copy link
Copy Markdown
Contributor

…cation

Adds a second round of scrubs in response to a fresh customer Xray scan that surfaced new findings the first round of fixes didn't address. Local jf docker scan --secrets against trialwyikk8 (same engine the customer's entplus.jfrog.io uses) drops from the original 144 customer violations to 59 residual ignore-rule items.

What's new in this commit (cumulative deltas vs the first scrub round):

  • Strip Python type-stub .pyi files from /code/deps. They are read by type checkers and IDEs only, never loaded at runtime. Generated proto stubs (_pb2.pyi) contain long string literals that trip secret detectors. (Drops drdroid_debug_toolkit/.../api_pb2.pyi finding.)
  • rm -rf /build/deps/dj_rest_auth/tests — wheel ships its test suite with sample passwords inside; never imported at runtime. (Drops the dj_rest_auth/tests/test_api.py:250 finding.)
  • Universal METADATA truncation — keep only the structured headers (Name:, Version:, Requires-Dist:, etc.) by truncating each dist-info/METADATA file at the first blank line. The long-form description body (which contains README markdown with CodeCov badge tokens, JWT examples, link-reference URLs) is what trips detectors. Verified importlib.metadata.version("pyjwt") still returns 2.12.1 after truncation; vpc-agent code does not call importlib.metadata for description access. Generic — applies to all 165 dist-info METADATA files in the image. Replaces the previous targeted azure_identity / dj_database_url / pyjwt truncation block.
  • google/oauth2/gdch_credentials.py docstring example: replace the -----BEGIN EC PRIVATE KEY-----\n<key bytes>\n-----END EC PRIVATE KEY----- placeholder with <private-key-pem> since the BEGIN/END PEM markers themselves trip detectors.
  • google/auth/aws.py docstring example: replace the three http://169.254.169.254/latest/... IMDS URLs with placeholders so the docstring stops tripping IP-literal heuristics.
  • sqlalchemy/dialects/mssql/pyodbc.py docstring example: replace https://database.windows.net/ Azure SQL token URL with a placeholder.

The remaining 59 secrets in the v3 image are all third-party variable identifiers (TOKEN_/SAML_/AWS/secret_/password) and OpenAPI field-name maps that cannot be renamed without breaking runtime imports, K8s API serialization, msal's WS-Trust parsing, or Django's i18n labels. Documented in the local triage notes.

…cation

Adds a second round of scrubs in response to a fresh customer Xray scan
that surfaced new findings the first round of fixes didn't address.
Local `jf docker scan --secrets` against trialwyikk8 (same engine the
customer's entplus.jfrog.io uses) drops from the original 144 customer
violations to 59 residual ignore-rule items.

What's new in this commit (cumulative deltas vs the first scrub round):

- Strip Python type-stub `.pyi` files from /code/deps. They are read by
  type checkers and IDEs only, never loaded at runtime. Generated proto
  stubs (`_pb2.pyi`) contain long string literals that trip secret
  detectors. (Drops `drdroid_debug_toolkit/.../api_pb2.pyi` finding.)
- `rm -rf /build/deps/dj_rest_auth/tests` — wheel ships its test suite
  with sample passwords inside; never imported at runtime. (Drops the
  `dj_rest_auth/tests/test_api.py:250` finding.)
- Universal METADATA truncation — keep only the structured headers
  (`Name:`, `Version:`, `Requires-Dist:`, etc.) by truncating each
  `dist-info/METADATA` file at the first blank line. The long-form
  description body (which contains README markdown with CodeCov badge
  tokens, JWT examples, link-reference URLs) is what trips detectors.
  Verified `importlib.metadata.version("pyjwt")` still returns 2.12.1
  after truncation; vpc-agent code does not call `importlib.metadata`
  for description access. Generic — applies to all 165 dist-info
  METADATA files in the image. Replaces the previous targeted
  `azure_identity / dj_database_url / pyjwt` truncation block.
- `google/oauth2/gdch_credentials.py` docstring example: replace the
  `-----BEGIN EC PRIVATE KEY-----\n<key bytes>\n-----END EC PRIVATE
  KEY-----` placeholder with `<private-key-pem>` since the BEGIN/END
  PEM markers themselves trip detectors.
- `google/auth/aws.py` docstring example: replace the three
  `http://169.254.169.254/latest/...` IMDS URLs with placeholders so
  the docstring stops tripping IP-literal heuristics.
- `sqlalchemy/dialects/mssql/pyodbc.py` docstring example: replace
  `https://database.windows.net/` Azure SQL token URL with a
  placeholder.

The remaining 59 secrets in the v3 image are all third-party variable
identifiers (TOKEN_*/SAML_*/_AWS_*/secret_*/password) and OpenAPI
field-name maps that cannot be renamed without breaking runtime
imports, K8s API serialization, msal's WS-Trust parsing, or Django's
i18n labels. Documented in the local triage notes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dimittal dimittal merged commit 7d8b49c into main Apr 27, 2026
1 check passed
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.

2 participants