Skip to content

Commit 958bbab

Browse files
knrcosmman
authored andcommitted
SECURESIGN-4304: Fix reference to updatetree and createtree images
Signed-off-by: Kevin Conner <kev.conner@gmail.com>
1 parent 5cf30b9 commit 958bbab

2 files changed

Lines changed: 30 additions & 16 deletions

File tree

docs/ctlog-key-rotation.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,23 @@ Before starting, ensure that:
1111

1212
## Key Rotation Steps
1313

14-
### 1. Connect to Kubernetes Cluster
14+
### 1. Set the Release Version
15+
16+
Set the RHTAS release version you are running, for example:
17+
18+
```bash
19+
VERSION=1.4.0
20+
```
21+
22+
### 2. Connect to Kubernetes Cluster
1523

1624
Set your context to the namespace that contains the CT log service:
1725

1826
```bash
1927
kubectl config set-context --current --namespace=<namespace-name>
2028
```
2129

22-
### 2. Backup the Current CT Log Configuration
30+
### 3. Backup the Current CT Log Configuration
2331

2432
Before making any changes, store the current CT log configuration and related keys for backup:
2533

@@ -33,43 +41,43 @@ kubectl get secret $SERVER_CONFIG_NAME -o jsonpath="{.data.public}" | base64 --d
3341

3442
This backup will be needed for generating a new configuration.
3543

36-
### 3. Record the Current Tree ID
44+
### 4. Record the Current Tree ID
3745

3846
Store the `treeID` of the currently active CT log shard:
3947

4048
```bash
4149
CURRENT_TREE_ID=$(kubectl get ctlog -o jsonpath='{.items[0].status.treeID}')
4250
```
4351

44-
### 4. Drain the CT Log
52+
### 5. Drain the CT Log
4553

4654
Stop new entries from being added by setting the current log to a `DRAINING` state. This will prevent new entries but allow already submitted entries to be processed:
4755

4856
```bash
49-
kubectl run --image registry.redhat.io/rhtas/updatetree-rhel9:latest --restart=Never --attach=true --rm=true -q -- updatetree --admin_server=trillian-logserver:8091 --tree_id=${CURRENT_TREE_ID} --tree_state=DRAINING
57+
kubectl run --image registry.redhat.io/rhtas/updatetree-rhel9:${VERSION} --restart=Never --attach=true --rm=true -q -- updatetree --admin_server=trillian-logserver:8091 --tree_id=${CURRENT_TREE_ID} --tree_state=DRAINING
5058
```
5159

52-
### 5. Monitor Queue Draining
60+
### 6. Monitor Queue Draining
5361

5462
It's critical to ensure that all pending entries in the log queue are processed before proceeding. Follow the instructions in [Trillian's documentation on freezing a log](https://github.com/google/trillian/blob/master/docs/howto/freeze_a_ct_log.md#monitor-queue--integration) to monitor the queue.
5563

56-
### 6. Freeze the CT Log
64+
### 7. Freeze the CT Log
5765

5866
Once the queue has fully drained, freeze the log by setting the log state to `FROZEN`:
5967

6068
```bash
61-
kubectl run --image registry.redhat.io/rhtas/updatetree-rhel9:latest --restart=Never --attach=true --rm=true -q -- updatetree --admin_server=trillian-logserver:8091 --tree_id=${CURRENT_TREE_ID} --tree_state=FROZEN
69+
kubectl run --image registry.redhat.io/rhtas/updatetree-rhel9:${VERSION} --restart=Never --attach=true --rm=true -q -- updatetree --admin_server=trillian-logserver:8091 --tree_id=${CURRENT_TREE_ID} --tree_state=FROZEN
6270
```
6371

64-
### 7. Create a New Merkle Tree
72+
### 8. Create a New Merkle Tree
6573

6674
Now, create a new Merkle Tree that will serve as the new active shard:
6775

6876
```bash
69-
NEW_TREE_ID=$(kubectl run createtree --image registry.redhat.io/rhtas/createtree-rhel9:latest --restart=Never --attach=true --rm=true -q -- -logtostderr=false --admin_server=trillian-logserver:8091 --display_name=ctlog-tree)
77+
NEW_TREE_ID=$(kubectl run createtree --image registry.redhat.io/rhtas/createtree-rhel9:${VERSION} --restart=Never --attach=true --rm=true -q -- -logtostderr=false --admin_server=trillian-logserver:8091 --display_name=ctlog-tree)
7078
```
7179

72-
### 8. Generate New Private Key
80+
### 9. Generate New Private Key
7381

7482
Generate a new private key for the new CT log shard using OpenSSL:
7583

@@ -79,7 +87,7 @@ openssl ec -in new-ctlog.pem -pubout -out new-ctlog-public.pem
7987
openssl ec -in new-ctlog.pem -out new-ctlog.pass.pem -des3 -passout pass:"changeit"
8088
```
8189

82-
### 9. Update the CT Log Configuration
90+
### 10. Update the CT Log Configuration
8391

8492
You will now modify the old configuration stored in `config.txtpb` to:
8593
- Add a `not_after_limit` field to the frozen log entry.
@@ -130,7 +138,7 @@ In this configuration:
130138
- The `frozen log` (identified by `CURRENT_TREE_ID`) has the `prefix` renamed to `trusted-artifact-signer-0`, and it includes a `not_after_limit` timestamp to stop accepting certificates with a `NotAfter` date beyond this point.
131139
- The `new active log` (identified by `NEW_TREE_ID`) is set up with a new prefix (`trusted-artifact-signer`), a new private key, and includes a `not_after_start` timestamp, marking when the log will start accepting certificates.
132140

133-
### 10. Create a new Kubernetes secret
141+
### 11. Create a new Kubernetes secret
134142

135143
Store the new configuration and keys in a Kubernetes secret:
136144

docs/rekor-sharding.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ This is necessary because you'll need the length of the current shard later on,
2929

3030
Follow these steps to shard the log:
3131

32+
1. Set the RHTAS release version you are running, for example:
33+
34+
```bash
35+
VERSION=1.4.0
36+
```
37+
3238
1. Connect to your Kubernetes cluster and switch to the namespace that contains the running RHTAS stack:
3339

3440
```bash
@@ -44,7 +50,7 @@ Follow these steps to shard the log:
4450
1. Stop all traffic to Rekor so new entries can't be added by setting the log tree to a `DRAINING` state.
4551

4652
```bash
47-
kubectl run --image registry.redhat.io/rhtas/updatetree-rhel9:latest --restart=Never --attach=true --rm=true -q -- updatetree --admin_server=trillian-logserver:8091 --tree_id=${CURRENT_TREE_ID} --tree_state=DRAINING
53+
kubectl run --image registry.redhat.io/rhtas/updatetree-rhel9:${VERSION} --restart=Never --attach=true --rm=true -q -- updatetree --admin_server=trillian-logserver:8091 --tree_id=${CURRENT_TREE_ID} --tree_state=DRAINING
4854
```
4955

5056
At this point, the log will not accept new entries, but there may be some that have already been submitted but not yet integrated.
@@ -58,7 +64,7 @@ Follow these steps to shard the log:
5864
**Warning**: Be sure to have completed the queue monitoring process set out in the previous section. If there are still queued leaves that have not been integrated, then setting the tree to frozen will put the log on a path to exceeding its MMD (Maximum Merge Delay).
5965

6066
```bash
61-
kubectl run --image registry.redhat.io/rhtas/updatetree-rhel9:latest --restart=Never --attach=true --rm=true -q -- updatetree --admin_server=trillian-logserver:8091 --tree_id=${CURRENT_TREE_ID} --tree_state=FROZEN
67+
kubectl run --image registry.redhat.io/rhtas/updatetree-rhel9:${VERSION} --restart=Never --attach=true --rm=true -q -- updatetree --admin_server=trillian-logserver:8091 --tree_id=${CURRENT_TREE_ID} --tree_state=FROZEN
6268
```
6369

6470
1. Store the length of the frozen tree:
@@ -76,7 +82,7 @@ Follow these steps to shard the log:
7682
1. Create a new Merkle Tree which will become the new active shard:
7783

7884
```bash
79-
NEW_TREE_ID=$(kubectl run createtree --image registry.redhat.io/rhtas/createtree-rhel9:latest --restart=Never --attach=true --rm=true -q -- -logtostderr=false --admin_server=trillian-logserver:8091 --display_name=rekor-tree)
85+
NEW_TREE_ID=$(kubectl run createtree --image registry.redhat.io/rhtas/createtree-rhel9:${VERSION} --restart=Never --attach=true --rm=true -q -- -logtostderr=false --admin_server=trillian-logserver:8091 --display_name=rekor-tree)
8086
```
8187

8288
1. At this point, we should have two trees: one is frozen, and the second is a new that will be used as the active shard. Example of stored values:

0 commit comments

Comments
 (0)