Commit Graph

14358 Commits

Author SHA1 Message Date
Fabiano Fidêncio
40d385d401
Merge pull request #10188 from wainersm/kbs_key
tests/k8s: check and save kbs.key
2024-08-19 23:29:10 +02:00
Wainer dos Santos Moschetta
e014eee4e8 tests/k8s: check and save kbs.key
The deploy-kbs.sh script generates the kbs.key that's used to install
KBS. This same file is used lately by kbs-client to authenticate. This ensures
that the file was created, otherwise fail.

Another problem solved here is that on bare-metal machines the key doesn't survive
a reboot as it is created in a temporary directory (/tmp/trustee). So let's save
the file to a non-temporary location.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-08-19 16:03:03 -03:00
Wainer Moschetta
6a982930e2
Merge pull request #10183 from fidencio/topic/kata-deploy-use-runtime_path
kata-deploy: Stop symlinking into /usr/local/bin
2024-08-19 13:17:21 -03:00
Fabiano Fidêncio
42d48efcc2
Merge pull request #10181 from fidencio/topic/ci-fix-stdio-typo
ci: stdio: Fix typo on getting the containerd version
2024-08-18 16:05:42 +02:00
Fabiano Fidêncio
e0ae398a2e
Merge pull request #10151 from squarti/rootdir2
runtime: Files are not synced between host and guest VMs
2024-08-18 12:32:52 +02:00
Fabiano Fidêncio
d03b72f19b
kata-deploy: Stop linking binaries to /usr/local/bin
Neither CRI-O nor containerd requires that, and removing such symlinks
makes everything less intrusive from our side.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-18 01:25:12 +02:00
Fabiano Fidêncio
c2393dc467
kata-deploy: Use shim's absolute path for crio's runtime_path
This will allow us, in the future, not have to do symlinks here and
there.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-18 01:25:12 +02:00
Fabiano Fidêncio
58623723b1
kata-deploy: Use runtime_path for containerd
It's already being used with CRi-O, let's simplify what we do and also
use this for containerd, which will allow us to do further cleanups in
the coming patches.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-18 01:25:12 +02:00
Fabiano Fidêncio
e75c149dec
ci: stdio: Properly start running the test
"gha-run.sh" requires a `run` argument in order to run the tests, which
seems to be forgotten when the test was added.

This PR needs to get merged before the test can successfully run.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-17 14:41:44 +02:00
Fabiano Fidêncio
dd2d9e5524
ci: stdio: Fix typo on getting the containerd version
I assume the PR that introduced this was based on an older version of
yq, and as the test couldn't run before it got merged we never noticed
the error.

However, this test has been failing for a reasonable amount of time,
which makes me think that we either need a maintainer for it, or just
remove it completely, but that's a discussion for another day.

For now, let's make it, at least, run.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-17 14:06:24 +02:00
Fabiano Fidêncio
7113490cb1
Merge pull request #10179 from fidencio/topic/switch-nginx-image
ci: k8s: Replace nginx alpine images
2024-08-17 13:07:31 +02:00
Fabiano Fidêncio
0831081399
ci: k8s: Replace nginx alpine images
The previous ones are gone, so let's switch to our own multi-arch image
for the tests.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-17 12:19:33 +02:00
Fabiano Fidêncio
a78d82f4f1
Merge pull request #10159 from squarti/main
agent: Handle EINVAL error when umounting container rootfs
2024-08-16 22:07:50 +02:00
Dan Mihai
79c1d0a806
Merge pull request #10136 from microsoft/danmihai1/docker-image-volume2
genpolicy: add bind mounts for image volumes
2024-08-16 13:07:01 -07:00
Fabiano Fidêncio
28aa4314ba
Merge pull request #10175 from ChengyuZhu6/error_message
runtime: Add specific error message for gRPC request timeouts
2024-08-16 22:06:49 +02:00
Fabiano Fidêncio
720edbe3fc
Merge pull request #10174 from ChengyuZhu6/install_script
tools: install luks-encrypt-storage script by guest-components
2024-08-16 22:04:56 +02:00
Fabiano Fidêncio
7b5da45059
Merge pull request #10178 from fidencio/topic/revert-trustee-bump
Revert "version: bump trustee version"
2024-08-16 21:48:30 +02:00
Fabiano Fidêncio
45f43e2a6a
Revert "version: bump trustee version"
This reverts commit d35320472c.

Although the commit in question does solve an issue related to the usage
of busybox from docker.io, as it's reasonably easy to hit the rate
limit, the commit also brings in functionalities that are causing issues
in, at least, the TDX CI, such as:
```sh
[2024-08-16T16:03:52Z INFO  actix_web::middleware::logger] 10.244.0.1 "POST /kbs/v0/attest HTTP/1.1" 401 259 "-" "attestation-agent-kbs-client/0.1.0" 0.065266
[2024-08-16T16:03:53Z INFO  kbs::http::attest] Auth API called.
[2024-08-16T16:03:53Z INFO  actix_web::middleware::logger] 10.244.0.1 "POST /kbs/v0/auth HTTP/1.1" 200 74 "-" "attestation-agent-kbs-client/0.1.0" 0.000169
[2024-08-16T16:03:54Z INFO  kbs::http::attest] Attest API called.
[2024-08-16T16:03:54Z INFO  verifier::tdx] Quote DCAP check succeeded.
[2024-08-16T16:03:54Z INFO  verifier::tdx] MRCONFIGID check succeeded.
[2024-08-16T16:03:54Z INFO  verifier::tdx] CCEL integrity check succeeded.
[2024-08-16T16:03:54Z ERROR kbs::http::error] Attestation failed: Verifier evaluate failed: TDX Verifier: failed to parse AA Eventlog from evidence

    Caused by:
        at least one line should be included in AAEL
```

Let's revert this for now, and then once we get this one fixed on
trustee side we'll update again.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-16 18:10:38 +02:00
Dan Mihai
c22ac4f72c genpolicy: add bind mounts for image volumes
Add bind mounts for volumes defined by docker container images, unless
those mounts have been defined in the input K8s YAML file too.

For example, quay.io/opstree/redis defines two mounts:
/data
/node-conf
Before these changes, if these mounts were not defined in the YAML file
too, the auto-generated policy did not allow this container image to
start.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-08-16 15:11:05 +00:00
Fabiano Fidêncio
b203f715e5
Merge pull request #10170 from beraldoleal/deploy-reset-fix
kata-deploy: fix kata-deploy reset
2024-08-16 16:51:14 +02:00
Fabiano Fidêncio
8d63723910
Merge pull request #10161 from microsoft/saulparedes/ignore_role_resource
genpolicy: ignore Role resource
2024-08-16 16:50:16 +02:00
Fabiano Fidêncio
6c58ae5b95
Merge pull request #10171 from fidencio/topic/ci-treat-nydus-snapshotter-as-a-dep
ci: nydus: Treat the snapshotter as a dependency
2024-08-16 16:39:48 +02:00
ChengyuZhu6
1eda6b7237 tests: update error message with guest pulling image timeout
update error message with guest pulling image timeout.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-16 20:26:33 +08:00
ChengyuZhu6
ca05aca548 runtime: Add specific error message for gRPC request timeouts
Improved error handling to provide clearer feedback on request failures.

For example:
Improve createcontainer request timeout error message from
"Error: failed to create containerd task: failed to create shim task:context deadline exceed"
to "Error: failed to create containerd task: failed to create shim task: CreateContainerRequest timed out: context deadline exceed".

Fixes: #10173 -- part II

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-16 20:24:48 +08:00
Beraldo Leal
b3a4cd1a06
Merge pull request #10172 from deagon/fix-typo
osbuilder: fix typo in ubuntu rootfs depends
2024-08-16 08:01:59 -04:00
Beraldo Leal
b843b236e4 kata-deploy: improve kata-deploy script
For the rare cases where containerd_conf_file does not exist, cp could fail
and let the pod in Error state. Let's make it a little bit more robust.

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2024-08-16 07:52:38 -04:00
ChengyuZhu6
aa31a9d3c4 tools: install luks-encrypt-storage script by guest-components
Install luks-encrypt-storage script by guest-components. So that we can maintain a single source and prevent synchronization issues.

Fixes: #10173 -- part I

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-16 16:28:20 +08:00
Chengyu Zhu
ba3c484d12
Merge pull request #9999 from ChengyuZhu6/trusted-storage
Trusted image storage
2024-08-16 15:39:50 +08:00
Fabiano Fidêncio
0f3eb2451e
Merge pull request #10169 from fidencio/topic/revert-reset_runtime-to-cleanup
Revert "ci: add reset_runtime to cleanup"
2024-08-16 07:29:58 +02:00
Aurélien Bombo
e1775e4719
Merge pull request #10164 from BbolroC/make-exec_host-stable
tests: Ensure exec_host() consistently captures command output
2024-08-15 21:43:32 -07:00
Guoqiang Ding
1d21ff9864 osbuilder: fix typo in ubuntu rootfs depends
Remove the duplicate package "xz-utils".

Signed-off-by: Guoqiang Ding <dgq8211@gmail.com>
2024-08-16 11:33:55 +08:00
Silenio Quarti
5d815ffde1 runtime: Files are not synced between host and guest VMs
This PR resolves the default kubelet root dir symbolic link and
uses it as the absolute path for the fs watcher regexs

Fixes: https://github.com/kata-containers/kata-containers/issues/9986

Signed-off-by: Silenio Quarti <silenio_quarti@ca.ibm.com>
2024-08-15 23:19:08 -04:00
Silenio Quarti
0dd16e6b25 agent: Handle EINVAL error when umounting container rootfs
Container/Sandbox clean up should not fail if root FS is not mounted.
This PR handles EINVAL errors when umount2 is called.

Fixes: #10166

Signed-off-by: Silenio Quarti <silenio_quarti@ca.ibm.com>
2024-08-15 19:41:46 -04:00
Fabiano Fidêncio
3733266a60
ci: nydus: Treat the snapshotter as a dependency
Instead of deploying and removing the snapshotter on every single run,
let's make sure the snapshotter is always deploy on the TDX case.

We're doing this as an experiment, in order to see if we'll be able to
reduce the failures we've been facing with the nydus snapshotter.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-15 22:44:30 +02:00
Hyounggyu Choi
ba3e5f6b4a Revert "tests: Disable k8s file volume test"
This reverts commit e580e29246.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-08-15 21:10:39 +02:00
Hyounggyu Choi
758e650a28 tests: Ensure exec_host() consistently captures command output
The `exec_host()` function often fails to capture the output of a given command
because the node debugger pod is prematurely terminated. To address this issue,
the function has been refactored to ensure consistent output capture by adjusting
the `kubectl debug` process as follows:

- Keep the node debugger pod running
- Wait until the pod is fully ready
- Execute the command using `kubectl exec`
- Capture the output and terminate the pod

This commit refactors `exec_host()` to implement the above steps, improving its reliability.

Fixes: #10081

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-08-15 21:10:39 +02:00
Beraldo Leal
74662a0721
Merge pull request #10137 from hex2dec/fix-image-warning
tools: Fix container image build warning
2024-08-15 14:45:41 -04:00
Dan Mihai
905c76bd47
Merge pull request #10153 from microsoft/saulparedes/support_cron_job
genpolicy: Add support for cron jobs
2024-08-15 11:11:00 -07:00
Aurélien Bombo
0223eedda5
Merge pull request #10050 from burgerdev/request-hardening
genpolicy: hardening some agent requests
2024-08-15 08:31:21 -07:00
Fabiano Fidêncio
1f6a8baaf1 Revert "ci: add reset_runtime to cleanup"
This reverts commit 8d9bec2e01, as it
causes issues in the operator and kata-deploy itself, leading to the
node to be NotReady.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-08-15 16:09:34 +02:00
ChengyuZhu6
5f4209e008 agent:README: add secure_image_storage_integrity to agent's README
add secure_image_storage_integrity to agent's README.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 20:32:44 +08:00
ChengyuZhu6
6ecb2b8870 tests: skip test trusted storage in qemu-coco-dev
I can't set up loop device with `exec_host`, which the command is
necessary for qemu-coco-dev. See issue #10133.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 20:32:44 +08:00
ChengyuZhu6
51b9d20d55 tests: update error message in pulling image encrypted tests
Update error message in pulling image encrypted to "failed to get decrypt key no suitable key found for decrypting layer key".

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 20:32:44 +08:00
ChengyuZhu6
b4d10e7655 version: update the version of coco-guest-components
update the version of coco-guest-components.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 20:32:43 +08:00
Fupan Li
365df81d5e
Merge pull request #10148 from lifupan/main_sandboxapi
runtime-rs: Add the wait_vm support for hypervisors
2024-08-15 17:08:38 +08:00
ChengyuZhu6
a9b436f788 agent:cdh: Introduces secure_mount API in cdh
Introduces `secure_mount` API in the cdh. It includes:

- Adding the `SecureMountServiceClient`.
- Implementing the `secure_mount` function to handle secure mounting requests.
- Updating the confidential_data_hub.proto file to define SecureMountRequest and SecureMountResponse messages
  and adding the SecureMountService service.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 13:55:23 +08:00
ChengyuZhu6
1528d543b2 agent:cdh: Rename sealed_secret API namespace to confidential_data_hub
renames the sealed_secret.proto file to confidential_data_hub.proto and
updates the corresponding API namespace from sealed_secret to confidential_data_hub.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 13:55:23 +08:00
ChengyuZhu6
37bd2406e0 docs: add content about how to pull large image
Add content about how to pull large image in the guest with trust
storage.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 13:55:22 +08:00
ChengyuZhu6
c5a973e68c tests:k8s: add tests for guest pull with configured timeout
add tests for guest pull with configured timeout:
1) failed case: Test we cannot pull a large image that pull time exceeds a short creatcontainer timeout(10s) inside the guest
2) successful case: Test we can pull a large image inside the guest with increasing createcontainer timeout(120s)

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 13:55:22 +08:00
ChengyuZhu6
6c506cde86 tests:k8s: add tests for pull images in the guest using trusted storage
add tests for pull images in the guest using trusted storage:
1) failed case: Test we cannot pull an image that exceeds the memory limit inside the guest
2) successful case: Test we can pull an image inside the guest using
   trusted ephemeral storage.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-08-15 13:55:22 +08:00