Skip to content

Commit 1eec5d8

Browse files
author
Евгений Балякин
committed
implement initial sudocheck CLI
0 parents  commit 1eec5d8

60 files changed

Lines changed: 4380 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Bug report
3+
about: Report incorrect behavior
4+
labels: bug
5+
---
6+
7+
## Version
8+
9+
## OS / distro
10+
11+
## Command
12+
13+
## Expected behavior
14+
15+
## Actual behavior
16+
17+
## Reproduction
18+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: False positive
3+
about: Report a finding that should be downgraded or ignored
4+
labels: false-positive
5+
---
6+
7+
## Finding
8+
9+
## Why it is expected
10+
11+
## Distro / image
12+
13+
## Suggested severity
14+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Feature request
3+
about: Suggest a focused improvement
4+
labels: enhancement
5+
---
6+
7+
## Use case
8+
9+
## Proposed behavior
10+
11+
## Alternatives considered
12+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Missing GTFOBins mapping
3+
about: Report a binary or technique that should be mapped
4+
labels: data
5+
---
6+
7+
## Binary
8+
9+
## Source
10+
11+
## Function type
12+
13+
## Reference
14+

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-go@v5
13+
with:
14+
go-version: "1.22"
15+
- run: go test ./...
16+
- run: go vet ./...
17+

.github/workflows/codeql.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: "0 3 * * 1"
8+
9+
jobs:
10+
analyze:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
security-events: write
14+
packages: read
15+
actions: read
16+
contents: read
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: github/codeql-action/init@v3
20+
with:
21+
languages: go
22+
- uses: github/codeql-action/analyze@v3
23+

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
id-token: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/setup-go@v5
19+
with:
20+
go-version: "1.22"
21+
- uses: sigstore/cosign-installer@v3
22+
- uses: goreleaser/goreleaser-action@v6
23+
with:
24+
args: release --clean
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sudocheck
2+
*.sarif
3+
*.baseline.json
4+
dist/
5+
.DS_Store
6+

.goreleaser.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
version: 2
2+
3+
builds:
4+
- main: .
5+
binary: sudocheck
6+
env:
7+
- CGO_ENABLED=0
8+
goos:
9+
- linux
10+
goarch:
11+
- amd64
12+
- arm64
13+
- arm
14+
ldflags:
15+
- -s -w -X main.version={{.Version}}
16+
17+
archives:
18+
- format: tar.gz
19+
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
20+
21+
checksum:
22+
name_template: checksums.txt
23+
24+
signs:
25+
- cmd: cosign
26+
args:
27+
- sign-blob
28+
- --yes
29+
- --output-signature=${signature}
30+
- ${artifact}
31+
artifacts: checksum
32+
33+
changelog:
34+
sort: asc
35+
36+
nfpms:
37+
- package_name: sudocheck
38+
homepage: https://github.com/evgenybalyakin/sudocheck
39+
maintainer: evgenybalyakin
40+
description: Linux privilege escalation audit with GTFOBins mapping
41+
license: MIT
42+
formats:
43+
- deb
44+
- rpm

CONTRIBUTING.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Contributing
2+
3+
Contributions are welcome when they keep sudocheck focused: fast privilege escalation auditing with actionable
4+
remediation.
5+
6+
Good first contributions:
7+
8+
- add a remediation entry in `data/remediations.json`;
9+
- add an expected SUID path in `data/defaults.json`;
10+
- add scanner parser fixtures;
11+
- add a GTFOBins-compatible database entry;
12+
- improve SARIF or JSON output tests.
13+
14+
Before opening a PR:
15+
16+
```sh
17+
gofmt -w main.go cmd internal data scripts
18+
GOCACHE=/tmp/sudocheck-go-build go test ./...
19+
go vet ./...
20+
```
21+
22+
Do not add code that executes exploit commands. sudocheck explains risk; it does not exploit systems.
23+

0 commit comments

Comments
 (0)