Skip to content

security: resolve Oneleet gosec findings - #172

Merged
BSick7 merged 1 commit into
masterfrom
security/oneleet-gosec
Oct 7, 2026
Merged

BSick7 merged 1 commit into
masterfrom
security/oneleet-gosec

Conversation

@BSick7

@BSick7 BSick7 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

First PR of the Oneleet code-security sweep (plan: design-documents/oneleet-code-security-remediation.md in the monorepo root). Libraries go first so enigma and the CLI pick this up on re-vendor.

What changed

Annotations (no behaviour change) — every #nosec carries the reason:

  • docker/docker_cli.go G402: InsecureSkipVerify mirrors the SkipTLSVerify flag of the user's own docker context, same as the docker CLI.
  • aws/s3/upload_zip_artifact.go G401/G501: MD5 feeds the S3 Content-MD5 integrity header required by object-lock buckets.
  • 16 × G304 across the pushers/downloaders and docker context loader: paths are caller-supplied artifact paths, files enumerated from the caller's baseDir, or well-known files under the docker config dir.

Hardening

  • Download directories are created 0750 instead of 0755 (4 sites).
  • The four directory downloaders (S3, Azure Blob, GCS, Composer) now refuse an object key whose relative path escapes localDir. Keys come from our own buckets so this is belt-and-braces, but it makes the G304 annotation on the os.Create honest. Flagging it because it is the one change beyond annotate-and-tighten.

Verification

  • go build, go vet (the slices.Compact vet error in aws/ecs/get_all_deployment_tasks.go is pre-existing and untouched here), go test ./... green with GOTOOLCHAIN=go1.26.6.
  • This PR doubles as the check that Oneleet's gosec honours #nosec comments. If the annotated findings stay open after the rescan, the comments stay as in-code justification and the findings get per-issue Ignore in the Oneleet UI.

- G402: annotate InsecureSkipVerify in docker client; it mirrors the
  SkipTLSVerify setting of the user's own docker context
- G401/G501: annotate md5 in S3 zip upload; it feeds the Content-MD5
  integrity header required by object-lock buckets
- G304: annotate every os.Open/Create/ReadFile with the reason the path
  is trusted (caller-provided source, enumerated from baseDir, or a
  well-known docker config file)
- G301: download dirs created 0750 instead of 0755
- Add a traversal guard to the four directory downloaders (S3, Azure
  Blob, GCS, Composer) so an object key containing ".." can never
  write outside localDir
@BSick7
BSick7 requested a review from ssickles October 7, 2026 13:31
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

Go Tests

260 tests  ±0   260 ✅ ±0   4s ⏱️ ±0s
 76 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit bdb96fe. ± Comparison against base commit 6a3ea61.

@BSick7
BSick7 merged commit cd49c26 into master Oct 7, 2026
2 checks passed
@BSick7
BSick7 deleted the security/oneleet-gosec branch October 7, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants