2023-01-19 09:57:50 -05:00
|
|
|
# disk-mapper
|
2022-04-05 09:12:20 -04:00
|
|
|
|
2023-01-19 09:57:50 -05:00
|
|
|
The disk-mapper is a binary that runs during the initramfs of a Constellation node.
|
|
|
|
|
|
|
|
If running on a new node, it handles setting up the node's state disk by creating an integrity protected encrypted partition.
|
|
|
|
|
|
|
|
On a rebooting node, the disk-mapper handles recovery of the node by requesting a decryption key for its state disk.
|
|
|
|
Once the disk is decrypted, the measurement salt is read from disk and used to extend a PCR to mark the node as initialized.
|
2022-04-05 09:12:20 -04:00
|
|
|
|
|
|
|
## Testing
|
|
|
|
|
2022-09-08 08:45:27 -04:00
|
|
|
Integration test is available in `disk-mapper/test/integration_test.go`.
|
2022-04-05 09:12:20 -04:00
|
|
|
The integration test requires root privileges since it uses dm-crypt.
|
|
|
|
Build and run the test:
|
2022-06-01 04:14:36 -04:00
|
|
|
|
2022-04-05 09:12:20 -04:00
|
|
|
```bash
|
2023-01-19 09:57:50 -05:00
|
|
|
go test -c -tags=integration ./disk-mapper/internal/test/
|
2022-04-05 09:12:20 -04:00
|
|
|
sudo ./test.test
|
|
|
|
```
|