Skip to content

Feat/v2.5.0 go127 - #113

Merged
had-nu merged 14 commits into
mainfrom
feat/v2.5.0-go127
Aug 21, 2026
Merged

Feat/v2.5.0 go127#113
had-nu merged 14 commits into
mainfrom
feat/v2.5.0-go127

Conversation

@had-nu

@had-nu had-nu commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Description

Related Issue

Closes #

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature that changes existing behaviour)
  • Documentation update
  • Refactor (no functional change)

How Has This Been Tested?

  • go build ./...
  • go test ./... -count=1
  • go vet ./...

Checklist

  • My code follows the existing code style of this project
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally
  • I have updated the README or documentation as needed
  • My changes generate no new linter warnings

UX por Perfil

  • Developer:
  • DevOps/SRE:
  • Security Auditor:
  • Analista Júnior:

had-nu added 14 commits August 20, 2026 15:01
…feWriteFile/ReadFile); zero os.ReadFile+nosec outside
…+ deprecated facade; move ConfigHash->internal/cpl, ReadReport->pkg/report; replace bubble-sorts with slices.SortFunc
…n main/evaluate entry points

EvaluationPipeline runs the root wardex flow (config, correlation, gap analysis,
gate, snapshot, report, exit code) without os.Exit or direct os.Stderr writes,
logging through an injected *slog.Logger. RunGate owns the cmd/evaluate flow,
returning the exit code for the caller to apply.

main.go runWardex (28 lines) and cmd/evaluate runEvaluate (26 lines) now delegate
all orchestration. config.ApplyProfile accepts io.Writer; forward syslog windows
stub implements the ctx-based Send signature.
…ngci-lint clean

- pkg/orchestrator coverage 83.5%: evaluation pipeline tests (basic flow,
  gate blocked, compliance fail, snapshot delta, missing config, invalid
  framework, min-confidence filter), gate pipeline tests (allow/block,
  strict unsealed, missing-EPSS, dry-run, csv/json output, sealed wexstate
  config, state store + trend, Article 14 active exploitation), and helper
  unit tests (gateLabel, riskColor, dryRunGate, hintMissingEPSS, overrides,
  formatDuration, isCI).
- Fix collectCLIOverrides to not treat the zero-value gate mode as override.
- Fuzz tests with property invariants: ingestion (id/name/maturity/layer/
  context-weight invariants; caught and fixed unvalidated layer coercion
  in validateControl), pathguard (no workspace escape, null/overlong and
  pseudo-fs paths always rejected), verify (sign/verify round-trip, tamper
  and wrong-key rejection, corrupted batch signatures).
- go test -race ./... passes; golangci-lint v2.13.1 (built with go1.27) clean.
- CI pins golangci-lint v2.13.1 for the Go 1.27 module.
- CHANGELOG: add [2.5.0] entry covering Go 1.27 migration, orchestrator,
  safefile, slog, context propagation, pkg/accept decomposition, sorting,
  fuzzing, and lint/race hardening.
- README (pt/en): document Go >= 1.27 requirement; Go badge to 1.27.
- main.go: Version 2.5.0.
- wardex-config.yaml: provenance node_id wardex-release-v2.5.0.
- pkg/ingestion: benchmarks for LoadYAML/LoadJSON/LoadCSV/LoadMany with
  100-control fixtures; fixture setup excluded from the measured loop.
- pkg/epss: benchmarks for Sign/Verify over 100-enrichment payloads.
- doc/benchmarks/wardex-v2.5.0.md: baseline table satisfying the spec's
  no-regression comparison reference.
- .golangci.yml: enable gomodguard_v2 (gomodguard deprecated in v2.12.0);
  lint now runs warning-free with 0 issues.
- .gitignore: anchor benchmarks/ to repo root so doc/benchmarks can be tracked.
Critical fixes:
1. PathGuard symlink bypass (CVE-class): Fixed validatePath to check symlinks
   in parent directories of non-existent output files. Added
   resolveWithSymlinkCheck that walks path components and validates
   each existing component for symlink escapes. Added
   TestValidateOutputPath_SymlinkParentEscape.

2. Trust Store metadata manipulation: Enhanced VerifyRootSig to verify
   each KeyEntry.AddedSig against AddedBy signer, and each
   Revocation.Sig against RevokedBy admin signer. Previously only
   RootSig was verified, allowing role escalation via metadata
   modification.

3. Risk Acceptance hash validation: Added ConfigHash field to
   model.Acceptance and updated VerifyAll to check ReportHash and
   ConfigHash against current values. Set ReportMismatch and Stale
   flags appropriately.

4. NaN/Inf fail-open in risk engine: Added isValidScore validation
   in CalculateRisk for CVSSBase, EPSSScore, Criticality, and
   Effectiveness. Returns maximum risk (BLOCK) on NaN/Inf/out-of-range.

5. Arbitrary file write via os.WriteFile: Migrated 10 commands
   (art14, chain/seal, convert/grype/kev/sbom, policy, simulate,
   provenance/seal) to use cli.SafeWriteFile/cli.SafeOutputPath.

6. Atomic write symlink attack: Updated atomicwrite.Write to use
   os.CreateTemp with O_EXCL instead of path + '.tmp'.

Tests: All fuzz tests pass (pathguard, ingestion, accept/verify),
race detector clean, golangci-lint 0 issues.
- pkg/cli/pathguard.go: use strings.SplitSeq and range over iterator
- pkg/epss/epss_benchmark_test.go: use range over int
- pkg/ingestion/ingestion_benchmark_test.go: use range over int
The v1.1.4 crashes with panic when running on Go 1.27. v1.6.0 is the
latest stable version compatible with Go 1.27.
Will re-enable when gosec releases a compatible version.
@had-nu
had-nu merged commit e6b9501 into main Aug 21, 2026
4 of 5 checks passed
@had-nu
had-nu deleted the feat/v2.5.0-go127 branch August 21, 2026 01:48
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant