@@ -114,6 +114,51 @@ $ helm install artifact-attestations-opa-provider charts/artifact-attestations-o
114
114
115
115
## Verification
116
116
117
+ ### Architecture
118
+
119
+ GitHub Artifact Attestations OPA provider is a regular [ OPA Gatekeeper
120
+ external data
121
+ provider] ( https://open-policy-agent.github.io/gatekeeper/website/docs/externaldata ) .
122
+
123
+ It works by interacting with OCI registries to fetch [ Sigstore
124
+ bundles] ( https://github.com/sigstore/architecture-docs/blob/main/client-spec.md#5-serialization-and-wire-format )
125
+ containing attestations for the container to be deployed. The Artifact
126
+ Attestations OPA provider will fetch the bundles, verify the
127
+ cryptographic integrity, and if valid, return them to OPA Gatekeeper,
128
+ where the data can be used during policy evaluation. This means only
129
+ the cryptographic properties are verified within the Artifact
130
+ Attestations OPA provider, the rego policy is evaluated by OPA
131
+ Gatekeeper with normal [ constraint
132
+ objects] ( https://open-policy-agent.github.io/gatekeeper/website/docs/constrainttemplates ) . In
133
+ the constraint configuration is where affected resources and
134
+ namespaces are configured.
135
+
136
+ > [ !NOTE]
137
+ > OPA Gatekeeper has a hard timeout on 3 seconds, which include the
138
+ > time for the external data provider. Be sure that you don't have
139
+ > unnecessary attestations stored in the OCI registry as it may impact
140
+ > the duration so that a timeout can occur.
141
+
142
+ ``` mermaid
143
+ sequenceDiagram
144
+ participant k8s as K8s
145
+ participant opag as OPA Gatekeeper
146
+ participant opadp as Artifact Attestations OPA Provider
147
+ participant ocir as OCI Registry
148
+
149
+ k8s->>opag: Admit OCI image ref?
150
+ opag->>opadp: Validate OCI image ref
151
+ opadp->>ocir: Fetch attestations for image ref
152
+ ocir->>opadp: Zero or more attestations
153
+ opadp->>opadp: Verify integrity and authenticity of attestations
154
+ opadp->>opag: Verified attestations
155
+ opag->>opag: Perform rego policy evaluation on attestations
156
+ opag->>k8s: Policy decision
157
+
158
+ ```
159
+
160
+ ### Rego policies
161
+
117
162
Three examples are provided that can be used as references when
118
163
building out the policy.
119
164
0 commit comments