You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**Agent Policy**| Inside the TEE by Kata Agent | Controls what operations the agent can perform |[Init-Data](../../features/initdata/)) |
21
-
|**Resource Policy**| By Trustee KBS | Controls which secrets are released to which workloads | KBS (via KBS Client or config file) |
22
-
|**Attestation Policy**| By Trustee AS | Defines how hardware evidence is evaluated | AS (via KBS Client or config file) |
20
+
|**Kata Agent Policy**| Inside the TEE by Kata Agent | Controls what operations the agent can perform |[Init-Data](../../features/initdata/)) |
21
+
|**KBS Resource Policy**| By Trustee KBS | Controls which secrets are released to which workloads | KBS (via KBS Client or config file) |
22
+
|**Attestation Service Policy**| By Trustee AS | Defines how hardware evidence is evaluated | AS (via KBS Client or config file) |
23
23
24
-
This page focuses on the **two policies managed by Trustee**: resource policies and attestation policies.
25
-
For information about agent policies, which control the Kata agent's behavior inside the TEE,
24
+
This page focuses on the **two policies managed by Trustee**: KBS resource policies and attestation service policies.
25
+
For information about kata agent policies, which control the Kata agent's behavior inside the TEE,
26
26
see the [Init-Data feature documentation](../../features/initdata/#agent-policy-overview).
27
27
28
28
### How Policies Work Together
29
29
30
-
While agent policies are not managed by Trustee, they are cryptographically linked to the attestation process:
30
+
While kata agent policies are not managed by Trustee, they are cryptographically linked to the attestation process:
31
31
32
-
1.**Agent policies** are delivered via Init-Data, which is hashed and measured into the TEE's hardware evidence
33
-
2.**Attestation policies** evaluate this hardware evidence to generate an attestation token
34
-
3.**Resource policies** can check the Init-Data hash (containing the agent policy) in the attestation token before releasing secrets
32
+
1.**Kata agent policies** are delivered via Init-Data, which is hashed and measured into the TEE's hardware evidence
33
+
2.**Attestation service policies** evaluate this hardware evidence to generate an attestation token
34
+
3.**KBS resource policies** can check the Init-Data hash (containing the kata agent policy) in the attestation token before releasing secrets
35
35
In fact, resource policies can even check individual fields of the Init-Data claims
36
36
see [Trustee docs](https://github.com/confidential-containers/trustee/blob/main/attestation-service/docs/attestation_token.md)
37
37
38
-
This ensures that even though Trustee doesn't manage agent policies directly, it can verify that the correct agent policy was applied to a workload before granting access to secrets.
38
+
This ensures that even though Trustee doesn't manage kata agent policies directly, it can verify that the correct kata agent policy was applied to a workload before granting access to secrets.
39
39
40
40
## Trustee Policies
41
41
42
-
Trustee manages two different policies that govern when secrets are released: resource policies and attestation policies. These serve distinct purposes.
42
+
Trustee manages two different policies that govern when secrets are released: KBS resource policies and attestation service policies. These serve distinct purposes.
43
43
44
-
Resource policies control which secrets are released and are generally scoped to the workload.
45
-
Attestation policies define how TCB claims are compared to reference values to determine
44
+
KBS resource policies control which secrets are released and are generally scoped to the workload.
45
+
Attestation service policies define how TCB claims are compared to reference values to determine
46
46
if the enclave is in a valid state. Generally this policy reflects the enclave boot flow.
Resource policies, also known as KBS Policies, control whether a resource is released to a guest.
68
-
The input to the resource policies is the URI of the resource that is being requested and the
67
+
KBS resource policies, also known as KBS Policies, control whether a resource is released to a guest.
68
+
The input to the KBS resource policies is the URI of the resource that is being requested and the
69
69
attestation token which was generated by attestation service for the guest making the request.
70
70
71
71
### Basic Policies
@@ -88,14 +88,14 @@ default allow = true
88
88
```
89
89
90
90
Allowing all requests is generally not secure.
91
-
By default the resource policy allows all requests as long as the evidence
91
+
By default the KBS resource policy allows all requests as long as the evidence
92
92
does not come from the sample attester.
93
93
This means that some TEE must have been used to request the secret
94
94
although it makes no guarantees about the TCB.
95
95
If you are testing Trustee without a TEE (with the sample evidence)
96
96
the default policy will block all of your requests.
97
97
98
-
Usually the policy should check if the attestation token represents a valid TCB.
98
+
Usually the KBS resource policy should check if the attestation token represents a valid TCB.
99
99
The attestation token is an EAR token, so we can check if it is contraindicated.
100
100
The `status` field in the EAR token represents an AR4SI Trustworthiness Tier.
101
101
There are 4 tiers: Contraindicated, Warning, Affirming,
@@ -143,7 +143,7 @@ These are `instance_identity`, `configuration`, `executables`, `file_system`, `h
143
143
Not all of these vectors is in scope for confidential containers.
144
144
See the next section for how these vectors are calculated.
145
145
146
-
A resource policy can check each of these values.
146
+
A KBS resource policy can check each of these values.
147
147
For instance this policy builds on the previous one to make sure that in addition
148
148
to not being contraindicated, the executables trust vector has a particular claim.
149
149
```rego
@@ -164,7 +164,7 @@ For instance, for the `executables` trust claim the value 2 stands for
164
164
"Only a recognized genuine set of approved executables have been loaded during the boot process."
165
165
A full listing of trust vectors and their meanings can be found [here](https://datatracker.ietf.org/doc/draft-ietf-rats-ar4si/).
166
166
167
-
The policy also takes the requested resource URI as input so the policy can have different behavior depending
167
+
The policy also takes the requested resource URI as input so the KBS resource policy can have different behavior depending
168
168
on which resource is requested.
169
169
170
170
Here is a basic policy checking which resource is requested.
@@ -220,21 +220,21 @@ Accessing init-data from policies can be extremely powerful because users can sp
220
220
This allows users to create their own schemes for identifying guests.
221
221
For instance, the init-data could be used to assign each guest a UUID or a workload class.
222
222
223
-
## Attestation Policies
223
+
## Attestation Service Policies
224
224
225
-
Attestation policies are what the attestation service uses to calculate EAR trust vectors
225
+
Attestation service policies are what the attestation service uses to calculate EAR trust vectors
226
226
based on the TCB claims extracted from the hardware evidence by the verifiers.
227
-
Essentially the AS policy defines which parts of the evidence are important
227
+
Essentially the attestation service policy defines which parts of the evidence are important
228
228
and how the evidence should be compared to reference values.
229
229
230
-
The default attestation policy already defines this relationship for TDX and SNP guests
230
+
The default attestation service policy already defines this relationship for TDX and SNP guests
231
231
booted by the Kata shim and running Kata guests.
232
232
If you are using Confidential Containers with these platforms you probably do not need
233
233
to change this policy.
234
-
If you are using Trustee to boot different types of guests, you might want to adjust the AS policy
234
+
If you are using Trustee to boot different types of guests, you might want to adjust the attestation service policy
235
235
to capture your TCB.
236
236
237
-
Either way, you'll need to provide the reference values that the policy expects.
237
+
Either way, you'll need to provide the reference values that the attestation service policy expects.
238
238
Take a look at the [default CPU policy](https://github.com/confidential-containers/trustee/blob/main/attestation-service/src/ear_token/ear_default_policy_cpu.rego)
239
239
to see which values are expected.
240
240
You only need to provision the reference values for the platform that you are using.
| **Agent Policy** | Inside the TEE by Kata Agent | Which operations the agent can perform (create containers, exec into pods, etc.) | Pod annotation with init-data |
92
-
| **Resource Policy** | By Trustee KBS | Which secrets are released to which workloads | KBS Client or Trustee Operator |
93
-
| **Attestation Policy** | By Trustee AS | How hardware evidence is evaluated (what TCB is acceptable) | KBS Client or Trustee Operator |
91
+
| **Kata Agent Policy** | Inside the TEE by Kata Agent | Which operations the agent can perform (create containers, exec into pods, etc.) | Pod annotation with init-data |
92
+
| **KBS Resource Policy** | By Trustee KBS | Which secrets are released to which workloads | KBS Client or Trustee Operator |
93
+
| **Attestation Service Policy** | By Trustee AS | How hardware evidence is evaluated (what TCB is acceptable) | KBS Client or Trustee Operator |
94
94
95
-
{{< figure src="/img/CoCoMeasurementsAndConfig.svg" alt="Diagram showing how agent policy, resource policy, and attestation policy interact in the attestation flow" >}}
95
+
{{< figure src="/img/CoCoMeasurementsAndConfig.svg" alt="Diagram showing how kata agent policy, KBS resource policy, and attestation service policy interact in the attestation flow" >}}
96
96
97
-
### 1. Agent Policy (Inside the TEE)
97
+
{{% alert title="Note" color="info" %}}
98
+
The diagram shows example Rego file names.
99
+
Those names are arbitrary.
100
+
Policies are always supplied by path via command line (e.g. `kbs-client ... set-resource-policy --policy-file <path>`) or config,
101
+
and the services use the file *content*, not the filename.
102
+
{{% /alert %}}
103
+
104
+
### 1. Kata Agent Policy (Inside the TEE)
98
105
99
-
The agent policy controls what operations the Kata agent can perform inside your TEE. This is your **first line of defense** against malicious or compromised Kubernetes control planes.
106
+
The kata agent policy controls what operations the Kata agent can perform inside your TEE. This is your **first line of defense** against malicious or compromised Kubernetes control planes.
100
107
101
108
**Example use cases:**
102
109
- Prevent `kubectl exec` into production pods
103
110
- Restrict which container images can be launched
104
111
- Control which commands can be executed
105
112
106
-
**Quick example** of a restrictive agent policy:
113
+
**Quick example** of a restrictive kata agent policy:
107
114
```rego
108
115
package agent_policy
109
116
import rego.v1
@@ -117,24 +124,24 @@ CreateContainerRequest if {
117
124
}
118
125
```
119
126
120
-
Agent policies get embedded in the Init-Data configuration file. That file provides additional configuration like where to look for Trustee.
127
+
Kata agent policies get embedded in the Init-Data configuration file. That file provides additional configuration like where to look for Trustee.
121
128
122
129
**Learn more:** [Agent Policies and Init-Data](../../features/initdata/)
123
130
124
131
125
-
### 2. Resource Policy (At the KBS)
132
+
### 2. KBS Resource Policy (At the KBS)
126
133
127
-
Resource policies control which secrets are released under what conditions. They inspect the attestation token from your workload to make decisions.
134
+
KBS resource policies control which secrets are released under what conditions. They inspect the attestation token from your workload to make decisions.
128
135
129
136
**Example use cases:**
130
-
- Verify the workload is using a specific agent policy (via Init-Data hash)
137
+
- Verify the workload is using a specific kata agent policy (via Init-Data hash)
131
138
- Only release database credentials to attesting TDX guests
132
139
- Require specific trust levels (affirming vs contraindicated)
133
140
- Different secrets for different platforms (TDX vs SNP)
134
141
135
142
**Example: Checking Init-Data hash**
136
143
137
-
When you provide Init-Data in your pod (with an agent policy), the Attestation Service verifies it and includes the hash in the token. Your resource policy can verify the specific Init-Data hash to ensure the exact agent policy was used:
144
+
When you provide Init-Data in your pod (with a kata agent policy), the Attestation Service verifies it and includes the hash in the token. Your KBS resource policy can verify the specific Init-Data hash to ensure the exact kata agent policy was used:
138
145
139
146
```rego
140
147
package policy
@@ -145,7 +152,7 @@ default allow = false
145
152
# Only release secrets to workloads with the expected Init-Data hash
### 3. Attestation Policy (At the Attestation Service)
170
+
### 3. Attestation Service Policy (At the Attestation Service)
164
171
165
-
Attestation policies define **how hardware evidence is evaluated** - what measurements are acceptable, which reference values to compare against, and how to calculate trust vectors.
172
+
Attestation service policies define **how hardware evidence is evaluated** - what measurements are acceptable, which reference values to compare against, and how to calculate trust vectors.
166
173
167
174
**Example use cases:**
168
175
- Define acceptable firmware versions
169
176
- Specify required security levels for different workloads
CoCo ships with sensible default attestation policies for TDX and SNP. For most users, you only need to provide reference values - the policy is already configured appropriately.
@@ -185,8 +192,8 @@ Once you've configured the basics, explore these features for enhanced security:
185
192
Before deploying to production, ensure you've addressed:
186
193
187
194
- [ ] Selected the correct runtime class for your hardware
188
-
- [ ] Generated and embedded an agent policy appropriate for your workload
189
-
- [ ] Configured resource policies in your KBS
195
+
- [ ] Generated and embedded a kata agent policy appropriate for your workload
196
+
- [ ] Configured KBS resource policies in your KBS
190
197
- [ ] Provisioned reference values to the attestation service
0 commit comments