Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions opa/rego/external/osv.rego
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ advisories = {
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N",
}],
"cwe_ids": [],
"non_vulnerable_exact_versions": ["v4"],
"vulnerable_versions": [],
"vulnerable_version_ranges": [">=4,<4.1.7"],
"vulnerable_commit_shas": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ rule := poutine.rule(rego.metadata.chain())
step_advisory(step) = advisory if {
parts = split(step.uses, "@")
action := parts[0]
version := trim_left(parts[1], "v")
raw_version := parts[1]
version := trim_left(raw_version, "v")
advisory := advisories[osv_id]
advisory.package_name == action

not raw_version in advisory.non_vulnerable_exact_versions

regex.match("^[0-9]+(\\.[0-9]+)*?$", version)

semver.constraint_check(advisory.vulnerable_version_ranges[_], version)
Expand Down
Loading