-
Notifications
You must be signed in to change notification settings - Fork 0
/
policy.yaml
98 lines (93 loc) · 3.13 KB
/
policy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
functionaries:
- name: alice
publicKeyPath: ./alice.pub
scheme: rsa-pss
attestationRules:
- name: untar
predicateType: https://in-toto.io/attestation/link/v0.3
policies:
- type: https://in-toto.io/policy/predicate-attribute/v0.1
definition:
expressions:
- this.predicate.command == ['tar', 'xvf', 'project.tar.gz']
- type: https://in-toto.io/policy/artifact-rules/v0.1
definition:
field: this.subject
rules:
- REQUIRE "main.c"
- REQUIRE "external.c"
- REQUIRE "external.h"
- REQUIRE "Makefile"
- REQUIRE "it.Makefile"
- DISALLOW "*"
allowedFunctionaries:
- alice
- name: build_external
predicateType: https://in-toto.io/attestation/link/v0.3
policies:
- type: https://in-toto.io/policy/predicate-attribute/v0.1
definition:
expressions:
- this.predicate.command == ['cc', '-c', '-o', 'external.o', 'external.c']
- type: https://in-toto.io/policy/artifact-rules/v0.1
definition:
field: this.predicate.materials
rules:
- MATCH "external.c" WITH "untar.subject"
- MATCH "external.h" WITH "untar.subject"
- ALLOW "Makefile"
- DISALLOW "*"
- type: https://in-toto.io/policy/artifact-rules/v0.1
definition:
field: this.subject
rules:
- REQUIRE "external.o"
- DISALLOW "*"
allowedFunctionaries:
- alice
- name: build_main
predicateType: https://in-toto.io/attestation/link/v0.3
policies:
- type: https://in-toto.io/policy/predicate-attribute/v0.1
definition:
expressions:
- this.predicate.command == ['cc', '-c', '-o', 'main.o', 'main.c']
- type: https://in-toto.io/policy/artifact-rules/v0.1
definition:
field: this.predicate.materials
rules:
- MATCH "main.c" WITH "untar.subject"
- MATCH "external.h" WITH "untar.subject"
- ALLOW "Makefile"
- DISALLOW "*"
- type: https://in-toto.io/policy/artifact-rules/v0.1
definition:
field: this.subject
rules:
- REQUIRE "main.o"
- DISALLOW "*"
allowedFunctionaries:
- alice
- name: build_testy
predicateType: https://in-toto.io/attestation/link/v0.3
policies:
- type: https://in-toto.io/policy/predicate-attribute/v0.1
definition:
expressions:
- this.predicate.command == ['cc', '-o', 'testy', 'main.o', 'external.o']
- type: https://in-toto.io/policy/artifact-rules/v0.1
definition:
field: this.predicate.materials
rules:
- MATCH "main.o" WITH "build_main.subject"
- MATCH "external.o" WITH "build_external.subject"
- ALLOW "Makefile"
- DISALLOW "*"
- type: https://in-toto.io/policy/artifact-rules/v0.1
definition:
field: this.subject
rules:
- REQUIRE "testy"
- DISALLOW "*"
allowedFunctionaries:
- alice