Skip to content

Commit

Permalink
Merge pull request #364 from crosbymichael/masked-paths
Browse files Browse the repository at this point in the history
Add masked and readonly paths
  • Loading branch information
Mrunal Patel committed Apr 1, 2016
2 parents c33fd5f + adcbe53 commit 93ca97e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
28 changes: 26 additions & 2 deletions config-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ The following parameters can be specified to setup the controller:

## Sysctl

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

###### Example
Expand Down Expand Up @@ -511,7 +511,7 @@ Operator Constants:

## Rootfs Mount Propagation

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

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

## Masked Paths

`maskedPaths` will mask over the provided paths inside the container so that they cannot be read.

###### Example

```json
"maskedPaths": [
"/proc/kcore"
]
```

## Readonly Paths

`readonlyPaths` will set the provided paths as readonly inside the container.

###### Example

```json
"readonlyPaths": [
"/proc/sys"
]
```

[cgroup-v1]: https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt
[cgroup-v1-blkio]: https://www.kernel.org/doc/Documentation/cgroup-v1/blkio-controller.txt
[cgroup-v1-cpusets]: https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt
Expand Down
8 changes: 8 additions & 0 deletions schema/schema-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,14 @@
"type": "null"
}
]
},
"maskedPaths": {
"id": "https://opencontainers.org/schema/bundle/linux/maskedPaths",
"$ref": "defs.json#/definitions/ArrayOfStrings"
},
"readonlyPaths": {
"id": "https://opencontainers.org/schema/bundle/linux/readonlyPaths",
"$ref": "defs.json#/definitions/ArrayOfStrings"
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ type Linux struct {
Seccomp *Seccomp `json:"seccomp,omitempty"`
// RootfsPropagation is the rootfs mount propagation mode for the container.
RootfsPropagation string `json:"rootfsPropagation,omitempty"`
// MaskedPaths masks over the provided paths inside the container.
MaskedPaths []string `json:"maskedPaths,omitempty"`
// ReadonlyPaths sets the provided paths as RO inside the container.
ReadonlyPaths []string `json:"readonlyPaths,omitempty"`
}

// Namespace is the configuration for a Linux namespace
Expand Down

0 comments on commit 93ca97e

Please sign in to comment.