Skip to content

Commit

Permalink
fix ite6 vuln attestation to use the right predicatetype (#2191)
Browse files Browse the repository at this point in the history
* fix ite6 vuln attestation to use the right predicatetype

Signed-off-by: Brandon Lum <[email protected]>

* fix vuln attestation in other areas

Signed-off-by: Brandon Lum <[email protected]>

---------

Signed-off-by: Brandon Lum <[email protected]>
  • Loading branch information
lumjjb authored Oct 11, 2024
1 parent 0efa268 commit 6940fb0
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion internal/testing/testdata/exampledata/certify-novuln.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"digest": {"sha256": "3a2bd2c5cc4c978e8aefd8bd0ef335fb42ee31d1"}
}
],
"predicateType": "https://in-toto.io/attestation/vuln/v0.1",
"predicateType": "https://in-toto.io/attestation/vulns/v0.1",
"predicate": {
"invocation": {
"parameters": [""],
Expand Down
2 changes: 1 addition & 1 deletion internal/testing/testdata/exampledata/certify-vuln.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"uri": "pkg:maven/org.apache.logging.log4j/[email protected]"
}
],
"predicateType": "https://in-toto.io/attestation/vuln/v0.1",
"predicateType": "https://in-toto.io/attestation/vulns/v0.1",
"predicate": {
"invocation": {
"parameters": [""],
Expand Down
18 changes: 9 additions & 9 deletions internal/testing/testdata/testdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -1891,7 +1891,7 @@ var (
"uri":"pkg:maven/org.apache.commons/[email protected]"
}
],
"predicate_type":"https://in-toto.io/attestation/vuln/v0.1",
"predicate_type":"https://in-toto.io/attestation/vulns/v0.1",
"predicate":{
"invocation":{
"uri":"guac",
Expand Down Expand Up @@ -1920,7 +1920,7 @@ var (
"uri":"pkg:oci/vul-secondLevel-latest?repository_url=gcr.io"
}
],
"predicate_type":"https://in-toto.io/attestation/vuln/v0.1",
"predicate_type":"https://in-toto.io/attestation/vulns/v0.1",
"predicate":{
"invocation":{
"uri":"guac",
Expand All @@ -1943,7 +1943,7 @@ var (
"uri":"pkg:oci/vul-image-latest?repository_url=gcr.io"
}
],
"predicate_type":"https://in-toto.io/attestation/vuln/v0.1",
"predicate_type":"https://in-toto.io/attestation/vulns/v0.1",
"predicate":{
"invocation":{
"uri":"guac",
Expand All @@ -1966,7 +1966,7 @@ var (
"uri":"pkg:maven/org.apache.logging.log4j/[email protected]"
}
],
"predicate_type":"https://in-toto.io/attestation/vuln/v0.1",
"predicate_type":"https://in-toto.io/attestation/vulns/v0.1",
"predicate":{
"invocation":{
"uri":"guac",
Expand Down Expand Up @@ -2027,7 +2027,7 @@ var (
"uri": "pkg:maven/io.vertx/[email protected]?type=jar"
}
],
"predicate_type": "https://in-toto.io/attestation/vuln/v0.1",
"predicate_type": "https://in-toto.io/attestation/vulns/v0.1",
"predicate": {
"invocation": {
"uri": "guac",
Expand All @@ -2051,7 +2051,7 @@ var (
"uri": "pkg:maven/io.vertx/[email protected]?type=jar"
}
],
"predicate_type": "https://in-toto.io/attestation/vuln/v0.1",
"predicate_type": "https://in-toto.io/attestation/vulns/v0.1",
"predicate": {
"invocation": {
"uri": "guac",
Expand All @@ -2075,7 +2075,7 @@ var (
"uri": "pkg:maven/io.vertx/[email protected]?type=jar"
}
],
"predicate_type": "https://in-toto.io/attestation/vuln/v0.1",
"predicate_type": "https://in-toto.io/attestation/vulns/v0.1",
"predicate": {
"invocation": {
"uri": "guac",
Expand All @@ -2099,7 +2099,7 @@ var (
"uri": "pkg:maven/io.vertx/[email protected]?type=jar"
}
],
"predicate_type": "https://in-toto.io/attestation/vuln/v0.1",
"predicate_type": "https://in-toto.io/attestation/vulns/v0.1",
"predicate": {
"invocation": {
"uri": "guac",
Expand Down Expand Up @@ -2128,7 +2128,7 @@ var (
"uri": "pkg:maven/io.vertx/[email protected]?type=jar"
}
],
"predicate_type": "https://in-toto.io/attestation/vuln/v0.1",
"predicate_type": "https://in-toto.io/attestation/vulns/v0.1",
"predicate": {
"invocation": {
"uri": "guac",
Expand Down
2 changes: 1 addition & 1 deletion pkg/certifier/attestation/attestation_vuln.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
// Currently, the predicate is defined here but the intention is to upstream this to
// https://github.com/in-toto/attestation in the near future once the quirks are worked out.
const (
PredicateVuln = "https://in-toto.io/attestation/vuln/v0.1"
PredicateVuln = "https://in-toto.io/attestation/vulns/v0.1"
)

// VulnerabilityStatement defines the statement header and the vulnerability predicate
Expand Down
2 changes: 1 addition & 1 deletion pkg/handler/processor/guesser/type_ite6.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (_ *ite6TypeGuesser) GuessDocumentType(blob []byte, format processor.Format
return processor.DocumentITE6Generic
} else if strings.HasPrefix(statement.PredicateType, "https://in-toto.io/attestation/certify/v0.1") {
return processor.DocumentITE6Generic
} else if strings.HasPrefix(statement.PredicateType, "https://in-toto.io/attestation/vuln/v0.1") {
} else if strings.HasPrefix(statement.PredicateType, "https://in-toto.io/attestation/vulns/v0.1") {
return processor.DocumentITE6Vul
} else if strings.HasPrefix(statement.PredicateType, "https://in-toto.io/attestation/clearlydefined/v0.1") {
return processor.DocumentITE6ClearlyDefined
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingestor/parser/vuln/vuln.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// Package vuln attestation parser parses the attestation defined by by
// the certifier using the predicate type
// "https://in-toto.io/attestation/vuln/v0.1" Three different types of ingest
// "https://in-toto.io/attestation/vulns/v0.1" Three different types of ingest
// predicates are created.
//
// - IsOccurences are created mapping between any package
Expand Down

0 comments on commit 6940fb0

Please sign in to comment.