Commit Graph

13971 Commits

Author SHA1 Message Date
stevenhorsman
7610b34426 tests: attestation: Restrict sample policy use
- We only want to enable the sample verifier in the KBS for non-TEE
tests, so prevent an edge case where the TEE platform isn't set up
correctly and we might fall back to the sample and get false positives.
To prevent this we add guards around the sample policy enablement and
only run it for non confidential hardware

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-06-25 16:59:40 +01:00
Steve Horsman
d574d37c4b
Merge pull request #9903 from stevenhorsman/authenticated-regsitry-workflow-secrets
workflow: coco: Add auth registry secret
2024-06-25 16:40:46 +01:00
stevenhorsman
d8961cbd4a workflow: coco: Add auth registry secret
- Add the `AUTHENTICATED_IMAGE_USER` and
`AUTHENTICATED_IMAGE_PASSWORD` repository secrets as env vars
to the coco tests, so we can use them to pull an images from
and authenticated registry for testing

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-06-25 11:11:02 +01:00
Alex Lyn
2c5b3a5c20
Merge pull request #9830 from gaohuatao-1/ght/count-rs
runtime-rs: fix the bug of func count_files
2024-06-25 15:00:46 +08:00
GabyCT
27d75f93e2
Merge pull request #9872 from GabyCT/topic/varmemin
metrics: Improve variable definition in memory inside containers script
2024-06-24 15:30:05 -06:00
Aurélien Bombo
b0cdf4eb0d
Merge pull request #9579 from microsoft/saulparedes/add_seccomp_support
genpolicy: ignore SeccompProfile in PodSpec
2024-06-24 08:58:01 -07:00
Wainer Moschetta
bcdc4fde10
Merge pull request #9857 from wainersm/disable_failing_jobs-part2
CI: disable jobs that failed >= 50% on nightly CI recently - part 2
2024-06-24 10:11:05 -03:00
Leonard Cohnen
6a3ed38140 genpolicy: allow specifying layer cache file
Add --layers-cache-file-path flag to allow the user to
specify where the cache file for the container layers
is saved. This allows e.g. to have one cache file
independent of the user's working directory.

Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
2024-06-24 14:53:27 +02:00
Fabiano Fidêncio
3adf9e250f
Merge pull request #9875 from zvonkok/gha-no-sudo-arm64
ci: gha no sudo arm64
2024-06-21 15:28:54 +02:00
Wainer Moschetta
f7e0d6313b
Merge pull request #9865 from wainersm/qemu-coco-dev_updates
runtime: updates to qemu-coco-dev configuration
2024-06-21 10:14:30 -03:00
Fabiano Fidêncio
2d552800f2
Merge pull request #9876 from zvonkok/gha-no-sudo-s390x
ci: remove sudo from s390x build
2024-06-21 15:00:31 +02:00
Saul Paredes
44afb4aa5f genpolicy: ignore SeccompProfile in PodSpec
Ignore SeccompProfile in PodSpec

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-06-20 09:42:17 -07:00
Dan Mihai
7aeaf2502a
Merge pull request #9856 from microsoft/danmihai1/new-policy-rules
genpolicy: reject untested CreateContainer field values
2024-06-20 09:34:53 -07:00
GabyCT
9320c2e484
Merge pull request #9845 from GabyCT/topic/fixartifacts
gha: Do not fail when collecting artifacts
2024-06-20 10:15:53 -06:00
Hyounggyu Choi
959a277dc5
Merge pull request #9886 from BbolroC/kernel-config-uv-uapi-s390x
kernel: Add CONFIG_S390_UV_UAPI for s390x
2024-06-20 16:05:15 +02:00
Steve Horsman
d5b4da7331
Merge pull request #9881 from stevenhorsman/remote-hypervisor-policy
runtime: Support policy in remote hypervisor
2024-06-20 14:01:29 +01:00
Hyounggyu Choi
9cb12dfa88 kernel: Add CONFIG_S390_UV_UAPI for s390x
While enabling the attestation for IBM SE, it was observed that
a kernel config `CONFIG_S390_UV_UAPI` is missing.
This config is required to present an ultravisor in the guest VM.
Ths commit adds the missing config.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-06-20 13:15:33 +02:00
Lukáš Doktor
b08c019003
ci.ocp: Ensure we smoke-test with the right runtime class
we do encourage people to set the KATA_RUNTIME, but it is only used by
the webhook. Let's define it in the main `test.sh` and use it in the
smoke test to ensure the user-defined runtime is smoke-tested rather
than hard-coded kata-qemu one.

Related to: #9804

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
2024-06-20 11:15:02 +02:00
Fabiano Fidêncio
0f2a4d202e
Merge pull request #9884 from fidencio/topic/re-enable-tdx-ci
ci: tdx: Re-enable TDX CI
2024-06-20 06:39:06 +02:00
GabyCT
02075f73e9
Merge pull request #9874 from GabyCT/topic/fixvarnerdctl
tests: nerdctl: Fix variables names and remove network
2024-06-19 13:43:25 -06:00
Fabiano Fidêncio
2bab0f31d7
ci: tdx: Re-enable TDX CI
Now, using vanilla kubernetes, let's re-enable the TDX CI and hope it
becomes more stable than it used to be.

The cleanup-snapshotter is now taking ~4 minutes, and that matches with
the other platforms, mainly considering there's a sum of 210 seconds
sleep in the process.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-06-19 20:08:28 +02:00
Greg Kurz
81972f6ffc
Merge pull request #9149 from ryansavino/upgrade-to-qemu-8.2.1
qemu: upgrade to 8.2.4
2024-06-19 19:10:02 +02:00
stevenhorsman
779754dcf6 runtime: Support policy in remote hypervisor
Move the `sandbox.agent.setPolicy` call out of the remoteHypervisor
if, block, so we can use the policy implementation on peer pods

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-06-19 16:43:53 +01:00
Fabiano Fidêncio
f9862e054c
Merge pull request #9882 from fidencio/topic/ci-tdx-use-vanilla-k8s
ci: tdx: Use vanilla k8s instead of k3s
2024-06-19 17:33:00 +02:00
Pavel Mores
6a4919eeb9 runtime-rs: fix misleading log message
get_vmm_master_tid() currently returns an error with the message "cannot
get qemu pid (though it seems running)" when it finds a valid
QemuInner::qemu_process instance but fails to extract the PID out of it.

This condition however in fact means that a qemu child process was running
(otherwise QemuInner::qemu_process would be None) but isn't anymore (id()
returns None).

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-06-19 17:15:24 +02:00
Pavel Mores
af5492e773 runtime-rs: made Qemu::stop_vm() idempotent
Since Hypervisor::stop_vm() is called from the WaitProcess request handling
which appears to be per-container, it can be called multiple times during
kata pod shutdown.  Currently the function errors out on any subsequent
call after the initial one since there's no VM to stop anymore.  This
commit makes the function tolerate that condition.

While it seems conceivable that sandbox shouldn't be stopped by WaitProcess
handling, and the right fix would then have to happen elsewhere, this
commit at least makes qemu driver's behaviour consistent with other
hypervisor drivers in runtime-rs.

We also slightly improve the error message in case there's no
QemuInner::qemu_process instance.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-06-19 17:15:24 +02:00
Pavel Mores
5fbbff9e5e runtime-rs: remove attempt to access sandbox bundle from container bundle
Since no objections were raised in the linked issue (#9847) this commit
removes the attempt to derive sandbox bundle path from container bundle
path.  As described in more detail in the linked issue, this is container
runtime specific and doesn't seem to serve any purpose.

As for implementation, we hoist the only part of
get_shim_info_from_sandbox() that's still useful (getting the socket
address) directly into the caller and remove the function altogether.

Fixes #9847

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-06-19 17:09:15 +02:00
Fabiano Fidêncio
7127178acc
ci: tdx: Use vanilla k8s instead of k3s
We've noticed a bunch of issues related to deploying and deleting the
nydus-snapshotter.  As we don't see the same issues on other machines
using vanilla kubernetes, let's avoid using k3s for now follow the flow.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-06-19 16:56:15 +02:00
Zvonko Kaiser
beab17f765
Merge pull request #9877 from zvonkok/gha-no-sudo-ppc64
ci: gha no sudo ppc64
2024-06-19 14:02:05 +02:00
Zvonko Kaiser
d783ddaf03 ci: Remove not needed chown for ppc64
Now that all artifacts are owned by $USER no extra step needed
to adjust ownership

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-06-19 07:56:45 +00:00
Zvonko Kaiser
5bc37e39d5 ci: remove sudo from ppc64 build
We can now do the same for ppc64 that we did for amd64 and remove
the sudo cp.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-06-19 07:55:45 +00:00
Zvonko Kaiser
c341234c0b ci: remove sudo from s390x build
We can now do the same for s390x that we did for amd64 and remove
the sudo cp.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-06-19 07:53:33 +00:00
Zvonko Kaiser
3beb460a97 ci: Remove not needed chown for arm64
Now that all artifacts are owned by $USER no extra step needed
to adjust ownership

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-06-19 07:48:00 +00:00
Zvonko Kaiser
445b389b16 ci: remove sudo from arm64 build
We can now do the same for arm64 that we did for amd64 and remove
the sudo cp.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-06-19 07:46:51 +00:00
Gabriela Cervantes
6ec7971f7a tests: nerdctl: Fix variables names and remove network
This PR fixes the variables names for the network that was created as well
removes the network that were created for the tests to ensure a clean environment
when running all the tests and avoid failures specially on baremental environments
that network already exists.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-06-18 23:00:49 +00:00
Dan Mihai
4df66568cf genpolicy: reject untested CreateContainer field values
Reject CreateContainerRequest field values that are not tested by
Kata CI and that might impact the confidentiality of CoCo Guests.

This change uses a "better safe than sorry" approach to untested
fields. It is very possible that in the future we'll encounter
reasonable use cases that will either:

- Show that some of these fields are benign and don't have to be
  verified by Policy, or
- Show that Policy should verify legitimate values of these fields

These are the new CreateContainerRequest Policy rules:

    count(input.shared_mounts) == 0
    is_null(input.string_user)

    i_oci := input.OCI
    is_null(i_oci.Hooks)
    is_null(i_oci.Linux.Seccomp)
    is_null(i_oci.Solaris)
    is_null(i_oci.Windows)

    i_linux := i_oci.Linux
    count(i_linux.GIDMappings) == 0
    count(i_linux.MountLabel) == 0
    count(i_linux.Resources.Devices) == 0
    count(i_linux.RootfsPropagation) == 0
    count(i_linux.UIDMappings) == 0
    is_null(i_linux.IntelRdt)
    is_null(i_linux.Resources.BlockIO)
    is_null(i_linux.Resources.Network)
    is_null(i_linux.Resources.Pids)
    is_null(i_linux.Seccomp)
    i_linux.Sysctl == {}

    i_process := i_oci.Process
    count(i_process.SelinuxLabel) == 0
    count(i_process.User.Username) == 0

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-06-18 18:09:31 +00:00
Wainer Moschetta
cf372f41bf
Merge pull request #9869 from fidencio/topic/disable-tdx-ci
ci: tdx: Disable TDX CI
2024-06-18 14:47:38 -03:00
Gabriela Cervantes
671d9af456 metrics: Improve variable definition in memory inside containers script
This PR improves the variable definition in memory inside
the container script for metrics. This change declares and assigns
the variables separately to avoid masking return values.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-06-18 16:56:12 +00:00
Gabriela Cervantes
eeb467bdc2 gha: Do not fail when collecting artifacts
This PR will avoid the failures when collecting artifacts for the gha.
This will ensure that we collect and archive system's data for the
purpose of debugging.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-06-18 16:05:23 +00:00
Wainer Moschetta
36093e86e0
Merge pull request #9863 from wainersm/kata-deploy_yq
kata-deploy: always copy ci/install_yq.sh
2024-06-18 10:05:41 -03:00
Fabiano Fidêncio
587f4d45de ci: tdx: Disable TDX CI
TDX CI has been having some issues with the Nydus snapshotter cleanup,
which has been stuck for hours depending every now and then.

With this in mind, let's disable the TDX CI, so we avoid it blocking the
progress of Kata Containers project, and we re-enable it as soon as we
have it solved on Intel's side.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-06-18 10:30:40 +02:00
markyangcc
a28bf266f9 runtime: fix missing of VhostUserDeviceReconnect parameter assignment
Commit 'ca02c9f5124e' implements the vhost-user-blk reconnection functionality,
However, it has missed assigning VhostUserDeviceReconnect when new the QEMU
HypervisorConfig, resulting in VhostUserDeviceReconnect always set to default value 0.

Real change is this line, most of changes caused by go format,

return vc.HypervisorConfig{
	// ...
	VhostUserDeviceReconnect: h.VhostUserDeviceReconnect,
}, nil

Fixes: #9848
Signed-off-by: markyangcc <mmdou3@163.com>
2024-06-18 12:15:10 +08:00
Alex Lyn
388cd7dde4
Merge pull request #9772 from pmores/add-base-qmp-framework
runtime-rs: add base qmp framework
2024-06-18 09:53:28 +08:00
Alex Lyn
275c498dc9
Merge pull request #9834 from lifupan/main
sandbox: fix the issue of failed to get the vmm master tid
2024-06-18 08:57:21 +08:00
Alex Lyn
d3fb6bfd35
Merge pull request #9860 from stevenhorsman/tokio-vulnerability-bump
Tokio vulnerability bump
2024-06-18 08:35:34 +08:00
Wainer dos Santos Moschetta
bdbee78517 runtime: allow default_{vcpus,memory} annotations to qemu-coco-dev
This is a counterpart of commit abf52420a4 for the qemu-coco-dev
configuration. By allowing default_vcpu and default_memory annotations
users can fine-tune the VM based on the size of the container
image to avoid issues related with pulling large images in the guest.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-06-17 18:59:52 -03:00
Wainer dos Santos Moschetta
baa8d9d99c runtime: set shared_fs=none to qemu-coco-dev configuration
Just like the TEE configurations (sev, snp, tdx) we want to have the
qemu-coco-dev using shared_fs=none.

Fixes: #9676
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-06-17 18:42:46 -03:00
Wainer Moschetta
b8d7a8c546
Merge pull request #9862 from BbolroC/improve-kubectl-retry
tests: Use selector rather than pod name for kubectl logs/describe
2024-06-17 18:33:24 -03:00
Hyounggyu Choi
6b065f5609 tests: Use selector rather than pod name for kubectl logs/describe
The following error was observed during the deployment of nydus snapshotter:

```
Error from server (NotFound):
the server could not find the requested resource ( pods/log nydus-snapshotter-5v82v)
  'kubectl logs nydus-snapshotter-5v82v -n nydus-system' failed after 3 tries
    Error: Process completed with exit code 1.
```

This error can occur when a pod is re-created by a daemonset during the retry interval.
This commit addresses the issue by using `--selector` rather than the pod name
for `kubectl logs/describe`.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-06-17 22:27:50 +02:00
Wainer Moschetta
7df221a8f9
Merge pull request #9833 from wainersm/qemu-rs_tests
tests/k8s: run for qemu-runtime-rs on AKS
2024-06-17 16:59:46 -03:00