Commit Graph

15974 Commits

Author SHA1 Message Date
Wainer dos Santos Moschetta
c9fb0b9c85 tests/k8s: fix shellcheck SC2154 in confidential_kbs.sh
Fixed "warning: HKD_PATH is referenced but not assigned. [SC2154]"

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2025-05-22 15:02:20 -03:00
Wainer dos Santos Moschetta
68d91d759a tests/k8s: add set -e to confidential_ksh.sh
Although the script will inherit that setting from the caller scripts,
expliciting it in the file will vanish shellcheck "warning: Use 'pushd
... || exit' or 'pushd ... || return' in case pushd fails. [SC2164]"

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2025-05-22 14:55:24 -03:00
Wainer dos Santos Moschetta
b4adfcb3cb tests/k8s: apply shellcheck tips to confidential_kbs.sh
Addressed the following shellcheck advices:

SC2046 (warning): Quote this to prevent word splitting.
SC2248 (style): Prefer double quoting even when variables don't contain special characters
SC2250 (style): Prefer putting braces around variable references even when not strictly required.
SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2025-05-22 14:52:38 -03:00
Steve Horsman
f8c5aa6df6
Merge pull request #11259 from fitzthum/bump-gc-0140
Update Trustee and Guest Components for CoCo v0.14.0
2025-05-20 18:05:17 +01:00
Steve Horsman
b4aa1e3fbd
Merge pull request #11279 from skazi0/repo-components
osbuilder: ubuntu: Add REPO_COMPONENTS setting
2025-05-20 16:03:48 +01:00
Sumedh Alok Sharma
9a4432d197
Merge pull request #11233 from Ankita13-code/ankitapareek/execprocess-additional-input-validation
genpolicy: validate input process fields for ExecProcessRequest
2025-05-20 20:11:41 +05:30
Jacek Tomasiak
91fb4353f6
osbuilder: ubuntu: Add REPO_COMPONENTS setting
Added variable REPO_COMPONENTS (default: "main") which sets components
used by mmdebstrap for rootfs building.
This is useful for custom image builders who want to include EXTRA_PKGS
from components other than the default "main" (e.g. "universe").

Fixes: #11278
Signed-off-by: Jacek Tomasiak <jtomasiak@arista.com>
Signed-off-by: Jacek Tomasiak <jacek.tomasiak@gmail.com>
2025-05-20 14:01:48 +02:00
Fabiano Fidêncio
29099d139b
Merge pull request #11280 from kata-containers/dependabot/cargo/src/tools/kata-ctl/ring-0.17.14
build(deps): bump ring from 0.17.5 to 0.17.14 in /src/tools/kata-ctl
2025-05-20 13:47:22 +02:00
Fabiano Fidêncio
0bc0623037
Merge pull request #11277 from skazi0/repo-url
osbuilder: ubuntu: Expose REPO_URL variables
2025-05-20 13:46:01 +02:00
Ankita Pareek
ad75595dc8 genpolicy: Add tests for various input validations for ExecProcessRequest
These additional tests cover edge cases specific to-
- Terminal validation
- Capabilities validation
- Working directory (Cwd) validation
- NoNewPrivileges validation
- User validation
- Environment variables validation

Signed-off-by: Ankita Pareek <ankitapareek@microsoft.com>
2025-05-20 11:19:55 +00:00
Saul Paredes
1e466bf39c genpolicy: fix validation of env variables sourced from metadata.namespace
Use $(sandbox-namespace) wildcard in case none is specified in yaml. If wildcard is present, compare
input against annotation value.

Fixes regression introduced in https://github.com/microsoft/kata-containers/pull/273
where samples that use metadata.namespace env var were no longer working.

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2025-05-20 11:19:46 +00:00
Dan Mihai
a113b9eefd genpolicy: validate probe process fields
Validate more process fields for k8s probe commands - e.g.,
livenessProbe, readinessProbe, etc.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-05-20 11:15:30 +00:00
Dan Mihai
c0b8c6ed5e genpolicy: validate process for commands from settings
Validate more process fields for commands enabled using the
ExecProcessRequest "commands" and/or "regex" fields from the
settings file.
Add function to get the container from state based on container_id
matching instead of matching it against every policy container data

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
Signed-off-by: Ankita Pareek <ankitapareek@microsoft.com>
2025-05-20 11:15:30 +00:00
Dan Mihai
6f78aaa411 genpolicy: use process inputs for allow_process()
Using process data inputs for allow_process() is easier to
read/understand compared with the older OCI data inputs.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-05-20 11:15:30 +00:00
Steve Horsman
2871c31162
Merge pull request #11273 from mythi/tdx-qemu-params
config: update QEMU TDX configuration
2025-05-20 10:22:59 +01:00
Steve Horsman
4b317dddfa
Merge pull request #11271 from stevenhorsman/gatekeeper-truncate-names
ci: gatekeeper: Require names update
2025-05-20 10:20:05 +01:00
Fupan Li
9a03815f18
Merge pull request #11095 from lifupan/ephemeral_volume
runtime-rs: add the ephemeral memory based volume support
2025-05-20 09:18:34 +08:00
RuoqingHe
5b5c71510e
Merge pull request #11093 from kimullaa/fix-err-when-containerd-conf-does-not-exist
kata-deploy: fix bug when config does not exist
2025-05-19 18:12:50 +02:00
Steve Horsman
cfdccaacb3
Merge pull request #11283 from Rtoax/p002-fix-typo
config: Fix typos
2025-05-19 14:59:37 +01:00
RuoqingHe
93b44f920c
Merge pull request #11287 from bpradipt/remote-hyp-logging
runtime: Fix logging for remote hypervisor
2025-05-19 15:49:15 +02:00
Shunsuke Kimura
9a8d64d6b1 kata-deploy: execute in the host environment
`containerd` command should be executed in the host environment.
(To generate the config that matches the host's containerd version.)

Fixes: #11092

Signed-off-by: Shunsuke Kimura <pbrehpuum@gmail.com>
2025-05-19 21:42:21 +09:00
Shunsuke Kimura
d3edc90d80 kata-deploy: Fix condition always true
if config.toml does not exist,
`[ -x $(command -v containerd) ]` will always True
(Because it is not enclosed in "").

```
// current code
$ [ -x $(command -v containerd_notfound) ]
$ echo $?
0

// maybe expected code
$ [ -x "$(command -v containerd_notfound)" ]
$ echo $?
1
```

Fixes: #11092

Signed-off-by: Shunsuke Kimura <pbrehpuum@gmail.com>
2025-05-19 21:42:21 +09:00
Pradipta Banerjee
9f9841492e runtime: Fix logging for remote hypervisor
Need to use hvLogger

Fixes: #11286

Signed-off-by: Pradipta Banerjee <pradipta.banerjee@gmail.com>
2025-05-19 07:01:59 -04:00
Jacek Tomasiak
da6860a632
osbuilder: ubuntu: Expose REPO_URL variables
This exposes REPO_URL and adds REPO_URL_X86_64 which can be set to use
custom Ubuntu repo for building rootfs.
If only one architecture is built, REPO_URL can be set. Otherwise,
REPO_URL_X86_64 is used for x86_64 arch and REPO_URL for others.

Fixes: #11276
Signed-off-by: Jacek Tomasiak <jtomasiak@arista.com>
Signed-off-by: Jacek Tomasiak <jacek.tomasiak@gmail.com>
2025-05-19 12:41:49 +02:00
Rong Tao
914730d948 config: Fix typos
devie should be device

Signed-off-by: Rong Tao <rongtao@cestc.cn>
2025-05-19 14:19:22 +08:00
Alex Lyn
305a5f5e41
Merge pull request #10578 from Apokleos/pcie-port-devices
runtime-rs: Introduce PCIe Port devices in runtime-rs for qemu-rs
2025-05-18 21:10:25 +08:00
Dan Mihai
b9651eadab
Merge pull request #11214 from microsoft/cameronbaird/address-gid-mismatch-additionalgids
genpolicy: Enable AdditionalGids checks in rules.rego
2025-05-16 10:15:53 -07:00
dependabot[bot]
a2c7e48e0e
build(deps): bump ring from 0.17.5 to 0.17.14 in /src/tools/kata-ctl
Bumps [ring](https://github.com/briansmith/ring) from 0.17.5 to 0.17.14.
- [Changelog](https://github.com/briansmith/ring/blob/main/RELEASES.md)
- [Commits](https://github.com/briansmith/ring/commits)

---
updated-dependencies:
- dependency-name: ring
  dependency-version: 0.17.14
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-16 14:51:20 +00:00
Fabiano Fidêncio
9e11b2e577
Merge pull request #11274 from fidencio/topic/arm-ci-k8s-enable-hotplug-tests
ci: k8s: arm: Enable skipped tests
2025-05-16 13:19:18 +02:00
Fabiano Fidêncio
219d6e8ea6
Merge pull request #11257 from mythi/coco-guest-hardening
confidential guest kernel hardening changes
2025-05-16 08:52:36 +02:00
Fabiano Fidêncio
86d2d96d4a ci: k8s: arm: Enable skipped tests
Now that memory hotplug should work, as we're using a firmware that
supports that, let's re-enable the tests that rely on hotplug.

Fixes: #10926, #10927

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-05-16 03:02:32 +02:00
Fabiano Fidêncio
02ce395a69
Merge pull request #11272 from seungukshin/enable-edk2-for-arm64
Enable edk2 for arm64
2025-05-15 20:59:56 +02:00
Cameron Baird
7bba7374ec genpolicy: Add retries to policy generation
As the genpolicy from_files call makes network requests to container
registries, it has a chance to fail.

Harden us against flakes due to network by introducing a 6x retry loop
in genpolicy tests.

Signed-off-by: Cameron Baird <cameronbaird@microsoft.com>
2025-05-15 18:12:50 +00:00
Steve Horsman
d21d2a0657
Merge pull request #11265 from chathuryaadapa/bumpalo-crate-bump
Bump: libz-sys crate to address CVE
2025-05-15 16:18:00 +01:00
Mikko Ylinen
ff851202e6 config: update QEMU TDX configuration
Drop '-vmx-rdseed-exit' from '-cpu host' QEMU options. The history
of it is unknown but it's likely related to early TDX enablement.

TD pods start up fine without it (tested by manually editing the
configuration file) and it's also not used elsewhere.

Keep TDXCPUFEATURES for now in case a need for it shows up later.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-05-15 15:43:24 +03:00
Fabiano Fidêncio
676e66ae49
Merge pull request #11246 from skazi0/mmdebstrap
osbuilder: ubuntu: Switch from multistrap to mmdebstrap
2025-05-15 14:15:37 +02:00
alex.lyn
07533522b8 runtime-rs: Handle PortDevice devices when invoke start_vm with Qemu
Extract PortDevice relevant information, and then invoke different
processing methods based on the device type.

Fixes #10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-15 20:10:49 +08:00
alex.lyn
c109328097 runtime-rs: Introduce pcie root port and switch port in qemu-rs cmdline.
Some data structures and methods are introduced to help handle vfio devices.
And mothods add_pcie_root_ports and add_pcie_switch_ports follow runtime's
related implementations of vfio devices.

Fixes #10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-15 20:10:49 +08:00
alex.lyn
47c7ba8672 runtime-rs: Prepare pcie port devices before start sandbox
Prepare pcie port devices before starting VM with the help of
device manager and PCIe Topology.

Fixes #10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-15 20:10:49 +08:00
alex.lyn
d435712ccb runtime-rs: Introduce PortDevice in resource manager in sandbox
A new resource type `PortDevice` is introduced which is dedicated
for handling root ports/switch ports during sandbox creation(VM).

Fixes #10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-15 20:10:49 +08:00
alex.lyn
1d670bb46c runtime-rs: handle useless Device match arms in dragonball vmm case
Fixes #10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-15 20:10:49 +08:00
alex.lyn
f08fdd25d8 runtime-rs: Introduce device type of PordDevice in device manager
PortDevice is for handling root ports or switch ports in PCIe
Topology. It will make it easy pass the root ports/switch ports
information during create VM with requirements of PCIe devices.

Fixes #10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-15 20:10:49 +08:00
alex.lyn
694a849eaa runtime-rs: Add PCIe topology mgmt for Root Port and Switch Port
This commit introduces an implementation for managing PCIe topologies,
focusing on the relationship between Root Ports and Switch Ports. The
design supports two strategies for generating Switch Ports:

Let's take the requirement of 4 switch ports as an example. There'll be
three possible solutions as below:
(1) Single Root Port + Single PCIe Switch: Uses 1 Root Port and 1 Switch
with 4 Downstream Ports.
(2) Multiple Root Ports + Multiple PCIe Switches: Uses 2 Root Ports and
2 Switches, each with 2 Downstream Ports.

The recommended strategy is Option 1 due to its simplicity, efficiency,
and scalability. The implementation includes data structures
(PcieTopology, RootPort, PcieSwitch, SwitchPort) and operations
(add_pcie_root_port, add_switch_to_root_port, add_switch_port_to_switch)
to manage the topology effectively.

Fxies #10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-15 20:10:49 +08:00
alex.lyn
2f5ee0ec6d kata-types: Support switch port config via annotation and configuration
Support setting switch ports with annotatation or configuration.toml

Fixes #10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-15 20:10:49 +08:00
alex.lyn
a42d16a6a4 kata-types: Introduce pcie_switch_port in configuration
(1) Introduce new field `pcie_switch_port` for switch ports.
(2) Add related checking logics in vmms(dragonball, qemu)

Fixes #10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-15 20:10:49 +08:00
Fabiano Fidêncio
af3c601a92
Merge pull request #11258 from fidencio/topic/second-try-fix-multi-install-prefix
kata-deploy: Avoid changing any component path in case of restart
2025-05-15 11:21:15 +02:00
Seunguk Shin
560e718979 runtime: Add edk2 to configuration-qemu.toml for arm64
The edk2 is required for memory hot plug on qemu for arm64.
This adds the edk2 to configuration-qemu.toml for arm64.

Signed-off-by: Seunguk Shin <seunguk.shin@arm.com>
Reviewed-by: Nick Connolly <nick.connolly@arm.com>
2025-05-15 10:12:31 +01:00
Seunguk Shin
5cabce1a25 packaging: Build edk2 for arm64
The edk2 is required for memory hot plug on qemu for arm64.
This adds the edk2 to static tarball for arm64.

Signed-off-by: Seunguk Shin <seunguk.shin@arm.com>
Reviewed-by: Nick Connolly <nick.connolly@arm.com>
2025-05-15 10:12:24 +01:00
stevenhorsman
c09291a9c7 ci: gatekeeper: Require names update
The github rest api truncated job names that are >100
characters (which doesn't seem to be documented).
There doesn't seem to be a way to easily make gatekeeper
handle this automatically, so lets update the required-tests
to expect the truncated job names

Fixes: #11176
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-15 10:07:41 +01:00
Steve Horsman
95e5e0ec49
Merge pull request #11264 from fidencio/topic/helm-to-ci
helm: release: Publish our helm charts to the OCI registries
2025-05-15 09:47:33 +01:00