Commit Graph

13488 Commits

Author SHA1 Message Date
Dan Mihai
88b7a44271 tests: k8s: k8s-exec.bats auto-generated policy
Auto-generate policy for k8s-exec.bats.

Fixes: #9247

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-03-08 17:48:20 +00:00
Steve Horsman
54e5ce2464
Merge pull request #9154 from chungeun-choi/change-deprecated-package
fixed - Change the deprecated module from 'io/util' to util. 'io/util…
2024-03-08 15:05:43 +00:00
Steve Horsman
e9bbf2f67b
Merge pull request #9203 from fidencio/topic/releases-follow-up-III
release: Ensure the release-type is passed to workflows
2024-03-08 14:09:36 +00:00
Alex Lyn
c73597c39d
Merge pull request #9208 from studychao/chao/fix_virt_ci
Dragonball: fix unit test problems when switching to new virt github machine
2024-03-08 09:41:05 +08:00
Chengyu Zhu
d49391a555
Merge pull request #8798 from LindaYu17/setpolicy
add setpolicy function to kata-runtime tool
2024-03-08 06:31:57 +08:00
Dan Mihai
5398b6466c
Merge pull request #9224 from 3u13r/sidecar-container
genpolicy: add restartPolicy to container struct
2024-03-07 12:59:55 -08:00
GabyCT
35d8f82232
Merge pull request #9242 from GabyCT/topic/enabldebugnerd
gha: Add collect artifacts step to nerdctl workflow
2024-03-07 13:34:40 -06:00
Wainer Moschetta
91998af173
Merge pull request #9114 from wainersm/ci_kbs_cli
CI: add KBS utilities for attestation tests
2024-03-07 16:34:03 -03:00
Dan Mihai
4c3d6fadc8 genpolicy: default env if image doesn't have env
Use containerd's default environment for container images that don't
specify the Env field.

Also, re-enable policy env variable verification, now that these
uncommon images are supported too.

Fixes: #9239

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-03-07 16:56:06 +00:00
Dan Mihai
b3a02d5e06
Merge pull request #9128 from microsoft/danmihai1/test-genpolicy
tests: k8s: auto-generated policy
2024-03-07 08:50:47 -08:00
Fabiano Fidêncio
8faab965a7 gh: Fix payload-after-push tags
We now expect the arch specific images to be tagged as
kata-containers-latest-${arch}.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-03-07 12:02:51 +00:00
Fabiano Fidêncio
eab78cf1ba release: Reword the extra notes added as part of the release
We're trying to keep just the bare minimum info, as we really would like
to not have the list of commits, and mainly the list of new
contributors, trucated from the release notes.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-03-07 12:02:51 +00:00
Fabiano Fidêncio
658fb6972b release: Ensure the release-type is passed to workflows
We need to ensure the release type is passed down to workflows,
otherwise we'll fail to get the correct release version for tagging the
daemonset images.

Fixes: #9064 - part III

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-03-07 12:02:51 +00:00
Alex Lyn
a0a50f5e52
Merge pull request #9191 from Apokleos/fix-kata-ctl-exec0
kata-ctl: Support using container short ID to enter guest.
2024-03-07 19:26:40 +08:00
Wainer dos Santos Moschetta
8ea9ac515e tests/k8s: update kbs repository
Recently confidential-containers/kbs repository was renamed to
confidential-containers/trustee. Github will automatically resolve the
old URL but we better adjust it in code.

The trustee repository will be cloned to $COCO_TRUSTEE_DIR. Adjusted
file paths and pushd/popd's to use $COCO_KBS_DIR
($COCO_TRUSTEE_DIR/kbs).

On versions.yaml changed from `coco-kbs` to `coco-trustee` as in the
future we might need other trustee components, so keeping it generic.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-07 11:20:36 +00:00
Wainer dos Santos Moschetta
c669567cd3 tests/k8s: add utils to set KBS policies
Added the kbs_set_resources_policy() function to set the KBS policy. Also the
kbs_set_allow_all_resources() and kbs_set_deny_all_resources to set the
"allow all" and "deny all" policy, respectively.

Fixes #9056
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-07 11:20:36 +00:00
Wainer dos Santos Moschetta
6f0d38094d tests/k8s: add utils to set KBS resources
Added utility functions to manage resources in KBS:
- kbs_set_resource(), where the resource data is passed via argument
- kbs_set_resource_from_file(), where the resource data is found in a
  file

Fixes #9056
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-07 11:20:36 +00:00
Wainer dos Santos Moschetta
2a374422c5 tests/k8s: add function to install kbs-client
Added kbs_install_cli function to build and install the kbs-client
executable if not present into the system.

Removed the stub from gha-run.sh; now the install kbs-client in the
.github/workflows/run-kata-deploy-tests-on-aks.yaml will effectively
install the executable.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-07 11:20:36 +00:00
Wainer dos Santos Moschetta
4141875ffd ci/lib.sh: set GOPATH default value
Scripts sourcing ci/lib.sh need to set $GOPATH otherwise it will
fail. This ensure that GOPATH is set to ${HOME}/go unless it is
already exported.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-07 11:20:36 +00:00
Wainer dos Santos Moschetta
e410aef4fa tests/k8s: add utils to get kbs service address
Added functions to return the service host, port or full-qualified
HTTP address, respectively, kbs_k8s_svc_host(), kbs_k8s_svc_port(),
and kbs_k8s_svc_http_addr().

Fixes #9056
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-07 11:20:36 +00:00
Leonard Cohnen
e30e8ab7dc genpolicy: add restartPolicy to container struct
This adds support for sidecar container introduced in Kubernetes 1.28

Fixes: #9220

Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
2024-03-07 12:00:14 +01:00
Chungeun Choi
bad263f399 runtime: Replace deprecated module io/ioutil" to "io"
This change updates the module import to use 'util' instead of the deprecated 'io/util'

Fixes: #9166

Signed-off-by: Chungeun Choi <ce.choi@okestro.com>
2024-03-07 10:56:06 +00:00
Alex Lyn
ef9a38e551 shim-interface: add Copyright of AntGroup in file shim-interface.rs
Fixes: #9189

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-03-07 15:46:32 +08:00
Alex Lyn
2972a3a675 shim-interface: add UT for get_uds_with_sid
Fixes: #9189

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-03-07 15:45:44 +08:00
Alex Lyn
7145243bd3 kata-ctl: Support using container short ID to enter guest.
Fixes: #9189

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-03-07 15:44:47 +08:00
Linda Yu
bb77d2d7e6 docs: add docs on how to set policy by kata-runtime
Fixes: #8797

Signed-off-by: Linda Yu <linda.yu@intel.com>
2024-03-07 15:00:23 +08:00
Linda Yu
1c5693be86 stream: repeat copybuffer if it is blocked by policy
copyBuffer returns and the streams will be closed when error occurs.
If the error contains "blocked by policy" it means the log output is
disabled by policy with "ReadStreamRequest" and "WriteStreamRequest" set
to false. But at this moment, we want the real stream still working (not
be seen) because we might want to enable logging for debugging purpose,
so we repeat copybuffer in this case to avoid streams being closed.

Fixes: #8797

Signed-off-by: Linda Yu <linda.yu@intel.com>
2024-03-07 15:00:23 +08:00
Linda Yu
eda419cb03 kata-runtime: add set policy function to kata-runtime
logging/debugging information might probably be disabled in production
due to security consideration, but we'd better provide an approach for
customer to get logging information during runtime, this PR implement
setpolicy function in kata-runtime tools, although it can set whole policy
other than logging.
setpolicy would evokes remote attestation, which means before setting
policy during runtime, user has to reconfigure new policy hash in KBS/AS.

usage:  kata-runtime policy set policy.rego --sandbox-id XXXXXXXX

Fixes: #8797

Signed-off-by: Linda Yu <linda.yu@intel.com>
2024-03-07 15:00:23 +08:00
Dan Mihai
c08b696d9e tests: k8s: k8s-shared-volume generated policy
Auto-generate policy for k8s-shared-volume.bats.

Fixes: #9096

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-03-07 05:57:30 +00:00
Dan Mihai
b24758fad8 tests: k8s: k8s-scale-nginx auto-generated policy
Auto-generate policy for k8s-scale-nginx.bats.

Fixes: #9096

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-03-07 05:57:30 +00:00
Dan Mihai
af9ac8d194 tests: k8s: k8s-replication auto-generated policy
Auto-generate policy for k8s-replication.bats.

Fixes: #9096

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-03-07 05:57:30 +00:00
Dan Mihai
56689c6800 tests: k8s: k8s-qos-pods auto-generated policy
Auto-generate policy for k8s-qos-pods.bats.

Fixes: #9096

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-03-07 05:57:30 +00:00
Dan Mihai
0179f53469 tests: k8s: k8s-parallel auto-generated policy
Auto-generate policy for k8s-parallel.bats.

Fixes: #9096

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-03-07 05:57:30 +00:00
Dan Mihai
73a8b61c2e
Merge pull request #9243 from microsoft/danmihai1/genpolicy-unblock-ci
genpolicy: disable env variable verification
2024-03-06 21:44:18 -08:00
Dan Mihai
e61ef30a76 genpolicy: disable env variable verification
Disable env variable verification to unblock CI, until container
images that don't specify the Env variables will be handled correctly
(see #9239).

Also, mark the image config Env field as optional, thus allowing
policy generation for these container images.

Fixes: #9240

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-03-07 01:59:18 +00:00
Gabriela Cervantes
94fdcda7f7 scripts: Add collect artifacts function in nerdctl gha run script
This PR adds the collect artifacts function in nerdctl gha run script.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-06 19:48:12 +00:00
Gabriela Cervantes
f902ee78d0 gha: Add collect artifacts step to nerdctl workflow
This PR adds the collect artifacts step to nerdctl workflow.

Fixes #9241

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-06 19:41:16 +00:00
GabyCT
640ed591bd
Merge pull request #9219 from GabyCT/topic/fixkerneldoc
docs: Remove stale kernel information at README documentation
2024-03-06 10:24:31 -06:00
James O. D. Hunt
b1d4cbd9d1 utils: spell-checker: Fix grep warning
Fix the `grep(1)` warning caused by the unnecessary escaping of the
hash/sharp symbol.

Fixes: #9235.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-03-06 13:21:15 +00:00
James O. D. Hunt
5257bfa9a9 docs: install: Simplify instructions
Move the "build from source" and "manual installation" details to the
developer guide. This makes the installation landing page clearer for
users.

Fixes: #9234.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-03-06 13:14:03 +00:00
Ryan Savino
fdfc825bc4
Merge pull request #9174 from ryansavino/snp-qemu-stable-coco-tag
versions: SNP qemu updated to stable coco tagged version
2024-03-06 01:03:10 -06:00
GabyCT
83e39a206c
Merge pull request #9223 from jodh-intel/tests-add-k3s-artifacts
tests: Add k3s artifacts
2024-03-05 13:37:21 -06:00
James O. D. Hunt
a67ed2f1c2 tests: Add k3s artifacts
The k3s distribution of k8s uses an embedded version of containerd and
configures it to log to a file, not the journal. Hence, although we
collect the journal as a test artifact, we also need to collect the
actual log files for containerd.

Also collect the k3s containerd config files to help with debugging.

Fixes: #9104.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-03-05 17:54:20 +00:00
GabyCT
9fab57acc8
Merge pull request #9217 from wainersm/revert_collect_artifacts
gha: export start_time to collect artifacts properly
2024-03-05 11:11:49 -06:00
Gabriela Cervantes
12be4cf828 docs: Remove stale kernel information at README documentation
This PR removes stale kernel information at README documentation.

Fixes #9218

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-05 16:46:45 +00:00
Wainer dos Santos Moschetta
9ba5e3d2a8 gha: export start_time to collect artifacts properly
The jobs running on garm will collect journal information. The data gathered
is based on the time the tests started running. The $start_time is
exported on run_tests() and used in collect_artifacts(). It happens that
run_tests() and collect_artifacts() are called on different steps of the
workflow and the environment variables aren't preserved between them,
i.e, $start_time exported on the first step is not available on the
subsequents.

To solve that issue, let's save $start_time in the file pointed out by
$GITHUB_ENV that Github actions uses to export variables. In case $GITHUB_ENV is
empty then probably it is running locally outside of Github, so it won't
save the start time value.

Fixes #9217
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-05 12:15:20 -03:00
James O. D. Hunt
b761a80bd1
Merge pull request #9059 from jodh-intel/kata-manager-add-hypervisor-option
kata-manager: Allow hypervisor to be changed
2024-03-05 09:30:04 +00:00
Alex Lyn
bf5edc8e73
Merge pull request #9155 from Jimmy-Xu/fix-build-gpu-kernel
gpu: fix build guest kernel with gpu
2024-03-05 16:53:44 +08:00
Greg Kurz
0320198889
Merge pull request #9206 from lifupan/main
CI: fix the issue of ci failure on crio
2024-03-05 09:52:13 +01:00
Fupan Li
628f57aca0
Merge pull request #9193 from UiPath/fix/clh-dax
clh: Enable DAX for rootfs
2024-03-05 09:39:22 +08:00