Skip to content

Add null guard for input.v0.osv in aliased_records rule#37

Draft
Copilot wants to merge 44 commits intomainfrom
copilot/sub-pr-15-5d84275d-5c59-4c43-85ef-feaf843b92e7
Draft

Add null guard for input.v0.osv in aliased_records rule#37
Copilot wants to merge 44 commits intomainfrom
copilot/sub-pr-15-5d84275d-5c59-4c43-85ef-feaf843b92e7

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 12, 2026

Iterating input.v0.osv in aliased_records without a null check causes a type error when osv is null or absent, breaking evaluation entirely.

Changes

  • baseline/high-risk-vulnerability.rego: Added input.v0.osv != null guard before iterating in aliased_records, consistent with the pattern in malware-block.rego
aliased_records[k] := records if {
    input.v0.osv != null  # added
    some v_seed in input.v0.osv
    some k in vuln_keys(v_seed)
    records := {v | some v in input.v0.osv; k in vuln_keys(v)}
}

Existing tests test_no_match_null_osv and test_no_match_missing_osv cover both failure modes.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

ciaracarey and others added 30 commits February 18, 2026 21:49
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan

* fix(readme): wrap repository structure in fenced code block

Co-authored-by: ciaracarey <84123925+ciaracarey@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ciaracarey <84123925+ciaracarey@users.noreply.github.com>
* Initial plan

* Fix spelling: "Specialised" -> "Specialized" in README.md

Co-authored-by: ciaracarey <84123925+ciaracarey@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ciaracarey <84123925+ciaracarey@users.noreply.github.com>
* Initial plan

* Remove import rego.v1 from advanced/huggingface-recipes policies

Co-authored-by: ciaracarey <84123925+ciaracarey@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ciaracarey <84123925+ciaracarey@users.noreply.github.com>
Added section on GitOps workflow for managing policy exemptions.
chore: tidy rego based on regal output
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
markmcmurray and others added 13 commits March 11, 2026 11:34
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Mark McMurray <mmcmurray@cloudsmith.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: ciaracarey <84123925+ciaracarey@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 12, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • openpolicyagent.org
    • Triggering command: /usr/bin/curl curl -L -o /tmp/opa REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] [WIP] Address feedback on Epm baseline refactor PR Add null guard for input.v0.osv in aliased_records rule Mar 12, 2026
@ciaracarey ciaracarey requested a review from Copilot March 12, 2026 12:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a null guard (input.v0.osv != null) to the aliased_records rule in high-risk-vulnerability.rego to prevent type errors when osv is null or absent, matching the existing defensive pattern used in malware-block.rego.

Changes:

  • Added input.v0.osv != null guard before iterating input.v0.osv in the aliased_records rule

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ciaracarey ciaracarey force-pushed the epm-baseline-refactor branch from 3185b50 to aa38feb Compare March 12, 2026 13:35
Base automatically changed from epm-baseline-refactor to main March 12, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants