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

Add end-to-end test with docker compose and sample attester #283

Merged
merged 9 commits into from
Jan 12, 2024

Conversation

fitzthum
Copy link
Member

@fitzthum fitzthum commented Jan 10, 2024

In order to integrate the KBS/AS into the Kata CI, we need an easy way for people to deploy it. I think the docker compose approach might be best, but it had some problems and wasn't tested. This should fix that.

The test itself is not yet done. PR is still WIP.

Point the client tool to the most recent version of the
kbs-protocol (to pick up changes involving the sample attester).

Update the README with a few examples.

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
@fitzthum fitzthum requested a review from sameo as a code owner January 10, 2024 01:13
Copy link
Member

@Xynnn007 Xynnn007 left a comment

Choose a reason for hiding this comment

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

Thanks for the nice feature. Some nits at first glance. Hope that will not break your work

kbs/src/api/src/http/resource.rs Outdated Show resolved Hide resolved
Rework the docker compose yaml to build each component
rather than pulling the images from ghcr.

We might want to switch back to the pre-built images
(or introduce a second yaml file) for the release,
but for now we need the newest version.

When building the components from source, we pickup a number
of changes that need to be accounted for in the yaml files.

Move the yaml file to the top of the repo since it covers
all of the components. This also works best with the workspace.

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
Let's set a somewhat restrictive default by blocking
any resource requests made with sample evidence.

Also, add the `tee` field to the attestation token.
The `tcb-status` will contain the tee anyway,
but this makes it a little easier for a client to
write a policy, especially since different verifiers
will have different flattened claims.

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
@fitzthum fitzthum force-pushed the kbs-sample-test branch 25 times, most recently from 9ad2863 to 4781096 Compare January 11, 2024 01:13
@fitzthum fitzthum force-pushed the kbs-sample-test branch 10 times, most recently from 7a0a335 to d4453cc Compare January 11, 2024 03:07
Cargo.lock Outdated
@@ -2921,18 +2943,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"

[[package]]
name = "openssl-src"
version = "300.1.6+3.1.4"
Copy link
Member

Choose a reason for hiding this comment

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

The build error https://github.com/confidential-containers/kbs/actions/runs/7483975835/job/20370068894?pr=283#step:7:849 is caused by chaing the version and checksum here. Although Cargo will automatically update the rev here, but we'd better keep it as-is to make the csv building pass.

At the meantime, we are getting touch with csv colleagues to fix the upstream.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the tip!

@fitzthum fitzthum force-pushed the kbs-sample-test branch 3 times, most recently from 8136a75 to 2643a8a Compare January 11, 2024 20:52
Copy link
Member

@Xynnn007 Xynnn007 left a comment

Choose a reason for hiding this comment

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

Thanks for the great e2e test.

@@ -0,0 +1,73 @@
version: '3.2'
Copy link
Member

Choose a reason for hiding this comment

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

Once we move the docker-compose to the top directory, we might need add some contents to the top README to help the users who is not familiar with the project to use this? like a link to https://github.com/confidential-containers/kbs/blob/main/kbs/docs/cluster.md

wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have a number of changes to the docs planned, but I was thinking I would do that in a follow-up PR, especially so we can get the fix in this PR merged quickly. Does that work for you?

Copy link
Member

Choose a reason for hiding this comment

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

It works

Copy link
Member Author

Choose a reason for hiding this comment

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

See #287

We weren't actually checking the output of the policy engine.
This makes sure that the request is rejected if the policy
is not valid.

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
For testing we only need the sample attester.
Introduce a feature to skip building all the other ones
to avoid issues with network connectivity for certain
dependencies.

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
Includes a negative test to make sure that policy
validation does something.

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
the policy engine is very picky about the padding of
the policy.

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
Update the Cargo lock (or the e2e tests won't pass)

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
Now that the default policy does not allow the sample evidence,
update the e2e tests to set a permissive policy first.

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
@fitzthum fitzthum merged commit 1357e41 into confidential-containers:main Jan 12, 2024
11 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