c

cortex-plugin-security-audit

ESM
v1.0.0MIT

Official CortexPrism plugin

0.00CortexPrism
auditcompliancecortex-plugindevelopmentesmsecurity

Install Command

$ cortex plugin install marketplace:cortexprism.io/plugins/cortex-plugin-security-audit
Website RepositoryLicense: MITEntry: mod.ts

Configuration

Plugin Type
ESM
Entry Point
mod.ts
License
MIT

Capabilities

toolsshell:runfs:readnetwork:fetch

Tags

auditcompliancecortex-plugindevelopmentesmsecurity

Statistics

Downloads
0
Rating
0.0
/ 5.0
Version
v1.0.0
Published
June 15, 2026

Reviews (0)

No reviews yet. Be the first to rate this plugin!

README

Security Audit Agent

Automated security scanning for CortexPrism. Detects dependency vulnerabilities, hardcoded secrets, SAST issues, and OWASP Top 10 violations. Generates detailed audit reports with remediation guidance.

Installation

# From marketplace
cortex plugin install marketplace:cortex-plugin-security-audit

# From GitHub
cortex plugin install github:CortexPrism/cortex-plugin-security-audit

# Local development
cortex plugin install ./manifest.json

Quick Start

# Check available audit capabilities
cortex tool call audit_status

# Scan dependencies
cortex tool call audit_dependencies --project_path ./my-project --package_manager npm

# Scan for secrets
cortex tool call audit_secrets --target_path ./src

# Run SAST analysis
cortex tool call audit_sast --target_path ./src --language typescript

# OWASP Top 10 compliance check
cortex tool call audit_owasp --target_path ./

# Generate a combined report from findings
cortex tool call audit_generate_report --findings "$(cat findings.json)" --format html

Tools

ToolDescriptionKey Parameters
audit_dependenciesScan dependencies for known vulnerabilities (npm, pip, cargo, gomod)project_path*, package_manager, output_format
audit_secretsDetect hardcoded secrets, keys, tokens, passwords (30+ patterns)target_path*, file_patterns, exclude_dirs
audit_sastStatic analysis for SQL injection, XSS, command injection, SSRF, etc.target_path , language, rules
audit_owaspOWASP Top 10 compliance check (2021/2017)target_path*, year
audit_generate_reportGenerate comprehensive audit report (markdown/json/html)findings*, format, include_remediation
audit_statusCheck available capabilities and configuration(none)

audit_dependencies

Scan project dependencies for known vulnerabilities.

Parameters:

  • project_path (string, required) — Path to the project root directory
  • package_manager (string, optional, default: "auto") — One of: npm, pip, cargo, gomod, auto
  • output_format (string, optional, default: "json") — json or markdown

Example:

cortex tool call audit_dependencies \
  --project_path ./my-node-app \
  --package_manager npm \
  --output_format markdown

audit_secrets

Scan codebase for hardcoded secrets and credentials.

Parameters:

  • target_path (string, required) — Directory or file to scan
  • file_patterns (string, optional) — Glob patterns, comma-separated (e.g. *.ts,*.js,*.py)
  • exclude_dirs (string, optional, default: "node_modules,.git,dist,build") — Directories to skip

Detection Categories (30+ patterns):

CategoryPatterns Detected
API KeysGitHub, OpenAI, Anthropic, Google, Slack, Stripe, Twilio, SendGrid, Heroku, GitLab
Cloud CredentialsAWS Access Key, AWS Secret, GCP API Key, Azure Connection String
TokensJWT, Bearer, npm Auth, PyPI, Docker Hub, Generic Token
PasswordsHardcoded passwords in assignments
Private KeysRSA, DSA, EC, OpenSSH, PGP private key headers
Connection StringsMongoDB, PostgreSQL, MySQL, Redis, JDBC
OAuthGoogle OAuth Client ID, Generic Client Secret
Encoded SecretsBase64, Hex-encoded values near secret/key names

Example:

cortex tool call audit_secrets \
  --target_path ./src \
  --file_patterns "*.ts,*.js,*.env" \
  --exclude_dirs "node_modules,.git,dist"

audit_sast

Static analysis security testing for common vulnerability patterns.

Parameters:

  • target_path (string, required) — Directory or file to analyze
  • language (string, required) — javascript, typescript, python, java, go, php
  • rules (string, optional) — Comma-separated rule groups or IDs. Available groups: owasp_top10, injection, xss, auth, crypto. Or individual rules: sql-injection, xss, command-injection, path-traversal, ssrf, insecure-deserialization, hardcoded-crypto

SAST Rules:

RuleSeverityOWASP 2021
SQL InjectionCriticalA03:2021
Command InjectionCriticalA03:2021
Cross-Site Scripting (XSS)HighA03:2021
Path TraversalHighA01:2021
Server-Side Request Forgery (SSRF)HighA10:2021
Insecure DeserializationHighA08:2021
Hardcoded Cryptographic MaterialHighA02:2021

Example:

cortex tool call audit_sast \
  --target_path ./src \
  --language python \
  --rules "injection,xss"

audit_owasp

OWASP Top 10 compliance check.

Parameters:

  • target_path (string, required) — Project directory to check
  • year (string, optional, default: "2021") — 2021 or 2017

Example:

cortex tool call audit_owasp --target_path ./ --year 2021

audit_generate_report

Generate a comprehensive security audit report from collected findings.

Parameters:

  • findings (string, required) — JSON array of findings from audit tools
  • format (string, optional, default: "markdown") — markdown, json, or html
  • include_remediation (boolean, optional, default: true) — Include fix guidance

Example:

# Collect findings from multiple tools
FINDINGS=$(cortex tool call audit_dependencies --project_path . --output_format json)
FINDINGS="$FINDINGS$(cortex tool call audit_secrets --target_path ./src)"

# Generate HTML report
cortex tool call audit_generate_report \
  --findings "[$FINDINGS]" \
  --format html \
  --include_remediation true > security-report.html

audit_status

Check what security audit capabilities are available.

Example:

cortex tool call audit_status

Output includes available tools, pattern counts, supported languages, and current configuration.

Configuration

Configure via Cortex settings UI under the General section:

SettingTypeDefaultDescription
severityThresholdselectmediumMinimum severity to report (low, medium, high, critical)
maxFileSizeMBnumber10Maximum file size in MB to scan
excludeDirstextnode_modules,.git,dist,build,__pycache__Directories to exclude from scans

Configuration is loaded in onLoad via ctx.config.get().

Programmatic Configuration

In ~/.cortex/config.json:

{
  "plugins": {
    "cortex-plugin-security-audit": {
      "enabled": true,
      "config": {
        "severityThreshold": "high",
        "maxFileSizeMB": 5,
        "excludeDirs": "node_modules,.git,dist,target"
      }
    }
  }
}

Capabilities

CapabilityRequired ByPurpose
toolsAll toolsTool registration and execution
shell:runaudit_dependenciesRun package manager audit commands
fs:readaudit_dependencies, audit_secrets, audit_sast, audit_owaspRead project files for scanning
network:fetch(reserved)Fetch vulnerability database updates

OWASP Mapping

Each finding includes an OWASP Top 10 category reference for compliance tracking.

OWASP 2021

IDCategoryDetected By
A01:2021Broken Access ControlPath Traversal (SAST)
A02:2021Cryptographic FailuresHardcoded Crypto (SAST)
A03:2021InjectionSQL Injection, XSS, Command Injection (SAST)
A05:2021Security MisconfigurationHardcoded Secrets
A06:2021Vulnerable ComponentsDependency Audit
A08:2021Software Integrity FailuresInsecure Deserialization (SAST)
A10:2021SSRFSSRF Detection (SAST)

Severity Scoring

Each finding has a severity score used for risk assessment:

SeverityScoreDescription
Low1Informational, no immediate risk
Medium3Potential risk, should be addressed
High7Significant risk, prioritize remediation
Critical10Severe risk, immediate action required

Development

# Install dependencies
deno cache mod.ts

# Run tests
deno task test

# Format code
deno fmt

# Lint
deno lint

# Validate plugin
deno task validate

Publishing

  1. Update version in manifest.json
  2. Update CHANGELOG.md
  3. Commit and tag: git tag v1.0.0
  4. Push to GitHub: git push origin main --tags

Troubleshooting

No files scanned

Ensure target_path points to a valid directory and exclude_dirs isn't too aggressive. Try explicit file_patterns like *.ts,*.js.

Package manager not detected

Use --package_manager auto to auto-detect from lock files (package-lock.json, requirements.txt, Cargo.toml, go.mod), or specify explicitly.

Secret patterns not matching

The scanner uses regex-based detection. Custom patterns can be added in the SECRET_PATTERNS array in mod.ts.

License

MIT — See LICENSE file

Support

Published June 15, 2026 · Updated June 15, 2026