Skip to content

Commit 08a7029

Browse files
fix: improve golangci-lint install security
Download pre-built binary directly from GitHub releases instead of piping install script to sh. This addresses supply chain security concerns about executing remote scripts. The image tag 1-1.24-bookworm is valid - the first '1' is the devcontainer definition version, second '1.24' is the Go version. The markdown tables render correctly (Copilot false positive).
1 parent e6f43c5 commit 08a7029

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.devcontainer/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ RUN curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor
1515
ENV PATH="/opt/mssql-tools18/bin:${PATH}"
1616

1717
# Install golangci-lint for code quality
18-
# Download from specific release tag instead of master branch for supply chain security
19-
ARG GOLANGCI_LINT_VERSION=v1.64.8
20-
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/${GOLANGCI_LINT_VERSION}/install.sh | sh -s -- -b /usr/local/bin ${GOLANGCI_LINT_VERSION}
18+
# Download pre-built binary directly instead of running install script (supply chain security)
19+
ARG GOLANGCI_LINT_VERSION=1.64.8
20+
RUN curl -fsSLO "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_LINT_VERSION}/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz" \
21+
&& tar -xzf "golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz" \
22+
&& mv "golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64/golangci-lint" /usr/local/bin/ \
23+
&& rm -rf "golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64" "golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz" \
24+
&& golangci-lint --version
2125

2226
# Install additional Go tools (pinned versions for reproducibility)
2327
RUN go install golang.org/x/tools/gopls@v0.18.1 \

0 commit comments

Comments
 (0)