-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli/generate: automatic cryptsetup configuration #1223
base: main
Are you sure you want to change the base?
Conversation
|
Functionally the initializer will act as a sidecar container which serves to set up a secure mount inside an `emptyDir` mount shared with the main container. | ||
Applications can set up trusted storage on top of an untrusted block device based on the workload secret using the `contrast.edgeless.systems/secure-pv` annotation. | ||
This annotation enables `contrast generate` to configure the Initializer to set up a LUKS-encrypted volume at the specified device and mount it to a specified volume. | ||
Configure any resource with the following annotation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configure any resource with the following annotation: | |
Configure any pod-generating resource with the following annotation: |
... not sure whether this is readable, but it's more specific.
@@ -49,11 +49,38 @@ If the data owner fully trusts the seed share owner (when they're the same entit | |||
### Secure persistence | |||
|
|||
Remember that persistent volumes from the cloud provider are untrusted. | |||
Using the built-in `cryptsetup` subcommand of the initializer, applications can set up trusted storage on top of untrusted block devices based on the workload secret. | |||
Functionally the initializer will act as a sidecar container which serves to set up a secure mount inside an `emptyDir` mount shared with the main container. | |||
Applications can set up trusted storage on top of an untrusted block device based on the workload secret using the `contrast.edgeless.systems/secure-pv` annotation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove based on the workload secret
from here and add a standalone sentence along the lines of
The volume is encrypted using the workload secret introduced in the last section.
```yaml | ||
spec: # v1.PodSpec | ||
containers: | ||
- name: my-container | ||
image: "my-image@sha256:..." | ||
volumeMounts: | ||
- mountPath: /secure | ||
mountPropagation: HostToContainer | ||
name: secure | ||
volumes: | ||
- name: secure | ||
emptyDir: {} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this example is confusing:
- It declares the emptyDir volume although that should not be necessary.
- It does not use the annotation, which might help clarify which names go where.
- It does not have a block device volume.
signalChan := make(chan os.Signal, 1) | ||
signal.Notify(signalChan, syscall.SIGTERM, syscall.SIGINT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move signal handling closer to main, use signal.NotifyContext
and wait for the context to expire at the end of this function?
} | ||
} | ||
} | ||
return fmt.Errorf("device %s not found", volumeName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("device %s not found", volumeName) | |
return fmt.Errorf("device %q not found", volumeName) |
if volume.EmptyDir != nil { | ||
return fmt.Errorf("device %s cannot be of type EmptyDir", *volume.Name) | ||
} | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might be able to exclude more invalid configurations here, because there are not many volume types that can be block devices.
This implements RFC 009 and automatically adds the necessary configuration to set up an encrypted mount using the
contrast.edgeless.systems/secure-pv
annotation, which translates to a configured Initializer oncontrast generate
.A successful run for the
volumestatefulset
test can be found here.