Rule packs
Rule packs are YAML files that teach the source detector which calls and identifiers count as crypto. What you will do: put a file in the right folder, copy an existing rule, scan. Use the field reference below when you need a detail. Hands-on walkthrough: Adding a rule.Where to put a file
Shipped C / C++ packs (v0.3.0)
For C and C++,
match.package is an ecosystem tag (openssl, libsodium, mbedtls, botan). Calls are usually unqualified; the tag does not need an import path.
Release binaries ship embedded packs. If you scan from a source checkout, on-disk rules/ wins so edits apply without rebuilding. --rules adds extra directories after the defaults (it does not replace them). See CLI flags.
Annotated example
languagepicks which files this pack applies to.idon each rule must stay stable (SARIF baselines).primitivemust be a canonical name, orUNKNOWN.matchis how cryptarium finds the site (calloridentifier).
How loading works
- Find on-disk
rules/by walking up from the working directory, or use the embedded packs. - Skip
libraries/when loading source packs (that file is for deps). - Append any
--rulesdirectories. - For each source file, run packs for that language (plus aliases: TS→javascript, cpp→c).
- Prefer tree-sitter AST matches; regex fallback forces low confidence.
Library catalog
rules/libraries/catalog.yaml is separate from source packs:
go.mod and entries with ecosystem: go. Presence means “this library is in the graph,” not “this algorithm is used.”
Pack fields
Pack fields
Rule fields
Rule fields
Use
high only when the match alone establishes the algorithm and its important parameters.match object
match object
kind: callFor OpenSSL, libsodium, mbedTLS, and Botan,
package is an ecosystem tag. Unqualified C/C++ calls still match.kind: identifierparameters
parameters