Commit Graph

148 Commits

Author SHA1 Message Date
pacoxu
2cab85a403 Mark net.ipv4.ip_unprivileged_port_start as a safe sysctl
Signed-off-by: pacoxu <paco.xu@daocloud.io>
2021-07-01 10:31:21 +08:00
Shihang Zhang
88b31814f4 BoundServiceAccountTokenVolume ga 2021-05-13 20:45:47 -07:00
Patrick Ohly
aa4f8ae793 security: another test case for generic ephemeral inline volumes
When the PSP contains some other volume types, generic ephemeral
inline volumes must be rejected.
2021-03-07 10:56:48 +01:00
Patrick Ohly
38384d5c13 PSP: conditional support for generic volume type
When introducing the new "generic" volume type for generic ephemeral
inline volumes, the storage policy for PodSecurityPolicy objects
should have been extended so that this new type is valid only
if the generic ephemeral volume feature is enabled or an
existing object already has it.

Adding the new type to the internal API was also missed.
2021-03-07 10:56:48 +01:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Mayank Kumar
9a6f1e807e Promote RunAsGroup to GA 2021-02-18 13:32:54 -08:00
Sascha Grunert
5588f025e2
Fix seccomp PSP docker/default annotation handling
With the graduation of seccomp to GA we automatically convert the
deprecated seccomp profile annotation `docker/default` to
`runtime/default`. This means that we now have to automatically allow
`runtime/default` if a user specifies `docker/default` and vice versa in
an allowed PSP seccomp profile.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-10-29 14:08:14 +01:00
Kubernetes Prow Robot
70f68dbf74
Merge pull request #92856 from saschagrunert/psp-seccomp-ga
Implement PodSecurityPolicy enforcement for seccomp GA
2020-07-11 15:35:22 -07:00
Sascha Grunert
96fb83c4c1
Implement PodSecurityPolicy enforcement for seccomp GA
This implements the necessary pieced for the PodSecurityPolicy
enforcement like described in the appropriate KEP section:

https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/20190717-seccomp-ga.md#podsecuritypolicy-enforcement

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-07-10 15:55:21 +02:00
Patrick Ohly
c05c8e915b GenericEphemeralVolume: feature gate, API, documentation
As explained in
https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/1698-generic-ephemeral-volumes,
CSI inline volumes are not suitable for more "normal" kinds of storage
systems. For those a new approach is needed: "generic ephemeral inline
volumes".
2020-07-09 11:02:59 +02:00
Paulo Gomes
8976e3620f
Add seccomp enforcement and validation based on new GA fields
Adds seccomp validation.

This ensures that field and annotation values must match when present.

Co-authored-by: Sascha Grunert <sgrunert@suse.com>
2020-07-06 09:13:25 +01:00
Shihang Zhang
613a712717 default to add projected fstype in psp when boundedserviceaccounttoken is enabled 2020-06-24 09:09:27 -07:00
Andrew Sy Kim
2e56866c97 move apparmor annotation constants to k8s.io/api/core/v1
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-04-06 10:22:04 -04:00
Ted Yu
af0e1319c3 Allow container visitor to operate on selected container types
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2020-03-05 11:48:00 -08:00
Akihiro Suda
821362bd1e SafeSysctlWhitelist: add net.ipv4.ping_group_range
sysctl value `net.ipv4.ping_group_range` can be used for allowing `ping`
command without `CAP_NET_RAW` capability.

e.g. `net.ipv4.ping_group_range="0 42"` to allow ping for users with
GID 0-GID 42.

This sysctl value was introduced in kernel 3.0 and has been namespaced
since its birth.

c319b4d76b (diff-5b536a7a92abed603bbb4caa61613270R57)

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-11-20 07:26:02 +09:00
Hongwei Yu
65f2280a38 Optimizing some format problems (#82983)
* modify the error string

* omit redundant type bool from variable declarations
2019-11-01 10:21:25 -07:00
Hongwei Yu
7574f95f7d optimize comments on exported constants (#83875)
* optimize comments on exported constants

* remove package in hack/.golint_failures are passing golint
2019-10-16 22:25:30 -07:00
hwdef
4e7ef9ad36 delete unused var 2019-09-19 18:04:13 +08:00
Ted Yu
cf7c164ae3 Restore early return for podSpecHasContainer 2019-06-26 14:17:13 +08:00
Lee Verberne
a0b57ad3db Update BUILD files for container helper 2019-06-21 08:32:04 +00:00
Lee Verberne
ee821e2a04 Create helpers for iterating containers in a pod 2019-06-21 08:32:04 +00:00
Vladimir Vivien
8e0cf65310 Enforce pod security policy for CSI inline 2019-05-29 15:38:21 -04:00
Tim Allclair
1bd4340c7c Implement PodSecurityPolicy RuntimeClass support 2019-05-01 13:43:41 -07:00
Kubernetes Prow Robot
ccc90b2ba6
Merge pull request #75680 from tallclair/psp-refactor
Clean up some PodSecurityPolicy code
2019-03-26 21:59:01 -07:00
Tim Allclair
a387409500 Modernize PSP unit test 2019-03-25 11:46:36 -07:00
Tim Allclair
e5d2cad7b9 Refactor PSP provider 2019-03-25 11:46:36 -07:00
Vladimir Vivien
4ec7d2305d CSI Inline Volume - API changes 2019-03-08 12:35:07 -05:00
Roy Lenferink
b43c04452f Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
Jordan Liggitt
35178d352d auth policy subproject approvers/reviewers 2018-11-06 00:57:39 -05:00
yue9944882
e2c61169b1 externalize psp admission controller 2018-10-24 00:22:07 +08:00
Slava Semushin
14c969b604 Remove myself from OWNERS files. 2018-10-16 22:47:44 +01:00
k8s-ci-robot
53e85280f4
Merge pull request #69714 from ericchiang/owners
Remove ericchiang from OWNERS files
2018-10-12 16:01:52 -07:00
Eric Chiang
766f5875bf Remove ericchiang from OWNERS files
Kept myself in the OpenID Connect ones for now.
2018-10-11 18:11:15 -07:00
Mayank Kumar
bc3e3afc46 api changes for psp runasgroup policy 2018-10-09 17:32:09 -07:00
Stanislav Laznicka
a577b50012
Add "MayRunAs" value among other GroupStrategies
Adds "MayRunAs" value among other group strategies. This strategy
allows to define a certain range of GIDs for FSGroupStrategy and
SupplementalGroupStrategy in a PSP.

This new strategy works similarly to the "MustRunAs" one, except that
when no GID is specified in a pod/container security context then no
GID is generated for the respective containers.

Resolves #56173
2018-09-27 12:47:21 +02:00
Kubernetes Submit Queue
924121cc35
Merge pull request #68105 from tallclair/psp-test
Automatic merge from submit-queue (batch tested with PRs 65251, 67255, 67224, 67297, 68105). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Cleanup PodSecurityPolicy AllowPrivEsc tests

**What this PR does / why we need it**:

Old tests were confusing and missing a lot of combinations. The new test is a simple table-driven test with all valid combinations.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes ##67387

**Special notes for your reviewer**:
Alternative to https://github.com/kubernetes/kubernetes/pull/67388

**Release note**:
```release-note
NONE
```
2018-08-31 19:25:39 -07:00
Tim Allclair
8824fe0765 Cleanup PodSecurityPolicy AllowPrivEsc tests 2018-08-31 09:03:21 -07:00
Jess Frazelle
30dcca6233
ProcMount: add api options and feature gate
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-08-30 11:40:02 -04:00
Tim Allclair
5ace0f03d8
Cleanup & fix PodSecurityPolicy field path usage 2018-07-18 17:47:32 -07:00
Jeff Grafton
23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Jan Chaloupka
3cc15363bc Run make update 2018-06-06 00:12:40 +02:00
Jan Chaloupka
ab616a88b9 Promote sysctl annotations to API fields 2018-06-05 23:17:00 +02:00
Josh Horwitz
c7fbcf35da Add support for enforcing read only host paths in PSPs. 2018-06-04 19:10:37 -04:00
Slava Semushin
f49a0fbd5f Replace UserIDRange/GroupIDRange by IDRange in internal type to reduce difference with external type.
We had IDRange in both types prior 9440a68744 commit that splitted it
into UserIDRange/GroupIDRange. Later, in c91a12d205 commit we had to
revert this changes because they broke backward compatibility but
UserIDRange/GroupIDRange struct left in the internal type.

This commit removes these leftovers and reduces the differences
between internal and external types.
2018-05-04 18:31:42 +02:00
Slava Semushin
6767e233ed Update generated files.
In order to make it compilable I had to remove these files manually:

pkg/client/listers/extensions/internalversion/podsecuritypolicy.go
pkg/client/informers/informers_generated/internalversion/extensions/internalversion/podsecuritypolicy.go
pkg/client/clientset_generated/internalclientset/typed/extensions/internalversion/podsecuritypolicy.go
pkg/client/clientset_generated/internalclientset/typed/extensions/internalversion/fake/fake_podsecuritypolicy.go
2018-04-11 18:35:24 +02:00
Slava Semushin
8a7d5707d5 PSP: move internal types from extensions to policy. 2018-04-11 18:35:09 +02:00
Christoph Blecker
857aac9ae4
Update gofmt for go1.10 2018-04-02 17:44:04 -07:00
Kubernetes Submit Queue
09170ab684
Merge pull request #61624 from jianglingxia/selinux2018032412
Automatic merge from submit-queue (batch tested with PRs 61644, 61624, 61743, 61019, 61287). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add a sceneo UT test to TestMustRunAsOptions

**What this PR does / why we need it**:
Add a sceneo UT test to TestMustRunAsOptions when the opts is nil
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-27 06:41:13 -07:00
Kubernetes Submit Queue
c014cc2740
Merge pull request #56848 from CaoShuFeng/duplicated-validation-psp
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove duplicated validation from podsecuritypolicy

**Release note**:
```release-note
NONE
```
2018-03-26 00:13:08 -07:00
jianglingxia
25052c591a Add a sceneo UT test to TestMustRunAsOptions 2018-03-24 12:54:42 +08:00