Skip to content

fix(sdk): skip strict CheckMetadata validators for external tool providers#10363

Merged
andoniaf merged 5 commits intomasterfrom
fix/image-provider-checkmetadata-validation
Mar 18, 2026
Merged

fix(sdk): skip strict CheckMetadata validators for external tool providers#10363
andoniaf merged 5 commits intomasterfrom
fix/image-provider-checkmetadata-validation

Conversation

@andoniaf
Copy link
Member

Context

PR #8583 added strict validation to CheckMetadata. External tool providers (image, iac, llm) build metadata dynamically at runtime from tool output (e.g. Trivy, promptfoo), not from curated .metadata.json files. Several validators now reject valid external tool data (long descriptions, non-hub URLs, custom categories).

Description

Extend the existing EXTERNAL_TOOL_PROVIDERS bypass pattern (already used by ServiceName, CheckID, and CheckType validators) to 6 additional validators:

  • CheckTitle — skip 150-char limit and "Ensure" prefix check
  • Description — skip 400-char limit
  • Risk — skip 400-char limit
  • RelatedUrl — skip deprecated-field rejection
  • Recommendation URL — skip hub.prowler.com prefix check
  • Categories — skip VALID_CATEGORIES whitelist check (format validation still applies)

Native providers (aws, azure, gcp, etc.) continue to receive full strict validation.

Steps to review

  1. Review the validator changes in prowler/lib/check/models.py — each follows the same values.get("Provider") not in EXTERNAL_TOOL_PROVIDERS pattern
  2. Run tests: pytest -xvs tests/lib/check/models_test.py::TestExternalToolProviderValidatorBypass
  3. Verify native provider tests still enforce strict rules: each bypass test has a corresponding native-provider rejection test

Checklist

Community Checklist
  • This feature/issue is listed in here or roadmap.prowler.com
  • Is it assigned to me, if not, request it via the issue/feature in here or Prowler Community Slack

SDK/CLI

  • Are there new checks included in this PR? No

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

- Use "vulnerabilities" (plural) category to match VALID_CATEGORIES
- Move Trivy PrimaryURL to AdditionalURLs (Recommendation.Url requires hub.prowler.com prefix)
- Update test assertions for new category value
- Truncate Description and Risk to 400 chars max
- Truncate CheckTitle to 150 chars max
…iders

- Extend EXTERNAL_TOOL_PROVIDERS bypass to CheckTitle, Description, Risk,
  RelatedUrl, Recommendation URL, and Categories validators
- Add tests verifying bypass for external tools and strict enforcement
  for native providers
@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2026

✅ All necessary CHANGELOG.md files have been updated.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2026

Conflict Markers Resolved

All conflict markers have been successfully resolved in this pull request.

@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.99%. Comparing base (df680ef) to head (ee0c229).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #10363       +/-   ##
===========================================
+ Coverage    5.75%   65.99%   +60.24%     
===========================================
  Files         834       94      -740     
  Lines       23717     6594    -17123     
===========================================
+ Hits         1365     4352     +2987     
+ Misses      22352     2242    -20110     
Flag Coverage Δ
prowler-py3.10-aws ?
prowler-py3.10-lib 65.99% <100.00%> (?)
prowler-py3.11-aws ?
prowler-py3.11-lib 65.99% <100.00%> (?)
prowler-py3.12-aws ?
prowler-py3.12-lib 65.99% <100.00%> (?)
prowler-py3.9-aws ?
prowler-py3.9-lib 65.99% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
prowler 65.99% <100.00%> (+60.24%) ⬆️
api ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2026

🔒 Container Security Scan

Image: prowler:2152cc3
Last scan: 2026-03-18 07:45:55 UTC

📊 Vulnerability Summary

Severity Count
🔴 Critical 3
Total 3

3 package(s) affected

⚠️ Action Required

Critical severity vulnerabilities detected. These should be addressed before merging:

  • Review the detailed scan results
  • Update affected packages to patched versions
  • Consider using a different base image if updates are unavailable

📋 Resources:

@andoniaf andoniaf marked this pull request as ready for review March 17, 2026 15:41
@andoniaf andoniaf requested review from a team as code owners March 17, 2026 15:41
@andoniaf
Copy link
Member Author

image

…rovider

The validator bypass for external tool providers makes the [:150] and
[:400] truncations unnecessary, preserving full Trivy finding data.
@andoniaf andoniaf merged commit 65e745d into master Mar 18, 2026
37 checks passed
@andoniaf andoniaf deleted the fix/image-provider-checkmetadata-validation branch March 18, 2026 08:11
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