2022-08-12 15:05:52 +02:00
|
|
|
// Copyright 2022 Docker Compose CLI authors
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
variable "GO_VERSION" {
|
update to go1.19.4
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 https://github.com/golang/net/commit/1e63c2f08a10a150fa02c50ece89b340ae64efe4
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-06 23:14:02 +01:00
|
|
|
default = "1.19.4"
|
2022-08-12 15:05:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "BUILD_TAGS" {
|
2023-01-09 12:37:55 +01:00
|
|
|
default = "e2e"
|
2022-08-12 15:05:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "DOCS_FORMATS" {
|
|
|
|
default = "md,yaml"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Defines the output folder
|
|
|
|
variable "DESTDIR" {
|
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
function "bindir" {
|
|
|
|
params = [defaultdir]
|
|
|
|
result = DESTDIR != "" ? DESTDIR : "./bin/${defaultdir}"
|
|
|
|
}
|
|
|
|
|
|
|
|
target "_common" {
|
|
|
|
args = {
|
|
|
|
GO_VERSION = GO_VERSION
|
|
|
|
BUILD_TAGS = BUILD_TAGS
|
|
|
|
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
group "default" {
|
|
|
|
targets = ["binary"]
|
|
|
|
}
|
|
|
|
|
|
|
|
group "validate" {
|
|
|
|
targets = ["lint", "vendor-validate", "license-validate"]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "lint" {
|
|
|
|
inherits = ["_common"]
|
|
|
|
target = "lint"
|
|
|
|
output = ["type=cacheonly"]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "license-validate" {
|
|
|
|
target = "license-validate"
|
|
|
|
output = ["type=cacheonly"]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "license-update" {
|
|
|
|
target = "license-update"
|
|
|
|
output = ["."]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "vendor-validate" {
|
|
|
|
inherits = ["_common"]
|
|
|
|
target = "vendor-validate"
|
|
|
|
output = ["type=cacheonly"]
|
|
|
|
}
|
|
|
|
|
2022-12-08 18:45:47 +01:00
|
|
|
target "vendor-update" {
|
2022-08-12 15:05:52 +02:00
|
|
|
inherits = ["_common"]
|
|
|
|
target = "vendor-update"
|
|
|
|
output = ["."]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "test" {
|
|
|
|
inherits = ["_common"]
|
|
|
|
target = "test-coverage"
|
|
|
|
output = [bindir("coverage")]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "binary" {
|
|
|
|
inherits = ["_common"]
|
|
|
|
target = "binary"
|
|
|
|
output = [bindir("build")]
|
|
|
|
platforms = ["local"]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "binary-cross" {
|
|
|
|
inherits = ["binary"]
|
|
|
|
platforms = [
|
|
|
|
"darwin/amd64",
|
|
|
|
"darwin/arm64",
|
|
|
|
"linux/amd64",
|
|
|
|
"linux/arm/v6",
|
|
|
|
"linux/arm/v7",
|
|
|
|
"linux/arm64",
|
|
|
|
"linux/ppc64le",
|
2022-08-14 23:25:50 +02:00
|
|
|
"linux/riscv64",
|
2022-08-12 15:05:52 +02:00
|
|
|
"linux/s390x",
|
2022-08-14 23:25:50 +02:00
|
|
|
"windows/amd64",
|
|
|
|
"windows/arm64"
|
2022-08-12 15:05:52 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "release" {
|
|
|
|
inherits = ["binary-cross"]
|
|
|
|
target = "release"
|
|
|
|
output = [bindir("release")]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "docs-validate" {
|
|
|
|
inherits = ["_common"]
|
|
|
|
target = "docs-validate"
|
|
|
|
output = ["type=cacheonly"]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "docs-update" {
|
|
|
|
inherits = ["_common"]
|
|
|
|
target = "docs-update"
|
|
|
|
output = ["./docs"]
|
|
|
|
}
|