Skip to content

Commit

Permalink
Allow to set security.nesting param
Browse files Browse the repository at this point in the history
-- Signed Off: Malte Wagner <git@monkz.de>
  • Loading branch information
monkz committed Feb 26, 2024
1 parent d78b5ff commit b4799f0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/components/forms/SecurityPoliciesForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { optionRenderer } from "util/formFields";
export interface SecurityPoliciesFormValues {
security_protection_delete?: string;
security_privileged?: string;
security_nesting?: string;
security_protection_shift?: string;
security_idmap_base?: string;
security_idmap_size?: number;
Expand All @@ -35,6 +36,7 @@ export const securityPoliciesPayload = (
[getInstanceKey("security_protection_delete")]:
values.security_protection_delete,
[getInstanceKey("security_privileged")]: values.security_privileged,
[getInstanceKey("security_nesting")]: values.security_nesting,
[getInstanceKey("security_protection_shift")]:
values.security_protection_shift,
[getInstanceKey("security_idmap_base")]: values.security_idmap_base,
Expand Down Expand Up @@ -88,6 +90,21 @@ const SecurityPoliciesForm: FC<Props> = ({ formik }) => {
),
}),

getConfigurationRow({
formik,
label: "Nesting (Containers only)",
name: "security_nesting",
defaultValue: "",
disabled: isContainerOnlyDisabled,
readOnlyRenderer: (val) => optionRenderer(val, optionAllowDeny),
children: (
<Select
options={optionAllowDeny}
disabled={isContainerOnlyDisabled}
/>
),
}),

getConfigurationRow({
formik,
label: "Protect UID/GID shift (Containers only)",
Expand Down
1 change: 1 addition & 0 deletions src/util/instanceConfigFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const instanceConfigFormFieldsToPayload: Record<string, string> = {
limits_disk_priority: "limits.disk.priority",
limits_processes: "limits.processes",
security_privileged: "security.privileged",
security_nesting: "security.nesting",
security_protection_delete: "security.protection.delete",
security_protection_shift: "security.protection.shift",
security_idmap_base: "security.idmap.base",
Expand Down
1 change: 1 addition & 0 deletions src/util/instanceEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const getEditValues = (

security_protection_delete: item.config["security.protection.delete"],
security_privileged: item.config["security.privileged"],
security_nesting: item.config["security.nesting"],
security_protection_shift: item.config["security.protection.shift"],
security_idmap_base: item.config["security.idmap.base"],
security_idmap_size: item.config["security.idmap.size"]
Expand Down

0 comments on commit b4799f0

Please sign in to comment.