Commit Graph

16112 Commits

Author SHA1 Message Date
Cameron Baird
29ee46c186 genpolicy: Handle PodSecurityContext.fsGroup|supplementalGroups
Policy enforcement for additionalGids, A list of groups applied to the first process run in each container.

Manifests in OCI struct as additionalGids: Consists of container's GID, fsGroup, and supplementalGroups.

https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#PodSecurityContext-v1-core

Signed-off-by: Cameron Baird <cameronbaird@microsoft.com>
2025-05-13 21:44:51 +00:00
Tobin Feldman-Fitzthum
e10aa4e49c tests: update error message for encrypted image test
Guest components prints out a different error when failing to decrypt an
image. Update the test to look for this new error.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
2025-05-13 12:33:37 -05:00
RuoqingHe
cd4c3e89e1
Merge pull request #11243 from kata-containers/dependabot/go_modules/src/runtime/github.com/opencontainers/runc-1.2.0
build(deps): bump github.com/opencontainers/runc from 1.1.12 to 1.2.0 in /src/runtime
2025-05-13 17:02:35 +02:00
RuoqingHe
268197957d
Merge pull request #11253 from stevenhorsman/golang.org/x/oauth2v0.27.0-bump
versions: Bump golang.org/x/oauth2
2025-05-13 15:03:24 +02:00
stevenhorsman
b3825829d8 versions: Bump golang.org/x/oauth2
Update module to remediate
[CVE-2025-22868](https://www.cve.org/CVERecord?id=CVE-2025-22868)

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-13 11:00:35 +01:00
Rong Tao
37a16c19d1 osbuilder: lib.sh: Fix indent
Replace 4 spaces to [tab].

Signed-off-by: Rong Tao <rongtao@cestc.cn>
2025-05-13 16:56:54 +08:00
Steve Horsman
299fb3b77b
Merge pull request #11255 from stevenhorsman/skip-docker-tests
ci: gatekeeper: skip docker tests
2025-05-13 09:18:09 +01:00
Zvonko Kaiser
842ec6a32e
Merge pull request #11262 from BbolroC/add-vfio-config-for-sel-runtime
runtime/config: Add VFIO config for IBM SEL
2025-05-12 10:59:09 -04:00
Zvonko Kaiser
5cc098ae43
Merge pull request #11242 from houstar/qing/safe-path
agent: use safe-path to replace secure_join
2025-05-12 10:58:19 -04:00
Mikko Ylinen
ab29c8c979 runtime: do not add virtio-rng-pci device for confidential guests
Adding:
"-object rng-random,id=rng0,filename=/dev/urandom -device
virtio-rng-pci,rng=rng0"

for confidential guests is not necessary as the RNG source cannot
be trusted and the guest kernel has the driver already disable as well.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-05-12 17:14:51 +03:00
Mikko Ylinen
a44dfb8d37 versions: bump LTS kernel
6.12.28 has been released, let's bump to it.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-05-12 17:14:51 +03:00
Mikko Ylinen
eb326477fc kernel: disable virtio RNG for confidential guests
Linux CoCo x86 guest is hardened to ensure RDRAND provides enough
entropy to initialize Linux RNG. A failure will panic the guest.

For confidential guests any other RNG source is untrusted so disable
them.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-05-12 17:12:44 +03:00
Hyounggyu Choi
4fac1293bd runtime/config: Add VFIO config for IBM SEL
With #11076 merged, a VFIO configuration is needed in the runtime
when IBM SEL is involved (e.g., qemu-se or qemu-se-runtime-rs).

For the Go runtime, we already have a nightly test
(e.g., https://github.com/kata-containers/kata-containers/actions/runs/14964175872/job/42031097043)
in which this change has been applied.
For the Rust runtime, the feature has not yet been migrated.
Thus, this change serves as a placeholder and a reminder for future implementation.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-05-12 14:58:29 +02:00
Qingyuan Hou
c0ceaf661a agent: use safe-path to replace secure_join
This patch use safe-path library to safely handle filesystem paths.

Signed-off-by: Qingyuan Hou <qingyuan.hou@linux.alibaba.com>
2025-05-12 09:06:55 +00:00
Tobin Feldman-Fitzthum
de6f4ae99c versions: update Trustee version for CoCo v0.14.0
This hash will be tagged as Trustee v0.13.0 after the CoCo release is
finished.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
2025-05-09 13:40:28 -05:00
Tobin Feldman-Fitzthum
f9a9967e21 versions: update guest-components for CoCo v0.14.0
Pick up changes to guest components. This hash is right before the
changes to GC to support image pull via the CDH.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
2025-05-09 13:40:28 -05:00
Tobin Feldman-Fitzthum
d714eb2472 agent: update image-rs for CoCo v0.14.0
We might be able to eliminate this dependency soon, but for now let's
update image-rs.

I massaged the dependencies with:

cargo update idna_adapter@1.2.1 --precise 1.2.0
cargo update litemap@0.7.5 --precise 0.7.4
cargo update zerofrom@0.1.6 --precise 0.1.5
cargo update astral-tokio-tar@0.5.2 --precise 0.5.1
cargo update base64ct@1.7.3 --precise 1.6.0
cargo update generic-array@1.2.0 --precise 1.1.1

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
2025-05-09 13:39:52 -05:00
stevenhorsman
35ed3a2a3a versions: Bump bumpalo version
Bump bumpalo version to remediate RUSTSEC-2022-0078

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-09 16:09:22 +01:00
stevenhorsman
fcc60b514b versions: Bump hyper version
Bump hyper version to update and remediate CVE-2023-26964

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-09 16:09:22 +01:00
stevenhorsman
7807e6c29a versions: Bump byte-unit and rust_decimal
Bump the crates to update them and pull in a
newer version of borsh to remediate RUSTSEC-2023-0033

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-09 16:09:22 +01:00
Mikko Ylinen
96d922fc27 kernel: disable virtio MMIO for confidential guests
As the comment in the fragment suggests, this is for the firecracker builds
and not relevant for confidential guests, for example.

Exlude mmio.conf fragment by adding the new !confidential tag to drop
virtio MMIO transport for the confidential guest kernel (as virtio PCI is
enough for the use cases today).

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-05-09 17:53:22 +03:00
Mikko Ylinen
31d6839eb5 tools: let confidential guest kernel builds to exclude fragments
build-kernel.sh supports exluding fragments from the common base
set based on the kernel target architecture.

However, there are also cases where the base set must be stripped
down for other reason. For example, confidential guest builds want to
exclude some drivers the untrusted host may try to add devices (e.g.,
virtio-rng).

Make build-kernel.sh to skip fragments tagged using '!confidential'
when confidential guest kernels are built.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2025-05-09 17:53:22 +03:00
Zvonko Kaiser
78ff72a386
Merge pull request #11199 from fidencio/topic/kata-deploy-fix-multiInstallSufix-behaviour-during-restarts
helm: Avoid appending the multiInstallSuffix several times
2025-05-09 10:32:23 -04:00
Zvonko Kaiser
26a3cb4fd1
Merge pull request #11250 from stevenhorsman/tempfile-3.19.1-bump
versions: Update tempfile crate
2025-05-09 09:51:49 -04:00
stevenhorsman
a09a76a4f5 ci: gatekeeper: skip docker tests
It looks like the 22.04 image got updated and broke
the docker tests (see #11247), so make these un-required
until we can get a resolution

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-09 13:57:23 +01:00
Markus Rudy
835f59df2f
Merge pull request #10986 from 3u13r/euler/feat/genpolicy/env-from-secret
genpolicy: support secrets to be referenced for pod envs
2025-05-09 13:29:35 +02:00
stevenhorsman
787198f8bb versions: Update tempfile crate
Update the tempfile crate to resolve security issue
[WS-2023-0045](7247a8b6ee)
that came with the remove_dir_all dependency in prior versions

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-09 09:57:28 +01:00
Leonard Cohnen
b23ff6fc68 genpolicy: refactor policy test workdir setup
This aligns the workdir preparation more closely with the workdir
preparation for the generate integration test. Most notably, we
clean up the temporary directory before we execute the tests in it.
This way we better isolate different runs.

Signed-off-by: Leonard Cohnen <leonard.cohnen@gmail.com>
Signed-off-by: Markus Rudy <mr@edgeless.systems>
2025-05-09 09:45:28 +02:00
Leonard Cohnen
bad0cd0003 genpolicy: add cli integration tests
Add a new type of integration test to genpolicy. Now we can test flag handling
and how the CLI behaves with certain yaml inputs.

The first tests cover the case when a Pod references a Kubernetes secret of
config map in another file. Those need to be explicitly added via the
--config-files flag.

In the future we can easily add test suites that cover that all yaml fields
of all resources are understood by genpolicy.

Signed-off-by: Leonard Cohnen <leonard.cohnen@gmail.com>
2025-05-09 09:45:28 +02:00
Leonard Cohnen
61ee330029 genpolicy: move policy enforcement integration test to separate folder
In preparation for adding more types of integration tests, moving the
policy enforcements test into a separate folder.

Signed-off-by: Leonard Cohnen <leonard.cohnen@gmail.com>
Signed-off-by: Markus Rudy <mr@edgeless.systems>
2025-05-09 09:45:28 +02:00
Leonard Cohnen
2ea57aefbc genpolicy: remove unused function
Remove function that became unused in the last commit.

Signed-off-by: Leonard Cohnen <leonard.cohnen@gmail.com>
2025-05-09 09:41:43 +02:00
Aurélien Bombo
4bb441965f genpolicy: support arbitrary resources with -c
This allows passing config maps and secrets (as well as any other
resource kinds relevant in the future) using the -c flag.

Fixes: #10033

Co-authored-by: Leonard Cohnen <leonard.cohnen@gmail.com>
Signed-off-by: Leonard Cohnen <leonard.cohnen@gmail.com>
Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-05-09 09:41:43 +02:00
Hyounggyu Choi
a286a5aee8
Merge pull request #11076 from Jakob-Naucke/ap-bind-assoc
Bind/associate for VFIO-AP
2025-05-09 09:32:46 +02:00
Saul Paredes
1e09dfb0df
Merge pull request #11127 from microsoft/archana1/mount-tc
genpolicy: improve validation for mounts
2025-05-08 15:41:23 -07:00
stevenhorsman
17843e50bb runtime: Switch userns packages
Switch imports to resolve:
```
SA1019: "github.com/opencontainers/runc/libcontainer/userns" is deprecated:
use github.com/moby/sys/userns
```

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-08 11:04:11 +01:00
dependabot[bot]
2c80a3edce build(deps): bump github.com/opencontainers/runc in /src/runtime
Bumps [github.com/opencontainers/runc](https://github.com/opencontainers/runc) from 1.1.12 to 1.2.0.
- [Release notes](https://github.com/opencontainers/runc/releases)
- [Changelog](https://github.com/opencontainers/runc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/opencontainers/runc/compare/v1.1.12...v1.2.0)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/runc
  dependency-version: 1.2.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-08 11:02:16 +01:00
Steve Horsman
e3e0007bf7
Merge pull request #11141 from stevenhorsman/k8s-cpu-ns-exec-retry
tests: k8s: Retry output of kubectl exec in k8s-cpu-ns
2025-05-07 17:11:25 +01:00
Fabiano Fidêncio
f981e8a904
Merge pull request #10833 from stevenhorsman/crio-annotations-update
Crio annotations update
2025-05-07 16:05:24 +02:00
dependabot[bot]
96885a8449
build(deps): bump ring from 0.17.8 to 0.17.14 in /src/tools/agent-ctl
Bumps [ring](https://github.com/briansmith/ring) from 0.17.8 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-07 12:18:56 +00:00
RuoqingHe
be75391953
Merge pull request #11235 from kata-containers/dependabot/cargo/src/tools/kata-ctl/openssl-0.10.72
build(deps): bump openssl from 0.10.60 to 0.10.72 in /src/tools/kata-ctl
2025-05-07 20:17:42 +08:00
RuoqingHe
d4d737a73e
Merge pull request #10512 from ncppd/riscv64-agent
agent: Support RISC-V 64-bit architecture
2025-05-07 10:56:10 +08:00
RuoqingHe
7bdfea0041
Merge pull request #11123 from kimullaa/add-path-for-kata-deploy
runtime: Add Path for kata-deploy
2025-05-07 00:25:12 +08:00
RuoqingHe
b5e45601f6
Merge pull request #11116 from kimullaa/more-robust-script-path-resolution
kata-debug: Make path resolution more robust
2025-05-07 00:19:04 +08:00
stevenhorsman
5472662b33 runtime: Fix Incorrect conversion between integer types
Fix the high severity codeql issue by checking the
value is in bounds before converting

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-06 15:18:37 +01:00
stevenhorsman
4de79b9821 runtime: Ignoring deprecated warning.
In the latest oci-spec, the prestart hook is deprecated.
However, the docker & nerdctl tests failed when I switched
to one of the newer hooks which don't run at quite the same time,
so ignore the deprecation warnings for now to unblock the security fix

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-06 15:18:37 +01:00
stevenhorsman
37dda6060c runtime: Re-vendor
Re-run `make vendor` after the podman -> crio annotations
change

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-06 15:18:37 +01:00
stevenhorsman
3740ce6e7b runtime: Update crio annotations
We've been using the
github.com/containers/podman/v4/pkg/annotations module
to get cri-o annotations, which has some major CVEs in, but
in v5 most of the annotations were moved into crio (from 1.30)
(see https://github.com/cri-o/cri-o/pull/7867). Let's switch
to use the cri-o annotations module instead and remediate
CVE-2024-3056.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-06 15:18:37 +01:00
dependabot[bot]
70b481e1ee
build(deps): bump openssl from 0.10.60 to 0.10.72 in /src/tools/kata-ctl
Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.60 to 0.10.72.
- [Release notes](https://github.com/sfackler/rust-openssl/releases)
- [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.60...openssl-v0.10.72)

---
updated-dependencies:
- dependency-name: openssl
  dependency-version: 0.10.72
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-06 13:56:33 +00:00
RuoqingHe
4f97e5fed3
Merge pull request #11226 from kata-containers/dependabot/cargo/src/agent/tokio-1.44.2
build(deps): bump tokio from 1.44.0 to 1.44.2
2025-05-06 21:55:18 +08:00
Fabiano Fidêncio
78bf9d7500
Merge pull request #11232 from lifupan/mtu
runtime: add the mtu support for updating routes
2025-05-06 15:55:04 +02:00