grzmol/vibe-force/sf-org-security-audit
Claude Code and agent skill by grzmol/vibe-force
- community
Checking that the SKILL.md file is still in the repository.
Standing security audit of a Salesforce org and its source - who holds ModifyAllData, ViewAllData, AuthorApex and ViewEncryptedData, the object and field matrix behind every permission set, profile sprawl, Apex class and @AuraEnabled exposure, org-wide defaults and without-sharing code, guest user and Experience Cloud surface, Named and External Credentials, secrets in source and in git history, and the Setup-only checks (Health Check, session and password policy, login IP ranges, MFA, Setup Audit Trail) that no CLI command covers. Produces a severity-ranked findings report with evidence and a fix per item. Use when onboarding an org, preparing a security review or audit response, or periodically. Not for reviewing a diff - that is the sf-security-reviewer agent - and not for writing secure Apex, which is skill sf-security-model.
Install
npx vskill@latest install grzmol/vibe-force/sf-org-security-auditSKILL.md
The same SKILL.md was published earlier as grzmol/vibe-force/sf-org-security-audit.
Salesforce Org Security Audit
When to use
| Situation | Use this skill | |
|---|---|---|
| Auditing the standing security posture of an org | Yes | |
| Preparing for a customer or internal security review | Yes | |
| Onboarding an org you did not configure | Yes | |
| Reviewing the security of the diff you just wrote | Agent sf-security-reviewer | |
| Writing Apex that enforces CRUD, FLS and sharing | Skill sf-security-model | |
| Maintainability rather than exposure | Skill sf-technical-debt-audit | |
| Callout authentication design | Skill sf-integration-patterns | |
| Analyzer security rules on source | Skill sf-code-analyzer-quality |
This audit is read-only: queries, retrieves and greps. It never changes a permission, a setting or a record, and it is legitimate against production.
Scope and safety
| Rule | Why | |
|---|---|---|
Read-only commands only: sf data query, sf project retrieve preview, sf org list ..., vf-check static | An audit that mutates is an incident | |
Never VF_ALLOW_PROD=1 | That flag exists to let a mutating check through; nothing here needs it | |
| Retrieve into a scratch directory, never over the working tree | A retrieved profile overwriting source is a silent change | |
| Evidence or it did not happen | Every finding carries a query result, a file:line, or a named Setup page | |
| Handle findings like the vulnerability they describe | The report names exposures; treat it as confidential and never paste org ids, usernames or tokens into a public channel |
Production posture: vf-check prints a production banner for read-only checks rather than refusing them (scripts/checks/lib/org.mjs). Queries against a production alias are fine here. Running vf-check apex against production is not part of this audit.
Audit layers
| Layer | The question | How to measure | |
|---|---|---|---|
| Identity | Who can log in, from where, with what factor | Setup: session, password, login IP, MFA; sf org list users | |
| Grants | Who holds administrative permissions | PermissionSetAssignment SOQL, pattern 3 | |
| Access matrix | What each permission set opens up | ObjectPermissions and FieldPermissions SOQL, pattern 4 | |
| Record access | Org-wide defaults, sharing rules, without sharing code | Source <sharingModel> plus grep, pattern 7 | |
| Code exposure | @AuraEnabled, @RestResource, webService, Apex class access | Source inventory plus SetupEntityAccess, pattern 6 | |
| Public surface | Guest users, Sites, Experience Cloud | networks/ metadata plus guest profile, pattern 8 | |
| Integration | Named and External Credentials, Remote Site Settings, connected apps | Source inventory, pattern 9 | |
| Secrets | Literal credentials in source or history | Grep plus git history, pattern 9 | |
| Change control | Who changed security settings, and when | Setup Audit Trail, pattern 10 |
Core patterns
1. Fix the scope and the evidence trail
Record the org id, the edition, the alias, whether the source tree is the whole org, and the date. Every command below writes into $AUDIT, so the report can cite raw output rather than memory.
2. Retrieve the security-relevant metadata
Retrieving into --output-dir keeps the working tree untouched. The directory layout under it depends on the retrieve, so locate the retrieved types rather than assuming a path:
An ls against a guessed path that does not exist prints an error and counts as zero - on a security audit that reads as a clean result. Always count from find output.
Profiles retrieve as a sparse representation - a permission missing from a retrieved profile is not proof it is not granted, so confirm grants with the queries in patterns 3 and 4 rather than by reading profile XML.
3. Who holds the dangerous permissions
Repeat for PermissionsAuthorApex, PermissionsViewEncryptedData, PermissionsManageUsers and PermissionsCustomizeApplication [unverified: only PermissionsModifyAllData, PermissionsViewAllData, PermissionsViewAllRecords and PermissionsModifyAllRecords are confirmed field names in this repository - run sf sobject describe --sobject PermissionSet --target-org <alias> before relying on the rest]. Findings, in descending severity:
| Finding | Severity | |
|---|---|---|
An integration or service account holds ModifyAllData | high | |
A named person holds ModifyAllData outside the admin group | high | |
| An inactive user still holds an administrative permission | medium | |
ViewAllData granted for a reporting need a report type would satisfy | medium | |
AuthorApex outside the release process | medium |
A grant that appears through a profile's own permission set still counts as a grant, which is why profile sprawl (pattern 5) is a security topic and not only a tidiness one. [unverified: the IsOwnedByProfile field used below to separate profile-owned permission sets from standalone ones was not confirmed in this session - describe the object first, or drop the filter and group by Parent.Name.]
4. The access matrix per permission set
Audit the sensitive objects first: anything holding personal data, financial data, or credentials. PermissionsViewAllRecords and PermissionsModifyAllRecords bypass sharing for that object - each one needs a named reason, and an object-level bypass granted to a broad permission set is a high finding.
5. Profile sprawl
Posture, in order of preference: permission set groups for personas, permission sets for features, profiles reduced to login and default settings. A large profile count with few permission sets means access cannot be reviewed - the finding is "grants are not reviewable", and its severity depends on what those profiles open up (pattern 4), not on the count.
6. Code exposure surface
Every @AuraEnabled and @RestResource method is an API an authenticated user can call directly: the client never enforces anything. Check each one for user-mode data access and a sharing keyword (skill sf-security-model). A generic endpoint - "run this SOQL", "update this record with this map" - is a high finding regardless of who holds the class access.
7. Record access: org-wide defaults and elevation
An object whose sharing model is ReadWrite needs a reason; Private plus sharing rules is the defensible default for anything sensitive. Every without sharing class and every Apex managed sharing insert is an elevation path: it must be narrow, documented, and covered by a negative test (skill sf-security-model, references sharing-and-record-access.md).
8. Public surface
If the org has Sites or Experience Cloud, the guest user is an unauthenticated identity with real permissions. Audit it as its own user: what objects it reads, which Apex classes it can run, which Flows it can start, and whether any without sharing code runs on its behalf. Guest access to person data is a high finding on sight, and personal-information visibility settings on the User object are not enforced by user mode or stripInaccessible (skill sf-security-model, reference crud-fls-enforcement.md).
9. Integrations and secrets
A Remote Site Setting with no matching Named Credential usually means a callout is authenticating by hand, with the credential somewhere in source. A secret found in git history is still a secret: the finding is "rotate the credential", not "remove the line".
10. The Setup-only layer
No CLI command covers these; a person opens Setup and records the answer. They belong in the report with the same severity scale as everything else.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/sf-org-security-audit/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/grzmol/vibe-force/sf-org-security-audit)