Skip to content

Commit a84e195

Browse files
TMHSDigitalclaude
andcommitted
Bump lipgloss to v2.1.1 and sync doc pins, licence label (#366)
lipgloss v2.1.1 lowered its go line back to 1.26.0, so take it and narrow the Dependabot ignore to v2.1.0, the one release that needed Go 1.26.7. The go 1.26.0 minimum is unchanged and govulncheck reports nothing. Point the monitoring guide's example workflows at the upload-sarif and upload-artifact SHAs the repo's own workflows pin, and add a test that keeps every SHA-pinned action in docs/*.md and README.md in step with .github/workflows and action.yml, since Dependabot never reads Markdown. Change the Docker image's licence label to GPL-3.0-only to match CITATION.cff, with a test that checks the two agree. Fixes #366 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a0492af commit a84e195

8 files changed

Lines changed: 121 additions & 12 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ updates:
1212
groups:
1313
go-modules:
1414
patterns: ["*"]
15-
# lipgloss v2.1.0 requires go 1.26.7; the supported minimum stays at
16-
# go 1.26.0 until it is raised on purpose. CI's minimum leg installs the
17-
# go directive itself (not the patched toolchain line) to test this floor.
15+
# lipgloss v2.1.0 alone requires go 1.26.7 (v2.1.1 lowered it back to
16+
# 1.26.0); the supported minimum stays at go 1.26.0 until it is raised on
17+
# purpose. CI's minimum leg installs the go directive itself (not the
18+
# patched toolchain line) to test this floor.
1819
ignore:
1920
- dependency-name: "charm.land/lipgloss/v2"
20-
versions: [">= 2.1.0"]
21+
versions: ["2.1.0"]
2122
labels:
2223
- "dependencies"
2324
- "go"

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6969
- Tests no longer flake under load: lab end-to-end runs use a 5 s timeout with 3 attempts and fail with a clear message if the lab 2 wildcard probe times out, the resolver-pool spread test counts lookups per member instead of timing the scan (the timing view is now `BenchmarkPoolSpreadsLoad`), and CI runs tests in shuffled order (#167).
7070
- The names whose lookup timed out, was refused or failed are kept only when something reads them: for the `-inconclusive` file, and until the `-retry-inconclusive` pass has run. A scan without either only counts them, so under `-no-abort` or `-auto-rate` against a failing resolver memory no longer grows with every failed lookup (about 1 GB at 10M failures). When they are kept, a wordlist entry costs its index rather than its name. Counts, the report and `pkg/subenum`'s `Stats.Inconclusive` are unchanged; the `-resume` state lists the names only with `-inconclusive` (#300).
7171
- Less memory on large wordlists and busy scans: `-sources`, `-ct`, `-axfr` and `-permute` check their names against the wordlist without building a set as large as it (about 200 MB per feature and target on a 5M-line list), a `-simulate-zone` lab scan no longer keeps a count per queried name (about 170 MB on a 1M-line list), and a `CNAME` lookup reads a UDP answer into a buffer sized for the 1232-byte EDNS payload it advertises instead of 64 KB. Results are unchanged (#321).
72+
- The TUI's `charm.land/lipgloss/v2` moves from v2.0.6 to v2.1.1, which lowered its `go` line back to 1.26.0; Dependabot now skips only v2.1.0, the release that needed Go 1.26.7, instead of every later v2 release. The `go 1.26.0` minimum is unchanged. The Docker image's `org.opencontainers.image.licenses` label is now `GPL-3.0-only`, the SPDX id `CITATION.cff` uses, instead of the deprecated `GPL-3.0`, and the example workflows in the monitoring guide pin the same `upload-sarif` and `upload-artifact` commits as the repo's own workflows, which a test now keeps in step (#366).
7273

7374
### Fixed
7475
- Lab mode (`-simulate-zone`) now answers custom scenarios as a recursive resolver would: an in-zone CNAME is followed through further CNAMEs (up to 8) and wildcards to the addresses at the end, where it used to stop after one step so `a CNAME b`, `b CNAME www` or a CNAME to a `*.dev` name read as missing; an IPv4-mapped AAAA value such as `::ffff:192.0.2.1`, which the lab server never served, is rejected when the scenario loads; and a UDP answer larger than the query's EDNS buffer (512 bytes without one) is sent truncated so the client retries over TCP, where a large TXT value or many records used to fail the lookup. The shipped labs are unchanged (#371).

‎Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ CMD ["-version"]
5656
LABEL org.opencontainers.image.title="subenum"
5757
LABEL org.opencontainers.image.description="Fast concurrent subdomain enumeration via DNS brute-forcing"
5858
LABEL org.opencontainers.image.source="https://github.com/TMHSDigital/subenum"
59-
LABEL org.opencontainers.image.licenses="GPL-3.0"
59+
LABEL org.opencontainers.image.licenses="GPL-3.0-only"
6060
LABEL org.opencontainers.image.documentation="https://github.com/TMHSDigital/subenum/blob/main/README.md"
6161
LABEL org.opencontainers.image.vendor="TMHSDigital"
6262
LABEL org.opencontainers.image.usage="For educational and legitimate security testing purposes only"

‎docs/DEVELOPER_GUIDE.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,9 @@ into every binary. Direct third-party deps:
325325
- [`charm.land/lipgloss/v2`](https://github.com/charmbracelet/lipgloss) - terminal styling
326326

327327
Keep these on versions whose `go` directive is at most the module's `go
328-
1.26.0`: lipgloss v2.1.0 needs Go 1.26.7, so lipgloss stays on v2.0.x for now.
328+
1.26.0`. Check the `go` line of a new release before taking it (`go mod
329+
download -json <module>@<version>` names its go.mod); Dependabot skips
330+
lipgloss v2.1.0, the one release that needed Go 1.26.7.
329331
330332
If you need to add a further dependency:
331333

‎docs/monitoring.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
sarif: takeovers.sarif
109109
fail-on: degraded
110110
- if: always() && hashFiles('takeovers.sarif') != ''
111-
uses: github/codeql-action/upload-sarif@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4
111+
uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4
112112
with:
113113
sarif_file: takeovers.sarif
114114
category: subenum
@@ -246,7 +246,7 @@ jobs:
246246
run: mv current.jsonl previous.jsonl
247247
248248
- if: steps.scan.outputs.verdict == 'complete'
249-
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
249+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
250250
with:
251251
name: subenum-results
252252
path: |
@@ -275,7 +275,7 @@ add it only once the pinned `SUBENUM_VERSION` does. The job needs
275275
```yaml
276276
- name: Upload takeover candidates
277277
if: always() && hashFiles('takeovers.sarif') != ''
278-
uses: github/codeql-action/upload-sarif@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4
278+
uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4
279279
with:
280280
sarif_file: takeovers.sarif
281281
category: subenum

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toolchain go1.26.11
77
require (
88
charm.land/bubbles/v2 v2.2.1
99
charm.land/bubbletea/v2 v2.1.1
10-
charm.land/lipgloss/v2 v2.0.6
10+
charm.land/lipgloss/v2 v2.1.1
1111
golang.org/x/net v0.62.0
1212
)
1313

‎go.sum‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ charm.land/bubbles/v2 v2.2.1 h1:Fq1+qm5hV6GkvzLQDhCBpXXE5tLgvh1PRriCLwSvIQU=
22
charm.land/bubbles/v2 v2.2.1/go.mod h1:wdMgn+sje1KNXdwFizIWjbf328fIUBxqEmJ/vYPo8yc=
33
charm.land/bubbletea/v2 v2.1.1 h1:S1S9l37pCZGrj1JexBcr9x4Nr3MVeM42InqCYM/tDpU=
44
charm.land/bubbletea/v2 v2.1.1/go.mod h1:xWHeyxIX9/wiFU2kgPW04ojOZyTzrWf+8lGjUCaftiU=
5-
charm.land/lipgloss/v2 v2.0.6 h1:EaGKeuA8FvF+v2BT5VmZd2LoYLaMZJXA5n34th8nCIQ=
6-
charm.land/lipgloss/v2 v2.0.6/go.mod h1:ipDDJNSGa1hlwDtSfW1s2/xR8Vdhbut4PXh2zEKZd0Q=
5+
charm.land/lipgloss/v2 v2.1.1 h1:F+vKWis9Kz3MFRsbICSDFtT1ZwVL+8f+36Dtg+OpKwc=
6+
charm.land/lipgloss/v2 v2.1.1/go.mod h1:k79y/56yThpkJvbwyrcHr8MyZF42e84Q5fW9Ibu6LFc=
77
github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
88
github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
99
github.com/aymanbagabas/go-udiff v0.4.1 h1:OEIrQ8maEeDBXQDoGCbbTTXYJMYRCRO1fnodZ12Gv5o=

‎internal/cli/docs_test.go‎

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,111 @@ func TestSiteUnreleasedValueTags(t *testing.T) {
224224
}
225225
}
226226

227+
// usesPins maps each action's owner/repo to the commit SHAs that `uses:`
228+
// lines in text pin it at. Refs that are not a full SHA (a tag, a branch, a
229+
// local path) are skipped.
230+
func usesPins(text string) map[string][]string {
231+
pins := make(map[string][]string)
232+
for _, line := range strings.Split(text, "\n") {
233+
line = strings.TrimPrefix(strings.TrimSpace(line), "- ")
234+
ref, ok := strings.CutPrefix(line, "uses:")
235+
if !ok {
236+
continue
237+
}
238+
ref, _, _ = strings.Cut(strings.TrimSpace(ref), " ")
239+
name, sha, ok := strings.Cut(ref, "@")
240+
if !ok || len(sha) != 40 || strings.Trim(sha, "0123456789abcdef") != "" {
241+
continue
242+
}
243+
parts := strings.Split(name, "/")
244+
if len(parts) < 2 {
245+
continue
246+
}
247+
key := parts[0] + "/" + parts[1]
248+
pins[key] = append(pins[key], sha)
249+
}
250+
return pins
251+
}
252+
253+
// TestDocsActionPinsMatchWorkflows keeps the example workflows in the docs on
254+
// the action SHAs the repo itself runs. Dependabot bumps the workflows and
255+
// action.yml but never reads Markdown, so a copied example would otherwise
256+
// start on an old release (#366).
257+
func TestDocsActionPinsMatchWorkflows(t *testing.T) {
258+
sources, err := filepath.Glob(filepath.Join(".github", "workflows", "*.y*ml"))
259+
if err != nil {
260+
t.Fatal(err)
261+
}
262+
sources = append(sources, "action.yml")
263+
pinned := make(map[string]map[string]bool)
264+
for _, src := range sources {
265+
contents, err := os.ReadFile(src) //nolint:gosec // a repo file
266+
if err != nil {
267+
t.Fatal(err)
268+
}
269+
for key, shas := range usesPins(string(contents)) {
270+
if pinned[key] == nil {
271+
pinned[key] = make(map[string]bool)
272+
}
273+
for _, sha := range shas {
274+
pinned[key][sha] = true
275+
}
276+
}
277+
}
278+
279+
pages, err := filepath.Glob(filepath.Join("docs", "*.md"))
280+
if err != nil {
281+
t.Fatal(err)
282+
}
283+
pages = append(pages, readmeFlagsFile)
284+
checked := 0
285+
for _, page := range pages {
286+
contents, err := os.ReadFile(page) //nolint:gosec // a docs file
287+
if err != nil {
288+
t.Fatal(err)
289+
}
290+
for key, shas := range usesPins(string(contents)) {
291+
want, ok := pinned[key]
292+
if !ok {
293+
continue
294+
}
295+
for _, sha := range shas {
296+
checked++
297+
if !want[sha] {
298+
t.Errorf("%s pins %s@%s, but the workflows pin it elsewhere", page, key, sha)
299+
}
300+
}
301+
}
302+
}
303+
if checked == 0 {
304+
t.Fatal("found no action pins in the docs to check; has the parser drifted?")
305+
}
306+
}
307+
308+
// TestDockerLicenseLabelMatchesCitation keeps the image's OCI licence label
309+
// on the same SPDX identifier as CITATION.cff (#366).
310+
func TestDockerLicenseLabelMatchesCitation(t *testing.T) {
311+
field := func(path, prefix string) string {
312+
t.Helper()
313+
contents, err := os.ReadFile(path) //nolint:gosec // a repo file
314+
if err != nil {
315+
t.Fatal(err)
316+
}
317+
for _, line := range strings.Split(string(contents), "\n") {
318+
if _, value, ok := strings.Cut(line, prefix); ok {
319+
return strings.Trim(strings.TrimSpace(value), `"`)
320+
}
321+
}
322+
t.Fatalf("%s has no %q", path, prefix)
323+
return ""
324+
}
325+
citation := field("CITATION.cff", "license:")
326+
label := field("Dockerfile", "org.opencontainers.image.licenses=")
327+
if label != citation {
328+
t.Errorf("Dockerfile licence label is %q, CITATION.cff says %q", label, citation)
329+
}
330+
}
331+
227332
// TestREADMEFlagTableCoversCLI keeps the hand-written README table complete
228333
// when a CLI flag is added. The website table is generated, but the README is
229334
// maintained separately for quick reference (#137).

0 commit comments

Comments
 (0)