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

CP-39134: add filtering for vTPM API calls #4670

Conversation

edwintorok
Copy link
Contributor

swtpm runs in a sandbox and has access to a socket on which it can talk to XAPI.
xapi-guard is used to whitelist what API calls it can make, such that it can only access and change its own VM, and not other VMs.

This is already done for varstored and NVRAM API calls, implement filtering for VTPM API calls similarly.

Also add unit tests, and refactor/clean up the code a bit.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
…esting

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Check that basic API calls get forwarded

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Edwin Török <edvin.torok@citrix.com>
…e socket

This is the socket created by xapi-guard itself through Conduit,
but Conduit doesn't currently have an API to notify us when the socket
got created and listen()-ed on.
And we don't want to return too early to our caller
(the unit test or xenopsd) since they may get an ECONNREFUSED if they
try to connect too early.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Instead of `foo () >>= fun result -> ...` use `let* result = foo () in ...`.
Instead of `foo () >|= fun result -> ...` use `let+ result = foo () in ...`.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Edwin Török <edvin.torok@citrix.com>
@psafont
Copy link
Member

psafont commented Jun 28, 2022

Are there salvageable commits here?

(I was thinking about the unit-testing)

@edwintorok edwintorok closed this Jul 5, 2022
@edwintorok edwintorok reopened this Jul 5, 2022
@edwintorok edwintorok closed this Jul 5, 2022
@edwintorok
Copy link
Contributor Author

Opened ticket to salvage unit tests

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