Add C or JavaScript coverage in YAML: copy a rule, add fixtures, run lint.
Adding a rule
Teach cryptarium about a crypto API by editing YAML. You usually do not need to change Go.What you will do: add a rule, add a positive and negative fixture, run make lint-rules.
Checklist
Stable id (do not rename later; SARIF baselines break)
Canonical primitive (or honest UNKNOWN)
Honest confidence (high only when the match proves the algorithm and key details)
Positive fixture that must match
Negative fixture that must not (especially comments)
references link to the API docs
make lint-rules passes
Full field list: Rule packs. Fixture layout: Fixtures.Shipped C packs (append new symbols there): rules/c/openssl.yaml, rules/c/libsodium.yaml, rules/c/mbedtls.yaml. C++-only packs: rules/cpp/cryptopp.yaml, rules/cpp/botan.yaml. Do not re-add OpenSSL under rules/cpp/; C++ files already load C packs.
Use medium or low when the API can pick the algorithm at runtime (for example generateKey or generateKeyPairSync). Do not guess RSA from the function name alone.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"cryptarium","description":"Cryptographic discovery and CBOM generation for the post-quantum transition.","colors":{"primary":"#005DFC","light":"#3D7FFF","dark":"#031F45"},"logo":{"light":"https://mintcdn.com/cryptarium/ANhfuJiFU1kktFhD/logo/light.svg?fit=max\u0026auto=format\u0026n=ANhfuJiFU1kktFhD\u0026q=85\u0026s=90d92d484d4dbd8b40061a970426eba7","dark":"https://mintcdn.com/cryptarium/ANhfuJiFU1kktFhD/logo/dark.svg?fit=max\u0026auto=format\u0026n=ANhfuJiFU1kktFhD\u0026q=85\u0026s=ce057eb75fb4cc8348a55769075377e5","href":"/"},"favicon":"https://mintcdn.com/cryptarium/ANhfuJiFU1kktFhD/favicon.svg?fit=max\u0026auto=format\u0026n=ANhfuJiFU1kktFhD\u0026q=85\u0026s=f3be2e8aa877bf1fec064d45cc73f4be","appearance":{"default":"system"},"navbar":{"links":[{"href":"https://github.com/sgoveia/cryptarium","label":"GitHub"}],"primary":{"type":"button","label":"Install","href":"/install"}},"footer":{"socials":{"github":"https://github.com/sgoveia/cryptarium"}},"fonts":{"family":"Inter"},"styling":{"codeblocks":{"theme":"night-owl"},"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"cryptarium","hasAudioNarration":false,"actualSubdomain":"cryptarium","customDomains":["docs.cryptarium.dev"],"gitSource":{"type":"github","owner":"sgoveia","repo":"cryptarium","deployBranch":"main","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6acd8364bafd9391e75646b9","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"default","tag":"Docs","count":22},{"language":"default","tag":"Concepts","count":6},{"language":"default","tag":"Guides","count":5},{"language":"default","tag":"Outputs","count":5},{"language":"default","tag":"Output formats","count":5},{"language":"default","tag":"CLI","count":4},{"language":"default","tag":"CLI reference","count":4},{"language":"default","tag":"Detectors \u0026 rules","count":4},{"language":"default","tag":"Get started","count":4},{"language":"default","tag":"Reference","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"detectors/adding-a-rule","slug":"/detectors/adding-a-rule","pageMetadata":{"title":"Adding a rule","description":"Add C or JavaScript coverage in YAML: copy a rule, add fixtures, run lint.","href":"/detectors/adding-a-rule"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Add C or JavaScript coverage in YAML: copy a rule, add fixtures, run lint.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,input:`input`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`1`,id:`adding-a-rule`,children:`Adding a rule`}),`\n`,_jsx(_components.p,{children:`Teach cryptarium about a crypto API by editing YAML. You usually do not need to change Go.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`What you will do:`}),` add a rule, add a positive and negative fixture, run `,_jsx(_components.code,{children:`make lint-rules`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`checklist`,children:`Checklist`}),`\n`,_jsxs(_components.ul,{className:`contains-task-list`,children:[`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Stable `,_jsx(_components.code,{children:`id`}),` (do not rename later; SARIF baselines break)`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Canonical `,_jsx(_components.code,{children:`primitive`}),` (or honest `,_jsx(_components.code,{children:`UNKNOWN`}),`)`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Honest `,_jsx(_components.code,{children:`confidence`}),` (`,_jsx(_components.code,{children:`high`}),` only when the match proves the algorithm `,_jsx(_components.em,{children:`and`}),` key details)`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Positive fixture that must match`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Negative fixture that must not (especially comments)`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,_jsx(_components.code,{children:`references`}),` link to the API docs`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,_jsx(_components.code,{children:`make lint-rules`}),` passes`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Full field list: `,_jsx(_components.a,{href:`/detectors/rule-packs`,children:`Rule packs`}),`. Fixture layout: `,_jsx(_components.a,{href:`/detectors/fixtures`,children:`Fixtures`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Shipped C packs (append new symbols there): `,_jsx(_components.code,{children:`rules/c/openssl.yaml`}),`, `,_jsx(_components.code,{children:`rules/c/libsodium.yaml`}),`, `,_jsx(_components.code,{children:`rules/c/mbedtls.yaml`}),`. C++-only packs: `,_jsx(_components.code,{children:`rules/cpp/cryptopp.yaml`}),`, `,_jsx(_components.code,{children:`rules/cpp/botan.yaml`}),`. Do not re-add OpenSSL under `,_jsx(_components.code,{children:`rules/cpp/`}),`; C++ files already load C packs.`]}),`\n`,_jsx(Heading,{level:`2`,id:`example-1-javascript`,children:`Example 1: JavaScript`}),`\n`,_jsxs(_components.p,{children:[`Append to `,_jsx(_components.a,{href:`https://github.com/sgoveia/cryptarium/blob/main/rules/javascript/webcrypto.yaml`,children:_jsx(_components.code,{children:`rules/javascript/webcrypto.yaml`})}),` (also covers TypeScript files):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:` - `}),_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:`id`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`js.crypto.generatekeypairsync`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` primitive`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`UNKNOWN`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` assetType`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`algorithm`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` functions`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: [`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`keygen`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` confidence`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`low`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` match`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` kind`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`call`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` package`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`crypto`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` symbol`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`generateKeyPairSync`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` references`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:` - `}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`\"`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`https://nodejs.org/api/crypto.html#cryptogeneratekeypairsynctype-options`}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`\"`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Shipped rules in that pack already look like this:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:` - `}),_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:`id`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`js.crypto.createcipheriv.aes`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` primitive`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`AES`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` functions`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: [`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`encrypt`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` confidence`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`medium`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` match`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` kind`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`call`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` package`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`crypto`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` symbol`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`createCipheriv`})]}),`\n`]})})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`medium`}),` or `,_jsx(_components.code,{children:`low`}),` when the API can pick the algorithm at runtime (for example `,_jsx(_components.code,{children:`generateKey`}),` or `,_jsx(_components.code,{children:`generateKeyPairSync`}),`). Do not guess `,_jsx(_components.code,{children:`RSA`}),` from the function name alone.`]})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Positive fixture`}),` (`,_jsx(_components.code,{children:`testdata/rules/js.crypto.createcipheriv.aes/positive.js`}),`):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-dark\":`#C792EA`},children:`const`}),_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:` crypto`}),_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-dark\":`#C792EA`},children:` =`}),_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:` require`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`(`}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`\"`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`crypto`}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`\"`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-dark\":`#C792EA`},children:`function`}),_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:` seal`}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`(`}),_jsx(_components.span,{style:{color:`#D7DBE0`,\"--shiki-dark\":`#D7DBE0`},children:`key`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`, `}),_jsx(_components.span,{style:{color:`#D7DBE0`,\"--shiki-dark\":`#D7DBE0`},children:`iv`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`, `}),_jsx(_components.span,{style:{color:`#D7DBE0`,\"--shiki-dark\":`#D7DBE0`},children:`plain`}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`)`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#C792EA`,\"--shiki-dark-font-style\":`italic`},children:` return`}),_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#7FDBCA`,\"--shiki-dark-font-style\":`italic`},children:` crypto`}),_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#C792EA`,\"--shiki-dark-font-style\":`italic`},children:`.`}),_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:`createCipheriv`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`(`}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`\"`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`aes-256-gcm`}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`\"`}),_jsx(_components.span,{style:{color:`#5F7E97`,\"--shiki-dark\":`#5F7E97`},children:`,`}),_jsx(_components.span,{style:{color:`#D7DBE0`,\"--shiki-dark\":`#D7DBE0`},children:` key`}),_jsx(_components.span,{style:{color:`#5F7E97`,\"--shiki-dark\":`#5F7E97`},children:`,`}),_jsx(_components.span,{style:{color:`#D7DBE0`,\"--shiki-dark\":`#D7DBE0`},children:` iv`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`)`}),_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#C792EA`,\"--shiki-dark-font-style\":`italic`},children:`.`}),_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:`update`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`(`}),_jsx(_components.span,{style:{color:`#D7DBE0`,\"--shiki-dark\":`#D7DBE0`},children:`plain`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Negative fixture`}),` (must not match):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#637777`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#637777`,\"--shiki-dark-font-style\":`italic`},children:`// crypto.createCipheriv is only mentioned in a comment.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-dark\":`#C792EA`},children:`function`}),_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:` seal`}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`()`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#C792EA`,\"--shiki-dark-font-style\":`italic`},children:` return`}),_jsx(_components.span,{style:{color:`#FF5874`,\"--shiki-dark\":`#FF5874`},children:` null`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`example-2-c-/-openssl`,children:`Example 2: C / OpenSSL`}),`\n`,_jsxs(_components.p,{children:[`Append to `,_jsx(_components.a,{href:`https://github.com/sgoveia/cryptarium/blob/main/rules/c/openssl.yaml`,children:_jsx(_components.code,{children:`rules/c/openssl.yaml`})}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:` - `}),_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:`id`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`c.openssl.rsa_generate_key_ex`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` primitive`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`RSA`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` assetType`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`algorithm`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` functions`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: [`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`keygen`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` confidence`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`high`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` match`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` kind`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`call`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` package`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`openssl`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` symbol`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`RSA_generate_key_ex`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` references`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:` - `}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`\"`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`https://www.openssl.org/docs/man3.0/man3/RSA_generate_key.html`}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`C++ files also load `,_jsx(_components.code,{children:`c`}),` packs. Put a rule in `,_jsx(_components.code,{children:`rules/cpp/`}),` only when it should `,_jsx(_components.em,{children:`not`}),` apply to plain C.`]}),`\n`,_jsx(_components.p,{children:`Compare with a vague API in the same pack:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:` - `}),_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:`id`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`c.openssl.evp_pkey_keygen`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` primitive`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`UNKNOWN`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` functions`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: [`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`keygen`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` confidence`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`medium`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` match`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` kind`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`call`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` package`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`openssl`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` symbol`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`EVP_PKEY_keygen`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`EVP_PKEY_keygen`}),` can create many key types. `,_jsx(_components.code,{children:`UNKNOWN`}),` is the right call.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Positive fixture:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`c`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`c`,children:_jsxs(_components.code,{language:`c`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-dark\":`#C792EA`},children:`#`}),_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#C792EA`,\"--shiki-dark-font-style\":`italic`},children:`include`}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`openssl/rsa.h`}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-dark\":`#C792EA`},children:`int`}),_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:` make_rsa`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`(RSA `}),_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:`*`}),_jsx(_components.span,{style:{color:`#D7DBE0`,\"--shiki-dark\":`#D7DBE0`},children:`rsa`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`, BIGNUM `}),_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:`*`}),_jsx(_components.span,{style:{color:`#D7DBE0`,\"--shiki-dark\":`#D7DBE0`},children:`e`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#C792EA`,\"--shiki-dark-font-style\":`italic`},children:` return`}),_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:` RSA_generate_key_ex`}),_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-dark\":`#82AAFF`},children:`(rsa, `}),_jsx(_components.span,{style:{color:`#F78C6C`,\"--shiki-dark\":`#F78C6C`},children:`2048`}),_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-dark\":`#82AAFF`},children:`, e, NULL)`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Negative fixture:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`c`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`c`,children:_jsxs(_components.code,{language:`c`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#637777`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#637777`,\"--shiki-dark-font-style\":`italic`},children:`/* RSA_generate_key_ex is only mentioned in a comment. */`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-dark\":`#C792EA`},children:`int`}),_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:` make_rsa`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`(`}),_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-dark\":`#C792EA`},children:`void`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#C792EA`,\"--shiki-dark-font-style\":`italic`},children:` return`}),_jsx(_components.span,{style:{color:`#F78C6C`,\"--shiki-dark\":`#F78C6C`},children:` 0`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`enhance-a-rule`,children:`Enhance a rule`}),`\n`,_jsx(_components.p,{children:`Common upgrades:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Lower false positives by tightening `,_jsx(_components.code,{children:`package`}),` / `,_jsx(_components.code,{children:`symbol`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Raise `,_jsx(_components.code,{children:`confidence`}),` only after you extract real parameters (or the symbol alone is unambiguous).`]}),`\n`,_jsxs(_components.li,{children:[`Add static `,_jsx(_components.code,{children:`parameters`}),` only when every hit shares them (example: known AES-128 constant).`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` parameters`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` keySize`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: { `}),_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:`value`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#F78C6C`,\"--shiki-dark\":`#F78C6C`},children:`128`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:` }`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`extend-the-library-catalog`,children:`Extend the library catalog`}),`\n`,_jsxs(_components.p,{children:[`To flag a Go module in `,_jsx(_components.code,{children:`go.mod`}),`, edit `,_jsx(_components.code,{children:`rules/libraries/catalog.yaml`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:` - `}),_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:`name`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`github.com/example/pq-crypto`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` ecosystem`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`go`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` primitives`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: [`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`ML-KEM`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`, `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`ML-DSA`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-dark\":`#7FDBCA`},children:` confidence`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`: `}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`medium`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`A library in the lockfile is `,_jsx(_components.strong,{children:`medium`}),` confidence at most. It is not proof the code uses that crypto. See `,_jsx(_components.a,{href:`/concepts/correlation`,children:`Correlation`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`when-not-to-write-a-rule`,children:`When not to write a rule`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Need`}),_jsx(_components.th,{children:`Use instead`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Parse certificates`}),_jsx(_components.td,{children:`Certs detector`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`nginx / SSH / JWT config strings`}),_jsx(_components.td,{children:`Config detector`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Follow data across files`}),_jsx(_components.td,{children:`Out of scope for YAML rules`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`what-happens-after-the-match`,children:`What happens after the match?`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`The source detector emits a finding (where + what API).`}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/concepts/classification`,children:`Classification`}),` assigns Broken / Weakened / Safe / Unknown.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/concepts/scoring`,children:`Scoring`}),` sets priority for the report.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`Your YAML should describe the call site. It should not invent a migration target.`}),`\n`,_jsx(Heading,{level:`2`,id:`validate`,children:`Validate`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:`make`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:` lint-rules`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:`make`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:` test`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:`make`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:` check`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`related`,children:`Related`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/detectors/rule-packs`,children:`Rule packs`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/detectors/fixtures`,children:`Fixtures \u0026 validation`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/detectors/overview`,children:`Detectors overview`})}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":"night-owl"},"config":{},"pageMetadata":{"title":"Adding a rule","description":"Add C or JavaScript coverage in YAML: copy a rule, add fixtures, run lint.","href":"/detectors/adding-a-rule"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Adding a rule","slug":"adding-a-rule","depth":1,"children":[]},{"title":"Checklist","slug":"checklist","depth":2,"children":[]},{"title":"Example 1: JavaScript","slug":"example-1-javascript","depth":2,"children":[]},{"title":"Example 2: C / OpenSSL","slug":"example-2-c-/-openssl","depth":2,"children":[]},{"title":"Enhance a rule","slug":"enhance-a-rule","depth":2,"children":[]},{"title":"Extend the library catalog","slug":"extend-the-library-catalog","depth":2,"children":[]},{"title":"When not to write a rule","slug":"when-not-to-write-a-rule","depth":2,"children":[]},{"title":"What happens after the match?","slug":"what-happens-after-the-match","depth":2,"children":[]},{"title":"Validate","slug":"validate","depth":2,"children":[]},{"title":"Related","slug":"related","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"cryptarium","siteName":"cryptarium","title":"Adding a rule - cryptarium","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-18T22:57:39.327Z","originalFileLocation":"detectors/adding-a-rule.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Add C or JavaScript coverage in YAML: copy a rule, add fixtures, run lint.\">\u003cmeta data-mint-head name=\"application-name\" content=\"cryptarium\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Adding a rule - cryptarium\">\u003cmeta data-mint-head property=\"og:description\" content=\"Add C or JavaScript coverage in YAML: copy a rule, add fixtures, run lint.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"cryptarium\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.cryptarium.dev/detectors/adding-a-rule\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://cryptarium.mintlify.site/_mintlify/api/og/v2?division=Detectors+%26+rules\u0026amp;title=Adding+a+rule\u0026amp;description=Add+C+or+JavaScript+coverage+in+YAML%3A+copy+a+rule%2C+add+fixtures%2C+run+lint.\u0026amp;theme=6d79725afb102272d041497a\u0026amp;signature=7159be44ca63becb384bb2491f3021c9a2f9e1081dfb6cb4a48d72e8995f2db3\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Adding a rule - cryptarium\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Add C or JavaScript coverage in YAML: copy a rule, add fixtures, run lint.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://cryptarium.mintlify.site/_mintlify/api/og/v2?division=Detectors+%26+rules\u0026amp;title=Adding+a+rule\u0026amp;description=Add+C+or+JavaScript+coverage+in+YAML%3A+copy+a+rule%2C+add+fixtures%2C+run+lint.\u0026amp;theme=6d79725afb102272d041497a\u0026amp;signature=7159be44ca63becb384bb2491f3021c9a2f9e1081dfb6cb4a48d72e8995f2db3\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"cryptarium\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#005DFC\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.cryptarium.dev/detectors/adding-a-rule\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/detectors/adding-a-rule.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.cryptarium.dev/#organization\",\"name\":\"cryptarium\",\"url\":\"https://docs.cryptarium.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/cryptarium/ANhfuJiFU1kktFhD/logo/light.svg?fit=max\u0026auto=format\u0026n=ANhfuJiFU1kktFhD\u0026q=85\u0026s=90d92d484d4dbd8b40061a970426eba7\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.cryptarium.dev#website\",\"name\":\"cryptarium\",\"url\":\"https://docs.cryptarium.dev\",\"publisher\":{\"@id\":\"https://docs.cryptarium.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.cryptarium.dev/detectors/adding-a-rule#webpage\",\"url\":\"https://docs.cryptarium.dev/detectors/adding-a-rule\",\"name\":\"Adding a rule\",\"description\":\"Add C or JavaScript coverage in YAML: copy a rule, add fixtures, run lint.\",\"dateModified\":\"2026-09-18T22:57:39.327Z\",\"isPartOf\":{\"@id\":\"https://docs.cryptarium.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.cryptarium.dev/detectors/adding-a-rule#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.cryptarium.dev/detectors/adding-a-rule#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Detectors \u0026 rules\",\"item\":\"https://docs.cryptarium.dev/detectors/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Adding a rule\",\"item\":\"https://docs.cryptarium.dev/detectors/adding-a-rule\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.cryptarium.dev/detectors/adding-a-rule#article\",\"headline\":\"Adding a rule\",\"name\":\"Adding a rule\",\"description\":\"Add C or JavaScript coverage in YAML: copy a rule, add fixtures, run lint.\",\"url\":\"https://docs.cryptarium.dev/detectors/adding-a-rule\",\"mainEntityOfPage\":{\"@id\":\"https://docs.cryptarium.dev/detectors/adding-a-rule#webpage\"},\"dateModified\":\"2026-09-18T22:57:39.327Z\",\"publisher\":{\"@id\":\"https://docs.cryptarium.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.cryptarium.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"cryptarium\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"cryptarium\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/detectors/adding-a-rule.md","siteName":"cryptarium","nav":{"global":null,"anchors":[{"anchor":"Docs","icon":"book-open","groups":[{"group":"Get started","pages":[{"title":"cryptarium","href":""},{"title":"Quickstart","href":"/quickstart"},{"title":"Install","href":"/install"},{"title":"What Cryptarium is not","href":"/what-it-is-not"}]},{"group":"Concepts","pages":[{"title":"Four evidence sources","href":"/concepts/evidence-sources"},{"title":"Correlation","href":"/concepts/correlation"},{"title":"Quantum classification","href":"/concepts/classification"},{"title":"Confidence \u0026 unknown","href":"/concepts/confidence"},{"title":"Determinism","href":"/concepts/determinism"},{"title":"Risk scoring","href":"/concepts/scoring"}]},{"group":"Detectors \u0026 rules","pages":[{"title":"Detectors overview","href":"/detectors/overview"},{"title":"Rule packs","description":"YAML under rules/: where to put files, how they load, and a field reference you can skip until you need it.","href":"/detectors/rule-packs"},{"title":"Adding a rule","href":"/detectors/adding-a-rule"},{"title":"Fixtures \u0026 validation","description":"Positive and negative fixtures prove a rule matches the right code and skips comments.","href":"/detectors/fixtures"}]},{"group":"Guides","pages":[{"title":"First scan in 5 minutes","href":"/guides/first-scan"},{"title":"CI/CD \u0026 workflow integration","sidebarTitle":"CI/CD \u0026 workflows","icon":"diagram-project","href":"/guides/ci-cd"},{"title":"CI with --fail-on","href":"/guides/ci-fail-on"},{"title":"Uploading SARIF","href":"/guides/sarif-upload"},{"title":"Reading the migration report","href":"/guides/migration-report"}]},{"group":"Reference","pages":[{"title":"Canonical primitives","href":"/reference/primitives"},{"title":"Limitations \u0026 roadmap","href":"/reference/limitations"},{"title":"Changelog","href":"/reference/changelog"}]}]},{"anchor":"CLI","icon":"terminal","pages":[{"title":"CLI","href":"/cli/overview"}]},{"anchor":"Outputs","icon":"file-code","pages":[{"title":"Outputs","href":"/outputs/overview"}]},{"anchor":"GitHub","icon":"github","href":"https://github.com/sgoveia/cryptarium"}]},"basePath":"","title":"Adding a rule - cryptarium","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":[],"chunks":[]}