Loading
Allow forward slashes in vendor definition token types
🤖 AI wrote this code from my instructions.Unreviewed AI output often lands on reviewers and costs them time.
This MR is human verified: I read the full diff and ran the tests myself, because your time is as valuable as mine.
This merge request lets a vendor definition carry a detection rule id that contains a forward slash, i.e. /.
Related to #631759.
Gap
token_typemust equal the rule id, because the registry is keyed by it.TOKEN_TYPE_PATTERNdoes not allow forward slashes, so it rejects rule ids such asHashicorp Terraform user/org API token.- A definition for such a rule needs a renamed
token_typeand a hand-edited registry key, as in !259344 (merged).
Fix
- We add the forward slash to
TOKEN_TYPE_PATTERNregex. - This is safe:
token_typereaches generated source only in the registry entry, through#inspect.
MR acceptance checklist
I have evaluated this MR against the MR acceptance checklist.
Edited by Ahmed Hemdan