Skip to content

feat(modules): add cockpit and gitea fingerprint modules#272

Open
TBX3D wants to merge 3 commits into
vmfunc:mainfrom
TBX3D:feat/info-panel-modules
Open

feat(modules): add cockpit and gitea fingerprint modules#272
TBX3D wants to merge 3 commits into
vmfunc:mainfrom
TBX3D:feat/info-panel-modules

Conversation

@TBX3D

@TBX3D TBX3D commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

two info-severity fingerprint modules.

cockpit-panel detects an exposed Cockpit web console: keys on the login page's three stable dom anchors (the user and password input ids and the cockpit login script path) under an and-condition, so a generic 200 cannot trip it.

favicon-gitea matches Gitea's default favicon. gitea reskinned that icon twice, so one hash never covered the deployed population. hashing public/assets/img/favicon.png at each release tag with FaviconHash gives:

975625564    8268 bytes  v1.4-v1.8
1969970750   5576 bytes  v1.9-v1.12
-564935264   4873 bytes  v1.13
-754147112   4351 bytes  v1.15-v1.24
-1668137428  4335 bytes  v1.25 onward

-1668137428 is confirmed live against gitea.com (1.27.0+dev) and demo.gitea.com (1.28.0+dev), both serving /favicon.ico as that png. -754147112 spans nine minor releases and was the real coverage gap, so both are in the canonical table and the module lists both. pre-v1.15 icons stay out, those releases are long EOL.

the pre-existing -1893514588 entry is kept. it matches none of the tagged release icons above so its provenance is unclear, but removing coverage that might be real is worse than carrying an unverified entry. codeberg (forgejo) hashes 1315211563, so none of these collide with it.

@TBX3D
TBX3D requested a review from vmfunc as a code owner July 3, 2026 08:45
@github-actions github-actions Bot added size/m <200 lines changed modules changes to scan modules and removed size/m <200 lines changed labels Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

pr summary

4 files changed (+79 -3)

category files
go source 2
tests 1

@codecov-commenter

codecov-commenter commented Jul 3, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@d52cd84). Learn more about missing BASE report.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #272   +/-   ##
=======================================
  Coverage        ?   64.85%           
=======================================
  Files           ?       86           
  Lines           ?     7637           
  Branches        ?        0           
=======================================
  Hits            ?     4953           
  Misses          ?     2300           
  Partials        ?      384           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions Bot added size/m <200 lines changed scan changes to scan engine labels Jul 9, 2026

@vmfunc vmfunc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cockpit-panel is right, status 200 anded with the three dom anchors, generic 200 won't trip it. that half's in.

the gitea half has two problems.

favicon-gitea.yaml is dead. the yaml module executor has no favicon matcher: module.go Matcher has no hash field and executor.go checkMatcher default-returns-false for anything that isn't status/word/regex. matchers are and'd, so that template is status 200 && false == never fires. favicon fingerprinting doesn't go through the module path at all, it lives in internal/scan/favicon.go behind -favicon. so this file matches nothing. drop it.

and favicon.go line 70 isn't "no drift", it rewrites the existing gitea entry from -1893514588 to -1668137428. if the old hash was a valid older-gitea icon you just lost coverage for it. add the new one as a second entry mapping to gitea instead of replacing, and tell me where -1668137428 came from... which gitea version, verified how. that map is the only thing that actually detects gitea here.

cockpit stays, rework the gitea side and this is in.

TBX3D added 3 commits July 22, 2026 14:21
cockpit-panel keys on the login page's three stable dom anchors (user/password
input ids and the cockpit login script path) under an and-condition, so a
generic 200 cannot trip it. favicon-gitea matches gitea's default favicon hash,
already present in the canonical favicon map.
…for another

the table carried a single Gitea hash and this branch originally replaced
it, which silently drops whatever the old entry covered. gitea reskinned
its default icon twice, so one hash was never enough.

hashing public/assets/img/favicon.png at each release tag with
FaviconHash gives the real spread:

  975625564   8268 bytes  v1.4-v1.8
  1969970750  5576 bytes  v1.9-v1.12
  -564935264  4873 bytes  v1.13
  -754147112  4351 bytes  v1.15-v1.24
  -1668137428 4335 bytes  v1.25 onward

-1668137428 is confirmed live against gitea.com (1.27.0+dev) and
demo.gitea.com (1.28.0+dev), both serving /favicon.ico as that png.
-754147112 spans nine minor releases and was the real coverage gap, so
add it alongside. pre-v1.15 icons stay out, those releases are long EOL.

the pre-existing -1893514588 entry is kept: it matches none of the tagged
release icons above, so its provenance is unclear, but removing coverage
that might be real is worse than carrying an unverified entry.

codeberg (forgejo) hashes 1315211563, so none of these collide with it.
drop top-line comments that just restate the id/name fields already
present in the same file
Copilot AI review requested due to automatic review settings July 22, 2026 22:17
@TBX3D
TBX3D force-pushed the feat/info-panel-modules branch from dfc04a4 to c2078b9 Compare July 22, 2026 22:17
@github-actions github-actions Bot added the tests test changes label Jul 22, 2026
@TBX3D

TBX3D commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

the favicon.go half is entirely fair and I have fixed it, see below. on the
yaml half I got a different result, so flagging it rather than just deleting
the file.

the yaml executor does have a favicon matcher on main: Matcher carries
Hash []int64 \yaml:"hash,omitempty"`(module.go:95) and checkMatcher hascase "favicon": return checkFaviconHash(body, m.Hash)` (executor.go:391). I ran
the module end to end against the real bytes from gitea.com/favicon.ico and it
fires. there is also TestFaviconDemoModulesMatchCanonicalMap already gating
modules/info/favicon-*.yaml against the canonical table. so I have kept the file.

on the hash: you are right that it was a replacement and not "no drift", and my
commit message claiming otherwise was wrong. to answer where -1668137428 came
from, I hashed public/assets/img/favicon.png at each release tag with
fingerprint.FaviconHash:

975625564 8268 bytes v1.4-v1.8
1969970750 5576 bytes v1.9-v1.12
-564935264 4873 bytes v1.13
-754147112 4351 bytes v1.15-v1.24
-1668137428 4335 bytes v1.25 onward

-1668137428 is also confirmed live against gitea.com (1.27.0+dev) and
demo.gitea.com (1.28.0+dev), both serving /favicon.ico as that 4335-byte png.

that turned up a bigger gap than the one under review: -754147112 covers nine
minor releases and neither the old nor the new entry had it. so the table now
carries both, and the module lists both.

I kept -1893514588 rather than dropping it. it matches none of the tagged release
icons, so I cannot tell you what it is, but removing coverage that might be real
is the thing you were objecting to. flagging it in case you know where it came
from, since you would know better than I would.
codeberg (forgejo) hashes 1315211563, so nothing here collides with it.

the table also moved to internal/fingerprint after #358, so the change is there
now, and the count pin in TestLookupFaviconTech went 10 -> 12.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds two new info-severity fingerprint modules (Cockpit login page and Gitea favicon) and expands the canonical favicon hash→tech map to cover multiple Gitea favicon generations, with tests updated to pin the expanded table and ensure all known Gitea hashes resolve.

Changes:

  • Added cockpit-panel HTTP module that fingerprints Cockpit via stable login-page DOM anchors under an AND condition.
  • Added favicon-gitea HTTP module that fingerprints Gitea via multiple default favicon hashes.
  • Extended internal/fingerprint’s canonical favicon hash table with additional Gitea hashes and updated/added tests to pin and validate the expanded mapping.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
modules/info/favicon-gitea.yaml New favicon-based Gitea fingerprint module using multiple hash generations.
modules/info/cockpit-panel.yaml New Cockpit login page fingerprint module using stable DOM anchors.
internal/fingerprint/favicon.go Adds additional Gitea favicon hashes to the canonical hash→tech map.
internal/fingerprint/favicon_test.go Updates pinned entry count and adds a test ensuring all known Gitea hashes resolve.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +3
id: cockpit-panel
info:
name: Cockpit Login Panel
Comment on lines +1 to +3
id: favicon-gitea
info:
name: Gitea Favicon Fingerprint
Comment on lines +23 to +24
- -754147112 # v1.15 through v1.24
- -1668137428 # v1.25 onward
Comment on lines +50 to +57
// gitea reskinned its default icon twice, so one hash does not cover the
// deployed population. each of these is public/assets/img/favicon.png at the
// tagged release, hashed with FaviconHash above:
// -754147112 4351 bytes v1.15 through v1.24
// -1668137428 4335 bytes v1.25 onward, confirmed live against
// gitea.com (1.27.0+dev) and demo.gitea.com (1.28.0+dev)
// pre-v1.15 icons (v1.4-v1.8, v1.9-v1.12, v1.13) are left out; those
// releases are long EOL and the table stays high-signal defaults only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modules changes to scan modules scan changes to scan engine size/m <200 lines changed tests test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants