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

Defining proposal A for FreeBSD jail configuration #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dfr
Copy link
Collaborator

@dfr dfr commented Mar 26, 2024

This is intended to be a one-to-one mapping from the runtime configuration to the kernel's jail parameters. This keeps the runtime as simple as possible, moving all policy decisions to the container engine (e.g. podman, containerd, cri-o).

@dfr
Copy link
Collaborator Author

dfr commented May 2, 2024

I added a table showing the mapping from traditional jail config parameters to the runtime spec.

@emaste
Copy link
Collaborator

emaste commented May 2, 2024

FreeBSD-specific section and container configuration links not working

@dfr
Copy link
Collaborator Author

dfr commented May 3, 2024

FreeBSD-specific section and container configuration links not working

This started as a branch in opencontainers/runtime-spec and I made the links relative. I have made them absolute for now - they can change back if this (or something like it) gets merged to runtime-spec.

@dfr dfr force-pushed the simple-jail branch 5 times, most recently from d5315f6 to adc1db4 Compare May 3, 2024 12:22
@dfr
Copy link
Collaborator Author

dfr commented May 3, 2024

Fixed lint

docs/proposals/PROPOSAL_A.md Show resolved Hide resolved
docs/proposals/PROPOSAL_A.md Show resolved Hide resolved

- **`parent`** _(string, OPTIONAL)_ - parent jail.
The value is the name of a jail which should be this container's parent (defaults to none).
- **`host`** _(string, OPTIONAL)_ - allow overriding hostname, domainname, hostuuid and hostid.
Copy link
Member

Choose a reason for hiding this comment

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

From a JSON perspective this is a string but it sounds like the valid values are effectively an enum: "new" and "inherit"?

docs/proposals/PROPOSAL_A.md Show resolved Hide resolved
| name | see below |
| path | root.path |
| ip4.addr | freebsd.jail.ip4Addr |
| ip4.saddrsel | - |
Copy link
Member

Choose a reason for hiding this comment

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

We'd omit these fields with -?


The `devfs_ruleset` parameter is only required for jails which create new `devfs` mounts - typically OCI runtimes will mount `devfs` on the host.

The `children.max` parameter is managed by the OCI runtime e.g when a new container is added to a pod.
Copy link
Member

Choose a reason for hiding this comment

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

The OCI runtime doesn't know about pods (that's a Kubernetes concept). Would you expect a runtime invocation processing a bundle that specifies the parent to go find the parent and mutate its children.max?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will reword this for clarity. In ocijail I do indeed adjust children.max automatically when adding a new child jail.


The `children.max` parameter is managed by the OCI runtime e.g when a new container is added to a pod.

The `allow.mount.*` parameter set is extensible - this proposal suggests representing allowed mount types as an array. As with `devfs`, typically the OCI runtime will manage mounts for the container by performing mount operations on the host.
Copy link
Member

Choose a reason for hiding this comment

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

I'm having trouble visualizing exactly what you're proposing here; what would be the contents of the allow.mount parameter?

Choose a reason for hiding this comment

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

Some sort of ACL I'm assuming

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will clarify and perhaps add to the example config

Signed-off-by: Doug Rabson <dfr@rabson.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants