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
37 changes: 37 additions & 0 deletions .woodpecker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Woodpecker CI pipeline.
# Server: ci.lthn.sh. Lint + sonar in parallel, both depend only on clone.
# sonar_token is admin-scoped on the Woodpecker server.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Do not run Sonar with an admin-scoped token.

Line 3 documents admin scope for the CI secret; this is over-privileged for scanning and increases blast radius. Use a project-scoped token and rotate the current secret.

Also applies to: 34-35

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.woodpecker.yml at line 3, The CI config currently documents/uses an
admin-scoped secret for Sonar ("sonar_token") which is over-privileged; replace
the admin-scoped token with a project-scoped Sonar token, rotate the existing
secret value in the secrets manager, update the .woodpecker.yml
reference/comment (and any other mentions on lines 34-35) to indicate it is
project-scoped, and ensure the pipeline uses the rotated secret name (e.g.,
SONAR_PROJECT_TOKEN) so no admin credentials remain in CI.


when:
- event: push
branch: [dev, main]

steps:
- name: golangci-lint
image: golangci/golangci-lint:latest-alpine
depends_on: []
environment:
GOFLAGS: -buildvcs=false
GOWORK: "off"
commands:
- golangci-lint run --timeout=5m ./...

- name: go-test
image: golang:1.26-alpine
depends_on: []
environment:
GOFLAGS: -buildvcs=false
GOWORK: "off"
CGO_ENABLED: "1"
commands:
- apk add --no-cache git build-base
- go test -race -coverprofile=coverage.out -covermode=atomic -count=1 ./...
- name: sonar
image: sonarsource/sonar-scanner-cli:latest
depends_on: [go-test]
environment:
SONAR_HOST_URL: https://sonar.lthn.sh
SONAR_TOKEN:
from_secret: sonar_token
commands:
- sonar-scanner
2 changes: 1 addition & 1 deletion admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/url"
"strconv"

core "dappco.re/go/core"
core "dappco.re/go"
"dappco.re/go/forge/types"
)

Expand Down
Loading
Loading