Skip to content

Commit 93ca97e

Browse files
author
Mrunal Patel
committed
Merge pull request opencontainers#364 from crosbymichael/masked-paths
Add masked and readonly paths
2 parents c33fd5f + adcbe53 commit 93ca97e

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

config-linux.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ The following parameters can be specified to setup the controller:
443443

444444
## Sysctl
445445

446-
sysctl allows kernel parameters to be modified at runtime for the container.
446+
`sysctl` allows kernel parameters to be modified at runtime for the container.
447447
For more information, see [the man page](http://man7.org/linux/man-pages/man8/sysctl.8.html)
448448

449449
###### Example
@@ -511,7 +511,7 @@ Operator Constants:
511511

512512
## Rootfs Mount Propagation
513513

514-
rootfsPropagation sets the rootfs's mount propagation.
514+
`rootfsPropagation` sets the rootfs's mount propagation.
515515
Its value is either slave, private, or shared.
516516
[The kernel doc](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) has more information about mount propagation.
517517

@@ -521,6 +521,30 @@ Its value is either slave, private, or shared.
521521
"rootfsPropagation": "slave",
522522
```
523523

524+
## Masked Paths
525+
526+
`maskedPaths` will mask over the provided paths inside the container so that they cannot be read.
527+
528+
###### Example
529+
530+
```json
531+
"maskedPaths": [
532+
"/proc/kcore"
533+
]
534+
```
535+
536+
## Readonly Paths
537+
538+
`readonlyPaths` will set the provided paths as readonly inside the container.
539+
540+
###### Example
541+
542+
```json
543+
"readonlyPaths": [
544+
"/proc/sys"
545+
]
546+
```
547+
524548
[cgroup-v1]: https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt
525549
[cgroup-v1-blkio]: https://www.kernel.org/doc/Documentation/cgroup-v1/blkio-controller.txt
526550
[cgroup-v1-cpusets]: https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt

schema/schema-linux.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,14 @@
337337
"type": "null"
338338
}
339339
]
340+
},
341+
"maskedPaths": {
342+
"id": "https://opencontainers.org/schema/bundle/linux/maskedPaths",
343+
"$ref": "defs.json#/definitions/ArrayOfStrings"
344+
},
345+
"readonlyPaths": {
346+
"id": "https://opencontainers.org/schema/bundle/linux/readonlyPaths",
347+
"$ref": "defs.json#/definitions/ArrayOfStrings"
340348
}
341349
}
342350
}

specs-go/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ type Linux struct {
136136
Seccomp *Seccomp `json:"seccomp,omitempty"`
137137
// RootfsPropagation is the rootfs mount propagation mode for the container.
138138
RootfsPropagation string `json:"rootfsPropagation,omitempty"`
139+
// MaskedPaths masks over the provided paths inside the container.
140+
MaskedPaths []string `json:"maskedPaths,omitempty"`
141+
// ReadonlyPaths sets the provided paths as RO inside the container.
142+
ReadonlyPaths []string `json:"readonlyPaths,omitempty"`
139143
}
140144

141145
// Namespace is the configuration for a Linux namespace

0 commit comments

Comments
 (0)