Documentation
¶
Overview ¶
Package classify names the KINDS of sensitive data in sampled values.
The scanner already classified sensitivity by COLUMN NAME: a column called password is a credential, one called iban is financial. That works well and has one systematic blind spot -- every pattern is English. A schema written in German (passwort, kreditkarte), or one that simply uses generic names (notes, payload, data, value), yields no tags at all, so a readable relation full of card numbers is rated "data with nothing recognised in it" rather than critical. For a tool whose first requirement is that it work against ANY project, that is not a missing nicety; it is a severity that is systematically too low outside the anglophone web.
This package looks at what the scan already retrieved. It sends no requests, stores nothing, and returns kinds -- never values. A finding that says "this table contains card numbers" is evidence; one that quotes the number is a second copy of the leak.
PRECISION IS THE WHOLE DESIGN. A false "financial" tag on a table of order IDs teaches an operator to distrust the severity column, and a severity nobody trusts is worse than none. So every rule here is structural rather than statistical: a card number must pass Luhn AND carry a real issuer prefix and a length that issuer uses, an IBAN must satisfy mod-97, a JWT's header must actually decode to JSON naming an algorithm. Rules that cannot be checked that way are not included, however tempting.
Structural does not mean infallible, and this paragraph used to imply that it did. Measured against 26,000 generated values in volume_test.go, the card rule tags 2.15% of random sixteen-digit strings: Luhn passes one in ten and roughly a quarter of sixteen-digit strings carry an accepted issuer prefix, so that product is the floor the rule can reach and a bare card number offers nothing further to check. The national-identity rule reaches 0.10% after three independent constraints. Both rates are pinned by that test, so a rule that gets looser fails rather than drifting.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Kinds ¶
Kinds returns the sorted, deduplicated kinds found anywhere in rows.
The kinds match the vocabulary the column-name classifier already uses -- credential, financial, pii -- so the two can be merged without translation.
func Names ¶
Names returns "name:kind" for each name matching a rule.
Used for database columns, for Realtime Database key names, and for Firestore collection names: all four are a caller telling you what a thing holds, and none of them require reading what it holds.
func Vocabulary ¶
func Vocabulary() []string
Vocabulary returns every class either classifier can emit, sorted.
The authoritative answer to "what kinds of data does this tool report". It exists so the renderer can be checked AGAINST the classifiers rather than maintained alongside them: internal/finding offered phrases for three classes -- contact, location, health -- that nothing had ever produced, and nothing could see that because the two lists were written in different packages and compared by nobody.
Types ¶
This section is empty.