Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (49 loc) · 2.06 KB
/
Copy pathMakefile
File metadata and controls
63 lines (49 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# OBLITERATUS build system
# Default target produces a console binary so `--audit` output is visible.
BINARY := obliteratus
CMD := ./cmd/obliteratus
LDFLAGS := -ldflags="-s -w"
.PHONY: all build build-windowed cross audit test vet fmt clean sast fuzz-check cover
all: test build
build:
@echo "[+] building windows/amd64 console binary..."
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o bin/$(BINARY).exe $(CMD)
build-windowed:
@echo "[+] building windows/amd64 windowed binary (no console)..."
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -H=windowsgui -o bin/$(BINARY).exe $(CMD)
# Cross-compile check from any host (what CI runs on Linux).
cross:
GOOS=windows GOARCH=amd64 go build ./...
audit: build
./bin/$(BINARY).exe --audit
test:
gofmt -l . | (! grep .) || (gofmt -l . && false)
go vet ./...
go test ./...
vet:
go vet ./...
# Static analysis, mirroring the `sast` job in CI: same exclusions, same
# rationale (see .github/workflows/ci.yml). Requires: go install
# github.com/securego/gosec/v2/cmd/gosec@latest
sast:
gosec -exclude=G103,G104 ./...
# Short fuzz smoke over the parser targets. CI runs 30s each; this is the
# "did I break a parser" check. A crasher lands in testdata/fuzz/<target>/.
fuzz-check:
go test -run='^$$' -fuzz=FuzzRegf -fuzztime=20s ./internal/audit
go test -run='^$$' -fuzz=FuzzParseRep -fuzztime=20s ./internal/krb
go test -run='^$$' -fuzz=FuzzUnpack -fuzztime=20s ./internal/research
go test -run='^$$' -fuzz=FuzzMaskRoundTrip -fuzztime=20s ./internal/obfuscate
go test -run='^$$' -fuzz=FuzzSanitizeName -fuzztime=20s ./internal/persist
go test -run='^$$' -fuzz=FuzzValidHost -fuzztime=15s ./internal/server
go test -run='^$$' -fuzz=FuzzAllowedOrigin -fuzztime=15s ./internal/server
go test -run='^$$' -fuzz=FuzzRoutesRejectBadToken -fuzztime=15s ./internal/server
go test -run='^$$' -fuzz=FuzzEqual -fuzztime=15s ./internal/token
# Whole-tree statement coverage; CI fails below its ratcheting floor.
cover:
go test ./... -coverprofile=cover.out -count=1
go tool cover -func=cover.out | tail -1
fmt:
gofmt -w .
clean:
rm -rf bin/