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

(feat):Kyverno Adapter #77

Merged
merged 3 commits into from
Mar 21, 2024
Merged

(feat):Kyverno Adapter #77

merged 3 commits into from
Mar 21, 2024

Conversation

VedRatan
Copy link
Collaborator

Description

This PR introduces a new kyverno adapter for escapeToHost issue.

Fixes # (issue)
Closes #76

Does this PR introduce a breaking change?

Checklist

  • PR title follows the <type>: <description> convention
  • I use conventional commits in my commit messages
  • I have updated the documentation accordingly
  • I Keep It Small and Simple: The smaller the PR is, the easier it is to review and have it merged
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional information for reviewer

Mention if this PR is part of any design or a continuation of previous PRs

@VedRatan VedRatan force-pushed the issue_76 branch 7 times, most recently from 0098de3 to f2e37cf Compare March 14, 2024 06:49
@VedRatan VedRatan marked this pull request as ready for review March 14, 2024 06:53
examples/clusterscoped/escape-to-host-si-sib.yaml Outdated Show resolved Hide resolved
examples/namespaced/escape-to-host-si-sib.yaml Outdated Show resolved Hide resolved
pkg/adapter/idpool/idpool.go Outdated Show resolved Hide resolved
pkg/adapter/nimbus-kyverno/go.mod Outdated Show resolved Hide resolved
pkg/adapter/nimbus-kyverno/manager/manager.go Outdated Show resolved Hide resolved
pkg/adapter/nimbus-kyverno/processor/kpbuilder.go Outdated Show resolved Hide resolved
pkg/adapter/nimbus-kyverno/utils/utils.go Outdated Show resolved Hide resolved
pkg/adapter/nimbus-kyverno/watcher/kpwatcher.go Outdated Show resolved Hide resolved
pkg/adapter/nimbus-kyverno/watcher/kpwatcher.go Outdated Show resolved Hide resolved
pkg/adapter/nimbus-kyverno/go.mod Show resolved Hide resolved
@anurag-rajawat
Copy link
Collaborator

In a follow-up PR add a helm chart and include this in our release adapters and adapter images build jobs:

https://github.com/5GSEC/nimbus/tree/main/deployments

matrix:
adapters: [ "nimbus-kubearmor", "nimbus-netpol" ]

matrix:
adapters: [ "nimbus-kubearmor", "nimbus-netpol" ]

@VedRatan
Copy link
Collaborator Author

@anurag-rajawat I have addressed all your reviews.

@VedRatan VedRatan requested a review from anurag-rajawat March 14, 2024 10:21
pkg/adapter/nimbus-kyverno/go.mod Outdated Show resolved Hide resolved
pkg/adapter/nimbus-kyverno/go.mod Outdated Show resolved Hide resolved
pkg/adapter/nimbus-kyverno/go.mod Show resolved Hide resolved
pkg/adapter/nimbus-kyverno/manager/manager.go Outdated Show resolved Hide resolved
pkg/adapter/nimbus-kyverno/manager/manager.go Show resolved Hide resolved
pkg/adapter/nimbus-kyverno/manager/manager.go Show resolved Hide resolved
pkg/adapter/nimbus-kyverno/processor/kpbuilder.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@anurag-rajawat anurag-rajawat left a comment

Choose a reason for hiding this comment

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

Rebase and some comments to address then we're good to merge this.

pkg/adapter/nimbus-kyverno/manager/manager.go Outdated Show resolved Hide resolved
pkg/adapter/nimbus-kyverno/manager/manager.go Outdated Show resolved Hide resolved
pkg/adapter/nimbus-kyverno/processor/kpbuilder.go Outdated Show resolved Hide resolved
@anurag-rajawat
Copy link
Collaborator

On running make from root directory I'm getting the below error:

❯ make
/Users/anurag/projects/work/nimbus/bin/controller-gen rbac:roleName=nimbus-operator crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
Error: load packages in root "/Users/anurag/projects/work/nimbus/pkg/adapter/nimbus-kyverno": err: exit status 1: stderr: go: github.com/emicklei/go-restful/[email protected]: missing go.sum entry for go.mod file; to add it:
	go mod download github.com/emicklei/go-restful/v3

Please update the dependencies by executing the below command from the kyverno-adapter directory:

go mod tidy

@VedRatan VedRatan requested a review from anurag-rajawat March 20, 2024 14:03
@anurag-rajawat
Copy link
Collaborator

Please address this comment.

Signed-off-by: Ved Ratan <[email protected]>

updated adapter for namespaced policy

Signed-off-by: Ved Ratan <[email protected]>

added clusterpolicy logic

Signed-off-by: Ved Ratan <[email protected]>

minor fixes

Signed-off-by: Ved Ratan <[email protected]>
@VedRatan
Copy link
Collaborator Author

@anurag-rajawat I had addressed your comments, I guess we are good to merge this one.

@anurag-rajawat anurag-rajawat merged commit 8050a0d into 5GSEC:main Mar 21, 2024
8 checks passed
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.

Admission Controller Adapter: Escape to Host
2 participants