security-scan
Skill1 starsChanged 7 months agoMITView on GitHub
Run PMD with the Apex security ruleset against the project's Apex source. Surfaces SOQL injection vectors, missing CRUD/FLS checks, hardcoded credentials, sharing violations, and other Apex-specific security issues. CI mode emits SARIF for GitHub Code Scanning.
89 other projects use a version of this.
Adopted by
Most recently taken up by
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- bsene/skillstheir own version, first seen Nov 8, 2026
- TheurgicDuke771/DataQtheir own version, first seen Nov 8, 2026
- codewithmukesh/dotnet-claude-kittheir own version, first seen Nov 8, 2026
- NemesLaszlo/claude-code-harnesstheir own version, first seen Nov 8, 2026
- pfangueiro/claude-code-agentstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use django-security, deployment-patterns and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
mstuder-slalomSkilldjango-security
Django security best practices, authentication, authorization, CSRF protection, SQL injection prevention, XSS prevention, and secure deployment configurations.
Also in 5 projects that use this
royaluniondesign-sysSkilldeployment-patterns
Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications.
Also in 5 projects that use this
mstuder-slalomSkillspringboot-security
Spring Security best practices for authn/authz, validation, CSRF, secrets, headers, rate limiting, and dependency security in Java Spring Boot services.
Also in 4 projects that use this
DonTiziSkilldependency-check
Analyze project dependencies for outdated packages, security vulnerabilities, and licensing issues. Use for dependency audits and maintenance.
Also in 3 projects that use this
RojiosSkillsecurity-bounty-hunter
Hunt for exploitable, bounty-worthy security issues in repositories. Focuses on remotely reachable vulnerabilities that qualify for real reports instead of noisy local-only findings.
Also in 3 projects that use this
nek1987Skillpostgres-patterns
PostgreSQL patterns for reviewing migrations and writing efficient queries. Use when reviewing Alembic migrations, optimizing queries, or debugging database issues.
Also in 6 projects that use this
- +2 more from mstuder-slalom
Other versions89 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 89
- openai/codex-security★ 11ksame name
- openai/plugins★ 7.8ksame name
- zereight/gitlab-mcp★ 2.1ksame name
- heartleo/zlib★ 1.5ksame name
- codewithmukesh/dotnet-claude-kit★ 808same name
- bagofwords1/bagofwords★ 463same name
- loulanyue/awesome-claude-notes★ 272same name
- Resgrid/Core★ 238same name
- GoogleCloudPlatform/cloud-solutions★ 139same name
- Fmarzochi/EGC★ 61same name
79 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository53 other files it gives its agents.
- templates/CLAUDE.mdCLAUDE.md
- adrSkill
- agent-deploySkill
- agent-discoverSkill
- agent-eval-trendSkill
- agent-exchange-listSkill
- agent-specSkill
- agent-testSkill
- agent-vs-flow-vs-apexSkill
- before-vs-after-triggerSkill
- code-reviewSkill
- complexitySkill
- coverage-trendSkill
- dead-codeSkill
- dependency-graphSkill
- deploySkill
- destructive-changesSkill
- diff-deploySkill
- erdSkill
- field-impactSkill
- flaky-test-finderSkill
- flow-auditSkill
- flow-vs-apexSkill
- fls-auditSkill
- gateway-configSkill
- generate-docsSkill
- limit-usageSkill
- lwc-vs-reactSkill
- mcp-tool-vs-restSkill
- notifySkill
- onboardSkill
- org-diffSkill
- org-exploreSkill
- package-versionSkill
- pattern-packSkill
- perf-reviewSkill
- permset-auditSkill
- pr-prepareSkill
- queueable-vs-batchSkill
- quick-deploySkill
- react-initSkill
- release-notesSkill
- scratch-orgSkill
- sequence-diagramSkill
- sf-initSkill
- sharing-reviewSkill
- slack-agentSkill
- soql-analyzerSkill
- test-coverageSkill
- test-dataSkill
- test-planSkill
- trust-evalSkill
- trust-layer-auditSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 80 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 95
Default Markdown (one report per scan):
- Very specific: line 136
Honor
.pmd-suppressions.xml: if the user adds one — PMD reads it natively
“Common” is measured: kept by at least 6 in 10 of the 80 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are running a security scan of the Apex source. The scan uses PMD with its apex-security ruleset (built-in to PMD 7.x). PMD is downloaded on first use into the plugin data directory.
Read Project Config First
source "${CLAUDE_PLUGIN_ROOT}/hooks/lib/config.sh"
source "${CLAUDE_PLUGIN_ROOT}/hooks/lib/pmd.sh"
APEX_SRC="$(sf_config_get '.paths.apexSource' "$ENV")"Input
$ARGUMENTS:
- (empty) — scan the entire Apex source directory
<ClassName>— scan one class<path>— scan a specific path--ruleset <name>— additional rulesets beyondapex-security(e.g.,apex-bestpractices,apex-performance,apex-codestyle). Comma-separated. Default isapex-securityonly--baseline <path>— diff against a baseline scan; only report new findings (Phase 8 builds on this)--ci— machine output--format json|sarif(defaultsarifin CI mode)--out <path>— output file
Steps
1. Ensure PMD is installed
pmd_install || exit 2First call downloads PMD; subsequent calls reuse the cache.
2. Build the ruleset arg
PMD 7.x reference categories:
category/apex/security.xml— SOQL injection, CRUD/FLS, hardcoded URLs, weak randomness, etc.category/apex/bestpractices.xmlcategory/apex/performance.xmlcategory/apex/codestyle.xmlcategory/apex/design.xmlcategory/apex/errorprone.xmlcategory/apex/documentation.xml
Default: category/apex/security.xml only.
3. Run PMD
pmd_run check \
--dir "$APEX_SRC" \
--rulesets "category/apex/security.xml${EXTRA:+,$EXTRA}" \
--format json \
--report-file /tmp/security-scan.pmd.json \
--no-progressCapture exit code separately — PMD exits non-zero on findings, which is expected.
4. Convert PMD output to internal finding shape
Map each PMD violation to:
{
"ruleId": "SEC-${PMD_RULE_NAME}",
"severity": "error|warning|note", // map from PMD priority 1-2 → error, 3 → warning, 4-5 → note
"message": "<PMD description>",
"file": "<relative path>",
"line": <beginline>,
"endLine": <endline>,
"ruleHelpUri": "https://docs.pmd-code.org/.../<rule>.html",
"tool": "security-scan"
}Common rules in apex-security (mapped IDs):
| PMD rule | Mapped | Severity |
| ApexBadCrypto | SEC-BAD-CRYPTO | error |
| ApexCRUDViolation | SEC-CRUD-VIOLATION | error |
| ApexInsecureEndpoint | SEC-INSECURE-ENDPOINT | error |
| ApexOpenRedirect | SEC-OPEN-REDIRECT | error |
| ApexSharingViolations | SEC-SHARING-VIOLATION | error |
| ApexSOQLInjection | SEC-SOQL-INJECTION | error |
| ApexSuggestUsingNamedCred | SEC-USE-NAMED-CRED | warning |
| ApexXSSFromEscapeFalse | SEC-XSS-ESCAPE-FALSE | error |
| ApexXSSFromURLParam | SEC-XSS-URL-PARAM | error |
| ApexDangerousMethods | SEC-DANGEROUS-METHODS | error |
5. Output
Default Markdown (one report per scan):
# Security Scan: <project.name>
Scanned: 47 Apex files
PMD: 7.6.0 | Ruleset: apex-security
Run at: 2026-04-28T12:45:00Z
## Findings
### Critical (3)
- `SEC-SOQL-INJECTION` — force-app/.../OrderController.cls:42 — Dynamic SOQL with unescaped user input
- ...
### High (5)
- `SEC-CRUD-VIOLATION` — force-app/.../OrderService.cls:84 — Missing CRUD check before insert
- ...
### Medium (8)
- `SEC-USE-NAMED-CRED` — force-app/.../OldClient.cls:12 — Endpoint hardcoded; use Named Credential (SF-15)
- ...
## Pattern compliance reminders
- SF-15: HTTP callouts via Named Credential
- SF-11: Dynamic field-name whitelist before SOQL composition
- SF-17: Custom Metadata Type lookup; do not put credentials in Custom Settings
(See ${paths.patternsSalesforceDoc} for full pattern docs.)CI mode: pipe internal findings through sarif_emit "argo/security-scan" "$VERSION".
6. Exit codes
- 0 — no findings
- 1 — any error or warning findings
- 2 — PMD failed to run
Rules
- Don't auto-fix. This scan is a report; the user reads and fixes
- Don't run on test classes by default — they're allowed to violate sharing for setup. Skip
*<testSuffix>.cls - Honor
.pmd-suppressions.xmlif the user adds one — PMD reads it natively - Don't shadow @qa. This scan is narrower (Apex security only) than
/code-review; both should be run - Update PMD version pinning intentionally. New PMD versions add rules — never silently upgrade. Pin in
hooks/lib/pmd.shand bump in a chore commit
Consumers
/argo:code-reviewand@qarecommend running/security-scanfor any class touching DML, callouts, or dynamic SOQL- CI pipelines run
/security-scan --ci --format sarif --out scan.sarifand upload to GitHub Code Scanning @security-reviewer(Phase 5) reads scan results to focus its analysis
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

