-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into xinhl/cpulimit
- Loading branch information
Showing
26 changed files
with
770 additions
and
146 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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
13 changes: 13 additions & 0 deletions
13
artifacthub/library/pod-security-policy/fsgroup/1.0.2/samples/psp-fsgroup/constraint2.yaml
This file contains 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,13 @@ | ||
apiVersion: constraints.gatekeeper.sh/v1beta1 | ||
kind: K8sPSPFSGroup | ||
metadata: | ||
name: psp-fsgroup | ||
spec: | ||
match: | ||
kinds: | ||
- apiGroups: [""] | ||
kinds: ["Pod"] | ||
parameters: | ||
ranges: | ||
- min: 1 | ||
max: 1000 |
7 changes: 7 additions & 0 deletions
7
artifacthub/library/pod-security-policy/fsgroup/1.1.0/README.md
This file contains 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,7 @@ | ||
# Deprecated | ||
|
||
**This Policy is deprecated** | ||
|
||
Please use the FSGroup settings on the users policy to enforce FSGroup Settings. | ||
|
||
[Users Policy](../users) |
22 changes: 22 additions & 0 deletions
22
artifacthub/library/pod-security-policy/fsgroup/1.1.0/artifacthub-pkg.yml
This file contains 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,22 @@ | ||
version: 1.1.0 | ||
name: k8spspfsgroup | ||
displayName: FS Group | ||
createdAt: "2024-07-08T22:14:40Z" | ||
description: Controls allocating an FSGroup that owns the Pod's volumes. Corresponds to the `fsGroup` field in a PodSecurityPolicy. For more information, see https://kubernetes.io/docs/concepts/policy/pod-security-policy/#volumes-and-file-systems | ||
digest: b0c1dada1dd06b897676e480a7a1439cc339cd9d1703dc0dbb4329e0b89ba4bd | ||
license: Apache-2.0 | ||
homeURL: https://open-policy-agent.github.io/gatekeeper-library/website/fsgroup | ||
keywords: | ||
- gatekeeper | ||
- open-policy-agent | ||
- policies | ||
readme: |- | ||
# FS Group | ||
Controls allocating an FSGroup that owns the Pod's volumes. Corresponds to the `fsGroup` field in a PodSecurityPolicy. For more information, see https://kubernetes.io/docs/concepts/policy/pod-security-policy/#volumes-and-file-systems | ||
install: |- | ||
### Usage | ||
```shell | ||
kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper-library/master/artifacthub/library/pod-security-policy/fsgroup/1.1.0/template.yaml | ||
``` | ||
provider: | ||
name: Gatekeeper Library |
2 changes: 2 additions & 0 deletions
2
artifacthub/library/pod-security-policy/fsgroup/1.1.0/kustomization.yaml
This file contains 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,2 @@ | ||
resources: | ||
- template.yaml |
14 changes: 14 additions & 0 deletions
14
artifacthub/library/pod-security-policy/fsgroup/1.1.0/samples/psp-fsgroup/constraint.yaml
This file contains 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,14 @@ | ||
apiVersion: constraints.gatekeeper.sh/v1beta1 | ||
kind: K8sPSPFSGroup | ||
metadata: | ||
name: psp-fsgroup | ||
spec: | ||
match: | ||
kinds: | ||
- apiGroups: [""] | ||
kinds: ["Pod"] | ||
parameters: | ||
rule: "MayRunAs" #"MustRunAs" #"MayRunAs", "RunAsAny" | ||
ranges: | ||
- min: 1 | ||
max: 1000 |
13 changes: 13 additions & 0 deletions
13
artifacthub/library/pod-security-policy/fsgroup/1.1.0/samples/psp-fsgroup/constraint2.yaml
This file contains 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,13 @@ | ||
apiVersion: constraints.gatekeeper.sh/v1beta1 | ||
kind: K8sPSPFSGroup | ||
metadata: | ||
name: psp-fsgroup | ||
spec: | ||
match: | ||
kinds: | ||
- apiGroups: [""] | ||
kinds: ["Pod"] | ||
parameters: | ||
ranges: | ||
- min: 1 | ||
max: 1000 |
12 changes: 12 additions & 0 deletions
12
artifacthub/library/pod-security-policy/fsgroup/1.1.0/samples/psp-fsgroup/constraint3.yaml
This file contains 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,12 @@ | ||
apiVersion: constraints.gatekeeper.sh/v1beta1 | ||
kind: K8sPSPFSGroup | ||
metadata: | ||
name: psp-fsgroup | ||
spec: | ||
match: | ||
kinds: | ||
- apiGroups: [""] | ||
kinds: ["Pod"] | ||
parameters: | ||
rule: "MustRunAs" #"MayRunAs", "RunAsAny" | ||
ranges: [] # empty ranges should result in violation |
17 changes: 17 additions & 0 deletions
17
...acthub/library/pod-security-policy/fsgroup/1.1.0/samples/psp-fsgroup/example_allowed.yaml
This file contains 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,17 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: fsgroup-allowed | ||
spec: | ||
securityContext: | ||
fsGroup: 500 # directory will have group ID 500 | ||
volumes: | ||
- name: fsgroup-demo-vol | ||
emptyDir: {} | ||
containers: | ||
- name: fsgroup-demo | ||
image: busybox | ||
command: ["sh", "-c", "sleep 1h"] | ||
volumeMounts: | ||
- name: fsgroup-demo-vol | ||
mountPath: /data/demo |
17 changes: 17 additions & 0 deletions
17
...hub/library/pod-security-policy/fsgroup/1.1.0/samples/psp-fsgroup/example_disallowed.yaml
This file contains 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,17 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: fsgroup-disallowed | ||
spec: | ||
securityContext: | ||
fsGroup: 2000 # directory will have group ID 2000 | ||
volumes: | ||
- name: fsgroup-demo-vol | ||
emptyDir: {} | ||
containers: | ||
- name: fsgroup-demo | ||
image: busybox | ||
command: [ "sh", "-c", "sleep 1h" ] | ||
volumeMounts: | ||
- name: fsgroup-demo-vol | ||
mountPath: /data/demo |
22 changes: 22 additions & 0 deletions
22
artifacthub/library/pod-security-policy/fsgroup/1.1.0/samples/psp-fsgroup/update.yaml
This file contains 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,22 @@ | ||
kind: AdmissionReview | ||
apiVersion: admission.k8s.io/v1beta1 | ||
request: | ||
operation: "UPDATE" | ||
object: | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: fsgroup-disallowed | ||
spec: | ||
securityContext: | ||
fsGroup: 2000 # directory will have group ID 2000 | ||
volumes: | ||
- name: fsgroup-demo-vol | ||
emptyDir: {} | ||
containers: | ||
- name: fsgroup-demo | ||
image: busybox | ||
command: [ "sh", "-c", "sleep 1h" ] | ||
volumeMounts: | ||
- name: fsgroup-demo-vol | ||
mountPath: /data/demo |
53 changes: 53 additions & 0 deletions
53
artifacthub/library/pod-security-policy/fsgroup/1.1.0/suite.yaml
This file contains 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,53 @@ | ||
kind: Suite | ||
apiVersion: test.gatekeeper.sh/v1alpha1 | ||
metadata: | ||
name: fsgroup | ||
tests: | ||
- name: fsgroup | ||
template: template.yaml | ||
constraint: samples/psp-fsgroup/constraint.yaml | ||
cases: | ||
- name: example-disallowed | ||
object: samples/psp-fsgroup/example_disallowed.yaml | ||
assertions: | ||
- violations: yes | ||
- name: example-allowed | ||
object: samples/psp-fsgroup/example_allowed.yaml | ||
assertions: | ||
- violations: no | ||
- name: update | ||
object: samples/psp-fsgroup/update.yaml | ||
assertions: | ||
- violations: no | ||
- name: fsgroup-no-rules | ||
template: template.yaml | ||
constraint: samples/psp-fsgroup/constraint2.yaml | ||
cases: | ||
- name: example-allowed | ||
object: samples/psp-fsgroup/example_disallowed.yaml | ||
assertions: | ||
- violations: no | ||
- name: example-allowed | ||
object: samples/psp-fsgroup/example_allowed.yaml | ||
assertions: | ||
- violations: no | ||
- name: update | ||
object: samples/psp-fsgroup/update.yaml | ||
assertions: | ||
- violations: no | ||
- name: fsgroup-empty-ranges | ||
template: template.yaml | ||
constraint: samples/psp-fsgroup/constraint3.yaml | ||
cases: | ||
- name: example-disallowed-2000 | ||
object: samples/psp-fsgroup/example_disallowed.yaml | ||
assertions: | ||
- violations: yes | ||
- name: example-disallowed-500 | ||
object: samples/psp-fsgroup/example_allowed.yaml | ||
assertions: | ||
- violations: yes | ||
- name: update | ||
object: samples/psp-fsgroup/update.yaml | ||
assertions: | ||
- violations: no |
Oops, something went wrong.