Skip to content

Commit 3a0fb42

Browse files
committed
docs: clarify policy names
Address feedback for consistent use of policy names And clarify that filenames are arbitrary Signed-off-by: Dan Middleton <dmiddleton@nvidia.com>
1 parent 68ecd34 commit 3a0fb42

File tree

3 files changed

+54
-47
lines changed

3 files changed

+54
-47
lines changed

content/en/docs/attestation/policies/_index.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,32 @@ Confidential Containers uses three types of policies to secure workloads at diff
1717

1818
| Policy | Where Enforced | Purpose | Where it is set |
1919
|--------|----------------|---------|------------|
20-
| **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) |
2323

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,
2626
see the [Init-Data feature documentation](../../features/initdata/#agent-policy-overview).
2727

2828
### How Policies Work Together
2929

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:
3131

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
3535
In fact, resource policies can even check individual fields of the Init-Data claims
3636
see [Trustee docs](https://github.com/confidential-containers/trustee/blob/main/attestation-service/docs/attestation_token.md)
3737

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.
3939

4040
## Trustee Policies
4141

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.
4343

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
4646
if the enclave is in a valid state. Generally this policy reflects the enclave boot flow.
4747
Both policies use OPA.
4848

@@ -55,17 +55,17 @@ kbs-client --url <kbs-url> config \
5555
--policy-file <path-to-policy-file>
5656
```
5757

58-
The attestation policy is set in a similar manner.
58+
The attestation service policy is set in a similar manner.
5959
```bash
6060
kbs-client --url <kbs-url> config \
6161
--auth-private-key <admin-private-key> set-attestation-policy \
6262
--policy-file <path-to-policy-file>
6363
```
6464

65-
## Resource Policies
65+
## KBS Resource Policies
6666

67-
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
6969
attestation token which was generated by attestation service for the guest making the request.
7070

7171
### Basic Policies
@@ -88,14 +88,14 @@ default allow = true
8888
```
8989

9090
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
9292
does not come from the sample attester.
9393
This means that some TEE must have been used to request the secret
9494
although it makes no guarantees about the TCB.
9595
If you are testing Trustee without a TEE (with the sample evidence)
9696
the default policy will block all of your requests.
9797

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.
9999
The attestation token is an EAR token, so we can check if it is contraindicated.
100100
The `status` field in the EAR token represents an AR4SI Trustworthiness Tier.
101101
There are 4 tiers: Contraindicated, Warning, Affirming,
@@ -143,7 +143,7 @@ These are `instance_identity`, `configuration`, `executables`, `file_system`, `h
143143
Not all of these vectors is in scope for confidential containers.
144144
See the next section for how these vectors are calculated.
145145

146-
A resource policy can check each of these values.
146+
A KBS resource policy can check each of these values.
147147
For instance this policy builds on the previous one to make sure that in addition
148148
to not being contraindicated, the executables trust vector has a particular claim.
149149
```rego
@@ -164,7 +164,7 @@ For instance, for the `executables` trust claim the value 2 stands for
164164
"Only a recognized genuine set of approved executables have been loaded during the boot process."
165165
A full listing of trust vectors and their meanings can be found [here](https://datatracker.ietf.org/doc/draft-ietf-rats-ar4si/).
166166

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
168168
on which resource is requested.
169169

170170
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
220220
This allows users to create their own schemes for identifying guests.
221221
For instance, the init-data could be used to assign each guest a UUID or a workload class.
222222

223-
## Attestation Policies
223+
## Attestation Service Policies
224224

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
226226
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
228228
and how the evidence should be compared to reference values.
229229

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
231231
booted by the Kata shim and running Kata guests.
232232
If you are using Confidential Containers with these platforms you probably do not need
233233
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
235235
to capture your TCB.
236236

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.
238238
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)
239239
to see which values are expected.
240240
You only need to provision the reference values for the platform that you are using.

content/en/docs/getting-started/securing-workloads.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -88,22 +88,29 @@ Confidential Containers uses **three types of policies** to protect your workloa
8888

8989
| Policy Type | Where Enforced | What It Controls | Configured Via |
9090
|------------|----------------|------------------|----------------|
91-
| **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 |
9494

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" >}}
9696

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)
98105

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.
100107

101108
**Example use cases:**
102109
- Prevent `kubectl exec` into production pods
103110
- Restrict which container images can be launched
104111
- Control which commands can be executed
105112

106-
**Quick example** of a restrictive agent policy:
113+
**Quick example** of a restrictive kata agent policy:
107114
```rego
108115
package agent_policy
109116
import rego.v1
@@ -117,24 +124,24 @@ CreateContainerRequest if {
117124
}
118125
```
119126

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.
121128

122129
**Learn more:** [Agent Policies and Init-Data](../../features/initdata/)
123130

124131

125-
### 2. Resource Policy (At the KBS)
132+
### 2. KBS Resource Policy (At the KBS)
126133

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.
128135

129136
**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)
131138
- Only release database credentials to attesting TDX guests
132139
- Require specific trust levels (affirming vs contraindicated)
133140
- Different secrets for different platforms (TDX vs SNP)
134141

135142
**Example: Checking Init-Data hash**
136143

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:
138145

139146
```rego
140147
package policy
@@ -145,7 +152,7 @@ default allow = false
145152
# Only release secrets to workloads with the expected Init-Data hash
146153
allow if {
147154
input["submods"]["cpu0"]["ear.status"] == "affirming"
148-
# Verify the specific Init-Data hash (includes agent policy + config)
155+
# Verify the specific Init-Data hash (includes kata agent policy + config)
149156
input["submods"]["cpu0"]["ear.veraison.annotated-evidence"]["init_data"] == "expected-hash-here"
150157
}
151158
```
@@ -158,18 +165,18 @@ a command line you could run:
158165
sha384sum initdata.toml
159166
```
160167

161-
**Learn more:** [Resource Policies](../../attestation/policies/#resource-policies)
168+
**Learn more:** [KBS Resource Policies](../../attestation/policies/#kbs-resource-policies)
162169

163-
### 3. Attestation Policy (At the Attestation Service)
170+
### 3. Attestation Service Policy (At the Attestation Service)
164171

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.
166173

167174
**Example use cases:**
168175
- Define acceptable firmware versions
169176
- Specify required security levels for different workloads
170177
- Map hardware measurements to trust claims
171178

172-
**Learn more:** [Attestation Policies](../../attestation/policies/#attestation-policies)
179+
**Learn more:** [Attestation Service Policies](../../attestation/policies/#attestation-service-policies)
173180

174181
{{% alert title="Default Policies" color="success" %}}
175182
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:
185192
Before deploying to production, ensure you've addressed:
186193

187194
- [ ] 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
190197
- [ ] Provisioned reference values to the attestation service
191198

192199
## Next Steps

static/img/CoCoMeasurementsAndConfig.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)