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

Vex support #54

Merged
merged 11 commits into from
Oct 16, 2023
Merged

Vex support #54

merged 11 commits into from
Oct 16, 2023

Conversation

slashben
Copy link
Contributor

@slashben slashben commented Oct 16, 2023

PR Type:

Enhancement


PR Description:

This PR introduces support for VEX (Vulnerability Exchange) documents in the Kubescape Storage component. It includes the addition of OpenVulnerabilityExchangeContainer and OpenVulnerabilityExchangeContainerList objects, which are based on the go-vex declarations. These new objects are designed to work with OpenAPI and Kubernetes API. The PR also includes updates to the relevant Go files and Dockerfile.


PR Main Files Walkthrough:

files:

pkg/apis/softwarecomposition/v1beta1/zz_generated.deepcopy.go: Autogenerated deepcopy functions for new VEX related objects such as Component, Metadata, OpenVulnerabilityExchangeContainer, OpenVulnerabilityExchangeContainerList, Product, Statement, Subcomponent, VEX, and VexVulnerability.
pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/fake/fake_openvulnerabilityexchangecontainer.go: Autogenerated fake clientset for testing OpenVulnerabilityExchangeContainer operations such as Get, List, Watch, Create, Update, Delete, DeleteCollection, and Patch.
pkg/apis/softwarecomposition/v1beta1/types.go: Definitions of new VEX related types and their methods.
pkg/registry/softwarecomposition/openvulnerabilityexchange/strategy.go: Implementation of the registry strategy for OpenVulnerabilityExchangeContainer.
pkg/registry/softwarecomposition/openvulnerabilityexchange/etcd.go: Implementation of the etcd storage for OpenVulnerabilityExchangeContainer.
build/Dockerfile: Updated the Go builder version to 1.21.
go.mod and go.sum: Updated the Go dependencies to support the new VEX related changes.
test.yaml: Test cases related to the new VEX support.


User Description:

Adding support for VEX documents in the Kubescape Storage component:

  • Openvulnerabilityexchangecontainer
  • OpenvulnerabilityexchangecontainerList

Both of them are based on https://github.com/openvex/go-vex declarations but were re-defined here due to OpenAPI and K8s API support.

Supporting kubescape/kubevuln#155

slashben and others added 7 commits October 11, 2023 22:49
Signed-off-by: Ben <ben@armosec.io>
Signed-off-by: Ben <ben@armosec.io>
Signed-off-by: Ben <ben@armosec.io>
Signed-off-by: Ben <ben@armosec.io>
Signed-off-by: Ben <ben@armosec.io>
Signed-off-by: Ben <ben@armosec.io>
@slashben slashben requested a review from matthyx October 16, 2023 14:35
@codiumai-pr-agent-free codiumai-pr-agent-free bot added the enhancement New feature or request label Oct 16, 2023
@codiumai-pr-agent-free
Copy link

PR Analysis

  • 🎯 Main theme: Adding support for VEX (Vulnerability Exchange) documents in the Kubescape Storage component
  • 📝 PR summary: This PR introduces support for VEX documents in the Kubescape Storage component. It includes the addition of OpenVulnerabilityExchangeContainer and OpenVulnerabilityExchangeContainerList objects, which are based on the go-vex declarations. These new objects are designed to work with OpenAPI and Kubernetes API. The PR also includes updates to the relevant Go files and Dockerfile.
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: Yes
  • ⏱️ Estimated effort to review [1-5]: 4, because the PR includes a significant amount of autogenerated code and new functionality, which requires a deep understanding of the project and the VEX standard to review properly.
  • 🔒 Security concerns: No security concerns found

PR Feedback

  • 💡 General suggestions: The PR seems to be well-structured and includes a good amount of detail in the description. It would be beneficial to include more context about the VEX standard and why it's being added to the project in the PR description. This would help reviewers understand the purpose and impact of the changes.

  • 🤖 Code feedback:

    • relevant file: pkg/apis/softwarecomposition/v1beta1/zz_generated.deepcopy.go
      suggestion: Ensure that the deepcopy functions are working as expected. Autogenerated code can sometimes have issues that are not immediately apparent. Consider adding tests to verify the correct operation of these functions. [important]
      relevant line: func (in *Component) DeepCopyInto(out *Component) {

    • relevant file: pkg/generated/informers/externalversions/softwarecomposition/v1beta1/interface.go
      suggestion: It's important to ensure that the new informer for OpenVulnerabilityExchangeContainer is integrated properly with the rest of the project. Check that it's being used correctly in all relevant places. [medium]
      relevant line: func (v *version) OpenVulnerabilityExchangeContainers() OpenVulnerabilityExchangeContainerInformer {

    • relevant file: build/Dockerfile
      suggestion: The Go builder version has been updated to 1.21. Make sure that this version is compatible with all dependencies and the rest of the codebase. [medium]
      relevant line: Change GO builder version to 1.21

How to use

To invoke the PR-Agent, add a comment using one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback.
/ask <QUESTION>: Pose a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, use the /config command.

Signed-off-by: Ben <ben@armosec.io>
@github-actions
Copy link

Summary:

  • License scan: success
  • Credentials scan: success
  • Vulnerabilities scan: failure
  • Unit test: success
  • Go linting: success

Copy link
Contributor

@matthyx matthyx left a comment

Choose a reason for hiding this comment

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

move test.yaml to artifacts/openvulnerabilityexchange

Signed-off-by: Ben <ben@armosec.io>
@github-actions
Copy link

Summary:

  • License scan: success
  • Credentials scan: success
  • Vulnerabilities scan: failure
  • Unit test: success
  • Go linting: success

Signed-off-by: Ben <ben@armosec.io>
@github-actions
Copy link

Summary:

  • License scan: success
  • Credentials scan: success
  • Vulnerabilities scan: failure
  • Unit test: success
  • Go linting: success

@github-actions
Copy link

Summary:

  • License scan: success
  • Credentials scan: success
  • Vulnerabilities scan: failure
  • Unit test: success
  • Go linting: success

@slashben slashben merged commit da13f36 into main Oct 16, 2023
7 checks passed
@matthyx matthyx deleted the vex-support branch October 1, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants