diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..01fffd3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: gomod + directory: / + schedule: + interval: weekly + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/ci-go.yml b/.github/workflows/ci-go.yml index 50a9b45..4485526 100644 --- a/.github/workflows/ci-go.yml +++ b/.github/workflows/ci-go.yml @@ -9,12 +9,14 @@ on: - 'go.sum' - 'Makefile' - 'scripts/**' + - 'scripts/assemble-install.sh' - 'install.sh' - - 'packaging/init/**' + - 'uninstall.sh' + - 'packaging/**' - 'build/Dockerfile.embedded' - 'Dockerfile' - 'docs/cli/**' - - '.github/workflows/ci-go.yml' + - '.github/**' pull_request: branches: [ main, develop, edgelet/** ] paths: @@ -23,14 +25,18 @@ on: - 'go.sum' - 'Makefile' - 'scripts/**' + - 'scripts/assemble-install.sh' - 'install.sh' - - 'packaging/init/**' + - 'uninstall.sh' + - 'packaging/**' - 'build/Dockerfile.embedded' - 'Dockerfile' - 'docs/cli/**' - - '.github/workflows/ci-go.yml' + - '.github/**' workflow_dispatch: +permissions: read-all + env: GO_VERSION: '1.26.4' @@ -39,10 +45,10 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: go-version: ${{ env.GO_VERSION }} cache-dependency-path: go.sum @@ -50,7 +56,7 @@ jobs: - run: go version - name: golangci-lint - uses: golangci/golangci-lint-action@v8 + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 with: version: v2.12.2 args: --timeout=5m0s @@ -62,10 +68,10 @@ jobs: name: Test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: go-version: ${{ env.GO_VERSION }} cache-dependency-path: go.sum @@ -75,6 +81,9 @@ jobs: - name: Run unit tests run: make test-unit + - name: Fuzz smoke + run: go test -fuzz=FuzzFileMapFields -fuzztime=30s ./pkg/dataverify + - name: CLI docs drift gate run: make cli-docs-check @@ -99,8 +108,8 @@ jobs: runs-on: ubuntu-latest needs: [lint, test] steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: go-version: ${{ env.GO_VERSION }} - name: Install embed build deps @@ -117,8 +126,8 @@ jobs: runs-on: ubuntu-24.04-arm needs: [lint, test] steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: go-version: ${{ env.GO_VERSION }} - name: Install embed build deps @@ -143,10 +152,10 @@ jobs: - goos: windows goarch: amd64 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: go-version: ${{ env.GO_VERSION }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..aa0d78a --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,45 @@ +name: CodeQL + +on: + push: + branches: [ develop ] + pull_request: + branches: [ develop ] + +permissions: read-all + +env: + GO_VERSION: '1.26.4' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + # Required to upload SARIF to the code-scanning dashboard. + security-events: write + actions: read + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@dd903d2e4f5405488e5ef1422510ee31c8b32357 # v3 + with: + languages: go + + - name: Set up Go + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 + with: + go-version: ${{ env.GO_VERSION }} + cache-dependency-path: go.sum + + - name: Autobuild + uses: github/codeql-action/autobuild@dd903d2e4f5405488e5ef1422510ee31c8b32357 # v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@dd903d2e4f5405488e5ef1422510ee31c8b32357 # v3 + with: + category: "/language:go" diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml index c19b24e..85a3e40 100644 --- a/.github/workflows/govulncheck.yml +++ b/.github/workflows/govulncheck.yml @@ -19,10 +19,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: go-version: ${{ env.GO_VERSION }} cache-dependency-path: go.sum diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f899f91..96be7d9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,9 +11,7 @@ env: IMAGE: ${{ vars.EDGELET_CONTAINER_IMAGE }} GITHUB_REPO: ${{ vars.EDGELET_GITHUB_REPO }} -permissions: - contents: write - packages: write +permissions: read-all jobs: build-linux: @@ -37,9 +35,9 @@ jobs: buildarch: amd64 runner: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: go-version: ${{ env.GO_VERSION }} @@ -80,7 +78,7 @@ jobs: ARCH=${{ matrix.arch }} ./scripts/binary_size_check.sh test -f "build/edgelet-linux-${{ matrix.arch }}" - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: edgelet-linux-${{ matrix.arch }} path: build/edgelet-linux-${{ matrix.arch }} @@ -106,9 +104,9 @@ jobs: goarch: amd64 out: build/edgelet-windows-amd64.exe steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: go-version: ${{ env.GO_VERSION }} @@ -122,7 +120,7 @@ jobs: -o "${{ matrix.out }}" ./cmd/edgelet test -f "${{ matrix.out }}" - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: edgelet-${{ matrix.id }} path: ${{ matrix.out }} @@ -133,9 +131,9 @@ jobs: runs-on: ubuntu-latest needs: [build-linux, build-desktop] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 with: path: artifacts @@ -164,7 +162,7 @@ jobs: install.sh uninstall.sh > SHA256SUMS ) - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: release-dist path: dist/* @@ -174,16 +172,37 @@ jobs: name: GitHub Release runs-on: ubuntu-latest needs: package + permissions: + contents: write + id-token: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: fetch-depth: 0 - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 with: name: release-dist path: dist + - name: Install cosign + uses: sigstore/cosign-installer@cad07c2e89fa2edd6e2d7bab4c1aa38e53f76003 # v4.1.1 + + - name: Sign release artifacts (keyless cosign) + run: | + set -euo pipefail + for f in dist/*; do + case "$(basename "$f")" in + *.sig|*.pem|*.sigstore|*.sigstore.json) continue ;; + esac + [ -f "$f" ] || continue + cosign sign-blob --yes \ + --bundle "${f}.sigstore.json" \ + --output-signature "${f}.sig" \ + "$f" + done + ls -la dist/ + - name: Generate release notes run: | cat > release_notes.md <`, `edgelet-darwin-`, `edgelet-windows-amd64.exe`), `SHA256SUMS`, `install.sh`, `uninstall.sh`, and config/CA samples. diff --git a/SECURITY.md b/SECURITY.md index 43f5108..2160890 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,7 +4,7 @@ | Version | Supported | |---------|-----------| -| `v1.0.0-beta.0` and later pre-releases on `develop` | Yes | +| `v1.0.0-beta.1` and later pre-releases on `develop` | Yes | | Earlier migration / dev builds | No | ## Reporting a vulnerability @@ -41,7 +41,7 @@ make vulncheck # govulncheck@v1.1.4 + go mod verify ## Known vulnerability exceptions -The following findings are **documented exceptions** accepted for `v1.0.0-beta.0`. They are enforced by `scripts/vulncheck.sh` (keep `ALLOWED_VULNS` in sync with this table). +The following findings are **documented exceptions** accepted for `v1.0.0-beta.1`. They are enforced by `scripts/vulncheck.sh` (keep `ALLOWED_VULNS` in sync with this table). | ID | CVE | Component | Rationale | Fix timeline | |----|-----|-----------|-----------|--------------| diff --git a/build/Dockerfile.embedded b/build/Dockerfile.embedded index 846e973..cf577f9 100644 --- a/build/Dockerfile.embedded +++ b/build/Dockerfile.embedded @@ -2,7 +2,7 @@ # macOS dev: # docker build -f build/Dockerfile.embedded -t edgelet-embed-ci . # docker run --rm -v "$(pwd)":/src -w /src edgelet-embed-ci ./scripts/ci -FROM golang:1.26.4-trixie +FROM golang:1.26.4-trixie@sha256:0dcba0d95dbfb072e9917a106b9e07d7cc298097dc83e9307056ef1889de654d COPY scripts/install-embed-build-deps /usr/local/bin/install-embed-build-deps RUN chmod +x /usr/local/bin/install-embed-build-deps \ diff --git a/docs/FEATURE-PARITY.md b/docs/FEATURE-PARITY.md index 29fd0ad..0a7159c 100644 --- a/docs/FEATURE-PARITY.md +++ b/docs/FEATURE-PARITY.md @@ -1,6 +1,6 @@ # Edgelet feature checklist -This document tracks implemented Edgelet capabilities for the v1.0.0-beta.0 release. +This document tracks implemented Edgelet capabilities for the v1.0.0-beta.1 release. ## Core Features diff --git a/go.mod b/go.mod index d592f8b..25450c9 100644 --- a/go.mod +++ b/go.mod @@ -155,7 +155,7 @@ require ( go.yaml.in/yaml/v2 v2.4.3 // indirect golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect golang.org/x/mod v0.35.0 // indirect - golang.org/x/net v0.54.0 // indirect + golang.org/x/net v0.55.0 // indirect golang.org/x/oauth2 v0.34.0 // indirect golang.org/x/sync v0.20.0 // indirect golang.org/x/text v0.37.0 // indirect diff --git a/go.sum b/go.sum index 28be290..a93f7fe 100644 --- a/go.sum +++ b/go.sum @@ -488,8 +488,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= -golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= +golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= +golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= diff --git a/pkg/dataverify/dataverify_fuzz_test.go b/pkg/dataverify/dataverify_fuzz_test.go new file mode 100644 index 0000000..ab8a93e --- /dev/null +++ b/pkg/dataverify/dataverify_fuzz_test.go @@ -0,0 +1,25 @@ +package dataverify + +import ( + "os" + "path/filepath" + "testing" +) + +func FuzzFileMapFields(f *testing.F) { + f.Add([]byte("abc123 relative/path\n")) + f.Add([]byte("link target\n")) + f.Add([]byte("malformed\n")) + f.Add([]byte("")) + + f.Fuzz(func(t *testing.T, data []byte) { + dir := t.TempDir() + manifest := filepath.Join(dir, "manifest") + if err := os.WriteFile(manifest, data, 0644); err != nil { + t.Fatalf("write manifest: %v", err) + } + for _, keyVal := range [][2]int{{1, 0}, {0, 1}} { + _, _ = fileMapFields(manifest, keyVal[0], keyVal[1]) + } + }) +} diff --git a/scripts/lint.sh b/scripts/lint.sh index a978f6a..a1b00e7 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -13,7 +13,7 @@ echo "Running linters..." # Check if golangci-lint is installed if ! command -v golangci-lint &> /dev/null; then echo "golangci-lint not found. Installing..." - go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2 fi make lint