gunk-dev/the-valley

registry.cue

sourcefec8fb9dfaf0main's published tip history
4.9 KiB
1// The worked identity registry: an example instance, written against
2// schema/identity.cue. The compiler renders it into
3// ../compiled/, which is what the enforcement boundaries read — so this
4// pair is the schema's evidence, and the golden case of the identity-e2e
5// check.
6//
7// The keys were generated for this example, and their private halves were
8// discarded. Nothing in a registry is a secret: it holds public halves
9// only, which is why it is an ordinary document in the instance repository
10// rather than a provisioned file.
11package identity
12
13boundaries: {
14 // The host serving the instance's repositories. sshd is the gate: a key
15 // in the compiled authorized_keys may push, and one that is not there
16 // cannot reach the repositories at all.
17 "valley-host-push": kind: "git-push"
18
19 // The integration path that admits a change to this document.
20 "registry": kind: "registry"
21
22 // The same host's pre-receive hook, deciding who may write an
23 // integration request. A key it does not find among the holders cannot
24 // file one.
25 "valley-host-request": kind: "request"
26
27 // The web edge at example.org: the publisher sends it what the read
28 // grants here, and each project's own policy/read, let anyone read. A
29 // read grant compiles into no artifact; the publisher reads it from
30 // this document.
31 "web": {
32 kind: "edge-read"
33 destination: "example.org"
34 }
35}
36
37// The reader with no credential may read app at the edge, by the
38// publication identity app's policy/read declares. app is public there
39// because its own policy/read names anyone too. site is not named, so it is
40// public nowhere, whatever its policy says.
41anyone: grants: read: {
42 boundary: "web"
43 projects: app: "9da6809f038df92138c131cd16bed76d"
44}
45
46genesis: "operator"
47
48principals: {
49 // The operator. Five keys across four machines, and the signing name
50 // varies per key rather than per entry: two keys on the workstation sign
51 // under that machine's attestations name, the plain key on
52 // valley-host signs under the operator's own name, and the two that
53 // sign nothing push and never attest. The operator files integration
54 // requests, so the entry holds request beside push. The operator reads
55 // every project at the edge whose own policy/read names the operator,
56 // as any reader would.
57 "operator": {
58 kind: "human"
59 keys: [
60 { // workstation, first system
61 class: "ssh-ed25519"
62 bound: "host"
63 public: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINeHRYwKqCETPj0ZZ/+B5c5Julf3dJZclYZaRWixQs1D"
64 signs: "workstation/attestations"
65 },
66 { // workstation, second system
67 class: "ssh-ed25519"
68 bound: "host"
69 public: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIORtFu8o9epEZ6UPhN7EfghFnP0gUTrvuZxdSwlHGGWQ"
70 signs: "workstation/attestations"
71 },
72 { // valley-host
73 class: "ssh-ed25519"
74 bound: "host"
75 public: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMsWYyDSCNBwb6MnvQ7sfu++kZold+0HuP5leY4IiKnV"
76 signs: "operator"
77 },
78 { // cloud-shell
79 class: "ssh-ed25519"
80 bound: "host"
81 public: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFtx7r+B/QI75Oohpr5+TQIEmTBstSuby0rsG9d4T8vx"
82 },
83 { // laptop
84 class: "ssh-ed25519"
85 bound: "host"
86 public: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA2HH5cIC6Nmby7aN2bEOxeF6pe4EYvtOLTiLdztbQFG"
87 },
88 ]
89 grants: {
90 push: boundary: "valley-host-push"
91 request: boundary: "valley-host-request"
92 govern: boundary: "registry"
93 read: {
94 boundary: "web"
95 projects: "all"
96 }
97 }
98 }
99
100 // A scratch machine: it clones and pushes topic branches, files no
101 // request, decrypts nothing, and holds its raw key until the
102 // certificate issuance service exists. Hence the expiry, which is what
103 // makes the compilation a revocation already scheduled (bd-8a591dc).
104 "agent-vm": {
105 kind: "machine"
106 keys: [{
107 class: "ssh-ed25519"
108 bound: "host"
109 public: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO0AEJMcSrXCOYKlyVrdVWG07RF2SIM/8gaI/8oDEMRI"
110 }]
111 grants: push: boundary: "valley-host-push"
112 expires: "2026-10-01"
113 }
114
115 // The host itself, signing the execution claims `attest run` produces on
116 // it. It pushes nowhere, so it holds no grant — and it is still in the
117 // compiled known-signers, because that artifact is every
118 // attestation-capable key rather than the holders of some grant.
119 "valley-host": {
120 kind: "machine"
121 keys: [{
122 class: "ssh-ed25519"
123 bound: "host"
124 public: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGRtI+7TYX67rzFGIp3ZJEVLAnaL4SA2n5ipYkFqpgKS"
125 signs: "valley-host/attestations"
126 }]
127 expires: "2027-06-01"
128 }
129
130 // The integrator, signing its transfer statements under its own name.
131 // No push grant: it reaches the repositories through the git group on
132 // the host, not through sshd.
133 "integrator": {
134 kind: "service"
135 keys: [{
136 class: "ssh-ed25519"
137 bound: "host"
138 public: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEGTRJkpUO9Z+nujKT+u5Ho7jcovPYu070iz6poQIKoI"
139 signs: "integrator"
140 }]
141 expires: "2027-06-01"
142 }
143}