Skip to content
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

First functional chunk of server code #5

Merged
merged 15 commits into from
Aug 21, 2024

Conversation

paulhowardarm
Copy link
Collaborator

feat: First functional chunk of code for the key broker server.

Implements the documented API, but with various limitations and TODOs. It provides enough that it can be tested and demonstrated.

Only supports Arm CCA attestation at the moment, although this restriction would be easy to lift.

The nonce/challenge value is currently hardcoded and not properly randomised. This allows the server to be tested with a mock client that just replays pre-baked CCA example tokens. Once we have a working client that gets real attestation tokens from the system, we can move to using properly randomised nonces.

The key broker stores a single key called "skywalker", and its value decodes to "May the force be with you.". This is hard-coded in the initialisation path at the moment. It would be better to read these from an input config file so that multiple keys can be stored.

Signed-off-by: Paul Howard [email protected]

- Common types derived from OpenAPI specification.
- Server adopts popular actix_web framework and stubs out handlers for the contracts defined in OpenAPI specification.
- Veraison client integration code is sketched in but not working yet, possibly due to async/sync mismatch in programming styles.
- No key store or key wrapping code implemented yet - this is a very partial first commit.

Signed-off-by: Paul Howard <[email protected]>
Indicates how errors will be structured and mapped from inner-errors in the dependent libraries (using 'thiserror' crate). Use this to start stripping out some of the spurious unwrap() and expect() calls to reduce panic risks.

Signed-off-by: Paul Howard <[email protected]>
…running in an async context.

Veraison call-outs are now succeeding!

Signed-off-by: Paul Howard <[email protected]>
…ces and remembers the information about the requested key.

Challenges contain the state that needs to be remembered in between when the key access is first requested, and when the attestation evidence is submitted.
Challenges are remembered in a simple hash table with random u32 keys.

This code is not wired into the rest of the service yet.

Signed-off-by: Paul Howard <[email protected]>
…P handlers using shared application state.

Signed-off-by: Paul Howard <[email protected]>
…ugh still defaulting to the Linaro Veraison server.

Signed-off-by: Paul Howard <[email protected]>
Signed-off-by: Paul Howard <[email protected]>
@paulhowardarm paulhowardarm self-assigned this Aug 19, 2024
Copy link
Contributor

@thomas-fossati thomas-fossati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent stuff.

A bunch of random musings inlined :)

rust-keybroker/keybroker-common/src/lib.rs Show resolved Hide resolved
rust-keybroker/keybroker-server/src/main.rs Outdated Show resolved Hide resolved
rust-keybroker/keybroker-server/src/main.rs Show resolved Hide resolved
@thomas-fossati thomas-fossati merged commit d3a6950 into veraison:main Aug 21, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants