Skip to content

Add standalone OWASP Kubernetes resource importers - #953

Open
Bornunique911 wants to merge 5 commits into
OWASP:mainfrom
Bornunique911:review/issue-471-kubernetes-importers-clean
Open

Add standalone OWASP Kubernetes resource importers#953
Bornunique911 wants to merge 5 commits into
OWASP:mainfrom
Bornunique911:review/issue-471-kubernetes-importers-clean

Conversation

@Bornunique911

@Bornunique911 Bornunique911 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR is split out from the larger issue-471 review flow to make review smaller and more focused.

It adds standalone importer support for:

  • OWASP Kubernetes Top Ten 2022
  • OWASP Kubernetes Top Ten 2025 (Draft)

Issue reference:

Problem Fixed

The earlier Kubernetes importer review became too large because it was mixed with unrelated OWASP importer, backend, and frontend work.

For this part of the work, the useful standalone contribution is:

  • Kubernetes mapping data
  • Kubernetes parser modules
  • parser tests
  • minimal CLI/import wiring

Solution

This PR adds:

  • Kubernetes Top Ten 2022 mapping data
  • Kubernetes Top Ten 2025 draft mapping data
  • parser implementations for both resources
  • parser tests for direct parsing behavior and fallback behavior
  • minimal cre.py / cre_main.py wiring so the importers can run from main

Files in scope:

  • cre.py
  • application/cmd/cre_main.py
  • application/utils/external_project_parsers/parsers/owasp_kubernetes_top10_2022.py
  • application/utils/external_project_parsers/parsers/owasp_kubernetes_top10_2025.py
  • application/utils/external_project_parsers/data/owasp_kubernetes_top10_2022.json
  • application/utils/external_project_parsers/data/owasp_kubernetes_top10_2025.json
  • application/tests/owasp_kubernetes_top10_2022_parser_test.py
  • application/tests/owasp_kubernetes_top10_2025_parser_test.py

Tests

./venv/bin/python -m pytest application/tests/owasp_kubernetes_top10_2022_parser_test.py application/tests/owasp_kubernetes_top10_2025_parser_test.py -q

Reviewer Notes

This PR is intentionally narrow because it was split to reduce review size:

  • no frontend changes
  • no gap-analysis feature work
  • no unrelated OWASP importer files
  • no bundle artifacts
  • no broader issue-471 aggregation

This PR is meant to be reviewed as a standalone Kubernetes importer addition.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Bornunique911, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 22 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 151f0bb8-da65-4016-908b-503bd4e09a28

📥 Commits

Reviewing files that changed from the base of the PR and between 0affe86 and fb9ced2.

📒 Files selected for processing (1)
  • application/cmd/cre_main.py

Summary by CodeRabbit

  • New Features

    • Added support for importing OWASP Kubernetes Top 10 2022 and 2025 draft resources.
    • Added command-line options for selecting either dataset.
    • The 2025 import can fall back to related 2022 mappings when current links are unavailable.
  • Bug Fixes

    • Updated 2025 resource links to use version-specific sections.
  • Tests

    • Added coverage validating parsing, CRE associations, section counts, and fallback behavior.

Walkthrough

The pull request adds OWASP Kubernetes Top 10 2022 and 2025 parsers, updates 2025 mappings, adds parser tests, and exposes both imports through CLI options.

Changes

OWASP Kubernetes Top 10 imports

Layer / File(s) Summary
Parser implementations
application/utils/external_project_parsers/parsers/owasp_kubernetes_top10_2022.py, application/utils/external_project_parsers/parsers/owasp_kubernetes_top10_2025.py
The parsers load mappings, link cached CREs, apply 2022 fallback mappings for 2025 entries, and return parsed standards.
Mapping and parser validation
application/tests/fixtures/owasp_mappings/owasp_kubernetes_top10_2025.json, application/tests/owasp_kubernetes_top10_2022_parser_test.py, application/tests/owasp_kubernetes_top10_2025_parser_test.py
The 2025 fixture uses section-specific URLs. Tests cover parsing, CRE links, section metadata, and fallback behavior.
CLI import wiring
cre.py, application/cmd/cre_main.py
The CLI accepts separate 2022 and 2025 import flags. The runtime wiring registers the 2025 parser when its flag is enabled.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • OWASP/OpenCRE#950: Updates and consumes shared OWASP Kubernetes Top 10 mapping fixtures.

Suggested reviewers: northdpole, pa04rth, paoga87, robvanderveer

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description directly explains the standalone Kubernetes importer scope, implementation, tests, and exclusions.
Title check ✅ Passed The title clearly summarizes the main change: standalone importers for OWASP Kubernetes resources.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@northdpole

Copy link
Copy Markdown
Collaborator

Please rebase onto latest main (~119 commits behind). #950 (mapping fixtures) has merged — align any fixture/data paths with that layout before review.

@Bornunique911
Bornunique911 force-pushed the review/issue-471-kubernetes-importers-clean branch from 11c247c to 0cf8f32 Compare August 7, 2026 12:22

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@application/cmd/cre_main.py`:
- Around line 979-996: Ensure the Kubernetes parser modules for
OwaspKubernetesTop10_2022 and OwaspKubernetesTop10_2025 are imported and
registered unconditionally before the batch discovery flow invokes
BaseParser.call_importers(), rather than only inside the corresponding
input-flag branches. Preserve the existing cache_file registration argument and
avoid duplicate registration when explicit flags are handled.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2b63977c-418c-4ac4-997e-22974a93af60

📥 Commits

Reviewing files that changed from the base of the PR and between a8c2436 and 11c247c.

📒 Files selected for processing (7)
  • application/cmd/cre_main.py
  • application/tests/fixtures/owasp_mappings/owasp_kubernetes_top10_2025.json
  • application/tests/owasp_kubernetes_top10_2022_parser_test.py
  • application/tests/owasp_kubernetes_top10_2025_parser_test.py
  • application/utils/external_project_parsers/parsers/owasp_kubernetes_top10_2022.py
  • application/utils/external_project_parsers/parsers/owasp_kubernetes_top10_2025.py
  • cre.py

Comment thread application/cmd/cre_main.py
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