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

doc: TRG 4.07: Read-Only Filesystem (DRAFT) #414

Merged
merged 20 commits into from
Nov 22, 2023
Merged
Changes from 2 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
38 changes: 38 additions & 0 deletions docs/release/trg-4/trg-4-07.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: TRG 4.07 - Read-only filesystems
---

:::caution
Proposed release date: "mandatory after": 19th of May 2023
:::

| Status | Created | Post-History |
|------------|--------------|----------------------------------------|
| Draft | 03-Octo-2023 | Initial contribution |

## Why

A read-only root filesystem helps to limit the impact of a compromised container on a Kubernetes node. It is recommended to utilize read-only filesystems when possible. This prevents a malicious process or application from writing back to the host system. Read-only filesystems are a key component to preventing container breakout.

## Description

Whether this container has a read-only root filesystem. Default is false.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description should explain potentially more than just a read-only filesystem. like implications, best practices (what to do with log files, what to do in other cases)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the input! I will add to that


### Implementation

The container's **Pod resource file (yaml)** has to be modified to set rights to read-only.

Mounts the container's root filesystem as read-only:

```yaml
apiVersion: v1
kind: Pod
metadata:
name: read-only-fs
spec:
containers:

securityContext:
#read-only fs explicitly defined
readOnlyRootFilesystem: true
```