mirror of
https://github.com/sresarehumantoo/wsmancer.git
synced 2026-11-24 05:49:16 +01:00
105 lines
3.9 KiB
YAML
105 lines
3.9 KiB
YAML
# CI for wsmancer, validation only (no deploy/publish).
|
|
#
|
|
# Mirrors the Makefile gates: `make check` (gofmt + go vet + the unit tests),
|
|
# `make mutants` and `make build`. Nothing here talks to a WinRM target, so what
|
|
# CI proves is a strict subset of what this project considers verified: the
|
|
# auth/sealing matrix, the shell's terminal behavior and every post-ex command
|
|
# are proven by the scripts/ harnesses against a real box, and those are
|
|
# deliberately not run here (they need a live Windows listener and lab
|
|
# credentials). The exceptions are the two mutation gates and the dumb-terminal
|
|
# test, which need no target at all. A green pipeline means "it compiles, it is
|
|
# formatted, the offline logic holds, and the sealing packages' tests still catch
|
|
# broken sealing", see docs/verification.md for the rest.
|
|
#
|
|
# This is the GitHub mirror of .gitlab-ci.yml; the two run the same commands and
|
|
# should be changed together.
|
|
|
|
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
GOTOOLCHAIN: local # build with the runner's Go, never download another
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version: "1.26"
|
|
- name: gofmt
|
|
run: test -z "$(gofmt -l cmd internal)" || { echo "gofmt needed:"; gofmt -l cmd internal; exit 1; }
|
|
- name: go vet
|
|
run: go vet ./...
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v6
|
|
with:
|
|
version: v1.64.8
|
|
install-mode: goinstall
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version: "1.26"
|
|
- run: go test ./...
|
|
|
|
# The mutation differentials for the two sealing packages: break the production
|
|
# code one way at a time and fail unless the unit tests catch every one. They
|
|
# are what keep each package's two test styles honest, the structural tests
|
|
# recompute with the production code's own primitives and so cannot see a
|
|
# self-consistent wrong algorithm, while the vectors compare against
|
|
# independent ground truth. Sealing crypto is the one part of this tool a
|
|
# silent regression would not surface as a visible failure, so the gate is
|
|
# automatic rather than something someone remembers to run.
|
|
#
|
|
# ntlmseal twenty mutants; five caught only by vectors_test.go's MS-NLMP
|
|
# published values.
|
|
# krbseal fourteen mutants; TEN caught only by vectors_test.go, which is
|
|
# impacket's output rather than a published vector, the RFCs
|
|
# publish none for these tokens. That ratio is why this second gate
|
|
# exists: krbseal hand-rolls RFC 4757's HMAC-MD5 chains, and before
|
|
# the vectors landed its whole test suite was blind to every one of
|
|
# them.
|
|
#
|
|
# Neither needs a target or credentials, only perl and the toolchain. The
|
|
# krbseal *generator* (scripts/krbseal-vectors.py) needs impacket, but it is
|
|
# deliberately not run here, the frozen bytes are the artifact.
|
|
mutants:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version: "1.26"
|
|
- run: ./scripts/ntlmseal-mutants.sh
|
|
- run: ./scripts/krbseal-mutants.sh
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version: "1.26"
|
|
- run: go build -o wsmancer ./cmd/wsmancer
|
|
# sealcheck drives the sealing providers (verify-matrix.sh runs it) and
|
|
# scripts/verify-matrix.sh still drives it, so it has to keep building.
|
|
- run: go build -o wsmancer-sealcheck ./cmd/sealcheck
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: wsmancer-linux-amd64
|
|
path: wsmancer
|
|
retention-days: 7
|