From e5d77f164d8fc7903fd92d71daad85ee632ad952 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 14 Aug 2019 13:31:49 +0200 Subject: [PATCH 1/3] Use golang-migrate/migrate, because mattes/migrate was archived Signed-off-by: Sebastiaan van Stijn --- migrations/README.md | 2 +- server.Dockerfile | 2 +- server.minimal.Dockerfile | 2 +- signer.Dockerfile | 2 +- signer.minimal.Dockerfile | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/migrations/README.md b/migrations/README.md index 66f87fbe4..aeefbfbf2 100644 --- a/migrations/README.md +++ b/migrations/README.md @@ -1,7 +1,7 @@ # Database Migrations This directory contains database migrations for the server and signer. They -are being managed using [this tool](https://github.com/mattes/migrate). +are being managed using [this tool](https://github.com/golang-migrate/migrate). Within each of the server and signer directories are directories for different database backends. Notary server and signer use GORM and are therefore capable of running on a number of different databases, however migrations diff --git a/server.Dockerfile b/server.Dockerfile index ef53c119e..1a3d1ee48 100644 --- a/server.Dockerfile +++ b/server.Dockerfile @@ -3,7 +3,7 @@ FROM golang:1.11.5-alpine RUN apk add --update git gcc libc-dev # Pin to the specific v3.0.0 version -RUN go get -tags 'mysql postgres file' github.com/mattes/migrate/cli && mv /go/bin/cli /go/bin/migrate +RUN go get -tags 'mysql postgres file' github.com/golang-migrate/migrate/cli && mv /go/bin/cli /go/bin/migrate ENV NOTARYPKG github.com/theupdateframework/notary diff --git a/server.minimal.Dockerfile b/server.minimal.Dockerfile index ae0e00f55..b5eae4020 100644 --- a/server.minimal.Dockerfile +++ b/server.minimal.Dockerfile @@ -1,7 +1,7 @@ FROM golang:1.11.5-alpine AS build-env RUN apk add --update git gcc libc-dev # Pin to the specific v3.0.0 version -RUN go get -tags 'mysql postgres file' github.com/mattes/migrate/cli && mv /go/bin/cli /go/bin/migrate +RUN go get -tags 'mysql postgres file' github.com/golang-migrate/migrate/cli && mv /go/bin/cli /go/bin/migrate ENV NOTARYPKG github.com/theupdateframework/notary diff --git a/signer.Dockerfile b/signer.Dockerfile index 272b53911..3a5afb4e4 100644 --- a/signer.Dockerfile +++ b/signer.Dockerfile @@ -3,7 +3,7 @@ FROM golang:1.11.5-alpine RUN apk add --update git gcc libc-dev # Pin to the specific v3.0.0 version -RUN go get -tags 'mysql postgres file' github.com/mattes/migrate/cli && mv /go/bin/cli /go/bin/migrate +RUN go get -tags 'mysql postgres file' github.com/golang-migrate/migrate/cli && mv /go/bin/cli /go/bin/migrate ENV NOTARYPKG github.com/theupdateframework/notary diff --git a/signer.minimal.Dockerfile b/signer.minimal.Dockerfile index 0d70818fc..6702411ac 100644 --- a/signer.minimal.Dockerfile +++ b/signer.minimal.Dockerfile @@ -1,7 +1,7 @@ FROM golang:1.11.5-alpine AS build-env RUN apk add --update git gcc libc-dev # Pin to the specific v3.0.0 version -RUN go get -tags 'mysql postgres file' github.com/mattes/migrate/cli && mv /go/bin/cli /go/bin/migrate +RUN go get -tags 'mysql postgres file' github.com/golang-migrate/migrate/cli && mv /go/bin/cli /go/bin/migrate ENV NOTARYPKG github.com/theupdateframework/notary From 1826beae4462476938e8a1e221f1c0c782baa2f3 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 17 Aug 2019 15:49:15 +0200 Subject: [PATCH 2/3] Update and pin golang-migrate to v4.6.2 v4.6.2 - Removed unnecessary debug output - Improved error messages when no migrations are found v4.6.1 - Fix issue parsing MySQL DSNs with custom query parameters v4.6.0 - Updated MongoDB driver to v1.1.0 - Missing migrate CLI commands will now return a non-zero exit - Go 1.12.8 fixed a security issue where invalid URIs were being parsed. The fix broke migrate when used with MySQL. - Update NewDockerContainer in unused/deprecated migrate/testing package . Signed-off-by: Sebastiaan van Stijn --- server.Dockerfile | 4 ++-- server.minimal.Dockerfile | 5 +++-- signer.Dockerfile | 4 ++-- signer.minimal.Dockerfile | 6 ++++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/server.Dockerfile b/server.Dockerfile index 1a3d1ee48..1e8c79522 100644 --- a/server.Dockerfile +++ b/server.Dockerfile @@ -2,8 +2,8 @@ FROM golang:1.11.5-alpine RUN apk add --update git gcc libc-dev -# Pin to the specific v3.0.0 version -RUN go get -tags 'mysql postgres file' github.com/golang-migrate/migrate/cli && mv /go/bin/cli /go/bin/migrate +ARG MIGRATE_VER=v4.6.2 +RUN GO111MODULE=on go get -tags 'mysql postgres file' github.com/golang-migrate/migrate/v4/cli@${MIGRATE_VER} && mv /go/bin/cli /go/bin/migrate ENV NOTARYPKG github.com/theupdateframework/notary diff --git a/server.minimal.Dockerfile b/server.minimal.Dockerfile index b5eae4020..9e3b99893 100644 --- a/server.minimal.Dockerfile +++ b/server.minimal.Dockerfile @@ -1,7 +1,8 @@ FROM golang:1.11.5-alpine AS build-env RUN apk add --update git gcc libc-dev -# Pin to the specific v3.0.0 version -RUN go get -tags 'mysql postgres file' github.com/golang-migrate/migrate/cli && mv /go/bin/cli /go/bin/migrate + +ARG MIGRATE_VER=v4.6.2 +RUN GO111MODULE=on go get -tags 'mysql postgres file' github.com/golang-migrate/migrate/v4/cli@${MIGRATE_VER} && mv /go/bin/cli /go/bin/migrate ENV NOTARYPKG github.com/theupdateframework/notary diff --git a/signer.Dockerfile b/signer.Dockerfile index 3a5afb4e4..d3b04c082 100644 --- a/signer.Dockerfile +++ b/signer.Dockerfile @@ -2,8 +2,8 @@ FROM golang:1.11.5-alpine RUN apk add --update git gcc libc-dev -# Pin to the specific v3.0.0 version -RUN go get -tags 'mysql postgres file' github.com/golang-migrate/migrate/cli && mv /go/bin/cli /go/bin/migrate +ARG MIGRATE_VER=v4.6.2 +RUN GO111MODULE=on go get -tags 'mysql postgres file' github.com/golang-migrate/migrate/v4/cli@${MIGRATE_VER} && mv /go/bin/cli /go/bin/migrate ENV NOTARYPKG github.com/theupdateframework/notary diff --git a/signer.minimal.Dockerfile b/signer.minimal.Dockerfile index 6702411ac..a551bc5df 100644 --- a/signer.minimal.Dockerfile +++ b/signer.minimal.Dockerfile @@ -1,7 +1,9 @@ FROM golang:1.11.5-alpine AS build-env RUN apk add --update git gcc libc-dev -# Pin to the specific v3.0.0 version -RUN go get -tags 'mysql postgres file' github.com/golang-migrate/migrate/cli && mv /go/bin/cli /go/bin/migrate + +ARG MIGRATE_VER=v4.6.2 +RUN GO111MODULE=on go get -tags 'mysql postgres file' github.com/golang-migrate/migrate/v4/cli@${MIGRATE_VER} && mv /go/bin/cli /go/bin/migrate + ENV NOTARYPKG github.com/theupdateframework/notary From 868ccd54e1646662f7beec92f3841443b53215dd Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 14 Aug 2019 11:51:24 +0200 Subject: [PATCH 3/3] Bump golang 1.12.10 (CVE-2019-9512, CVE-2019-9514, CVE-2019-16276) Bump golang 1.12.10 (CVE-2019-16276) ===================================================== go1.12.10 (released 2019/09/25) includes security fixes to the net/http and net/textproto packages. See the Go 1.12.10 milestone on our issue tracker for details. https://github.com/golang/go/issues?q=milestone%3AGo1.12.10 Bump golang 1.12.9 ===================================================== go1.12.9 (released 2019/08/15) includes fixes to the linker, and the os and math/big packages. See the Go 1.12.9 milestone on our issue tracker for details. https://github.com/golang/go/issues?q=milestone%3AGo1.12.9 Bump golang 1.12.8 (CVE-2019-9512, CVE-2019-9514) ===================================================== go1.12.8 (released 2019/08/13) includes security fixes to the net/http and net/url packages. See the Go 1.12.8 milestone on our issue tracker for details: https://github.com/golang/go/issues?q=milestone%3AGo1.12.8 - net/http: Denial of Service vulnerabilities in the HTTP/2 implementation net/http and golang.org/x/net/http2 servers that accept direct connections from untrusted clients could be remotely made to allocate an unlimited amount of memory, until the program crashes. Servers will now close connections if the send queue accumulates too many control messages. The issues are CVE-2019-9512 and CVE-2019-9514, and Go issue golang.org/issue/33606. Thanks to Jonathan Looney from Netflix for discovering and reporting these issues. This is also fixed in version v0.0.0-20190813141303-74dc4d7220e7 of golang.org/x/net/http2. net/url: parsing validation issue - url.Parse would accept URLs with malformed hosts, such that the Host field could have arbitrary suffixes that would appear in neither Hostname() nor Port(), allowing authorization bypasses in certain applications. Note that URLs with invalid, not numeric ports will now return an error from url.Parse. The issue is CVE-2019-14809 and Go issue golang.org/issue/29098. Thanks to Julian Hector and Nikolai Krein from Cure53, and Adi Cohen (adico.me) for discovering and reporting this issue. Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 2 +- cross.Dockerfile | 2 +- escrow.Dockerfile | 2 +- server.Dockerfile | 2 +- server.minimal.Dockerfile | 2 +- signer.Dockerfile | 2 +- signer.minimal.Dockerfile | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index e687b11c5..29f93035a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.12.7 +FROM golang:1.12.10 RUN apt-get update && apt-get install -y \ curl \ diff --git a/cross.Dockerfile b/cross.Dockerfile index be466686c..8bbb04006 100644 --- a/cross.Dockerfile +++ b/cross.Dockerfile @@ -1,4 +1,4 @@ -FROM dockercore/golang-cross:1.11.5 +FROM dockercore/golang-cross:1.12.10 RUN apt-get update && apt-get install -y \ curl \ diff --git a/escrow.Dockerfile b/escrow.Dockerfile index 12221a39e..abf6d868f 100644 --- a/escrow.Dockerfile +++ b/escrow.Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.11.5-alpine +FROM golang:1.12.10-alpine ENV NOTARYPKG github.com/theupdateframework/notary diff --git a/server.Dockerfile b/server.Dockerfile index 1e8c79522..db65268a1 100644 --- a/server.Dockerfile +++ b/server.Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.11.5-alpine +FROM golang:1.12.10-alpine RUN apk add --update git gcc libc-dev diff --git a/server.minimal.Dockerfile b/server.minimal.Dockerfile index 9e3b99893..e2e9e21c1 100644 --- a/server.minimal.Dockerfile +++ b/server.minimal.Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.11.5-alpine AS build-env +FROM golang:1.12.10-alpine AS build-env RUN apk add --update git gcc libc-dev ARG MIGRATE_VER=v4.6.2 diff --git a/signer.Dockerfile b/signer.Dockerfile index d3b04c082..7bec68397 100644 --- a/signer.Dockerfile +++ b/signer.Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.11.5-alpine +FROM golang:1.12.10-alpine RUN apk add --update git gcc libc-dev diff --git a/signer.minimal.Dockerfile b/signer.minimal.Dockerfile index a551bc5df..cbb92c460 100644 --- a/signer.minimal.Dockerfile +++ b/signer.minimal.Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.11.5-alpine AS build-env +FROM golang:1.12.10-alpine AS build-env RUN apk add --update git gcc libc-dev ARG MIGRATE_VER=v4.6.2