Commit Graph

29 Commits

Author SHA1 Message Date
zhouhao 79494b2175 schema: Fix the error
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-04-27 13:49:18 +08:00
Mrunal Patel 13895d6074 Merge pull request #775 from q384566678/rootfs-enum
schema: Add enumeration to rootfsPropagation values
2017-04-26 15:59:09 -07:00
v1.0.0.batts c6bff91450 Merge pull request #769 from wking/require-syscall-names
config-linux: Require at least one entry in linux.seccomp.sycalls[].names
2017-04-26 11:26:05 -04:00
Qiang Huang ce55de2517 Remove range limit which depend on kernel
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2017-04-26 22:46:02 +08:00
zhouhao a084798c96 schema: Add enumeration to rootfsPropagation values
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-04-21 13:29:13 +08:00
W. Trevor King 5c62f9b839 config-linux: Require at least one entry in linux.seccomp.sycalls[].names
I expect the (undocumented) intention here is to iterate through
'names' and call seccomp_rule_add(3) or similar for each name.  In
that case, an empty 'names' makes the whole syscall entry a no-op, and
with this commit we can warn users who are validating such configs.

If, on the other hand, we were comfortable with no-op syscall entries,
we'd want to make 'names' OPTIONAL.

Warning folks who accidentally empty (or don't set) 'names' seems more
useful to me, and doesn't restrict the useful config space, so that's
what I've gone with in this commit.

minItems is documented in [1], and there is an example of its use in
[2]:

  "options": {
    "type": "array",
    "minItems": 1,
    "items": { "type": "string" },
    "uniqueItems": true
  },

[1]: https://tools.ietf.org/html/draft-wright-json-schema-validation-00#section-5.11
[2]: http://json-schema.org/example2.html

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-04-12 10:17:13 -07:00
W. Trevor King 5bf9b95c45 schema/defs-linux: Fix type for seccomp names
The:

  "type": [
    "string"
  ]

syntax added in 652323cd (improve seccomp format to be more
expressive, 2017-01-13, #657) is not valid:

  $ ./validate ./config-schema.json <../config.json
  The document is not valid. see errors :
  - linux.seccomp.syscalls.0.names: Invalid type. Expected: string, given: array

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-03-06 12:15:47 -08:00
zhouhao 513ab686e9 Add new architectures from libseccomp 2.3.2
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-03-02 14:33:06 +08:00
Mrunal Patel ae7a541930 Merge pull request #657 from GrantSeltzer/improve-seccomp-spec
config: Improve seccomp format to be more expressive
2017-02-24 18:59:49 -08:00
grantseltzer 652323cd77 improve seccomp format to be more expressive
Signed-off-by: grantseltzer <grantseltzer@gmail.com>
2017-02-22 18:17:16 -05:00
Mrunal Patel ac9f8e0b5f Merge pull request #675 from crosbymichael/caps
Add ambient and bounding capability support
2017-02-22 14:59:11 -08:00
Michael Crosby eb114f0570 Add ambient and bounding capability support
Closes #668

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-02-22 14:47:51 -08:00
Ma Shimiao 0e808fcad0 schema: remove major,minor from device required items
When type is p, major and minor is not required.
So, we should not leave them in require.

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-02-14 14:15:12 +08:00
Ma Shimiao 4100020dfc schema: fix invalid types
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-02-08 16:35:45 +08:00
W. Trevor King 092743727e schema: Drop pointers and nulls
Maintainers feel (and I agree) that there's no point in explicitly
allowing a null value when callers can simply leave the property unset
[1].  This commit removes all references to "pointer" and "null" from
the JSON Schema to support that decision.  While optional properties
may sometimes be represented as pointer types in Go [2], optional
properties should be represented in JSON Schema by not including the
properties in the 'required' array.

[1]: https://github.com/opencontainers/runtime-spec/pull/555#issuecomment-272020515
[2]: style.md "Optional settings should not have pointer Go types"

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-01-23 11:23:44 -08:00
Michael Crosby d5a1269c87 Merge pull request #545 from Mashimiao/fix-blockio-related-validation
fix blkio related validation
2017-01-23 10:32:27 -08:00
Ma Shimiao 1b3e2c7f26 schema: fix invalid string reference
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-01-23 11:49:22 +08:00
Vincent Batts dc0fa75942 Merge pull request #655 from Mashimiao/schema-fix-with-latest-spec
schema: fix items based on latest spec
2017-01-18 17:29:21 -05:00
W. Trevor King 83200898a1 schema: Remove string pointers
Catch up with 868e6310 (Remove string pointers, 2017-01-12, #653).

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-01-13 07:09:36 -08:00
Ma Shimiao 5076439d49 schema: fix items based on latest spec
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-01-13 13:59:16 +08:00
Ma Shimiao a04cce97ea fix blkio related validation
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-01-12 14:56:27 +08:00
zhouhao 2d5e0df2f0 Perfect json content
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-01-06 10:34:38 +08:00
Mike Frysinger 7872d3ddff schema: update major/minor types
This matches the config-linux.md spec which says these are both int64.

Signed-off-by: Mike Frysinger <vapier@chromium.org>
2016-11-04 20:10:56 -04:00
Ma Shimiao 60672c0b3c add devices for resources and DeviceCgroup
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2016-08-30 13:31:01 +08:00
Haiyan Meng da3b96e996 Add missing `"type": "object"`
Signed-off-by: Haiyan Meng <haiyanalady@gmail.com>
2016-08-10 17:14:25 -04:00
Phil Estes 124ce0beeb Add new architectures from libseccomp 2.3.0
Signed-off-by: Phil Estes <estesp@gmail.com>
2016-06-22 17:43:50 -04:00
Aleksa Sarai ce19b8d167 *: add support for cgroup namespace
The cgroup namespace is a new kernel feature available in 4.6+ that
allows a container to isolate its cgroup hierarchy. This currently only
allows for hiding information from /proc/self/cgroup, and mounting
cgroupfs as an unprivileged user. In the future, this namespace may
allow for subtree management by a container.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-06-04 00:14:39 +10:00
Vincent Batts d118a8ff53 schema: updates and fixes
Several fields needed the correct typing, and updates for recent changes.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-04-07 10:13:39 -04:00
Vincent Batts cdcabdeb6b schema: JSON Schema and validator for `config.json`
Conforming to https://tools.ietf.org/html/draft-zyp-json-schema-03
and http://json-schema.org/latest/json-schema-core.html

* Utilizes a number of JSON schema features, including 'pattern'
* Defined primitives, like integers, that we'll use
* Split out definitions for primitives and platform-specific
* Provide a Makefile for:
 - "fmt" target for *.json
 - "validate" target for building the validation tool

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-09 19:32:52 +00:00