Commit Graph

343 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
b947a6f528
update go to go1.20.4, go1.19.9
go1.20.4 (released 2023-05-02) includes three security fixes to the html/template
package, as well as bug fixes to the compiler, the runtime, and the crypto/subtle,
crypto/tls, net/http, and syscall packages. See the Go 1.20.4 milestone on our
issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.20.4+label%3ACherryPickApproved

release notes: https://go.dev/doc/devel/release#go1.20.4
full diff: https://github.com/golang/go/compare/go1.20.3...go1.20.4

from the announcement:

> These minor releases include 3 security fixes following the security policy:
>
> - html/template: improper sanitization of CSS values
>
>   Angle brackets (`<>`) were not considered dangerous characters when inserted
>   into CSS contexts. Templates containing multiple actions separated by a '/'
>   character could result in unexpectedly closing the CSS context and allowing
>   for injection of unexpected HMTL, if executed with untrusted input.
>
>   Thanks to Juho Nurminen of Mattermost for reporting this issue.
>
>   This is CVE-2023-24539 and Go issue https://go.dev/issue/59720.
>
> - html/template: improper handling of JavaScript whitespace
>
>   Not all valid JavaScript whitespace characters were considered to be
>   whitespace. Templates containing whitespace characters outside of the character
>   set "\t\n\f\r\u0020\u2028\u2029" in JavaScript contexts that also contain
>   actions may not be properly sanitized during execution.
>
>   Thanks to Juho Nurminen of Mattermost for reporting this issue.
>
>   This is CVE-2023-24540 and Go issue https://go.dev/issue/59721.
>
> - html/template: improper handling of empty HTML attributes
>
>   Templates containing actions in unquoted HTML attributes (e.g. "attr={{.}}")
>   executed with empty input could result in output that would have unexpected
>   results when parsed due to HTML normalization rules. This may allow injection
>   of arbitrary attributes into tags.
>
>   Thanks to Juho Nurminen of Mattermost for reporting this issue.
>
>   This is CVE-2023-29400 and Go issue https://go.dev/issue/59722.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-03 20:38:00 +02:00
Nashwan Azhari
2e53c0ec8d Windows integration: fix critest binary path in Azure-based workflow.
The critest binary build directory has changed following
kubernetes-sigs/cri-tools#1085 to also include the OS and architecture,
so the Azure-based Windows workflows needed to be updated to account for
the new path.

Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
2023-05-02 19:15:56 +03:00
Maksym Pavlenko
c58a229e50 Run CI when adding to the merge queue
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-04-28 12:35:38 -07:00
Samuel Karp
7b18b48079
Merge pull request #8363 from aznashwan/windows-ci-azure-skus 2023-04-21 05:18:18 -07:00
Phil Estes
aee3587651
Update to setup-go@v4 action
The latest setup-go action caches the Go pkg cache and may have several
minute-per-run speed improvement on CI runs which have to fill the
pkg cache.

Signed-off-by: Phil Estes <estesp@amazon.com>
2023-04-07 15:26:40 -04:00
Nashwan Azhari
811be6085f Update Azure-based Windows workflow image SKUs.
Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
2023-04-07 13:42:30 +03:00
Kazuyoshi Kato
7cd72cce99
Merge pull request #8043 from gabriel-samfira/wcow_mount_layers_rebased
Mount snapshots on Windows
2023-04-06 16:34:05 -07:00
Sebastiaan van Stijn
0fb2d91322
update go to go1.20.3, go1.19.8
go1.20.3 (released 2023-04-04) includes security fixes to the go/parser,
html/template, mime/multipart, net/http, and net/textproto packages, as well
as bug fixes to the compiler, the linker, the runtime, and the time package.
See the Go 1.20.3 milestone on our issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.20.3+label%3ACherryPickApproved

full diff: https://github.com/golang/go/compare/go1.20.2...go1.20.3

go1.19.8 (released 2023-04-04) includes security fixes to the go/parser,
html/template, mime/multipart, net/http, and net/textproto packages, as well as
bug fixes to the linker, the runtime, and the time package. See the Go 1.19.8
milestone on our issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.19.8+label%3ACherryPickApproved

full diff: https://github.com/golang/go/compare/go1.19.7...go1.19.8

Further details from the announcement on the mailing list:

We have just released Go versions 1.20.3 and 1.19.8, minor point releases.
These minor releases include 4 security fixes following the security policy:

- go/parser: infinite loop in parsing

  Calling any of the Parse functions on Go source code which contains `//line`
  directives with very large line numbers can cause an infinite loop due to
  integer overflow.
  Thanks to Philippe Antoine (Catena cyber) for reporting this issue.
  This is CVE-2023-24537 and Go issue https://go.dev/issue/59180.

- html/template: backticks not treated as string delimiters

  Templates did not properly consider backticks (`) as Javascript string
  delimiters, and as such did not escape them as expected. Backticks are
  used, since ES6, for JS template literals. If a template contained a Go
  template action within a Javascript template literal, the contents of the
  action could be used to terminate the literal, injecting arbitrary Javascript
  code into the Go template.

  As ES6 template literals are rather complex, and themselves can do string
  interpolation, we've decided to simply disallow Go template actions from being
  used inside of them (e.g. "var a = {{.}}"), since there is no obviously safe
  way to allow this behavior. This takes the same approach as
  github.com/google/safehtml. Template.Parse will now return an Error when it
  encounters templates like this, with a currently unexported ErrorCode with a
  value of 12. This ErrorCode will be exported in the next major release.

  Users who rely on this behavior can re-enable it using the GODEBUG flag
  jstmpllitinterp=1, with the caveat that backticks will now be escaped. This
  should be used with caution.

  Thanks to Sohom Datta, Manipal Institute of Technology, for reporting this issue.

  This is CVE-2023-24538 and Go issue https://go.dev/issue/59234.

- net/http, net/textproto: denial of service from excessive memory allocation

  HTTP and MIME header parsing could allocate large amounts of memory, even when
  parsing small inputs.

  Certain unusual patterns of input data could cause the common function used to
  parse HTTP and MIME headers to allocate substantially more memory than
  required to hold the parsed headers. An attacker can exploit this behavior to
  cause an HTTP server to allocate large amounts of memory from a small request,
  potentially leading to memory exhaustion and a denial of service.
  Header parsing now correctly allocates only the memory required to hold parsed
  headers.

  Thanks to Jakob Ackermann (@das7pad) for discovering this issue.

  This is CVE-2023-24534 and Go issue https://go.dev/issue/58975.

- net/http, net/textproto, mime/multipart: denial of service from excessive resource consumption

  Multipart form parsing can consume large amounts of CPU and memory when
  processing form inputs containing very large numbers of parts. This stems from
  several causes:

  mime/multipart.Reader.ReadForm limits the total memory a parsed multipart form
  can consume. ReadForm could undercount the amount of memory consumed, leading
  it to accept larger inputs than intended. Limiting total memory does not
  account for increased pressure on the garbage collector from large numbers of
  small allocations in forms with many parts. ReadForm could allocate a large
  number of short-lived buffers, further increasing pressure on the garbage
  collector. The combination of these factors can permit an attacker to cause an
  program that parses multipart forms to consume large amounts of CPU and
  memory, potentially resulting in a denial of service. This affects programs
  that use mime/multipart.Reader.ReadForm, as well as form parsing in the
  net/http package with the Request methods FormFile, FormValue,
  ParseMultipartForm, and PostFormValue.

  ReadForm now does a better job of estimating the memory consumption of parsed
  forms, and performs many fewer short-lived allocations.

  In addition, mime/multipart.Reader now imposes the following limits on the
  size of parsed forms:

  Forms parsed with ReadForm may contain no more than 1000 parts. This limit may
  be adjusted with the environment variable GODEBUG=multipartmaxparts=. Form
  parts parsed with NextPart and NextRawPart may contain no more than 10,000
  header fields. In addition, forms parsed with ReadForm may contain no more
  than 10,000 header fields across all parts. This limit may be adjusted with
  the environment variable GODEBUG=multipartmaxheaders=.

  Thanks to Jakob Ackermann for discovering this issue.

  This is CVE-2023-24536 and Go issue https://go.dev/issue/59153.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-05 16:03:25 +02:00
Gabriel Adrian Samfira
7bb2756bc4 Increase integration test tmieout to 20m
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-04-04 00:29:14 -07:00
Iceber Gu
690ae58ca7 Update cri-tools version on windows
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2023-03-16 17:48:53 +08:00
Maksym Pavlenko
c50a3ef043 Update Makefile and CI
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-03-15 09:18:16 -07:00
Akihiro Suda
f2bb9c9b0b
Go 1.20.2
> go1.20.2 (released 2023-03-07) includes a security fix to the crypto/elliptic package,
> as well as bug fixes to the compiler, the covdata command, the linker, the runtime, and
> the crypto/ecdh, crypto/rsa, crypto/x509, os, and syscall packages.
> See the Go 1.20.2 milestone on our issue tracker for details.

https://go.dev/doc/devel/release#go1.20.minor

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-03-09 08:45:29 +09:00
Nashwan Azhari
30883d8314 Increase CI workflow timeout on Windows.
Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
2023-03-01 09:06:33 +02:00
Aniruddha Basak
3693398977
Migrate from k8s.gcr.io to registry.k8s.io
Signed-off-by: Aniruddha Basak <codewithaniruddha@gmail.com>
2023-02-18 19:11:27 +05:30
Akihiro Suda
90d004ae8c
Go 1.20.1
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-16 03:50:23 +09:00
Akihiro Suda
4b9fd6ba5f
golangci-lint v1.51.1
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-16 03:50:19 +09:00
Akihiro Suda
9a9cfe85e5
Go 1.19.6
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-15 13:31:32 +09:00
Akihiro Suda
9c82e929fd
release: xx v1.2.1
https://github.com/tonistiigi/xx/compare/v1.1.0...v1.2.1

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-14 14:25:59 +09:00
Phil Estes
024a748c09
Merge pull request #7933 from AkihiroSuda/drop-libbtrfs
btrfs: depend on kernel UAPI instead of libbtrfs
2023-02-10 16:13:19 -05:00
Akihiro Suda
fe0116ec2a
CI: skip some jobs when repo != containerd/containerd
For running CI in a non-upstream repo

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-10 18:12:08 +09:00
Akihiro Suda
52f82acb7b
btrfs: depend on kernel UAPI instead of libbtrfs
See containerd/btrfs PR 40 and moby/moby PR 44761. (Thanks to [@]neersighted.)

The containerd/btrfs library now requires headers from kernel 4.12 or newer:
- https://github.com/torvalds/linux/blob/master/include/uapi/linux/btrfs.h
- https://github.com/torvalds/linux/blob/master/include/uapi/linux/btrfs_tree.h

These files are licensed under the GPL-2.0 WITH Linux-syscall-note, so it should be compatible with the Apache License 2.0.
https://spdx.org/licenses/Linux-syscall-note.html

The dependency on the kernel headers only affects users building from source.
Users on older kernels may opt to not compile this library (`BUILDTAGS=no_btfs`),
or to provide headers from a newer kernel.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-10 10:07:34 +09:00
Maksym Pavlenko
6adb6a727e Rename release CI job
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-09 15:30:52 -08:00
Maksym Pavlenko
aed3b0a70b Clean CI file
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-09 15:30:52 -08:00
Kazuyoshi Kato
617c66dcc7 Add critest.exe in $PATH
The binary location was moved since
https://github.com/kubernetes-sigs/cri-tools/pull/1085.

Fixes #8073.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2023-02-09 22:23:01 +00:00
Akihiro Suda
7eb6528302
release: Ubuntu 18.04 -> 20.04 (glibc 2.27 -> 2.31)
Ubuntu 18.04 will reach its End of Standard Support in April 2023:
https://wiki.ubuntu.com/Releases

By updating Ubuntu from 18.04 to 20.04, the dynamically-linked glibc
version is bumped up from 2.27 to 2.31.
The dynamically linked containerd binary still seems to be compatible with
CentOS 7 (glibc 2.17).

The runc binary in the `cri-containerd(-cni)-<VERSION>-linux-<ARCH>.tar.gz`
bundle no longer works on CentOS 7, though, but this is acceptable, as the
`cri-containerd(-cni)` bundle has been deprecated since containerd 1.6.

```
$ ldd /usr/local/sbin/runc
        linux-vdso.so.1 =>  (0x00007fffee9c4000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007eff48721000)
        libseccomp.so.2 => /lib64/libseccomp.so.2 (0x00007eff484e0000)
        libc.so.6 => /lib64/libc.so.6 (0x00007eff48112000)
        /lib64/ld-linux-x86-64.so.2 (0x00007eff492cb000)
$ /usr/local/sbin/runc
/usr/local/sbin/runc: symbol lookup error: /usr/local/sbin/runc: undefined symbol: seccomp_notify_respond
```

Fix issue 7961

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-01-29 07:42:13 +09:00
Phil Estes
3f565daf68
Merge pull request #7968 from AkihiroSuda/ci-test-release
CI: test release.yml on every PR
2023-01-20 08:03:27 -05:00
Akihiro Suda
d1e1a16460
release/Dockerfile: set DEBIAN_FRONTEND=noninteractive
A build was hanging with `UBUNTU_VERSION=20.04`
```
...
 => [base 3/5] RUN APT-GET update &&  apt-get install -y dpkg-dev git make pkg-config                                                                            73.2s
 => => # questions will narrow this down by presenting a list of cities, representing
 => => # the time zones in which they are located.
 => => #   1. Africa      4. Australia  7. Atlantic  10. Pacific  13. Etc
 => => #   2. America     5. Arctic     8. Europe    11. SystemV
 => => #   3. Antarctica  6. Asia       9. Indian    12. US
 => => # Geographic area:
...

```

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-01-17 14:37:43 +09:00
Akihiro Suda
7ddd8add46
CI: remove redundant archs from ci.yml
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-01-17 11:09:20 +09:00
Akihiro Suda
ffabc8a296
CI: test release.yml on every PR
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-01-17 11:09:19 +09:00
yanggang
c8f4ab3b0d
update to go1.19.5, go1.18.10
Signed-off-by: yanggang <gang.yang@daocloud.io>
2023-01-11 06:41:43 +08:00
Kevin Parsons
79d09c69b4 CI: Pass GITHUB_TOKEN to containerd/project-checks
Previously the project-checks action was failing sometimes due to
hitting GitHub API rate limits. Since no token was supplied, the rate
limits were only 60 requests/hour keyed off the IP address of the
runner.

Now, passing GITHUB_TOKEN secret through to project-checks, we have a
limit of 1000 requests/hour for the whole repo. This should alleviate
the rate limits that were being seen.

I believe it is safe to pass this secret as project-checks is also owned
by the containerd organization. The secret is also scoped to the actions
run, and is invalidated upon completion.

project-checks version is also updated to the version that supports
repo-access-token input.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2023-01-03 15:48:51 -08:00
Kazuyoshi Kato
b6df6708b9 Check containerd's readiness before calling critest
It was assuming containerd was ready right after starting.
But it depends GitHub actions' performance.

In addition to that, this commit extracts the script from ci.yml.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-12-22 16:29:12 +00:00
Luca Comellini
c5fff10fe7
Bump golangci-lint to v1.50.1
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2022-12-12 22:48:55 -08:00
Maksym Pavlenko
36641eade6
Merge pull request #7794 from austinvazquez/upgrade-github-actions-packages
Upgrade GitHub actions packages in release workflow
2022-12-11 10:37:34 -08:00
Austin Vazquez
66f71ea4d5 Enable GitHub Actions local Linux CI runs
Sync package index and automatic yes to apt repository prompts.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2022-12-11 04:37:21 +00:00
Austin Vazquez
14a38e12b7
Upgrade GitHub actions packages in release workflow
Resolve NodeJS 12 and command deprecation warnings by upgrading
docker/setup-buildx-action and crazy-max/ghaction-github-runtime
packages.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2022-12-10 07:58:35 +00:00
Sebastiaan van Stijn
85776d2c67
update to go1.19.4, go1.18.9
Includes security fixes for net/http (CVE-2022-41717, CVE-2022-41720),
and os (CVE-2022-41720).

These minor releases include 2 security fixes following the security policy:

- os, net/http: avoid escapes from os.DirFS and http.Dir on Windows

  The os.DirFS function and http.Dir type provide access to a tree of files
  rooted at a given directory. These functions permitted access to Windows
  device files under that root. For example, os.DirFS("C:/tmp").Open("COM1")
  would open the COM1 device.
  Both os.DirFS and http.Dir only provide read-only filesystem access.

  In addition, on Windows, an os.DirFS for the directory \(the root of the
  current drive) can permit a maliciously crafted path to escape from the
  drive and access any path on the system.

  The behavior of os.DirFS("") has changed. Previously, an empty root was
  treated equivalently to "/", so os.DirFS("").Open("tmp") would open the
  path "/tmp". This now returns an error.

  This is CVE-2022-41720 and Go issue https://go.dev/issue/56694.

- net/http: limit canonical header cache by bytes, not entries

  An attacker can cause excessive memory growth in a Go server accepting
  HTTP/2 requests.

  HTTP/2 server connections contain a cache of HTTP header keys sent by
  the client. While the total number of entries in this cache is capped,
  an attacker sending very large keys can cause the server to allocate
  approximately 64 MiB per open connection.

  This issue is also fixed in golang.org/x/net/http2 vX.Y.Z, for users
  manually configuring HTTP/2.

  Thanks to Josselin Costanzi for reporting this issue.

  This is CVE-2022-41717 and Go issue https://go.dev/issue/56350.

View the release notes for more information:
https://go.dev/doc/devel/release#go1.19.4

And the milestone on the issue tracker:
https://github.com/golang/go/issues?q=milestone%3AGo1.19.4+label%3ACherryPickApproved

Full diff: https://github.com/golang/go/compare/go1.19.3...go1.19.4

The golang.org/x/net fix is in 1e63c2f08a

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-06 22:48:09 +01:00
Austin Vazquez
8c035d3873 Resolve warnings in Windows GitHub Actions periodic workflows
Upgrade actions/github-script from v3 to v6 to resolve Node.js 12
and `set-output` command warnings.
Upgrade google-github-actions/upload-cloud-storage from v0.8.0 to
v0.10.4 to resolve `set-output` command warnings.
Upgrade actions/checkout from v2 to v3 to resolve Node.js 12 warnings.
Remove references to `set-output` command from workflow.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2022-11-23 03:34:55 +00:00
Kazuyoshi Kato
49251e4de6
Merge pull request #7707 from austinvazquez/resolve-scorecards-workflow-warnings
Resolve Scorecards GitHub Actions workflow warnings
2022-11-21 10:48:32 -08:00
Austin Vazquez
5a7c108ba4 Resolve Scorecards GitHub Actions workflow warnings
Allow actions/checkout in scorecards workflow to use v3.1.0 commit.
Resolves `save-state` command usage warnings.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2022-11-21 16:21:57 +00:00
Sebastiaan van Stijn
b7b185c92f
update github.com/cpuguy83/go-md2man/v2 to v2.0.2
no significant updates, just keeping up with latest version

full diff: https://github.com/cpuguy83/go-md2man/compare/v2.0.1...v2.0.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-11-20 22:52:50 +01:00
Akihiro Suda
3fca677c19
Release: add static binaries
Fix issue 7296

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-11-12 03:52:37 +09:00
Derek McGowan
d1564fec5b
Merge pull request #7614 from huoqifeng/s390x
s390x: build and package s390x bin in release assets
2022-11-07 12:08:43 -08:00
Brian Goff
422a240666 Bump go version to 1.19.3
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-11-02 19:54:42 +00:00
Craig Ingram
a270d6e8ae
Harden GITHUB_TOKEN permissions
Signed-off-by: Craig Ingram <cjingram@google.com>
2022-11-01 10:56:38 -04:00
huoqifeng
98269c0619 s390x: initial enabler
Signed-off-by: huoqifeng <huoqif@cn.ibm.com>
2022-11-01 13:15:15 +08:00
Nashwan Azhari
7c77b3540d Add Workflow for running critest with Hyper-V Containers on Windows.
Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
2022-10-26 13:33:45 +03:00
Austin Vazquez
be3987a92d Migrate away from GitHub actions set-output
Migrate from set-output call to write to new GITHUB_OUTPUT environment
file.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2022-10-24 22:48:42 +00:00
Akhil Mohan
ddb8a65be2
update codeql-action to v2
updating codeql github actions to v2, as v1 version will be deprecated
in Dec'22.

Signed-off-by: Akhil Mohan <makhil@vmware.com>
2022-10-21 11:54:41 +05:30
Kazuyoshi Kato
a76d68ee48 Separate containerd logs in GitHub Actions' console
`::group::` groups containerd logs by default.

https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-10-17 16:27:23 +00:00