Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
## toolchain, module cache, or source tree — is present in the final
## image; only the compiled binary is copied out of it below.
## ---------------------------------------------------------------------
FROM golang:1.26.9-alpine AS builder
FROM golang:1.27.2-alpine AS builder

WORKDIR /src

Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
# Atualizar é deliberado: suba o número aqui, rode `make check`, e o
# commit registra a troca. O CI chama estes mesmos alvos, então não há um
# segundo lugar para desalinhar.
STATICCHECK_VERSION ?= v0.8.1
STATICCHECK_VERSION ?= v0.8.2
GOVULNCHECK_VERSION ?= v1.7.0
GOSEC_VERSION ?= v2.28.0
# O gosec está fixado num commit do master, não numa tag: a v2.29.0, última
# release, não lê o export data do Go 1.27 (#316). É o mesmo pin do usher e
# do sapper; volta para uma tag quando uma ler (usher#146, sapper#56).
GOSEC_VERSION ?= d2b649ec01825c20bd101ec584e559adb287e578

# Connection string used by the local PostgreSQL instance started via
# `make db-up` / `make docker-up` (see docker-compose.yml). Override on
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ make build && ./bin/task-api # build a standalone binary

## Running with Docker

`Dockerfile` is a two-stage build: `golang:1.26.9-alpine` compiles a static (`CGO_ENABLED=0`) binary, copied into an empty `scratch` image — no shell, no libc, just the binary and a nonroot user.
`Dockerfile` is a two-stage build: `golang:1.27.2-alpine` compiles a static (`CGO_ENABLED=0`) binary, copied into an empty `scratch` image — no shell, no libc, just the binary and a nonroot user.

```bash
make docker-build # build the image
Expand Down
6 changes: 6 additions & 0 deletions cmd/web/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,12 @@ func spaHandler(distDir string, indexHTML []byte) http.Handler {
return
}

// #nosec G703 -- fsPath is path.Clean of a rooted request path
// joined under cleanDistDir, then checked by pathEscapesDir above
// (see this handler's opening comment and
// TestSPAHandler_PathTraversal_AttemptStillResolvesInsideDist).
// gosec's taint analysis sees the request path reach os.Stat and
// nothing of the containment in between.
if info, err := os.Stat(fsPath); err == nil && !info.IsDir() {
// Vite hashes every filename under assets/ (index-BusBMSGH.js),
// so a given URL's content never changes — safe to cache
Expand Down
30 changes: 30 additions & 0 deletions docs/DECISIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3206,3 +3206,33 @@ por padrão.
da função e `TestSPAHandler_PathTraversal_AttemptStillResolvesInsideDist` já
documentam. Vai precisar de um `#nosec G703` com essa justificativa quando a
versão do gosec for atualizada.

## Piso Go 1.27.2: o resíduo da GO-2026-6617 encerrado (issue #316)

A entrada acima aceitou o piso 1.26.9 com um resíduo: um build local com Go
1.27.0 ou 1.27.1 satisfaz o piso e gera um binário vulnerável. O gatilho para
reabrir chegou com o `staticcheck` 2026.2.2 (v0.8.2, 2026-10-12), que "now
supports the updated export data format used by Go 1.27.2". `go.mod` e as duas
imagens passam para **1.27.2**, a única versão que exclui as duas linhas
vulneráveis, que é o mesmo piso do `usher` (usher#139).

**Ferramentas:** `STATICCHECK_VERSION` vai para v0.8.2. O `gosec` não tem
release que leia o export data do Go 1.27: a v2.29.0, a última, também não
lê. Então `GOSEC_VERSION` fica fixado no commit `d2b649e` do master, o mesmo
pin do `usher` e do `sapper`, e volta para uma tag quando uma ler (usher#146,
sapper#56).

**O G703 previsto acima apareceu, e foi anotado.** O gosec novo aponta o
`os.Stat(fsPath)` do `spaHandler` (`cmd/web/main.go`). É um falso positivo
pelo motivo já registrado, e o `#nosec G703` fica ao lado da chamada com essa
justificativa.

Todos os gates foram conferidos **pelo código de saída**, em Go 1.27.2:
- `go build` e `go vet`, com e sem `-tags=integration`;
- `make lint`, que roda o staticcheck nas duas variantes;
- `make gosec` e `make vulncheck`;
- `make tidy-check`;
- `go test -race ./...`.

Sem resíduo: os artefatos e qualquer build local que respeite o `go.mod`
estão em 1.27.2.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/JonasBorgesLM/task-api

go 1.26.9
go 1.27.2

require (
github.com/JonasBorgesLM/bastion v0.2.1
Expand Down
2 changes: 1 addition & 1 deletion web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ RUN npm run build
## server either serves the files in /dist or it does not, and that is
## already visible from what index.html itself renders.
## ---------------------------------------------------------------------
FROM golang:1.26.9-alpine AS go-builder
FROM golang:1.27.2-alpine AS go-builder

WORKDIR /src

Expand Down
Loading