{"_id":"@aspidasec/custom-rules","name":"@aspidasec/custom-rules","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@aspidasec/custom-rules","version":"0.1.0","description":"Custom rule authoring engine for AspidaSec","license":"Apache-2.0","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"main":"./dist/index.js","types":"./dist/index.d.ts","dependencies":{"yaml":"^2.6.0","zod":"^3.23.8","@aspidasec/core":"0.1.0","@aspidasec/config":"0.1.0","@aspidasec/schema":"0.1.0"},"devDependencies":{"typescript":"^5.6.0","vitest":"^2.1.0","@types/node":"^22.0.0"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/vibellabbs-code/aspidasec.git","directory":"packages/custom-rules"},"homepage":"https://github.com/vibellabbs-code/aspidasec#readme","bugs":{"url":"https://github.com/vibellabbs-code/aspidasec/issues"},"keywords":["aspidasec","security","custom-rules","scanner"],"scripts":{"build":"tsc","dev":"tsc --watch","typecheck":"tsc --noEmit","test":"vitest run --passWithNoTests","test:watch":"vitest","clean":"rm -rf dist"},"_id":"@aspidasec/custom-rules@0.1.0","_integrity":"sha512-XeELMWh13i0R9nSfcJcsTVeT4bkXOpxYftDsNKhNmw2qEhffklUz1HTeYKfxdZJQ1HDHlDhz2cFuoU6tVWrBRA==","_resolved":"C:\\Users\\user2\\AppData\\Local\\Temp\\ef3f4f33bb9ea5656c45e7adf995611d\\aspidasec-custom-rules-0.1.0.tgz","_from":"file:aspidasec-custom-rules-0.1.0.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-XeELMWh13i0R9nSfcJcsTVeT4bkXOpxYftDsNKhNmw2qEhffklUz1HTeYKfxdZJQ1HDHlDhz2cFuoU6tVWrBRA==","shasum":"00b37ab1040c2d9eb279e01c5418698fdf345c07","tarball":"https://registry.npmjs.org/@aspidasec/custom-rules/-/custom-rules-0.1.0.tgz","fileCount":19,"unpackedSize":42391,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC0VEvB/7PHgQtwETQlMYkQsz0wInbBjBFMAU5ubzyWAQIgVh6bkmn5nLhki8QrctDWkXJfxf4nx4oItFPM3x9sHg8="}]},"_npmUser":{"name":"kaa911-syp","email":"vibellabbs@gmail.com"},"directories":{},"maintainers":[{"name":"kaa911-syp","email":"vibellabbs@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/custom-rules_0.1.0_1778999325326_0.4447255773338603"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-17T06:28:45.240Z","0.1.0":"2026-05-17T06:28:45.472Z","modified":"2026-05-17T06:28:45.683Z"},"maintainers":[{"name":"kaa911-syp","email":"vibellabbs@gmail.com"}],"description":"Custom rule authoring engine for AspidaSec","homepage":"https://github.com/vibellabbs-code/aspidasec#readme","keywords":["aspidasec","security","custom-rules","scanner"],"repository":{"type":"git","url":"git+https://github.com/vibellabbs-code/aspidasec.git","directory":"packages/custom-rules"},"bugs":{"url":"https://github.com/vibellabbs-code/aspidasec/issues"},"license":"Apache-2.0","readme":"# @aspidasec/custom-rules\n\nCustom rule engine for AspidaSec. It loads YAML or inline rule definitions, validates them with Zod, applies regex patterns to matching files, and emits `NormalizedFinding` results through the `CustomRuleScanner` adapter.\n\n## Installation\n\n```bash\npnpm add @aspidasec/custom-rules\n```\n\n## Usage\n\n```ts\nimport { CustomRuleScanner, RuleLoader } from \"@aspidasec/custom-rules\";\n\nconst loader = new RuleLoader();\nconst validation = loader.validateDirectory(\".aspidasec/rules\");\n\nconst scanner = new CustomRuleScanner(loader);\nconst findings = await scanner.scan({ repoRoot: process.cwd() });\n```\n\nFrom the AspidaSec CLI:\n\n```bash\naspidasec rules list\naspidasec rules validate\n```\n\n## API\n\n- `RuleLoader` — loads `.yml` and `.yaml` files from a directory, validates inline config rules, and reports validation errors per file.\n- `aspidasecRuleSchema` — Zod schema for `AspidaSecRule` definitions.\n- `CustomRuleScanner` — scanner adapter with `name = \"custom-rules\"`; loads configured rules plus `.aspidasec/rules` and matches them against source files.\n- `AspidaSecRule` — rule definition with bilingual title/description/remediation, severity, category, regex `pattern`, `fileGlob`, optional OWASP category, and optional CWE list.\n- `CustomRulesConfig` — config shape for inline custom rules.\n- `RuleValidationResult` — validation result containing validity, parsed rule, errors, and file path.\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md","_rev":"1-2dfcc47bf6d3e38eda0f1b93837e94fd"}