Commit Graph

67 Commits

Author SHA1 Message Date
Sebastiaan van Stijn 92f32b5c79
ci: use latest stable dockerfile syntax & rename docs Dockerfile (#9711)
* update dockerfiles to use latest stable syntax

Some Dockerfiles were pinned to a minor release, which meant they
wouldn't be updated to get the latest stable syntax (and fixes),
and one Dockerfile used the "labs" variant to use the HEREDOC syntax,
which has now been promoted to the stable syntax.

* docs: rename Dockerfile

There's no other Dockerfiles in the same path, so the "docs"
prefix was redundant.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-03 16:36:13 -04:00
Milas Bowman b1e4cde2da build: bump to Go 1.18.5
Can give 1.19 a bit of time before we upgrade ;)

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-08-02 13:40:37 -04:00
Guillaume Lours 4eb56fd840
use Google addlicense instead of kunalkushwaha/ltag
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-07-26 15:13:34 +02:00
Ulysses Souza 2e96829607 Add gocritic to linters
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-07-13 19:33:03 +02:00
Sebastiaan van Stijn d54cd0445e
update go to 1.18.4
go1.18.4 (released 2022-07-12) includes security fixes to the compress/gzip,
encoding/gob, encoding/xml, go/parser, io/fs, net/http, and path/filepath
packages, as well as bug fixes to the compiler, the go command, the linker,
the runtime, and the runtime/metrics package. See the Go 1.18.4 milestone on the
issue tracker for details:

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

This update addresses:

CVE-2022-1705, CVE-2022-1962, CVE-2022-28131, CVE-2022-30630, CVE-2022-30631,
CVE-2022-30632, CVE-2022-30633, CVE-2022-30635, and CVE-2022-32148.

Full diff: https://github.com/golang/go/compare/go1.18.3...go1.18.4

From the security announcement;
https://groups.google.com/g/golang-announce/c/nqrv9fbR0zE

We have just released Go versions 1.18.4 and 1.17.12, minor point releases. These
minor releases include 9 security fixes following the security policy:

- net/http: improper sanitization of Transfer-Encoding header

  The HTTP/1 client accepted some invalid Transfer-Encoding headers as indicating
  a "chunked" encoding. This could potentially allow for request smuggling, but
  only if combined with an intermediate server that also improperly failed to
  reject the header as invalid.

  This is CVE-2022-1705 and https://go.dev/issue/53188.

- When `httputil.ReverseProxy.ServeHTTP` was called with a `Request.Header` map
  containing a nil value for the X-Forwarded-For header, ReverseProxy would set
  the client IP as the value of the X-Forwarded-For header, contrary to its
  documentation. In the more usual case where a Director function set the
  X-Forwarded-For header value to nil, ReverseProxy would leave the header
  unmodified as expected.

  This is https://go.dev/issue/53423 and CVE-2022-32148.

  Thanks to Christian Mehlmauer for reporting this issue.

- compress/gzip: stack exhaustion in Reader.Read

  Calling Reader.Read on an archive containing a large number of concatenated
  0-length compressed files can cause a panic due to stack exhaustion.

  This is CVE-2022-30631 and Go issue https://go.dev/issue/53168.

- encoding/xml: stack exhaustion in Unmarshal

  Calling Unmarshal on a XML document into a Go struct which has a nested field
  that uses the any field tag can cause a panic due to stack exhaustion.

  This is CVE-2022-30633 and Go issue https://go.dev/issue/53611.

- encoding/xml: stack exhaustion in Decoder.Skip

  Calling Decoder.Skip when parsing a deeply nested XML document can cause a
  panic due to stack exhaustion. The Go Security team discovered this issue, and
  it was independently reported by Juho Nurminen of Mattermost.

  This is CVE-2022-28131 and Go issue https://go.dev/issue/53614.

- encoding/gob: stack exhaustion in Decoder.Decode

  Calling Decoder.Decode on a message which contains deeply nested structures
  can cause a panic due to stack exhaustion.

  This is CVE-2022-30635 and Go issue https://go.dev/issue/53615.

- path/filepath: stack exhaustion in Glob

  Calling Glob on a path which contains a large number of path separators can
  cause a panic due to stack exhaustion.

  Thanks to Juho Nurminen of Mattermost for reporting this issue.

  This is CVE-2022-30632 and Go issue https://go.dev/issue/53416.

- io/fs: stack exhaustion in Glob

  Calling Glob on a path which contains a large number of path separators can
  cause a panic due to stack exhaustion.

  This is CVE-2022-30630 and Go issue https://go.dev/issue/53415.

- go/parser: stack exhaustion in all Parse* functions

  Calling any of the Parse functions on Go source code which contains deeply
  nested types or declarations can cause a panic due to stack exhaustion.

  Thanks to Juho Nurminen of Mattermost for reporting this issue.

  This is CVE-2022-1962 and Go issue https://go.dev/issue/53616.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-07-13 12:40:24 +02:00
CrazyMax 0a53d93338
ci: release workflow to open a PR on docs repo with latest changes
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-06-24 18:40:08 +02:00
Sebastiaan van Stijn d2639a8638
update golang to 1.18.3
go1.18.3 (released 2022-06-01) includes security fixes to the crypto/rand,
crypto/tls, os/exec, and path/filepath packages, as well as bug fixes to the
compiler, and the crypto/tls and text/template/parse packages. See the Go
1.18.3 milestone on our issue tracker for details:

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

Hello gophers,

We have just released Go versions 1.18.3 and 1.17.11, minor point releases.

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

- crypto/rand: rand.Read hangs with extremely large buffers
  On Windows, rand.Read will hang indefinitely if passed a buffer larger than
  1 << 32 - 1 bytes.

  Thanks to Davis Goodin and Quim Muntal, working at Microsoft on the Go toolset,
  for reporting this issue.

  This is [CVE-2022-30634][CVE-2022-30634] and Go issue https://go.dev/issue/52561.
- crypto/tls: session tickets lack random ticket_age_add
  Session tickets generated by crypto/tls did not contain a randomly generated
  ticket_age_add. This allows an attacker that can observe TLS handshakes to
  correlate successive connections by comparing ticket ages during session
  resumption.

  Thanks to GitHub user nervuri for reporting this.

  This is [CVE-2022-30629][CVE-2022-30629] and Go issue https://go.dev/issue/52814.
- `os/exec`: empty `Cmd.Path` can result in running unintended binary on Windows

  If, on Windows, `Cmd.Run`, `cmd.Start`, `cmd.Output`, or `cmd.CombinedOutput`
  are executed when Cmd.Path is unset and, in the working directory, there are
  binaries named either "..com" or "..exe", they will be executed.

  Thanks to Chris Darroch, brian m. carlson, and Mikhail Shcherbakov for reporting
  this.

  This is [CVE-2022-30580][CVE-2022-30580] and Go issue https://go.dev/issue/52574.
- `path/filepath`: Clean(`.\c:`) returns `c:` on Windows

  On Windows, the `filepath.Clean` function could convert an invalid path to a
  valid, absolute path. For example, Clean(`.\c:`) returned `c:`.

  Thanks to Unrud for reporting this issue.

  This is [CVE-2022-29804][CVE-2022-29804] and Go issue https://go.dev/issue/52476.

[CVE-2022-30634]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30634
[CVE-2022-30629]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30629
[CVE-2022-30580]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30580
[CVE-2022-29804]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-29804

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-02 09:56:16 +02:00
Guillaume Lours 71600a52bf
update golang version to 1.18
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-05-20 22:13:55 +02:00
Djordje Lukic 125752c127 Update golang to 1.17
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2021-11-04 09:15:46 +01:00
Ulysses Souza 3bf555cbd6 Fix lint make target
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-09-20 13:09:11 +02:00
Nicolas De Loof 1ae9b3cb5d
move compose-cli code into docker/compose/v2
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-08-31 19:09:19 +02:00
Nicolas De Loof 3aaec6a554
split compose-cli "docker" and composeV2 cli-plugin release processes
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-05-27 12:46:39 +02:00
Chris Crone d27bda5e1d build: Update golangci-lint
* Replace goling with revive as the former is deprecated

Signed-off-by: Chris Crone <christopher.crone@docker.com>
2021-05-19 15:00:53 +00:00
Chris Crone d543ef3064 build: Include go cache where module cache is used
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2021-05-19 14:59:21 +00:00
Guillaume Tardif 1fce1623ee Cross build & package compose-cli plugin
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-04-22 17:51:29 +02:00
Chris Crone a12b1dcea0 build: Bump linter, minor fixes
* Bump linter to 1.39.0
* Use dockerfile:1.2 syntax instead of experimental
* Fix typo in GitHub Actions

Signed-off-by: Chris Crone <christopher.crone@docker.com>
2021-04-13 15:19:23 +02:00
Chris Crone 8ecee6edaf deps: Bump Docker, Golang, linter
* Docker 20.10.3
* Golang 1.16
* golangci-lint 1.37.0

Signed-off-by: Chris Crone <christopher.crone@docker.com>
2021-02-18 17:13:15 +01:00
Nicolas De Loof 0e862eeaa7
introduce --resolve-image-digests on config command
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-02-18 14:48:28 +01:00
Guillaume Tardif dcd1e30f6a Fix protos target to update new protos folder
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
2021-01-19 16:48:54 +01:00
Chris Crone e81ea5b3e5 deps: Bump Golang
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-12-24 12:17:14 +01:00
Chris Crone 78190f8346 build: Add containerized go mod tidy
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-12-07 12:22:58 +01:00
Chris Crone 56eebade90 build: Fix syntax case
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-12-07 12:22:58 +01:00
Chris Crone 7a740aebf5 deps: Bump Go and golangci-lint
* Go to 1.15.5
* golangci-lint 1.33.0

Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-11-23 15:01:02 +01:00
Guillaume Tardif 3940b98da5 Lint packages behind feature flag : local, e2e
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-11-18 17:18:15 +01:00
Chris Crone c8b8a9f767 deps: Bump
Build:
* Golang 1.15.2 to 1.15.3
* golangci-lint 1.31.0 to 1.32.0
* protoc-gen-go 1.4.1 to 1.4.3

All direct Go dependencies except Azure/azure-sdk-for-go which required
code changes.

Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-10-27 14:09:38 +01:00
Chris Crone 66c9094e2d build: Remove unneeded mounts
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-09-23 19:06:45 +02:00
Chris Crone 5aa14ef911 build: Use BuildKit cache for modules
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-09-23 19:06:40 +02:00
Chris Crone d154c41586 Update copyright
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-09-22 12:13:00 +02:00
Chris Crone 5ef51722d0 deps: Bump Golang to 1.15.2, golangci-lint to 1.31.0
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-09-14 17:23:18 +02:00
Chris Crone 026a833732 deps: Bump Golang to 1.15.1
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-09-07 10:45:49 +02:00
Chris Crone 4c6280b0e9 Rename docker/api -> docker/compose-cli
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-08-21 17:28:39 +02:00
Djordje Lukic b41d216aaa Add import restrictions check
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-08-19 12:31:30 +02:00
Guillaume Lours b4e45bf597 Add a script to check if go.mod and go.sum are up-to-date
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2020-08-18 14:57:53 +02:00
Guillaume Lours 95de770e87 Update or add license header which are not valid
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2020-08-17 16:55:25 +02:00
Guillaume Lours 97a50f8d51 Add CI step to check license headers
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2020-08-17 16:55:25 +02:00
Chris Crone 9d073707b9 deps: Bump Go to 1.15 and Go linter to 1.30
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-08-12 10:36:09 +02:00
Christopher Crone 5ea711b586 dockerfile: Fix copyright
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-08-04 13:30:30 +02:00
Christopher Crone 5c947a2082 dockerfile: Update linter
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-07-31 16:17:19 +02:00
Christopher Crone bda30502b8 dependencies: Bump Golang
* Go to 1.14.6

Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-07-17 09:37:53 +02:00
Christopher Crone 8ec9b3c77b dependencies: Bump Golang and linter
* Go 1.14.5
* golangci-lint 1.28.3

Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-07-16 13:22:12 +02:00
Chris Crone b881f16085
Merge pull request #364 from chris-crone/set-version-docker
Set version when building with Docker
2020-07-08 11:51:00 +02:00
Christopher Crone 539464ed3d build: Set version when building with Docker
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-07-07 15:48:09 +02:00
Christopher Crone 878783d271 tools: Update Go and linter
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-07-07 15:29:48 +02:00
Djordje Lukic ad72c866cc Add license headers 2020-06-18 16:48:03 +02:00
Djordje Lukic 39042aa8bd Build example and local backend conditionaly
* `make` will build the cli with all backends exnabled
* `make cross` will cross build without the example and local backend

You can still cross compile with all backends by doing

```console
$ BUILD_TAGS=example,local make cross
```

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2020-06-15 18:02:30 +02:00
Djordje Lukic c34d016fdb Unify protos with client interfaces
* change function names in containers.proto
* add streams proto
2020-06-08 09:43:19 +02:00
Christopher Crone 247fa56ee1 More Dockerfile best practices
* Use mounts for RUN commands to avoid creating extra layers
* Use built-in platform support

Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-06-02 11:58:24 +02:00
Djordje Lukic 129e675932 Put all protos inside the `protos` package 2020-05-25 15:04:28 +02:00
Djordje Lukic 5d073028be Add buildkit cache when running unit tests
Since running `go test` downloads dependencies we want to have them in
the builder cache
2020-05-22 13:26:30 +02:00
Christopher Crone 3c5d37326d Use docker build for lint
This approach allows better caching of results (so faster subsequent
lints). It also avoids bind mounts which are slow.

Benchmarks on my machine (2017 MacBook Pro 13"):
* bind mount lint: 2m 38s
* new lint (after docker builder prune): 1m 35s
* old lint (rerun no changes): 2m 38s
* new lint (rerun added println in random Go file): 9s

Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-22 13:14:44 +02:00