Code Monkey home page Code Monkey logo

Comments (4)

Xynnn007 avatar Xynnn007 commented on August 15, 2024

KBS log on the CI machine

$ docker logs -f dc21822ee573
...
[2023-06-30T02:18:18Z INFO  actix_web::middleware::logger] 172.18.0.1 "POST /kbs/v0/attest HTTP/1.1" 200 1151 "-" "attestation-agent-kbs-client/0.1.0" 2.073529
[2023-06-30T02:18:18Z INFO  api_server::http::resource] Cookie bf7f999e6a6143f5af9576d4fbdea7a8 request to get resource
[2023-06-30T02:18:18Z INFO  api_server::http::resource] Resource description: ResourceDesc { repository_name: "default", resource_type: "image-kek", resource_tag: "11032d96-dccd-46a3-9244-93644d76745f" }
[2023-06-30T02:18:18Z INFO  actix_web::middleware::logger] 172.18.0.1 "GET /kbs/v0/resource/default/image-kek/11032d96-dccd-46a3-9244-93644d76745f HTTP/1.1" 200 532 "-" "attestation-agent-kbs-client/0.1.0" 0.000411

Shows that the key was successfully retrieved from KBS

from enclave-cc.

Xynnn007 avatar Xynnn007 commented on August 15, 2024

Let's check enclave-agent log to know how does it consume the key

root@iZj6cj2qap8uqto6jgvci1Z:/home/xynnn# cat  /run/containerd/agent-enclave/af41997bbf970c97a03ce674a2823be7adc48045f86a626035188ef689013547/stderr
[2023-06-30T02:18:09Z INFO  enclave_agent] ttRPC server started: "tcp://127.0.0.1:7788"
[2023-06-30T02:18:09Z INFO  enclave_agent::services::images] Pulling "ghcr.io/confidential-containers/test-container-enclave-cc:encrypted"
[2023-06-30T02:18:09Z INFO  image_rs::resource::kbs] secure channel uses native-aa
[2023-06-30T02:18:11Z INFO  kbs_protocol] CC-KBC: trying to request KBS, attempt 1
[2023-06-30T02:18:15Z INFO  kbs_protocol] CC-KBC: trying to request KBS, attempt 1
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `33`,
 right: `32`', /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/generic-array-0.14.6/src/lib.rs:565:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Seems that the symmetric key length is wrong. 32 Bytes (256 bits for AES256) expected but 33 bytes provided.

Check the key

root@iZj6cj2qap8uqto6jgvci1Z:/home/xynnn# ls -al kbs/data/kbs-storage/default/image-kek/11032d96-dccd-46a3-9244-93644d76745f 
-rw-r--r-- 1 root root 33 Jun 29 14:55 kbs/data/kbs-storage/default/image-kek/11032d96-dccd-46a3-9244-93644d76745f

shows that the file length is 33 not 32. Let's overwrite the key file with the one from https://github.com/confidential-containers/enclave-cc/blob/main/tools/packaging/build/test-image/Dockerfile#L13

echo LieOhvkqFcGMzZrVzt6vPWlj/F/bgYMNe45vhQpdxAA= | base64 -d > /home/xynnn/kbs/data/kbs-storage/default/image-kek/11032d96-dccd-46a3-9244-93644d76745f
```

from enclave-cc.

Xynnn007 avatar Xynnn007 commented on August 15, 2024

CI retriggered. https://github.com/confidential-containers/enclave-cc/actions/runs/5418442602

from enclave-cc.

Xynnn007 avatar Xynnn007 commented on August 15, 2024

Passed.

from enclave-cc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.