Commit Graph

201 Commits

Author SHA1 Message Date
Sergey Kanzhelev
44159dfc32 AppArmor no reevaluation of host is needed 2023-03-14 18:35:01 +00:00
Freddie
3db6cc5b8b changes in NewValidator 2023-02-21 13:02:30 +05:30
Freddie
e33a4d656f changes in NewValidator 2023-02-21 11:43:51 +05:30
Freddie
02e6092087 made error nil 2023-02-21 11:24:39 +05:30
Freddie
10193062f0 undone last changes 2023-02-19 21:26:43 +05:30
Freddie
7db787e97c removed Validator.Validate Interface 2023-02-19 21:08:06 +05:30
Freddie
a31820bac9 rebased 2023-02-19 13:53:47 +05:30
HirazawaUi
3b18e80fb4 delete unused functions in pkg directory 2023-01-16 21:43:36 +08:00
Jordan Liggitt
410ac59c0d Remove PodSecurityPolicy admission plugin 2022-05-04 16:00:56 -04:00
Tim Allclair
5f2b12e0d4 Move AppArmor profile validation to the API validation pkg 2022-02-15 16:17:37 -08:00
Tim Allclair
455f7c278c Add AppArmor OWNERS file 2022-02-15 16:05:27 -08:00
Tim Allclair
f780889d4c Forbid empty AppArmor localhost profile 2022-02-15 14:46:51 -08:00
yanghesong
b4f6eb681c Remove runtime in validate
Validate is useless as dockershim is removed

Signed-off-by: yanghesong <hesong.yang@foxmail.com>
2022-01-09 09:19:31 +08:00
yanghesong
6905fef761 Remove runtime in validate
Validate is useless as dockershim is removed

Signed-off-by: yanghesong <hesong.yang@foxmail.com>
2022-01-09 09:11:49 +08:00
Kubernetes Prow Robot
a90961aac0
Merge pull request #97966 from saschagrunert/apparmor-init-unconfined
Remove AppArmor loaded profile validation
2022-01-04 20:24:32 -08:00
Davanum Srinivas
9405e9b55e
Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-09 21:31:26 -05:00
Patrick Ohly
a8c930ef46 generic ephemeral volume: graduation to GA
The feature gate gets locked to "true", with the goal to remove it in two
releases.

All code now can assume that the feature is enabled. Tests for "feature
disabled" are no longer needed and get removed.

Some code wasn't using the new helper functions yet. That gets changed while
touching those lines.
2021-10-11 20:54:20 +02:00
Stephen Augustus
481cf6fbe7
generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
Wesley Williams
ff165c8823
Replace usage of Whitelist with Allowlist within Kubelet's sysctl package (#102298)
* Change uses of whitelist to allowlist in kubelet sysctl

* Rename whitelist files to allowlist in Kubelet sysctl

* Further renames of whitelist to allowlist in Kubelet

* Rename podsecuritypolicy uses of whitelist to allowlist

* Update pkg/kubelet/kubelet.go

Co-authored-by: Danielle <dani@builds.terrible.systems>

Co-authored-by: Danielle <dani@builds.terrible.systems>
2021-08-04 18:59:35 -07:00
Kubernetes Prow Robot
e799d7b191
Merge pull request #99023 from verb/1.21-securitycontext
Allow setting securityContext in ephemeral containers
2021-07-09 20:50:46 -07:00
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
Lee Verberne
babebf76d3 Apply PSP container tests to EphemeralContainers 2021-06-25 18:47:22 +02:00
Shihang Zhang
88b31814f4 BoundServiceAccountTokenVolume ga 2021-05-13 20:45:47 -07:00
Kubernetes Prow Robot
dd72c4534c
Merge pull request #97968 from saschagrunert/apparmor-host-check
Remove check for apparmor_parser in AppArmor host validation
2021-04-13 01:58:50 -07:00
Sascha Grunert
1f8c21166e
Remove AppArmor loaded profile validation
In general it could be possible that init containers deploy security
profiles. The existing AppArmor pre-validation would block the complete
workload without this patch being applied. If we now schedule a
workload which contains an unconfined init container, then we will skip
the validation. The underlying container runtime will fail if the
profile is not available after the execution of the init container.

This synchronizes the overall behavior with seccomp.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-03-12 10:19:44 +01: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
Sascha Grunert
0d22571519
Remove check for apparmor_parser in AppArmor host validation
The `apparmor_parser` binary is not really required for a system to run
AppArmor from a Kubernetes perspective. How to apply the profile is more
in the responsibility of lower level runtimes like CRI-O and containerd,
which may do the binary check on their own.

This synchronizes the current libcontainer implementation with the
vendored Kubernetes source code and allows distributions to use
AppArmor, even when they do not have the parser available in
`/sbin/apparmor_parser`.

Signed-off-by: Sascha Grunert <mail@saschagrunert.de>
2021-03-02 18:40:14 +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
Shihang Zhang
b56da85a77 sync api/v1/pod/util with api/pod/util and remove DefaultContainers 2020-03-24 16:42:32 -07: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
feifei.zhang@huawei.com
fdce8ef960 fix golint failures of pkg/security/apparmor 2019-11-05 18:56:15 +08: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