-
Notifications
You must be signed in to change notification settings - Fork 19
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 SBOM protocol buffer definitions #212
Conversation
c037cd0
to
f083a7c
Compare
} | ||
|
||
enum SBOMSourceType { | ||
UNSPECIFIED = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what cases can it be UNSPECIFIED
. Can this be useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s just that 0
is the default value when a field isn’t explicitly set or present in the encoded buffer.
Having a dedicated value for 0
allows to make the distinction between a bug where we forgot to set the field and a functionally relevant value.
I basically only mimicked the samples of the enum
documentation.
|
bdadc83
to
51a8dc1
Compare
|
33e814c
to
ba62413
Compare
14bf007
to
4224ec8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a number of things wrong with the repository but none of them are caused by this PR; I know you are just trying to work around the pertinent issues. I have to admit I'm not thrilled about you having to implement all those workarounds/hacks to be able to introduce the sbom definitions, but I understand we really have to tackle addressing all those issues in a separate effort. 😞
Reviewers: please see the review guidelines.
Define the SBOM message to be sent by the agent to the
sbom
EVP track.This payload is further described in the “Container images vulnerabilities” RFC.
This PR is built on top of #213.Generating the upstream CycloneDX
.proto
file with the current versions ofprotoc
andgogo/protobuf
doesn’t work..proto
file isn’t considered valid.protoc
complains about theoptional
keyword for ex..proto
file is “fixed”, the generated code doesn’t work because the use of “well-know” types likegoogle.protobuf.Timestamp
generates use of external GO modules (github.com/golang/protobuf/ptypes/timestamp
) that don’t implement the interface expected by the generated code.Upgrading the version of the ProtocolBuffer compiler for all the messages doesn’t work because it adds some
state
,sizeCache
andunknownFields
google.golang.org/protobuf/runtime/protoimpl
unexported fields which are making the generatedstruct
unsuitable for:map[…]…
;go vet
complains each time a generated struct is copied (either passed by value as a function argument or as a function return value) because one of theprotoimpl
unexported field contains async.Mutex
which cannot be copied.That’s why I had to use different version of
protoc
depending on the message.