Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
263 commits
Select commit Hold shift + click to select a range
661c00f
rootfs: add back coreutils to mariner's image (#48)
danmihai1 Sep 14, 2023
232714c
rootfs: add back ps to mariner's rootfs (#49)
danmihai1 Sep 14, 2023
5fe97f7
runtime: agent: SNP HOST_DATA set-up (#43)
danmihai1 Aug 23, 2023
e25109d
runtime: agent: validate policy contents (#50)
danmihai1 Sep 14, 2023
8d13eb1
runtime: use 10 PCI segments for the Guest (#59)
danmihai1 Sep 19, 2023
f1aaeaf
policy: bypass empty response from OPA (#85)
danmihai1 Oct 1, 2023
c439dd2
osbuilder: install device-mapper and enable udevd
wedsonaf Mar 16, 2023
b60201a
runtime: add support for layer-src-prefix option
wedsonaf Jun 16, 2023
520e73b
runtime: Allow disabling FS sharing for CLH/SNP
sprt Dec 1, 2023
a5c5445
runtime: Properly specify static resource mgmt
sprt Dec 1, 2023
e04ae70
runtime: decode layer string
wedsonaf Jun 18, 2023
eb3f993
osbuilder: include tardev components to rootfs
wedsonaf Feb 20, 2023
9f386d9
agent: use dm-verity if io.katacontainers.fs-opt.root-hash is set
wedsonaf Jun 13, 2023
1b01983
agent: change to layer directory when mounting overlays
wedsonaf Jun 16, 2023
7542d84
agent: add some context to device mapper error
wedsonaf Jun 23, 2023
5338761
agent: unmount storages in reverse order
wedsonaf Jun 23, 2023
c70d40a
runtime: minimum 10 seconds timeout for bootvm (#37)
danmihai1 Jul 24, 2023
2eda1f1
runtime: accomodate slower than expected boot (#44)
danmihai1 Aug 31, 2023
93c64cd
Append systemd kernel cmdline params for initrd (#39)
dallasd1 Jul 26, 2023
19aa313
tools: keep package zstd-libs in the UVM (#104)
dallasd1 Nov 6, 2023
ae75599
runtime: enable confidential guest by default in non-SNP config (#112)
arc9693 Nov 29, 2023
820aaac
tools: pick up genpolicy improvements (#114)
danmihai1 Nov 28, 2023
29f4aef
genpolicy: add topologySpreadConstraints support (#115)
danmihai1 Nov 29, 2023
e153ece
docs: add agent policy how-to doc (#116)
danmihai1 Nov 29, 2023
39041bc
Add snapshotter build files to .gitignore
sprt Dec 4, 2023
628db06
config: Add SEV SNP config
sprt Dec 5, 2023
8303202
agent: skip mount options that start with "io.katacontainers."
sprt Dec 6, 2023
3286dc6
Add src/agent/samples/policy/test-input/ to .gitignore
sprt Dec 6, 2023
bdd4585
genpolicy: Readd agent type definitions (#118)
Redent0r Dec 6, 2023
3683d4c
utarfs: implement the enumeration of xattrs (#119)
wedsonaf Dec 6, 2023
6fe9857
runtime: use shared dir to mount rootfs
wedsonaf Jun 16, 2023
526188a
Add dev directories to .gitignore
sprt Dec 15, 2023
400aa54
runtime: Resolve high UVM memory footprint
sprt Dec 15, 2023
11f4fb9
genpolicy: allow empty env vars (#120)
Redent0r Dec 7, 2023
002ac74
fixup! runtime: use shared dir to mount rootfs
sprt Dec 15, 2023
3a1461b
genpolicy: changing caching so the tool can run concurrently with itself
SethHollandsworth Nov 28, 2023
1f2690c
policy: Remove outdated samples
sprt Dec 18, 2023
2ae517a
Revert "runtime: use 10 PCI segments for the Guest (#59)"
sprt Dec 18, 2023
627be9b
runtime: agent: use up to 10 PCI segments (#61)
sprt Dec 18, 2023
522463c
agent: Remove obsolete Rego samples
sprt Dec 19, 2023
ae80eba
Microsoft mandatory file
microsoft-github-policy-service[bot] Dec 19, 2023
44186cc
Add kata metapackage change
miz060 Dec 18, 2023
b6cd090
Add new varaiable to differntiate vanilla and coco
miz060 Dec 18, 2023
1f96bd6
tools: Allow setting policy rego file via environment variable (#123)
manuelh-dev Dec 20, 2023
535cb50
Update package name
miz060 Dec 20, 2023
9a78063
genpolicy: deny UpdateEphemeralMountsRequest (#126)
danmihai1 Dec 19, 2023
1e1c013
Create pull_request_template.md
manuelh-dev Dec 20, 2023
d794f38
genpolicy: Update oci_distribution to 0.10.0
Redent0r Dec 20, 2023
d526cb1
Merge pull request #125 from microsoft/mitchzhu/add_meta_pkg
miz060 Dec 21, 2023
8beafe0
Revert "Add kata metapackage change"
miz060 Dec 21, 2023
c2c263a
Merge pull request #132 from microsoft/revert-125-mitchzhu/add_meta_pkg
miz060 Dec 21, 2023
2780493
Merge pull request #129 from microsoft/saulparedes/update_oci_distrib…
Redent0r Dec 21, 2023
d967ae8
lib: Add type definition for Windows support
Redent0r Dec 21, 2023
684477e
Merge pull request #134 from microsoft/saulparedes/fix_windows_build
Redent0r Dec 21, 2023
b94031f
Merge pull request #127 from microsoft/users/GitHubPolicyService/666e…
danmihai1 Dec 21, 2023
3427e4b
genpolicy: update sample
Redent0r Dec 22, 2023
5b285e1
Merge pull request #135 from microsoft/saulparedes/adjust_sample
danmihai1 Dec 22, 2023
32bbcc3
Update pull_request_template.md
manuelh-dev Dec 22, 2023
9c978be
genpolicy: reject some of the CopyFile requests
danmihai1 Dec 21, 2023
cb30ed8
policy: update sample files
danmihai1 Dec 22, 2023
8161af4
Update pull_request_template.md
manuelh-dev Dec 22, 2023
80b0055
Merge pull request #136 from microsoft/danmihai1/copy-file
danmihai1 Dec 22, 2023
06942b2
Update pull_request_template.md
manuelh-dev Dec 22, 2023
baab42d
Merge pull request #131 from microsoft/ms-mahuber-patch-1
manuelh-dev Dec 22, 2023
f1595b9
agent: hold lock while setting new policy
danmihai1 Dec 26, 2023
d3181c8
agent: improve policy handling of CopyFile
danmihai1 Dec 28, 2023
2df8216
genpolicy: block some symlink create requests
danmihai1 Dec 28, 2023
07aa085
policy: update samples
danmihai1 Dec 29, 2023
3083bf9
Merge pull request #137 from microsoft/danmihai1/copy-file
danmihai1 Dec 29, 2023
561c02d
genpolicy: reject kernel_modules
danmihai1 Jan 5, 2024
e446509
genpolicy: validate create sandbox storages
danmihai1 Jan 4, 2024
e86794d
policy: update samples
danmihai1 Jan 5, 2024
cb8b47c
Merge pull request #139 from microsoft/danmihai1/policy-improvements2
danmihai1 Jan 5, 2024
f84ac0e
genpolicy: reject create sandbox hooks
danmihai1 Jan 4, 2024
32c21f2
genpolicy: reject create container hooks
danmihai1 Jan 4, 2024
c7e219b
policy: update samples
danmihai1 Jan 5, 2024
7da3655
Merge pull request #140 from microsoft/danmihai1/hooks
miz060 Jan 6, 2024
dcdc39a
runtime: disable protection check
sprt Jan 12, 2024
74a9b96
Merge pull request #141 from microsoft/sprt/debug-conf-guest
sprt Jan 16, 2024
589207e
osbuilder: use Azure Linux PMC UVM build meta-package
miz060 Jan 17, 2024
f11daf7
genpolicy: Add support for envFrom
Redent0r Dec 19, 2023
7959347
Merge pull request #128 from microsoft/saulparedes/add_envfrom
Redent0r Jan 17, 2024
70925d2
Merge pull request #133 from microsoft/mitchzhu/add_meta_pkg
miz060 Jan 19, 2024
a057c04
github: add `upstream-missing` label to PR checklist
sprt Jan 19, 2024
cc53aa7
github: copy CODEOWNERS from cc-msft-prototypes
christopherco Jan 27, 2023
5ec4406
Merge pull request #148 from microsoft/sprt/fix-codeowners
sprt Jan 19, 2024
b14986e
genpolicy: add SPDX license header
danmihai1 Dec 21, 2023
9edeeae
genpolicy: "cargo fmt -- --check" clean-up
danmihai1 Jan 13, 2024
2cf24ec
genpolicy: cargo clippy fixes
danmihai1 Jan 13, 2024
b6d73f7
tools: genpolicy static checks
danmihai1 Jan 12, 2024
4917895
genpolicy: use root path from cbl-mariner Guest VM
danmihai1 Jan 15, 2024
42830f8
genpolicy: ignore pod DNS settings
danmihai1 Jan 19, 2024
9e91b21
policy: update sample files
danmihai1 Jan 20, 2024
34b8f61
Merge pull request #149 from microsoft/danmihai/pick-up-upstream
danmihai1 Jan 21, 2024
5d506f8
genpolicy: add shareProcessNamespace support
danmihai1 Jan 21, 2024
942b424
policy: update sample files
danmihai1 Jan 21, 2024
dae9db4
Merge pull request #150 from microsoft/danmihai1/shareProcessNamespace
danmihai1 Jan 22, 2024
41c8bc5
genpolicy: don't panic without cache file
danmihai1 Jan 22, 2024
d7af45e
Merge pull request #147 from microsoft/sprt/upstream-label2
sprt Jan 22, 2024
4f4d264
Merge pull request #151 from microsoft/danmihai1/no-cache-file
danmihai1 Jan 22, 2024
f16fbd1
genpolicy: add support for runAsUser
danmihai1 Jan 22, 2024
3e01311
policy: update sample files
danmihai1 Jan 22, 2024
5799fdf
Merge pull request #153 from microsoft/danmihai1/run-as-user
danmihai1 Jan 24, 2024
5952d30
runtime: fix error when using the debug console
danmihai1 Sep 1, 2022
fb4c887
config: don't hardcode confidential_guest=true for clh
sprt Jan 23, 2024
3bdb44d
genpolicy: add support for seccompProfile field
Redent0r Jan 26, 2024
c034bdc
genpolicy: updat policy samples
Redent0r Jan 26, 2024
3d44189
Merge pull request #152 from microsoft/saulparedes/support_seccompPro…
Redent0r Jan 26, 2024
f06cbc4
genpolicy: add priorityClassName as a field in PodSpec interface
arc9693 Jan 22, 2024
9ec2441
pod-ubuntu.yaml: Update spec file
arc9693 Jan 22, 2024
4736bd0
Add support for PodDisruptionBudget yaml
arc9693 Jan 30, 2024
a109d10
Merge pull request #145 from microsoft/archana1/genpolicy-priority-class
danmihai1 Jan 30, 2024
17da19f
Merge pull request #156 from microsoft/archana1/pdb-support
arc9693 Jan 30, 2024
b4ab11d
rootfs-builder: only look for AGENT_POLICY_FILE if AGENT_POLICY=yes
sprt Jan 30, 2024
542fc11
.github: fix the failure without devicemapper for host sharing
Nov 17, 2023
7726090
agent: fix code so that `make check` passes
sprt Jan 31, 2024
3f35717
Merge pull request #157 from microsoft/sprt/fix-agent-check
sprt Jan 31, 2024
93871fd
genpolicy: update policy sample
Redent0r Feb 2, 2024
b25ba3d
Merge pull request #158 from microsoft/saulparedes/update_sample
Redent0r Feb 2, 2024
5d2aa71
tarfs: keep ctx->pos up to date because dir_emit uses it
wedsonaf Aug 12, 2023
3f07137
tarfs: don't fail if at least one directory was emitted
wedsonaf Aug 12, 2023
68b255c
tarfs: unlock the page (and set the error flag) on failure to map it
wedsonaf Aug 14, 2023
4ebef3f
tarfs: don't issue bdev read requests for bad offsets
wedsonaf Aug 17, 2023
c0492c2
tarfs: call iget_failed on failure post iget_locked
wedsonaf Aug 17, 2023
2a17d18
tarfs: ensure the underlying block device can hold at least one block
wedsonaf Sep 7, 2023
14e22b6
tarfs: use GPF_NOFS when allocating memory on a mounted fs
wedsonaf Feb 9, 2024
ca1b9a7
runtime: make sev_snp_guest default to false
sprt Feb 12, 2024
0c12c64
Merge pull request #160 from microsoft/wedsonaf/tardev
manuelh-dev Feb 13, 2024
401db3a
Merge pull request #154 from microsoft/sprt/align-vanilla-sources
sprt Feb 14, 2024
b5effd4
genpolicy: ignore Role resource
Redent0r Feb 19, 2024
3e6fd60
genpolicy: update samples
Redent0r Feb 19, 2024
04747a1
Merge pull request #164 from microsoft/saulparedes/fix_ingress_test
Redent0r Feb 20, 2024
3951807
tarindex: Add special symlink name handling
miz060 Mar 5, 2024
daba467
Merge pull request #159 from microsoft/mitchzhu/genpolicy_fix_long_li…
miz060 Mar 5, 2024
ebb5b80
genpolicy: update samples
Redent0r Mar 13, 2024
63eba60
Merge pull request #165 from microsoft/saulparedes/update_samples
Redent0r Mar 19, 2024
eb74a76
genpolicy: update samples
Redent0r Mar 20, 2024
d9d794b
Merge pull request #167 from microsoft/saulparedes/update_samples
Redent0r Mar 20, 2024
8cd188d
genpolicy: block all relative paths for copyFile requests
Redent0r Mar 19, 2024
639c591
genpolicy: update samples
Redent0r Mar 19, 2024
2659e6a
Merge pull request #166 from microsoft/saulparedes/block_all_relative…
Redent0r Mar 21, 2024
96ffbf1
genpolicy: disable env variable verification
danmihai1 Mar 6, 2024
3a2f65e
genpolicy: default env if image doesn't have env
danmihai1 Mar 6, 2024
f223349
genpolicy: update sample
Redent0r Mar 27, 2024
1b5dc2e
Merge pull request #168 from microsoft/3.2.0.azl0.genpolicy1-msft-main
Redent0r Mar 28, 2024
9b04994
genpolicy: optional PodTemplateSpec metadata field
danmihai1 Jan 25, 2024
7868fdb
genpolicy: ignore the nodeName field
danmihai1 Jan 26, 2024
c3dc031
genpolicy: fix ConfigMap volume mount paths
danmihai1 Jan 26, 2024
a3d481f
genpolicy: ignore volume configMap optional field
danmihai1 Jan 30, 2024
04bdb2f
Merge pull request #171 from microsoft/saulparedes/genpolicy_sync_1
Redent0r Apr 9, 2024
c608826
genpolicy: allow separate paths for rules and settings files
malt3 Jan 29, 2024
97fac86
genpolicy: support non-default namespace name
danmihai1 Jan 31, 2024
2b3408d
genpolicy: ignore empty YAML as input
danmihai1 Jan 30, 2024
11c3296
Merge pull request #172 from microsoft/saulparedes/genpolicy_sync_2
Redent0r Apr 9, 2024
cb75f5f
genpolicy: update default values
danmihai1 Feb 7, 2024
35e34ef
genpolicy: add easy way to allow CloseStdinRequest
danmihai1 Feb 7, 2024
78a9152
genpolicy: improve logging from ExecProcessRequest
danmihai1 Feb 7, 2024
0b05a2d
genpolicy: fix typo in policy logging
danmihai1 Feb 10, 2024
8f07523
genpolicy: panic when we see a volume mount subpath
Redent0r Feb 23, 2024
8d86d84
genpolicy: add restartPolicy to container struct
3u13r Mar 5, 2024
2148abe
genpolicy: reduce policy debug prints
danmihai1 Mar 26, 2024
db5c673
genpolicy: update samples
Redent0r Apr 10, 2024
7f92755
Merge pull request #173 from microsoft/saulparedes/genpolicy_sync_3
Redent0r Apr 10, 2024
6e3dfde
agent: add SMB storage handler
arc9693 Apr 8, 2024
04a84d5
runtime: add support to handle SMB mounts
arc9693 Mar 26, 2024
fc54dd7
genpolicy: add containerd pull method
Redent0r Apr 11, 2024
1a2a44b
genpolicy: disable containerd pull on Windows
Redent0r Apr 12, 2024
41806f9
Merge pull request #169 from microsoft/archana1/addSMBSupport
arc9693 Apr 12, 2024
42d6b0d
genpolicy: add yaml sample
Redent0r Apr 12, 2024
9b7dcc0
Merge pull request #163 from microsoft/saulparedes/use_containerd_cli…
Redent0r Apr 12, 2024
4b44220
genpolicy: support readonly hostpath
Redent0r Apr 14, 2024
a9e6fb8
genpolicy: update samples
Redent0r Apr 14, 2024
658fcdd
Merge pull request #175 from microsoft/saulparedes/support_readonly_h…
Redent0r Apr 15, 2024
0e7ab3c
genpolicy: pass PVCs to get_mount_and_storage()
sprt Apr 12, 2024
8681920
genpolicy: support arbitrary resources with -c
sprt Apr 15, 2024
7951001
genpolicy: support PVCs with -c flag
sprt Apr 16, 2024
9c43bcf
genpolicy: add support for cc-managed-csi
sprt Apr 12, 2024
c2fd4d6
update_policy_samples: run in parallel
sprt Apr 15, 2024
7c0206c
samples: update genpolicy samples
sprt Apr 16, 2024
a2f0902
Merge pull request #174 from sprt/genpolicy-azuredisk
sprt Apr 17, 2024
8717d39
genpolicy: add support for cc-local-csi
sprt Apr 17, 2024
5650c9b
samples: update genpolicy samples
sprt Apr 17, 2024
a067b65
genpolicy: add --version flag
Redent0r Apr 15, 2024
b0a632c
Merge pull request #176 from microsoft/saulparedes/add_version_flag
Redent0r Apr 17, 2024
fa6b734
agent: shutdown vm on exit when agent is used as init process
alex-matei Apr 8, 2024
f467a04
Merge pull request #178 from sprt/gp-azurelocal
sprt Apr 18, 2024
9e73d0b
Merge pull request #179 from microsoft/saulparedes/sync_downstream
Redent0r Apr 18, 2024
a2207a3
genpolicy: add missing cache improvements
Redent0r Apr 22, 2024
b4c814c
Merge pull request #181 from microsoft/saulparedes/add_missing_cache_…
Redent0r Apr 23, 2024
0cb2324
genpolicy: add support for cc-azurefile-csi driver
arc9693 Apr 24, 2024
b5d68be
genpolicy: update policy samples
arc9693 Apr 24, 2024
3d38906
Merge pull request #180 from microsoft/archana1/azurefile-genpolicy
sprt Apr 24, 2024
823dcd2
Revert "runtime: agent: use up to 10 PCI segments (#61)"
danmihai1 Apr 23, 2024
6a47c86
runtime: clh: clean-up merge from main
danmihai1 Apr 19, 2024
c905577
runtime: agent: use PCI segments 1+ for blk devices
danmihai1 Apr 23, 2024
bbc7b97
samples: pod with ~70 image layers
danmihai1 Apr 25, 2024
38ebfa9
agent: lock anyhow version to 1.0.58
danmihai1 Apr 22, 2024
11f78ae
agent: use regorus instead of opa
danmihai1 Apr 22, 2024
0e79eef
genpolicy: bump release version
Redent0r Apr 26, 2024
7ea417b
Merge pull request #185 from microsoft/saulparedes/bump_release_version
Redent0r Apr 26, 2024
cbb60ff
genpolicy: update sample location
Redent0r Apr 30, 2024
99f1e83
Merge pull request #183 from microsoft/danmihai1/hotplug7
Redent0r Apr 30, 2024
02f03b3
Merge pull request #184 from microsoft/danmihai1/msft-regorus
Redent0r Apr 30, 2024
8df0459
rootfs: Stop building and shipping OPA
fidencio Apr 25, 2024
304d016
clh: initialize clh pid before using it
alex-matei Mar 6, 2024
5e0ec90
clh: isClhRunning waits for full timeout when clh exits
alex-matei Apr 8, 2024
9b43ba8
genpolicy: update sample
Redent0r Apr 30, 2024
597200d
Merge pull request #182 from microsoft/saulparedes/wait_for_clh
Redent0r May 2, 2024
dda2c28
Merge pull request #187 from microsoft/saulparedes/remove_opa2
Redent0r May 2, 2024
915a8fc
kata: Remove Issue - PR dependency
zvonkok Apr 17, 2024
9ce3226
Merge pull request #189 from microsoft/sprt/remove-fixes-check
sprt May 7, 2024
949f8c8
ci: add check for policy samples
sprt Apr 29, 2024
a004ef0
Merge pull request #186 from microsoft/sprt/workflow-update-samples
sprt May 7, 2024
af24293
samples: don't execute genpolicy as root user
danmihai1 May 8, 2024
82b870c
Merge pull request #190 from microsoft/danmihai1/change-containerd-so…
danmihai1 May 10, 2024
662c86e
genpolicy: update sample
Redent0r Apr 15, 2024
5f2bb03
genpolicy: update docker sample annotation
Redent0r May 10, 2024
f08c115
samples: save decoded policy text
danmihai1 May 10, 2024
6ca5489
samples: update policy for new container image
danmihai1 May 10, 2024
4b2ede3
Merge pull request #177 from microsoft/saulparedes/update_samples
Redent0r May 13, 2024
d056343
tools: Add initial igvm-builder and node-builder/azure-linux scripting
Mar 5, 2024
a8a038f
Merge pull request #188 from microsoft/mahuber/reproducible-builds
manuelh-dev May 13, 2024
dde0102
Merge pull request #191 from microsoft/danmihai1/save-policy-file
danmihai1 May 16, 2024
ff4c1ec
samples: use the dm-verity root hash cache
danmihai1 May 16, 2024
a1c3b2c
Merge pull request #192 from microsoft/danmihai1/genpolicy-cache
danmihai1 May 20, 2024
57ab374
clh: update sev snp param
Redent0r May 28, 2024
dde443c
Merge pull request #197 from microsoft/saulparedes/update_sev_snp_param
Redent0r Jun 5, 2024
6e5f3a0
genpolicy: add persistent storage support for stateful sets
arc9693 Jun 3, 2024
b41e55e
genpolicy: update policy samples
arc9693 Jun 6, 2024
2d32df1
Merge pull request #199 from microsoft/archana1/add-pv-ss
arc9693 Jun 6, 2024
980fb87
samples: add common images category
Redent0r Jun 11, 2024
70d6bf6
genpolicy: update policy samples
Jun 12, 2024
12d4585
Merge pull request #200 from microsoft/saulparedes/test_common_images
Redent0r Jun 13, 2024
a4b4ca2
Merge pull request #201 from microsoft/mahuber/samples
manuelh-dev Jun 13, 2024
39ab779
rootfs: Install Rust only when necessary
Jun 13, 2024
9c9199e
build: allow rootfs builds w/o git or VERSION file deps
Jun 11, 2024
f2f5d12
samples: change job.yaml to an mcr container image
danmihai1 Jul 11, 2024
cd7c5fa
Merge pull request #207 from microsoft/danmihai1/job-mcr
danmihai1 Jul 12, 2024
1590a72
samples: introduce incomplete_init category
Jul 12, 2024
cc23bdb
Merge pull request #208 from microsoft/mahuber/incomplete_init
manuelh-dev Jul 12, 2024
e7cb0d1
Merge pull request #206 from microsoft/mahuber/cherry-pick-upstr
manuelh-dev Jul 15, 2024
2f672a1
tools: Improve igvm-builder and node-builder/azure-linux scripting
Jun 4, 2024
dd57910
Merge pull request #204 from microsoft/mahuber/uvm-spec-build-pr
manuelh-dev Jul 15, 2024
e6e6d34
tardev: update tardev-snapshotter.service
miz060 Jul 15, 2024
1276d40
Merge pull request #209 from microsoft/mitchzhu/tardev-service
miz060 Jul 16, 2024
16523e2
samples: reduce dependencies to docker hub
Jul 16, 2024
386cab0
Merge pull request #210 from microsoft/tests/img-pull-src
manuelh-dev Jul 17, 2024
7f872b1
genpolicy: add utility script for containerd pull
Redent0r Aug 5, 2024
3e5b2b6
genpolicy: improve setup script
Redent0r Aug 6, 2024
0b22797
genpolicy: add guide for setup containerd pull
Redent0r Aug 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# By default, all files require review by members of these teams
* @microsoft/kata-cc-devs @microsoft/kata-cc-admins

# Modifications to this file require admin approval
/.github/CODEOWNERS @microsoft/kata-cc-admins
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
###### Merge Checklist <!-- REQUIRED -->
- [ ] Followed patch format from upstream recommendation: https://github.com/kata-containers/community/blob/main/CONTRIBUTING.md#patch-format
- [ ] Included a single commit in a given PR - at least unless there are related commits and each makes sense as a change on its own.
- [ ] Aware about the PR to be merged using "create a merge commit" rather than "squash and merge" (or similar)
- [ ] genPolicy only: Ensured the tool still builds on Windows
- [ ] The `upstream/missing` label (or `upstream/not-needed`) has been set on the PR.

###### Summary <!-- REQUIRED -->
<!-- Quick explanation of WHAT changed and WHY. -->

###### Test Methodology
<!-- How was this test validated? i.e. local build, pipeline build etc. -->
1 change: 1 addition & 0 deletions .github/workflows/build-kata-static-tarball-amd64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- cloud-hypervisor
- cloud-hypervisor-glibc
- firecracker
- genpolicy
- kata-ctl
- kernel
- kernel-sev
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/check-samples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright (c) Microsoft Corporation.

name: Check policy samples

on:
pull_request:

jobs:
check-policy-samples:
runs-on: ubuntu-latest

steps:

- name: Check out code
uses: actions/checkout@v4

- name: Install yq
env:
INSTALL_IN_GOPATH: false
run: |
./ci/install_yq.sh

- name: Install Rust
run: |
./tests/install_rust.sh
echo "${HOME}/.cargo/bin" >> $GITHUB_PATH

- name: Install protobuf-compiler
run: |
sudo apt-get -y install protobuf-compiler

- name: Configure containerd
run: |
sudo containerd config default | sudo dd of=/etc/containerd/config.toml
sudo systemctl restart containerd
sudo systemctl is-active containerd

- name: Update policy samples
working-directory: ./src/tools/genpolicy
run: |
python3 update_policy_samples.py

- name: Show diff
run: |
git diff

- name: Check policy samples
run: |
git diff-files --exit-code
11 changes: 0 additions & 11 deletions .github/workflows/commit-message-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ jobs:
error: 'Body line too long (max 150)'
post_error: ${{ env.error_msg }}

- name: Check Fixes
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') && ( success() || failure() ) }}
uses: tim-actions/[email protected]
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
pattern: '\s*Fixes\s*:?\s*(#\d+|github\.com\/kata-containers\/[a-z-.]*#\d+)|^\s*release\s*:'
flags: 'i'
error: 'No "Fixes" found'
post_error: ${{ env.error_msg }}
one_pass_all_pass: 'true'

- name: Check Subsystem
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') && ( success() || failure() ) }}
uses: tim-actions/[email protected]
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/move-issues-to-in-progress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ jobs:
grep -v "^\#" |\
cut -d';' -f3 || true)

# PR doesn't have any linked issues
# (it should, but maybe a new user forgot to add a "Fixes: #XXX" commit).
# PR doesn't have any linked issues, handle it only if it exists
[ -z "$linked_issue_urls" ] && {
echo "::error::No linked issues for PR $pr"
exit 1
echo "::warning::No linked issues for PR $pr"
exit 0
}

project_name="Issue backlog"
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/static-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
- log-parser-rs
- runk
- trace-forwarder
- genpolicy
command:
- "make vendor"
- "make check"
Expand Down Expand Up @@ -78,6 +79,8 @@ jobs:
install-libseccomp: yes
- component: runk
install-libseccomp: yes
- component: genpolicy
component-path: src/tools/genpolicy
steps:
- name: Checkout the code
uses: actions/checkout@v4
Expand All @@ -98,9 +101,15 @@ jobs:
run: |
./tests/install_rust.sh
echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
- name: Install protobuf-compiler
if: ${{ matrix.command == 'make check' && matrix.component == 'genpolicy' }}
run: sudo apt-get -y install protobuf-compiler
- name: Install musl-tools
if: ${{ matrix.component != 'runtime' }}
run: sudo apt-get -y install musl-tools
- name: Install devicemapper
if: ${{ matrix.command == 'make check' && matrix.component == 'agent' }}
run: sudo apt-get -y install libdevmapper-dev
- name: Install libseccomp
if: ${{ matrix.command != 'make vendor' && matrix.command != 'make check' && matrix.install-libseccomp == 'yes' }}
run: |
Expand Down
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,20 @@ src/agent/protocols/src/*.rs
!src/agent/protocols/src/lib.rs
build
src/tools/log-parser/kata-log-parser

# Microsoft-specific
.cargo/
vendor/
src/agent/samples/policy/test-input/
src/tarfs/**/*.cmd
src/tarfs/**/*.ko
src/tarfs/**/*.mod
src/tarfs/**/*.mod.c
src/tarfs/**/*.o
src/tarfs/**/modules.order
src/tarfs/**/Module.symvers
src/tarfs-cvm/
tools/osbuilder/root_hash.txt
tools/osbuilder/igvm.log
tools/osbuilder/kata-opa.service
tools/osbuilder/rootfs-builder/opa/
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ COMPONENTS += agent
COMPONENTS += dragonball
COMPONENTS += runtime
COMPONENTS += runtime-rs
COMPONENTS += tarfs
COMPONENTS += tardev-snapshotter
COMPONENTS += overlay
COMPONENTS += utarfs

# List of available tools
TOOLS =
Expand Down
41 changes: 41 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.9 BLOCK -->

## Security

Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).

If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.

## Preferred Languages

We prefer all communications to be in English.

## Policy

Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).

<!-- END MICROSOFT SECURITY.MD BLOCK -->
4 changes: 3 additions & 1 deletion docs/how-to/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@
- [How to run Kata Containers with AMD SEV-SNP](how-to-run-kata-containers-with-SNP-VMs.md)
- [How to use EROFS to build rootfs in Kata Containers](how-to-use-erofs-build-rootfs.md)
- [How to run Kata Containers with kinds of Block Volumes](how-to-run-kata-containers-with-kinds-of-Block-Volumes.md)
- [How to use the Kata Agent Policy](how-to-use-the-kata-agent-policy.md)

## Confidential Containers
- [How to use the Kata Agent Policy](how-to-use-the-kata-agent-policy.md)
129 changes: 128 additions & 1 deletion docs/how-to/how-to-use-the-kata-agent-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ When compiled with default settings, the Kata Containers code doesn't include th

1. The Kata Agent gets built using `AGENT_POLICY=yes`, and therefore includes Policy support. If the `AGENT_INIT=yes` build parameter was specified in addition to `AGENT_POLICY=yes`, the Kata Agent will start `OPA` during the Kata Containers sandbox creation.

# Policy format

The Policy document is a text file using the [`Rego` policy language](https://www.openpolicyagent.org/docs/latest/policy-language/). See [Creating the Policy document](#creating-the-policy-document) for information related to creating Policy files.

# Providing the Policy to the Kata Agent

There are two methods for providing the Policy document to the Kata Agent:
Expand Down Expand Up @@ -66,4 +70,127 @@ While creating the Pod sandbox, the Kata Shim will notice the `io.katacontainers

# How is the Policy being enforced?

The Kata Agent is responsible for enforcing the Policy, working together with `OPA`. The Agent checks the Policy for each [ttRPC API](../../src/libs/protocols/protos/agent.proto) request. Before carrying out the actions corresponding to the request, the Agent uses the [`OPA REST API`](https://www.openpolicyagent.org/docs/latest/rest-api/) to check if the Policy allows or blocks the call. The Agent rejects requests that are not allowed by the Policy.
The Kata Agent is responsible for enforcing the Policy, working together with [`OPA`](https://www.openpolicyagent.org/). The Agent checks the Policy for each [ttRPC API](../../src/libs/protocols/protos/agent.proto) request. Before carrying out the actions corresponding to the request, the Agent uses the [`OPA REST API`](https://www.openpolicyagent.org/docs/latest/rest-api/) to check if the Policy allows or blocks the request. The Agent rejects requests that are not allowed by the Policy.

# Creating the Policy document

## Creating the Policy document manually

For relatively simple uses cases, users can write the Policy text using the [`Rego` policy language documentation](https://www.openpolicyagent.org/docs/latest/policy-language/) as reference.

See [Policy contents](#policy-contents) for additional information.

## Using auto-generated Policy

The [`genpolicy`](../../src/tools/genpolicy/) application can be used to generate automatically a Policy matching an input Kubernetes `YAML` file. The Policy generated by this application is typically used for implementing confidential containers, where the Kata Shim and the Kata Agent have different trust properties.

**Warning** Users should review carefully the automatically-generated Policy, and modify the Policy file if needed to match better their use case, before using this Policy.

See the [`genpolicy` documentation](../../src/tools/genpolicy/README.md) and the [Policy contents examples](#policy-contents) for additional information.

## Policy contents

### The [`Rego`](https://www.openpolicyagent.org/docs/latest/policy-language/) package name

The name of the Kata Agent Policy package must be `agent_policy`. Therefore, all Agent Policy documents must start with:

```
package agent_policy
```
### Default values

When the Kata Shim sends a [ttRPC API](../../src/libs/protocols/protos/agent.proto) request to the Kata Agent, the [Policy rules](#rules) corresponding to that request type are evaluated. For example, when the Agent receives a `CopyFile` request, any rules defined in the Policy that are using the name `CopyFileRequest` are evaluated. [`OPA`](https://www.openpolicyagent.org/) evaluates these rules and tries to find at least one `CopyFileRequest` rule that returns value `true`:

1. If at least one `CopyFileRequest` rule returns `true`, `OPA` returns a `true` result to the Kata Agent, and the Agent carries out the file copy requested by the Shim.

1. If all the `CopyFileRequest` rules return `false`:
- If the Policy includes a default value for `CopyFileRequest`, `OPA` returns that value to the Agent.
- If the Policy doesn't include a default value for `CopyFileRequest`, `OPA` returns an empty response to the Agent. The Agent treats the empty response the same way as a `false` response, so it rejects the `CopyFile` request.

**Tip:** Although the Kata Agent treats empty responses from `OPA` similarly to `false` responses, it is recommended to always provide default values. With default values, the Policy document and the logs from `OPA` and Kata Agent are easier to understand.

Examples of default values:

```
default WaitProcessRequest := true
default ExecProcessRequest := false
```

### Policy data

Policy data is optional. It typically contains values that are compared by the [Policy rules](#rules) with the input parameters of a [ttRPC API](../../src/libs/protocols/protos/agent.proto) request. Based on this comparison, a rule can either allow or deny the request, by returning `true` or `false`.

Example of Policy data:

```
policy_data := {
"common": {
"cpath": "/run/kata-containers/shared/containers"
},
"request_defaults": {
"CopyFileRequest": [
"^$(cpath)/"
],
"ExecProcessRequest": {
"commands": [
"/bin/foo"
],
"regex": []
}
}
}
```

### Rules

Policy rules are optional. They typically compare the input parameters of a [ttRPC API](../../src/libs/protocols/protos/agent.proto) request with values from the [policy data](#policy-data). Based on this comparison, a rule can either allow or deny the request, by returning `true` or `false`.

Multiple rules having the same name can be defined in the same Policy. As described [above](#default-values), when the Kata Agent queries [`OPA`](https://www.openpolicyagent.org/) by using the [`OPA REST API`](https://www.openpolicyagent.org/docs/latest/rest-api/), `OPA` tries to find at least one rule having the same name as the request that returns `true` given the API input parameters defined by the [ttRPC API](../../src/libs/protocols/protos/agent.proto).

Examples of rules, corresponding to the Kata Agent `CopyFile` and `ExecProcess` requests:

```
import future.keywords.in
import input

CopyFileRequest {
print("CopyFileRequest: input.path =", input.path)

some regex1 in policy_data.request_defaults.CopyFileRequest
regex2 := replace(regex1, "$(cpath)", policy_data.common.cpath)
regex.match(regex2, input.path)

print("CopyFileRequest: true")
}

ExecProcessRequest {
print("ExecProcessRequest 1: input =", input)

i_command = concat(" ", input.process.Args)
print("ExecProcessRequest 1: i_command =", i_command)

some p_command in policy_data.request_defaults.ExecProcessRequest.commands
p_command == i_command

print("ExecProcessRequest 1: true")
}

ExecProcessRequest {
print("ExecProcessRequest 2: input =", input)

i_command = concat(" ", input.process.Args)
print("ExecProcessRequest 2: i_command =", i_command)

some p_regex in policy_data.request_defaults.ExecProcessRequest.regex
print("ExecProcessRequest 2: p_regex =", p_regex)

regex.match(p_regex, i_command)

print("ExecProcessRequest 2: true")
}

```

The `input` data from these examples is provided to `OPA` by the Kata Agent, as a ``JSON`` format representation of the API request parameters.

For additional examples of Policy rules, see [`rules.rego`](../../src/tools/genpolicy/rules.rego).
Loading