mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-14 00:11:28 +05:30
fa89a70db3
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>
188 lines
4.7 KiB
YAML
188 lines
4.7 KiB
YAML
name: build
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
tags:
|
|
- 'v*'
|
|
pull_request:
|
|
|
|
env:
|
|
DESTDIR: ./bin
|
|
GO_VERSION: 1.20.4
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-22.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target:
|
|
- lint
|
|
- validate-vendor
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
-
|
|
name: Run
|
|
run: |
|
|
make ${{ matrix.target }}
|
|
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- ubuntu-22.04
|
|
- ubuntu-20.04
|
|
- macOS-11
|
|
- windows-2022
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
-
|
|
name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
cache: true
|
|
-
|
|
name: Install deps
|
|
if: startsWith(matrix.os, 'ubuntu-')
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y dbus-x11 gnome-keyring libsecret-1-dev pass
|
|
-
|
|
name: GPG conf
|
|
if: startsWith(matrix.os, 'ubuntu-')
|
|
uses: actions/github-script@v6
|
|
id: gpg
|
|
with:
|
|
script: |
|
|
const fs = require('fs');
|
|
const gnupgfolder = `${require('os').homedir()}/.gnupg`;
|
|
if (!fs.existsSync(gnupgfolder)){
|
|
fs.mkdirSync(gnupgfolder);
|
|
}
|
|
fs.copyFile('.github/workflows/fixtures/gpg.conf', `${gnupgfolder}/gpg.conf`, (err) => {
|
|
if (err) throw err;
|
|
});
|
|
core.setOutput('key', fs.readFileSync('.github/workflows/fixtures/7D851EB72D73BDA0.key', {encoding: 'utf8'}));
|
|
core.setOutput('passphrase', fs.readFileSync('.github/workflows/fixtures/7D851EB72D73BDA0.pass', {encoding: 'utf8'}));
|
|
-
|
|
name: Import GPG key
|
|
if: startsWith(matrix.os, 'ubuntu-')
|
|
uses: crazy-max/ghaction-import-gpg@v5
|
|
with:
|
|
gpg_private_key: ${{ steps.gpg.outputs.key }}
|
|
passphrase: ${{ steps.gpg.outputs.passphrase }}
|
|
-
|
|
name: Test
|
|
run: |
|
|
if [[ "${{ matrix.os }}" = ubuntu-* ]]; then
|
|
echo -e "trust\n5\ny" | gpg --batch --no-tty --command-fd 0 --edit-key 7D851EB72D73BDA0
|
|
pass init 7D851EB72D73BDA0
|
|
fi
|
|
go test -short -v -coverprofile=./coverage.txt -covermode=atomic ./...
|
|
go tool cover -func=./coverage.txt
|
|
shell: bash
|
|
-
|
|
name: Upload coverage
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.txt
|
|
|
|
test-sandboxed:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
-
|
|
name: Test
|
|
uses: docker/bake-action@v2
|
|
with:
|
|
targets: test
|
|
set: |
|
|
*.cache-from=type=gha,scope=test
|
|
*.cache-to=type=gha,scope=test,mode=max
|
|
-
|
|
name: Upload coverage
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ${{ env.DESTDIR }}//coverage.txt
|
|
|
|
build:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
-
|
|
name: Build
|
|
run: |
|
|
make release
|
|
env:
|
|
CACHE_FROM: type=gha,scope=build
|
|
CACHE_TO: type=gha,scope=build,mode=max
|
|
-
|
|
name: List artifacts
|
|
run: |
|
|
tree -nh ${{ env.DESTDIR }}
|
|
-
|
|
name: Check artifacts
|
|
run: |
|
|
find ${{ env.DESTDIR }} -type f -exec file -e ascii -e text -- {} +
|
|
-
|
|
name: Upload artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: docker-credential-helpers
|
|
path: ${{ env.DESTDIR }}/*
|
|
if-no-files-found: error
|
|
-
|
|
name: GitHub Release
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
draft: true
|
|
files: ${{ env.DESTDIR }}/*
|
|
|
|
build-deb:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
-
|
|
name: Build
|
|
run: |
|
|
make deb
|