Skip to content

Commit 57c1d04

Browse files
committed
Remove ABI and add best-effort control in config
Signed-off-by: Kailun Qin <[email protected]>
1 parent 01a9796 commit 57c1d04

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

config.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,11 @@ For Linux-based systems, the `process` object supports the following process-spe
227227
Entries in the array contain the following properties:
228228
* **`allowedAccess`** (array of strings, OPTIONAL) is an array of FS typed actions that are allowed by a rule.
229229
* **`paths`** (array of strings, OPTIONAL) is an array of files or parent directories of the file hierarchies to restrict.
230-
* **`abi`** (object, OPTIONAL) the `abi` field defines the specific Landlock ABI version.
231-
This should be used by the runtime to check if the kernel supports the specified sets of Landlock features and then enforce those following a best-effort security approach.
230+
* **`disableBestEffort`** (bool, OPTIONAL) the `disableBestEffort` field disables the best-effort security approach for Landlock access rights.
231+
This is for conditions when the Landlock access rights explicitly configured by the container are not supported or available in the running kernel.
232+
If the best-effort security approach is enabled (`false`), the runtime SHOULD enforce the strongest rules configured up to the current kernel support, and only be [logged as a warning](runtime.md#warnings) for those not supported.
233+
If disabled (`true`), the runtime MUST [generate an error](runtime.md#errors) if one or more rules specified by the container is not supported.
234+
Default is `false`, i.e., following a best-effort security approach.
232235

233236
### <a name="configUser" />User
234237

@@ -323,7 +326,7 @@ _Note: symbolic name for uid and gid, such as uname and gname respectively, are
323326
}
324327
]
325328
},
326-
"abi": "v1"
329+
"disableBestEffort": false
327330
},
328331
"noNewPrivileges": true,
329332
"capabilities": {

specs-go/config.go

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ type Landlock struct {
6969
Ruleset *LandlockRuleset `json:"ruleset,omitempty" platform:"linux"`
7070
// Rules are the security policies (i.e., actions allowed on objects) to be added to an existing ruleset.
7171
Rules *LandlockRules `json:"rules,omitempty" platform:"linux"`
72-
// ABI is the specific Landlock ABI version.
73-
// This should be used by the runtime to check if the kernel supports the specified sets of Landlock
74-
// features and then enforce those following a best-effort security approach.
75-
ABI LandlockABIVersion `json:"abi,omitempty" platform:"linux"`
72+
// DisableBestEffort disables the best-effort security approach for Landlock access rights.
73+
// This is for conditions when the Landlock access rights explicitly configured by the container are not
74+
// supported or available in the running kernel.
75+
// Default is false, i.e., following a best-effort security approach.
76+
DisableBestEffort bool `json:"disableBestEffort,omitempty" platform:"linux"`
7677
}
7778

7879
// LandlockRuleset identifies a set of rules (i.e., actions on objects) that need to be handled.
@@ -97,14 +98,6 @@ type LandlockRulePathBeneath struct {
9798
Paths []string `json:"paths,omitempty" platform:"linux"`
9899
}
99100

100-
// LandlockABIVersion used to identify the ABI level to use for Landlock.
101-
type LandlockABIVersion string
102-
103-
// Define the supported Landlock ABI versions. There is currently only one supported Landlock ABI version.
104-
const (
105-
V1 LandlockABIVersion = "v1"
106-
)
107-
108101
// LandlockFSAction used to specify the FS actions that are handled by a ruleset or allowed by a rule.
109102
type LandlockFSAction string
110103

0 commit comments

Comments
 (0)