Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proto definition for vuln predicate type #345

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hectorj2f
Copy link
Contributor

This PR adds a proto definition for the vuln predicate type. This was pending since we added the vuln predicate type and it is needed to update the cosign vuln predicate types.

@hectorj2f
Copy link
Contributor Author

related to #268

Copy link
Contributor

@TomHennen TomHennen left a comment

Choose a reason for hiding this comment

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

Thanks for sending this.

Besides the other comments, have you by any chance generated any json with this? Could you provide a sample? it would be nice to compare it against the example https://github.com/in-toto/attestation/blob/main/spec/predicates/vuln.md#example

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe you don't need (and shouldn't!) include these files in your change. Instead they'll be autogenerated by this workflow https://github.com/in-toto/attestation/blob/main/.github/workflows/make-protos.yml

Can you remove this these files from this PR?


message Vulnerability {
string id = 1;
Severity severity = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is where we need resolution to #342

As defined here a given vulnerability can only have a single severity and method. In practice there are many ways to measure severity and users may need to express both in the vuln attestation.

We can see this in practice in the example.

So perhaps this should be repeated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll make all these changes. 👍🏻

string score = 2;
}

google.protobuf.Struct annotations = 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is also a list so perhaps it should be repeated too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch.

@marcelamelara
Copy link
Contributor

Friendly ping on this PR. @hectorj2f Could you please remove the generated Go/Python/Java files and add an entry for this proto here? then I think your PR will be pretty much ready to go.

@hectorj2f
Copy link
Contributor Author

@marcelamelara Yes, I'll do it.

@TomHennen
Copy link
Contributor

I think something might have gotten a bit screwy with the git commits (I've done this myself for sure). When I look at 'Files Changed' it doesn't look like anything has changed since our earlier comments?

@hectorj2f
Copy link
Contributor Author

I'm confused now. I followed what @marcelamelara commented above remove all the generated go/python and java code and leave the entry in protos.

@marcelamelara
Copy link
Contributor

If I understand correctly, having only the .proto file is what Tom had originally requested. But there may have been some edits to that proto file that were lost when the auto-generated files were removed? I only see 1 commit in this PR right now.

Separately, I also had requested a minor documentation update to the /protos/README.md file. This way this new proto is included in that list.

Copy link
Contributor

@TomHennen TomHennen left a comment

Choose a reason for hiding this comment

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

Thanks for these changes, just a couple minor updates needed I think.

protos/in_toto_attestation/predicates/vuln/v1/vuln.proto Outdated Show resolved Hide resolved
protos/in_toto_attestation/predicates/vuln/v1/vuln.proto Outdated Show resolved Hide resolved
protos/in_toto_attestation/predicates/vuln/v1/vuln.proto Outdated Show resolved Hide resolved
protos/in_toto_attestation/predicates/vuln/v1/vuln.proto Outdated Show resolved Hide resolved
protos/in_toto_attestation/predicates/vuln/v1/vuln.proto Outdated Show resolved Hide resolved
Signed-off-by: hectorj2f <[email protected]>
Copy link
Contributor

@marcelamelara marcelamelara left a comment

Choose a reason for hiding this comment

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

Thanks @hectorj2f ! LGTM.

@marcelamelara
Copy link
Contributor

One final question (which can be addressed in a separate PR, I think) is about the predicate type URI for this predicate. Right now, in the vuln predicate spec it's listed as https"//in-toto.io/attestation/vuln_s_ rather than /vuln which is the name we use everywhere else. Does the spec have a typo? We usually want the name to match everywhere, but I'm also worried that tooling might already be using the pluralized type URL.

@hectorj2f What do you think? Is this a concern?

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.

3 participants