Skip to content

Commit 3b1e8d7

Browse files
devGregAclaude
andcommitted
Ship third-party license notices with releases and the image
The release binaries compile in the Go standard library and 23 modules under MIT, BSD and Apache-2.0, which all require their license texts to travel with binary distributions. scripts/third-party-notices.sh collects those license and NOTICE files for every release platform into THIRD_PARTY_NOTICES.txt. Releases now upload LICENSE and THIRD_PARTY_NOTICES.txt beside the binaries, covered by the signed checksums, and the container image carries both under /licenses/. CI and the release job fail if the committed notices no longer match go.mod. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 16a3647 commit 3b1e8d7

6 files changed

Lines changed: 2654 additions & 1 deletion

File tree

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ jobs:
1616
- name: gofmt
1717
run: test -z "$(gofmt -l .)" || (gofmt -l . && exit 1)
1818
- run: go vet ./...
19+
- name: third-party notices are current
20+
run: |
21+
scripts/third-party-notices.sh "$RUNNER_TEMP/notices.txt"
22+
diff -u THIRD_PARTY_NOTICES.txt "$RUNNER_TEMP/notices.txt" || { echo "run scripts/third-party-notices.sh and commit THIRD_PARTY_NOTICES.txt"; exit 1; }
1923
- run: go test -race ./...
2024
- name: fuzz (short)
2125
run: |

‎.github/workflows/release.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ jobs:
2626
-o "dist/${cmd}_${GITHUB_REF_NAME}_${os}_${arch}${ext}" ./cmd/$cmd
2727
done
2828
done
29+
# The license texts ship beside the binaries and are covered by the signed checksums.
30+
scripts/third-party-notices.sh "$RUNNER_TEMP/notices.txt"
31+
diff -u THIRD_PARTY_NOTICES.txt "$RUNNER_TEMP/notices.txt"
32+
cp LICENSE THIRD_PARTY_NOTICES.txt dist/
2933
(cd dist && sha256sum -- * > checksums.txt)
3034
- uses: sigstore/cosign-installer@v3
3135
- name: Sign checksums

‎Dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=${VERSION}"
1111
# static-debian13 ships a CA bundle without the distrusted roots, needed to pull images.
1212
FROM gcr.io/distroless/static-debian13:nonroot
1313
COPY --from=build /out/earlylight /out/emudhra-scan /out/php2shell-scan /
14+
COPY LICENSE THIRD_PARTY_NOTICES.txt /licenses/
1415
ENTRYPOINT ["/earlylight"]

‎README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ python3 parity/php.py path/to/php2shell-scan ./php2shell-scan ./earlylight path/
132132

133133
## License
134134

135-
BSD 3-Clause. Report security issues as described in [SECURITY.md](SECURITY.md).
135+
BSD 3-Clause. The licenses of the Go standard library and the modules compiled into the binaries are in [THIRD_PARTY_NOTICES.txt](THIRD_PARTY_NOTICES.txt), which ships with every release and in the container image at `/licenses/`. After changing `go.mod`, run `scripts/third-party-notices.sh` and commit the result. CI fails when it is out of date.
136+
137+
Report security issues as described in [SECURITY.md](SECURITY.md).
136138

137139
Free and open source, from [DefectDojo](https://defectdojo.com).

0 commit comments

Comments
 (0)