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

fix(deploy) Increase container security #1057

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .kube-linter.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
checks:
exclude:
# TODO: exclude no rule
# https://github.com/Kong/charts/issues/753
- "no-read-only-root-fs"
- "run-as-non-root"
- "unset-cpu-requirements"
- "unset-memory-requirements"
7 changes: 7 additions & 0 deletions charts/gateway-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## Unreleased

## Changes

- Set `readOnlyRootFilesystem: true` for kube-rbac-proxy
[#1057](https://github.com/Kong/charts/pull/1057)

## 0.4.9

## Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,8 @@ spec:
- containerPort: 8443
name: https
protocol: TCP
securityContext:
readOnlyRootFilesystem: true
resources:
limits:
cpu: 500m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,8 @@ spec:
- containerPort: 8443
name: https
protocol: TCP
securityContext:
readOnlyRootFilesystem: true
resources:
limits:
cpu: 500m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,8 @@ spec:
- containerPort: 8443
name: https
protocol: TCP
securityContext:
readOnlyRootFilesystem: true
resources:
limits:
cpu: 500m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,8 @@ spec:
- containerPort: 8443
name: https
protocol: TCP
securityContext:
readOnlyRootFilesystem: true
resources:
limits:
cpu: 500m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,8 @@ spec:
- containerPort: 8443
name: https
protocol: TCP
securityContext:
readOnlyRootFilesystem: true
resources:
limits:
cpu: 500m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,8 @@ spec:
- containerPort: 8443
name: https
protocol: TCP
securityContext:
readOnlyRootFilesystem: true
resources:
limits:
cpu: 500m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,8 @@ spec:
- containerPort: 8443
name: https
protocol: TCP
securityContext:
readOnlyRootFilesystem: true
resources:
limits:
cpu: 500m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,8 @@ spec:
- containerPort: 8443
name: https
protocol: TCP
securityContext:
readOnlyRootFilesystem: true
resources:
limits:
cpu: 500m
Expand Down
2 changes: 2 additions & 0 deletions charts/gateway-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ spec:
- containerPort: 8443
name: https
protocol: TCP
securityContext:
readOnlyRootFilesystem: true
resources:
{{ toYaml .Values.kubeRBACProxy.resources | indent 10 }}
{{- end }}
Expand Down
19 changes: 14 additions & 5 deletions charts/kong/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## Unreleased

### Fixes

* Run containers with read-only file system and non-root user to increase container and pod security.
**Note**: This change may be incompatible with user sidecar containers. In this case, change the
`securityContext` in your values.
[#1057](https://github.com/Kong/charts/pull/1057)

## 2.47.0

### Changes
Expand Down Expand Up @@ -346,27 +355,27 @@

## 2.26.5

### Fixed
### Fixed

* Kuma ServiceAccount Token hints and volumes are also available in migrations
Pods.
[#877](https://github.com/Kong/charts/pull/877)

## 2.26.4

### Fixed
### Fixed

* updated `admin_api_uri` to `admin_gui_api_url` as per [kong documentation](https://docs.konghq.com/gateway/3.4.x/reference/configuration/#admin_api_uri).
* updated `admin_api_uri` to `admin_gui_api_url` as per [kong documentation](https://docs.konghq.com/gateway/3.4.x/reference/configuration/#admin_api_uri).

## 2.26.3

### Fixed
### Fixed

* Enabled Service and Ingress in Kong Manager for non enterprise users.

## 2.26.2

### Fixed
### Fixed

* Add missing CRD KongConsumerGroup and extend status subresource for CRDs

Expand Down
12 changes: 6 additions & 6 deletions charts/kong/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ listens if you do not provide your own. The chart can create
configure them for you. To use this integration, install cert-manager, create
an issuer, set `certificates.enabled: true` in values.yaml, and set your issuer
name in `certificates.issuer` or `certificates.clusterIssuer` depending on the
issuer type.
issuer type.

If you do not have an issuer available, you can install the example [self-signed ClusterIssuer](https://cert-manager.io/docs/configuration/selfsigned/#bootstrapping-ca-issuers)
and set `certificates.clusterIssuer: selfsigned-issuer` for testing. You
Expand Down Expand Up @@ -709,7 +709,7 @@ or `ingress` sections, as it is used only for stream listens.

#### Admin Service mTLS

On top of the common parameters listed above, the `admin` service supports parameters for mTLS client verification.
On top of the common parameters listed above, the `admin` service supports parameters for mTLS client verification.
If any of `admin.tls.client.caBundle` or `admin.tls.client.secretName` are set, the admin service will be configured to
require mTLS client verification. If both are set, `admin.tls.client.caBundle` will take precedence.

Expand Down Expand Up @@ -910,7 +910,7 @@ On the Gateway release side, set either `admin.tls.client.secretName` to the nam
| podSecurityPolicy.spec | Collection of [PodSecurityPolicy settings](https://kubernetes.io/docs/concepts/policy/pod-security-policy/#what-is-a-pod-security-policy) | |
| priorityClassName | Set pod scheduling priority class for Kong pods | `""` |
| secretVolumes | Mount given secrets as a volume in Kong container to override default certs and keys. | `[]` |
| securityContext | Set the securityContext for Kong Pods | `{}` |
| securityContext | Set the securityContext for Kong Pods | See values.yaml |
| containerSecurityContext | Set the securityContext for Containers | See values.yaml |
| serviceMonitor.enabled | Create ServiceMonitor for Prometheus Operator | `false` |
| serviceMonitor.trustCRDsExist | Do not check for the Prometheus Operator CRDs, just try to deploy | `false` |
Expand Down Expand Up @@ -938,11 +938,11 @@ containerSecurityContext: # run as root to bind to lower ports
runAsUser: 0
```

**Note:** The default `podAnnotations` values disable inbound proxying for Kuma
and Istio. This is appropriate when using Kong as a gateway for external
**Note:** The default `podAnnotations` values disable inbound proxying for Kuma
and Istio. This is appropriate when using Kong as a gateway for external
traffic inbound into the cluster.

If you want to use Kong as an internal proxy within the cluster network, you
If you want to use Kong as an internal proxy within the cluster network, you
should enable inbound the inbound mesh proxies:

```yaml
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion charts/kong/ci/__snapshots__/custom-labels-values.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion charts/kong/ci/__snapshots__/default-values.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading