-
Notifications
You must be signed in to change notification settings - Fork 14
feat: node scan #944
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
Open
alegrey91
wants to merge
5
commits into
kubewarden:main
Choose a base branch
from
alegrey91:node-scan-devel
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: node scan #944
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
de966a1
feat(api): define crds for nodescan
alegrey91 bac8c5b
feat: add nodescan logic
alegrey91 65176e5
feat(helm): add chart for nodescan
alegrey91 24b3dd5
feat(webhook): add nodescanconfigiration validation
alegrey91 4e10530
docs(examples): add nodescan crds
alegrey91 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package v1alpha1 | ||
|
|
||
| // IndexNodeMetadataName is the field index for the digest of a node. | ||
| const ( | ||
| IndexNodeMetadataName = "nodeMetadata.name" | ||
| ) | ||
|
|
||
| // NodeMetadata contains the metadata details of a node. | ||
| type NodeMetadata struct { | ||
| // Name specifies the name of the node. | ||
| Name string `json:"name" protobuf:"bytes,1,req,name=name"` | ||
| // Platform specifies the platform of the image. Example "linux/amd64". | ||
| Platform string `json:"platform" protobuf:"bytes,2,req,name=platform"` | ||
| } | ||
|
|
||
| type NodeMetadataAccessor interface { | ||
| GetNodeMetadata() NodeMetadata | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| package v1alpha1 | ||
|
|
||
| import ( | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| "k8s.io/apimachinery/pkg/runtime" | ||
| ) | ||
|
|
||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
|
||
| // NodeSBOMList contains a list of Software Bill of Materials for nodes | ||
| type NodeSBOMList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` | ||
|
|
||
| Items []NodeSBOM `json:"items" protobuf:"bytes,2,rep,name=items"` | ||
| } | ||
|
|
||
| // +genclient | ||
| // +genclient:nonNamespaced | ||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
| // +kubebuilder:resource:scope=Cluster | ||
| // +kubebuilder:selectablefield:JSONPath=`.nodeMetadata.name` | ||
| // +kubebuilder:selectablefield:JSONPath=`.nodeMetadata.platform` | ||
|
|
||
| // NodeSBOM represents a Software Bill of Materials of a node | ||
| type NodeSBOM struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` | ||
|
|
||
| NodeMetadata NodeMetadata `json:"nodeMetadata" protobuf:"bytes,2,req,name=nodeMetadata"` | ||
| // SPDX contains the SPDX document of the SBOM in JSON format | ||
| SPDX runtime.RawExtension `json:"spdx" protobuf:"bytes,3,req,name=spdx"` | ||
| } | ||
|
|
||
| func (s *NodeSBOM) GetNodeMetadata() NodeMetadata { | ||
| return s.NodeMetadata | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| package v1alpha1 | ||
|
alegrey91 marked this conversation as resolved.
|
||
|
|
||
| import ( | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
|
||
| // NodeVulnerabilityReportList contains a list of NodeVulnerabilityReport | ||
| type NodeVulnerabilityReportList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` | ||
|
|
||
| Items []NodeVulnerabilityReport `json:"items" protobuf:"bytes,2,rep,name=items"` | ||
| } | ||
|
|
||
| // +genclient | ||
| // +genclient:nonNamespaced | ||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
| // +kubebuilder:resource:scope=Cluster | ||
| // +kubebuilder:selectablefield:JSONPath=`.nodeMetadata.name` | ||
| // +kubebuilder:selectablefield:JSONPath=`.nodeMetadata.platform` | ||
|
|
||
| // NodeVulnerabilityReport is the Schema for the scanresults API | ||
| type NodeVulnerabilityReport struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` | ||
|
|
||
| // NodeMetadata contains info about the scanned node | ||
| NodeMetadata NodeMetadata `json:"nodeMetadata" protobuf:"bytes,2,req,name=nodeMetadata"` | ||
|
|
||
| // Report is the actual vulnerability scan report | ||
| Report Report `json:"report" protobuf:"bytes,3,req,name=report"` | ||
| } | ||
|
|
||
| func (v *NodeVulnerabilityReport) GetNodeMetadata() NodeMetadata { | ||
| return v.NodeMetadata | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.