Commit Graph

15773 Commits

Author SHA1 Message Date
Xynnn007
17d0db9865 agent: add initdata parse logic
Kata-agent now will check if a device /dev/vd* with 'initdata' magic
number exists. If it exists, kata-agent will try to read it. Bytes 9~16
are the length of the compressed initdata toml in little endine.
Bytes starting from 17 is the compressed initdata.

The initdata image device layout looks like

0        8      16    16+length ...         EOF
'initdata'  length gzip(initdata toml) paddings

The initdata will be parsed and put as aa.toml, cdh.toml and
policy.rego to /run/confidential-containers/initdata.

When AgentPolicy is initialized, the default policy will be overwritten
by that.

When AA is to be launched, if initdata is once processed, the launch arg
will include --initdata parameter.

Also, if
/run/confidential-containers/initdata/aa.toml exists, the launch args
will include -c /run/confidential-containers/initdata/aa.toml.

When CDH is to be launched, if initdata is once processed, the launch
args will include -c /run/confidential-containers/initdata/cdh.toml

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
2025-04-10 13:09:51 +08:00
stevenhorsman
75dc4ce3bf doc: Update required job process
Add information about using required-tests.yaml
as a way to track jobs that are required.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-09 18:13:45 +01:00
Steve Horsman
0dbf4ec39f
Merge pull request #10678 from stevenhorsman/update-gatekeeper-rules-for-md-only-PRs
ci: Update gatekeeper tests for md files
2025-04-09 18:10:05 +01:00
stevenhorsman
d1d60cfe89 ci: Update gatekeeper tests for md files
Update the required-tests.yaml so that .md files only
trigger the static tests, not the build, or CI

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-09 17:55:27 +01:00
Steve Horsman
9b401cd250
Merge pull request #11090 from stevenhorsman/required-test-updates
ci: required-tests fixes/updates
2025-04-09 14:41:57 +01:00
stevenhorsman
576747b060 ci: Skip tests if we only update the required list
When making new tests required, or removing existing tests
from required, this doesn't impact the CI jobs, so we don't need
to run all the tests.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-09 14:22:47 +01:00
stevenhorsman
9a7c5b914e ci: required-tests fixes/updates
- Remove metrics setup job
- Update some truncation typos of job names
- Add shellcheck-required
- Remove the ok-to-test as a required label on the build test
as it isn't needed as a trigger

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-09 14:22:37 +01:00
Xuewei Niu
5774f131ec
Merge pull request #10938 from Apokleos/fix-iommugrp-symlink
runtime-rs: Simplify iommu group base name extraction from symlink
2025-04-09 19:23:48 +08:00
Xuewei Niu
fd9a4548ab
Merge pull request #11129 from RuoqingHe/entend-runtime-rs-workspace
runtime-rs: Extend runtime-rs workspace and centralize local dependencies
2025-04-09 19:23:15 +08:00
stevenhorsman
6603cf7872 agent: Update vsock-exporter to use workspace settings
To reduce duplication, we could update
the vsock-exporter crate to use settings and versions
 from the agent, where applicable.
> [!NOTE]
> In order to use the workspace, this has bumped some crate versions

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-09 12:02:43 +01:00
stevenhorsman
2cb9fd3c69 agent: Update rustjail to use workspace settings
- To reduce duplication, we could update
the rustjail crate to use settings and versions
from the agent, where applicable.
- Also switch to using the derive feature in serde crate
rather than the separate serde_derive to avoid keeping
both versions in sync

> [!NOTE]
> In order to use the workspace, this has bumped
some crate versions

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-09 12:02:43 +01:00
stevenhorsman
655255b50c agent: Update policy to use workspace settings
To reduce duplication, we could update
the policy crate to use settings and versions
from the agent, where applicable.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-09 11:42:05 +01:00
stevenhorsman
1bec432ffa agent: Create workspace package and dependencies
- Create agent workspace dependencies and packge info
so that the packages in the workspace can use them
- Group the local dependencies together for clarity
(like in #11129)

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-09 11:42:00 +01:00
Ruoqing He
28c09ae645 runtime-rs: Put local dependencies into workspace
Put local dependencies into workspace to avoid complex path dependencies all
over the workspace. This gives an overview of local dependencies this workspace
uses, where those crates are located, and simplifies the local dependencies
referencing process.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-04-09 07:30:29 +00:00
Ruoqing He
3769ad9c0d runtime-rs: Group local dependencies
Judging by the layout of the `Cargo.toml` files, local dependencies are
intentionally separated from other dependencies, let's enforce it
workspace-wise.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-04-09 03:52:16 +00:00
Ruoqing He
abb5fb127b runtime-rs: Extend workspace to cover all crates
Only `shim` and `shim-ctl` are incorporated in `runtime-rs`'s workspace, let's
extend it to cover all crates in `runtime-rs/crates`.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-04-09 03:51:48 +00:00
alex.lyn
58bebe332a runtime-rs: Simplify iommu group base name extraction from symlink
Just get base name from iommu group symlink is enough. As the
validation will be handled in subsequent steps when constructing
the full path /sys/kernel/iommu_groups/$iommu_group.

In this PR, it will remove dupicalted validation of iommu_group.

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-04-09 09:28:00 +08:00
Steve Horsman
8df271358e
Merge pull request #11128 from stevenhorsman/disable-metrics-jobs
ci: Remove metric jobs
2025-04-08 18:16:35 +01:00
stevenhorsman
e6cca9da6d ci: Remove metric jobs
The metrics runner is broken, so skip the metrics
jobs to stop the CI being stuck waiting.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-04-08 17:55:07 +01:00
RuoqingHe
713cbb0c62
Merge pull request #11121 from fidencio/topic/bump-kernel-lts
versions: Bump LTS kernel
2025-04-08 17:28:31 +08:00
Xuewei Niu
d3c9cc4e36
Merge pull request #11014 from teawater/mem-agent-doc
docs: Add how-to-use-memory-agent.md to howto
2025-04-08 17:20:25 +08:00
Fabiano Fidêncio
a40b919afe
Merge pull request #10724 from likebreath/0109/upgrade_clh_v43.0
versions: Upgrade to Cloud Hypervisor v45.0
2025-04-08 08:11:30 +02:00
Fabiano Fidêncio
bc04c390bd versions: Bump LTS kernel
6.12.22 has been released Yesterday, let's bump to it.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-04-07 21:46:29 +02:00
Bo Chen
ee84068aed versions: Upgrade to Cloud Hypervisor v45.0
Details of this release can be found in our roadmap project as iteration
v45.0: https://github.com/orgs/cloud-hypervisor/projects/6.

Fixes: #10723

Signed-off-by: Bo Chen <bchen@crusoe.ai>
Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-04-07 20:33:34 +02:00
Dan Mihai
8779abd0a1
Merge pull request #11057 from mythi/tdx-qgs-uds
runtime: qemu: add support to use TDX QGS via Unix Domain Sockets
2025-04-07 07:27:48 -07:00
Dan Mihai
e606a8deb5
Merge pull request #11103 from Ankita13-code/ankitapareek/policy-input-validation
policy: Add missing input validations for ExecProcessRequest
2025-04-07 07:26:24 -07:00
Steve Horsman
ba92639481
Merge pull request #11094 from RuoqingHe/2025-03-28-enable-riscv-assets-build
ci: Enable `build-kata-static-tarball-riscv64.yaml`
2025-04-07 11:26:15 +01:00
Fabiano Fidêncio
c75ea2582e
Merge pull request #11114 from fidencio/topic/allow-building-the-agent-without-enabling-guest-pull
agent: Allow users to build without guest-pull
2025-04-06 12:17:27 +01:00
Fabiano Fidêncio
e3c98a5ac7 agent: Allow users to build without guest-pull
For those not interested in CoCo, let's at least allow them to easily
build the agent without the guest-pull feature.

This reduces the binary size (already stripped) from 25M to 18M.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-04-04 22:58:43 +01:00
Ankita Pareek
7e450bc1c2 policy: Add missing input validations for ExecProcessRequest
This commit introduces missing validations for input fields in ExecProcessRequest to
harden the security policy.

The changes include:
- Update rules.rego to add null/empty field enforcements for String_user, SelinuxLabel and ApparmorProfile
- Add unit test cases for ExecProcessRequest for each of the validations

Signed-off-by: Ankita Pareek <ankitapareek@microsoft.com>
2025-04-03 12:53:59 +00:00
Hui Zhu
17af28acad docs: Add how-to-use-memory-agent.md to howto
Add how-to-use-memory-agent.md (How to use mem-agent to decrease the
memory usage of Kata container) to docs to show how to use mem-agent.

Fixes: #11013

Signed-off-by: Hui Zhu <teawater@gmail.com>
2025-04-02 17:45:59 +08:00
Lukáš Doktor
009aa6257b
ci.ocp: Override default runtimeclass CPU resources
some of the e2e tests spawn a lot of workers which are mainly idle, but
the scheduler fails to schedule them due to cpu resource overcommit. For
our testing we are more focused on having actual pods running than the
speed of the scheduled pods so let's increase the amount of schedulable
pods by decreasing the default cpu requests.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
2025-04-02 10:30:40 +02:00
RuoqingHe
2f134514b0
Merge pull request #11097 from kimullaa/robust-user-input
kata-deploy: add INSTALLATION_PREFIX validation
2025-04-02 10:05:03 +08:00
Ruoqing He
96e43fbee5 ci: Enable build-kata-static-tarball-riscv64.yaml
Previously we introduced `build-kata-static-tarball-riscv64.yaml`,
enable that workflow in `ci.yaml`.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-04-01 16:35:14 +08:00
RuoqingHe
10ceeb0930
Merge pull request #11104 from fidencio/topic/kata-deploy-create-runtimeclasses-by-default
kata-deploy: Create runtimeclasses by default
2025-04-01 10:55:44 +08:00
RuoqingHe
b19a8c7b1c
Merge pull request #11066 from kimullaa/update-command-sample
kernel: Update the usage in readme
2025-04-01 09:12:43 +08:00
RuoqingHe
b046f79d06
Merge pull request #11100 from kimullaa/remove-double-slash
kata-deploy: remove the double "/"
2025-04-01 08:17:00 +08:00
Shunsuke Kimura
a05f5f1827 kata-deploy: add INSTALLATION_PREFIX validation
INSTALLATION_PREFIX must begin with a "/"
because it is being concatenated with /host.

If there is no /, displays a message and makes an error.

Fixes: #11096

Signed-off-by: Shunsuke Kimura <pbrehpuum@gmail.com>
2025-04-01 06:47:30 +09:00
Shunsuke Kimura
a49b6f8634 kata-deploy: Moves the function to the top
Move functions that may be used in validation to the top.

Fixes: #11097

Signed-off-by: Shunsuke Kimura <pbrehpuum@gmail.com>
2025-04-01 06:47:30 +09:00
Zvonko Kaiser
d81a1747bd
Merge pull request #11085 from kevinzs2048/fix-virtiomem
runtime-go: qemu: Fix sandbox start failing with virtio-mem enable on arm64
2025-03-31 17:09:43 -04:00
Zvonko Kaiser
e5c4cfb8a1
Merge pull request #11081 from BbolroC/unsealed-secret-fix
tests: Enable sealed secrets for all TEEs
2025-03-31 11:19:52 -04:00
Shunsuke Kimura
c0af0b43e0 kernel: Update the outdated usage in the readme
Since it is difficult to update the README when modifying the options of ./build-kernel.sh,
instead of update the README, we encourage users to run the -h command.

Fixes: #11065

Signed-off-by: Shunsuke Kimura <pbrehpuum@gmail.com>
2025-03-31 23:29:58 +09:00
Shunsuke Kimura
902cb5f205 kata-deploy: remove the double "/"
Currently, ConfigPath in containerd.toml is a double "/" as follows.

```
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.kata-clh.options]
ConfigPath = "/opt/kata/share/defaults/kata-containers//configuration-clh.toml"
...
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.kata-cloud-hypervisor.options]
ConfigPath = "/opt/kata/share/defaults/kata-containers//runtime-rs/configuration-cloud-hypervisor.toml"
...
```

So, removed the double "/".

Fixes: #11099

Signed-off-by: Shunsuke Kimura <pbrehpuum@gmail.com>
2025-03-31 22:31:36 +09:00
Fabiano Fidêncio
28be53ac92 kata-deploy: Create runtimeclasses by default
Let's make the life of the users easier and create the runtimeclasses
for them by default.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-03-31 11:29:44 +01:00
Xuewei Niu
abbc9c6b50
Merge pull request #11101 from RuoqingHe/runtime-rs-fix-fmt-check
runtime-rs: Remove redundant empty line
2025-03-31 16:28:55 +08:00
Ruoqing He
3c78c42ea5 runtime-rs: Remove redundant empty line
While running `cargo fmt -- --check` in `src/runtime-rs` directory, it
errors out and suggesting these is an redundant empty line, which
prevents `make check` of `runtime-rs` component from passing.

Remove redundant empty line to fix this.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-31 00:39:04 +08:00
Steve Horsman
44bab5afc4
Merge pull request #11091 from fidencio/topic/ci-add-kata-deploy-tests-as-required
gatekeeper: Add kata-deploy tests as required
2025-03-28 11:05:03 +00:00
Fabiano Fidêncio
5a08d748b9
Merge pull request #11088 from kimullaa/fix-cleanup-failure
kata-deploy: Fix kata-cleanup's CrashLoopBackOff
2025-03-27 20:33:52 +01:00
Fabiano Fidêncio
700944c420 gatekeeper: Add kata-deploy tests as required
kata-deploy tests have been quite stable, working for more than 10 days
without any nightly failure (or any failure reported at all), and I'll
be the one maintaining those.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-03-27 19:47:38 +01:00
Steve Horsman
97bd311a66
Merge pull request #11058 from stevenhorsman/required-static-checks-rename
ci: Update static-checks strings
2025-03-27 12:56:28 +00:00