Commit Graph

16112 Commits

Author SHA1 Message Date
Markus Rudy
ec969e4dcd genpolicy: remove redundant group check
https://github.com/kata-containers/kata-containers/pull/11077
established that the GID from the image config is never used for
deriving the primary group of the container process. This commit removes
the associated logic that derived a GID from a named group.

Signed-off-by: Markus Rudy <mr@edgeless.systems>
2025-06-03 10:59:10 +02:00
Zvonko Kaiser
985e965adb doc: Added Helm Chart README.md
We need more and accurate documentation. Let's start
by providing an Helm Chart install doc and as a second
step remove the kustomize steps.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
Co-authored-by: Steve Horsman <steven@uk.ibm.com>
2025-06-02 23:26:16 +00:00
Dan Mihai
dc0da567cd
Merge pull request #11340 from microsoft/danmihai1/image-size-alignment
image: custom guest rootfs image file size alignment
2025-06-02 14:33:21 -07:00
Dan Mihai
c2c194d860 kata-deploy: smaller guest image file for mariner
Align up the mariner Guest image file size to 2M instead of the
default 128M alignment.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-06-02 16:15:17 +00:00
Dan Mihai
65385a5bf9 image: custom guest rootfs image file size alignment
The Guest rootfs image file size is aligned up to 128M boundary,
since commmit 2b0d5b2. This change allows users to use a custom
alignment value - e.g., to align up to 2M, users will be able to
specify IMAGE_SIZE_ALIGNMENT_MB=2 for image_builder.sh.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-06-02 16:15:17 +00:00
Steve Horsman
c575048aa7
Merge pull request #11329 from Xynnn007/fix-initdata-snp
Fix | Support initdata for SNP
2025-06-02 15:24:12 +01:00
stevenhorsman
ae352e7e34 ci: Add dependabot groups
- Create groups for commonly seen cargo packages so that rather than
getting up to 9 PRs for each rust components, bumps to the same package
are grouped together.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-06-02 14:45:31 +01:00
stevenhorsman
a94388cf61 ci: Add dependabot config
- Create a dependabot configuration to check for updates
to our rust and golang packages each day and our github
actions each month

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-06-02 14:45:31 +01:00
Xynnn007
8750eadff2 test: turn SNP on for initdata tests
After the last commit, the initdata test on SNP should be ok. Thus we
turn on this flag for CI.

Fixes #11300

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
2025-06-02 20:33:19 +08:00
Xynnn007
39aa481da1 runtime: fix initdata support for SNP
the qemu commandline of SNP should start with `sev-snp-guest`, and then
following other parameters separeted by ','. This patch fixes the
parameter order.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
2025-06-02 20:33:19 +08:00
Fabiano Fidêncio
57f3cb8b3b
Merge pull request #11344 from fidencio/topic/kernel-add-tuntap-move-memagent-stuff
kernel: Add CONFIG_TUN (needed for VPNs) and move mem-agent related configs to common
2025-06-01 21:32:07 +02:00
RuoqingHe
51cc960cdd
Merge pull request #11346 from fidencio/topic/bump-cgroups-rs
rust: Update cgroups-rs to its v0.3.5 release
2025-05-31 04:13:05 +02:00
Fabiano Fidêncio
48f8496209
Merge pull request #11327 from Champ-Goblem/agent/increase-limit-nofile
agent: increase LimitNOFILE in the systemd service
2025-05-30 21:56:01 +02:00
Fabiano Fidêncio
02c46471fd rust: Update cgroups-rs to its v0.3.5 release
We're switching to using a rev as it may take some time for the package
to be updated on crates.io.

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-05-30 21:49:50 +02:00
Fabiano Fidêncio
dadbfd42c8 kernel: Move mem-agent configs to the common kernel build
There's no benefit on keeping those restricted to the dragonball build,
when they can be used with other VMMs as well (as long as they support
the mem-agent).

Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-05-30 21:49:22 +02:00
Champ-Goblem
a37080917d kernel: Add CONFIG_TUN for VPN services
TUN/TAP is a must for VPN related services.

Signed-off-by: Champ-Goblem <cameron@northflank.com>
Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-05-30 21:49:22 +02:00
Fabiano Fidêncio
b8a7350a3d
Merge pull request #11324 from Champ-Goblem/runtime/fix-cgroup-deletion
runtime: fix cgroupv2 deletion when sandbox_cgroup_only=false
2025-05-30 21:23:07 +02:00
Champ-Goblem
ef642fe890 runtime: fix cgroupv2 deletion when sandbox_cgroup_only=false
Currently, when a new sandbox resource controller is created with cgroupsv2 and sandbox_cgroup_only is disabled,
the cgroup management falls back to cgroupfs. During deletion, `IsSystemdCgroup` checks if the path contains `:`
and tries to delete the cgroup via systemd. However, the cgroup was originally set up via cgroupfs and this process
fails with `lstat /sys/fs/cgroup/kubepods.slice/kubepods-besteffort.slice/....scope: no such file or directory`.

This patch updates the deletion logic to take in to account the sandbox_cgroup_only=false option and in this case uses
the cgroupfs delete.

Fixes: #11036
Signed-off-by: Champ-Goblem <cameron@northflank.com>
2025-05-30 17:51:31 +02:00
Champ-Goblem
f4007e5dc1 agent: increase LimitNOFILE in the systemd service
Increase the NOFILE limit in the systemd service, this helps with
running databases in the Kata runtime.

Signed-off-by: Champ-Goblem <cameron@northflank.com>
2025-05-30 17:49:29 +02:00
Fabiano Fidêncio
3f5dc87284
Merge pull request #11333 from stevenhorsman/csi-driver-permissions-fix
workflow: add packages: write to csi-driver publish
2025-05-30 17:45:47 +02:00
Zvonko Kaiser
4586511c01 doc: Add Helm Chart entry
Since 3.12 we're shipping the helm-chart per default
with each release. Update the documentation to use helm rather
then the kata-deploy manifests.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-05-30 14:45:01 +00:00
Aurélien Bombo
c03b38c7e3 ci: Require agent-ctl tests
This adds `run-kata-agent-apis` to the list of required tests.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-05-29 14:09:42 -05:00
stevenhorsman
586d9adfe5 workflow: add packages: write to csi-driver publish
This one was missed in the earlier PR

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-29 15:57:07 +01:00
Steve Horsman
3da213a8c8
Merge pull request #11326 from kata-containers/top-level-workflow-permissions
Top level workflow permissions
2025-05-29 10:03:06 +01:00
stevenhorsman
c34416f53a workflows: Add explicit permissions where needed
We have a number of jobs that either need,or nest workflows
that need gh permissions, such as for pushing to ghcr,
or doing attest build provenance. This means they need write
permissions on things like `packages`, `id-token` and `attestations`,
so we need to set these permissions at the job-level
(along with `contents: read`), so they are not restricted by our
safe defaults.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-28 19:34:28 +01:00
stevenhorsman
088e97075c workflow: Add top-level permissions
Set:
```
permissions:
  contents: read
```
as the default top-level permissions explicitly
to conform to recommended security practices e.g.
https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions
2025-05-28 19:34:28 +01:00
Dan Mihai
353d0822fd
Merge pull request #11314 from katexochen/p/svc-name-regex
genpolicy: fix svc_name regex
2025-05-28 10:08:38 -07:00
Steve Horsman
7a9d919e3e
Merge pull request #11322 from kata-containers/workflow-permissions
workflows: Add explicit permissions for attestation
2025-05-28 17:28:22 +01:00
Steve Horsman
2667d4a345
Merge pull request #11323 from stevenhorsman/gatekeeper-workflow-permissions-ii
workflow: Update gatekeeper permissions
2025-05-28 17:05:24 +01:00
stevenhorsman
4d4fb86d34 workflow: Update gatekeeper permissions
I shortsightedly forgot that gatekeeper would need
to read more than just the commit content in it's
python scripts, so add read permissions to actions
issues which it uses in it's processing

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-28 15:58:27 +01:00
Steve Horsman
fed63e0801
Merge pull request #11319 from stevenhorsman/remove-old-workflows
workflows: Delete workflows
2025-05-28 15:38:19 +01:00
Steve Horsman
49f86aaa0d
Merge pull request #11320 from stevenhorsman/gatekeeper-workflow-permissions
workflows: gatekeeper: Update permissions
2025-05-28 15:38:06 +01:00
stevenhorsman
3ff602c1e8 workflows: Add explicit permissions for attestation
We have a number of jobs that nest the build-static-tarball
workflows later on. Due to these doing attest build provenance,
and pushing to ghcr.io, t hey need write permissions on
`packages`, `id-token` and `attestations`, so we need to set
these permissions on the top-level jobs (along with `contents: read`),
so they are not blocked.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-28 12:56:52 +01:00
stevenhorsman
2f0dc2ae24 workflows: gatekeeper: Update permissions
Restrict the permissions of gatekeeper flow to read
contents only for better security

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-28 09:57:19 +01:00
stevenhorsman
f900b0b776 workflows: Delete workflows
Some legacy workflows require write access to github which
is a security weakness and don't provide much value,
so lets remove them.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-05-28 09:45:42 +01:00
Alex Lyn
aab6caa141
Merge pull request #10362 from Apokleos/vfio-hotplug-runtime-rs
runtime-rs: add support hotplugging vfio device for qemu-rs
2025-05-28 13:21:58 +08:00
Fabiano Fidêncio
ac934e001e
Merge pull request #11244 from katexochen/p/guest-pull-config
runtime: add option to force guest pull
2025-05-27 16:00:09 +02:00
alex.lyn
e69a4d203a runtime-rs: Increase QMP read timeout to mitigate failures
It frequently causes "Resource Temporarily Unavailable (OS Error 11)"
with the original 250ms read timeout When passing through devices via
VFIO in QEMU. The root cause lies in synchronization timeout windows
failing to accommodate inherent delays during critical hardware init
phases in kernel space. This commit would increase the timeout to 5000ms
which was determined through some tests. While not guaranteeing complete
resolution for all hardware combinations, this change significantly
reduces timeout failures.

Fixes # 10361

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2025-05-27 21:06:57 +08:00
Paul Meyer
c4815eb3ad runtime: add option to force guest pull
This enables guest pull via config, without the need of any external
snapshotter. When the config enables runtime.experimental_force_guest_pull, instead of
relying on annotations to select the way to share the root FS, we always
use guest pull.

Co-authored-by: Markus Rudy <mr@edgeless.systems>
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2025-05-27 12:42:00 +02:00
Fabiano Fidêncio
d3f81ec337
Merge pull request #11240 from Apokleos/copydir
runtime-rs: Propagate k8s configs correctly when sharedfs is disabled
2025-05-27 12:41:21 +02:00
Paul Meyer
8de8b8185e genpolicy: rename svc_name to svc_name_downward_env
Just to be more explicit what this matches.

Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2025-05-27 10:13:43 +02:00
Paul Meyer
78eb65bb0b genpolicy: fix svc_name regex
The service name is specified as RFC 1035 lable name [1]. The svc_name
regex in the genpolicy settings is applied to the downward API env
variables created based on the service name. So it tries to match
RFC 1035 labels after they are transformed to downward API variable
names [2]. So the set of lower case alphanumerics and dashes is
transformed to upper case alphanumerics and underscores.
The previous regex wronly permitted use of numbers, but did allow
dot and dash, which shouldn't be allowed (dot not because they aren't
conform with RFC 1035, dash not because it is transformed to underscore).

We have to take care not to also try to use the regex in places where
we actually want to check for RFC 1035 label instead of the downward
API transformed version of it.

Further, we should consider using a format like JSON5/JSONC for the
policy settings, as these are far from trivial and would highly benefit
from proper documentation through comments.

[1]: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service
[2]: b2dfba4151/pkg/kubelet/envvars/envvars.go (L29-L70)

Signed-off-by: Paul Meyer <katexochen0@gmail.com>
2025-05-27 08:43:25 +02:00
RuoqingHe
139dc13bdc
Merge pull request #11301 from lifupan/fix_cgroup
runtime-rs: fix the issue of delete cgroup failed
2025-05-27 05:05:32 +02:00
Wainer Moschetta
d77e33babf
Merge pull request #11266 from ldoktor/ci-pp-retry
ci.ocp: A couple of peer-pods setup improvements
2025-05-26 14:22:11 -03:00
Wainer Moschetta
c249769bb8
Merge pull request #11270 from ldoktor/gk
tools.testing: Add methods to simplify gatekeeper development
2025-05-26 12:04:07 -03:00
Fabiano Fidêncio
20d3bc6f37
Merge pull request #10964 from hsiangkao/drop_outdated_patches
Drop outdated erofs patches for 6.1.y kernels & fix a dragonball vsock issue
2025-05-26 13:00:25 +02:00
Gao Xiang
b441890749 kernel: drop outdated erofs patches for 6.1.y kernels
Patches 0001..0004 have been included upstream as dependencies
since Linux 6.1.113.

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2025-05-26 15:48:24 +08:00
Xingru Li
71b6acfd7e dragonball: vsock: support single descriptor
Since kernel v6.3 the vsock packet is not split over two descriptors and
is instead included in a single one.

Therefore, we currently decide the specific method of obtaining
BufWrapper based on the length of descriptor.

Refer:
a2752fe04f
https://git.kernel.org/torvalds/c/71dc9ec9ac7d

Signed-off-by: Xingru Li <lixingru.lxr@linux.alibaba.com>
[ Gao Xiang: port this patch from the internal branch to address Linux 6.1.63+. ]
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2025-05-26 15:48:19 +08:00
RuoqingHe
b6cafba5f6
Merge pull request #11308 from hsiangkao/enable_tmpfs_xattr
kernel: support `CONFIG_TMPFS_XATTR=y`
2025-05-26 05:00:26 +02:00
Gao Xiang
b681dfb594 kernel: support CONFIG_TMPFS_XATTR=y
Currently, Kata EROFS support needs it, otherwise it will:
[    0.564610] erofs: (device sda): mounted with root inode @ nid 36.
[    0.564858] overlayfs: failed to set xattr on upper
[    0.564859] overlayfs: ...falling back to index=off,metacopy=off.
[    0.564860] overlayfs: ...falling back to xino=off.

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2025-05-24 20:43:35 +08:00