-
Notifications
You must be signed in to change notification settings - Fork 67
Add SecurityException CRDs, RBAC, and riskAcceptance capability #817
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
aa08fe2
feat: add SecurityException and ClusterSecurityException CRD definitions
slashben ba085b7
feat: add riskAcceptance capability and SecurityException RBAC
slashben 090253f
fix: address review feedback on SecurityException CRDs
slashben f79e87c
test: add riskAcceptance to snapshot tests
slashben 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
126 changes: 126 additions & 0 deletions
126
charts/kubescape-operator/crds/cluster-security-exception.crd.yaml
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,126 @@ | ||
| apiVersion: apiextensions.k8s.io/v1 | ||
| kind: CustomResourceDefinition | ||
| metadata: | ||
| name: clustersecurityexceptions.kubescape.io | ||
| spec: | ||
| group: kubescape.io | ||
| names: | ||
| plural: clustersecurityexceptions | ||
| singular: clustersecurityexception | ||
| kind: ClusterSecurityException | ||
| shortNames: | ||
| - cse | ||
| scope: Cluster | ||
| versions: | ||
| - name: v1beta1 | ||
| served: true | ||
| storage: true | ||
| schema: | ||
| openAPIV3Schema: | ||
| type: object | ||
| required: ["spec"] | ||
| properties: | ||
| spec: | ||
| type: object | ||
| properties: | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| author: | ||
| type: string | ||
| reason: | ||
| type: string | ||
| expiresAt: | ||
| type: string | ||
| format: date-time | ||
| match: | ||
| type: object | ||
| properties: | ||
| namespaceSelector: | ||
| type: object | ||
| x-kubernetes-preserve-unknown-fields: true | ||
| objectSelector: | ||
| type: object | ||
| x-kubernetes-preserve-unknown-fields: true | ||
| resources: | ||
| type: array | ||
| items: | ||
| type: object | ||
| required: | ||
| - kind | ||
| properties: | ||
| apiGroup: | ||
| type: string | ||
| kind: | ||
| type: string | ||
| name: | ||
| type: string | ||
| images: | ||
| type: array | ||
| items: | ||
| type: string | ||
| vulnerabilities: | ||
| type: array | ||
| items: | ||
| type: object | ||
| required: | ||
| - vulnerability | ||
| - status | ||
| properties: | ||
| vulnerability: | ||
| type: object | ||
| required: | ||
| - id | ||
| properties: | ||
| id: | ||
| type: string | ||
| aliases: | ||
| type: array | ||
| items: | ||
| type: string | ||
| status: | ||
| type: string | ||
| enum: | ||
| - not_affected | ||
| - fixed | ||
| - under_investigation | ||
| justification: | ||
| type: string | ||
| enum: | ||
| - component_not_present | ||
| - vulnerable_code_not_present | ||
| - vulnerable_code_not_in_execute_path | ||
| - vulnerable_code_cannot_be_controlled_by_adversary | ||
| - inline_mitigations_already_exist | ||
| impactStatement: | ||
| type: string | ||
| expiredOnFix: | ||
| type: boolean | ||
| posture: | ||
| type: array | ||
| items: | ||
| type: object | ||
| required: | ||
| - controlID | ||
| - action | ||
| properties: | ||
| controlID: | ||
| type: string | ||
| frameworkName: | ||
| type: string | ||
| action: | ||
| type: string | ||
| enum: | ||
| - ignore | ||
| - alert_only | ||
| status: | ||
| type: object | ||
| additionalPrinterColumns: | ||
| - name: Reason | ||
| type: string | ||
| jsonPath: .spec.reason | ||
| - name: Expires | ||
| type: string | ||
| jsonPath: .spec.expiresAt | ||
| - name: Age | ||
| type: date | ||
| jsonPath: .metadata.creationTimestamp | ||
|
matthyx marked this conversation as resolved.
|
||
| subresources: | ||
| status: {} | ||
123 changes: 123 additions & 0 deletions
123
charts/kubescape-operator/crds/security-exception.crd.yaml
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,123 @@ | ||
| apiVersion: apiextensions.k8s.io/v1 | ||
| kind: CustomResourceDefinition | ||
| metadata: | ||
| name: securityexceptions.kubescape.io | ||
| spec: | ||
| group: kubescape.io | ||
| names: | ||
| plural: securityexceptions | ||
| singular: securityexception | ||
| kind: SecurityException | ||
| shortNames: | ||
| - se | ||
| scope: Namespaced | ||
| versions: | ||
| - name: v1beta1 | ||
| served: true | ||
| storage: true | ||
| schema: | ||
| openAPIV3Schema: | ||
| type: object | ||
| required: ["spec"] | ||
| properties: | ||
| spec: | ||
| type: object | ||
| properties: | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| author: | ||
| type: string | ||
| reason: | ||
| type: string | ||
| expiresAt: | ||
| type: string | ||
| format: date-time | ||
| match: | ||
| type: object | ||
| properties: | ||
| objectSelector: | ||
| type: object | ||
| x-kubernetes-preserve-unknown-fields: true | ||
| resources: | ||
| type: array | ||
| items: | ||
| type: object | ||
| required: | ||
| - kind | ||
| properties: | ||
| apiGroup: | ||
| type: string | ||
| kind: | ||
| type: string | ||
| name: | ||
| type: string | ||
| images: | ||
| type: array | ||
| items: | ||
| type: string | ||
| vulnerabilities: | ||
| type: array | ||
| items: | ||
| type: object | ||
| required: | ||
| - vulnerability | ||
| - status | ||
| properties: | ||
| vulnerability: | ||
| type: object | ||
| required: | ||
| - id | ||
| properties: | ||
| id: | ||
| type: string | ||
| aliases: | ||
| type: array | ||
| items: | ||
| type: string | ||
| status: | ||
| type: string | ||
| enum: | ||
| - not_affected | ||
| - fixed | ||
| - under_investigation | ||
| justification: | ||
| type: string | ||
| enum: | ||
| - component_not_present | ||
| - vulnerable_code_not_present | ||
| - vulnerable_code_not_in_execute_path | ||
| - vulnerable_code_cannot_be_controlled_by_adversary | ||
| - inline_mitigations_already_exist | ||
| impactStatement: | ||
| type: string | ||
| expiredOnFix: | ||
| type: boolean | ||
| posture: | ||
| type: array | ||
| items: | ||
| type: object | ||
| required: | ||
| - controlID | ||
| - action | ||
| properties: | ||
| controlID: | ||
| type: string | ||
| frameworkName: | ||
| type: string | ||
| action: | ||
| type: string | ||
| enum: | ||
| - ignore | ||
| - alert_only | ||
| status: | ||
| type: object | ||
| additionalPrinterColumns: | ||
| - name: Reason | ||
| type: string | ||
| jsonPath: .spec.reason | ||
| - name: Expires | ||
| type: string | ||
| jsonPath: .spec.expiresAt | ||
| - name: Age | ||
| type: date | ||
| jsonPath: .metadata.creationTimestamp | ||
| subresources: | ||
| status: {} | ||
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 |
|---|---|---|
|
|
@@ -41,4 +41,9 @@ rules: | |
| - apiGroups: ["kubescape.io"] | ||
| resources: ["operatorcommands/status"] | ||
| verbs: ["get", "watch", "list", "update", "patch"] | ||
| {{- if eq .Values.capabilities.riskAcceptance "enable" }} | ||
| - apiGroups: ["kubescape.io"] | ||
| resources: ["securityexceptions", "clustersecurityexceptions"] | ||
| verbs: ["get", "list", "watch"] | ||
| {{- end }} | ||
|
Comment on lines
+44
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update snapshot fixtures for the new conditional RBAC rule. CI is currently failing with a snapshot mismatch tied to this block. Please update the expected rendered output (including the disabled path) to unblock merge. 🤖 Prompt for AI Agents |
||
| {{- end }} | ||
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.