Scan your whole stack
Are you using sfsec?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.3.1
sfsec was last scanned on 29 Nov 2026 at version 0.3.1. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.3.1 LATEST | 29 Nov 2026 | No rules fired |
Findings for v0.3.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.3.1; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
sfsec is a read-only command-line scanner for Salesforce org security
configuration. It collects a snapshot from one org, then analyses that
snapshot offline. Rules do not receive an HTTP client and do not call the
network. The same snapshot and the same config produce the same JSON report,
except generated_at, which is the time the report was built. duration_ms
is always 0. The analysis clock defaults to meta.collected_at.
Two modules run unless you narrow them:
NOT_EVALUATED does not lower the
score. It lowers coverage. Coverage below 70% adds a warning.health=. It
does not change the security grade. A practices-only run leaves the
top-level JSON score null.The catalogue is 142 rules: 92 security and 50 practices. The generated list,
including each rule's datasets, risk, remediation, and reference URL, is
docs/RULES.md. That file is produced by
sfsec rules list --format md. Do not edit it by hand.
How the pieces fit together is docs/ARCHITECTURE.md. Choices that are not obvious from the code are docs/DECISIONS.md.
The tool does not phone home. After collection finishes, analysis and diff do not use the network.
Python 3.10 or newer. The console script is sfsec. python -m sfsec is
the same entry point.
pipx install .
For development:
python3.12 -m venv .venv
.venv/bin/pip install -e '.[dev]'
Runtime libraries are click, defusedxml, httpx, jinja2, pydantic
v2, pyyaml, and rich. CI tests 3.10, 3.11, 3.12, 3.13, and 3.14.
Authenticate with the Salesforce CLI, then pass that alias on every command.
sfsec does not change the CLI's default org.
sf org login web --alias my-org
sfsec doctor --target-org my-org
sfsec scan --target-org my-org --fail-on high
scan writes ./sfsec-report-<orgid>-<timestamp>/ with snapshot.json,
report.json, and report.html, and prints the console summary. It then
opens report.html in the local browser. --no-open skips that. --quiet
prints one summary line and still opens the page.
To analyse a snapshot you already have:
sfsec analyze snapshot.json --fail-on high
sfsec diff previous.json current.json
analyze with no --format writes report.json and report.html in the
working directory (or under --out) and opens the HTML file.
--format json writes only JSON and does not open a browser.
--debug and --quiet work on the top-level group and on scan,
analyze, collect, and doctor. sfsec scan --quiet and
sfsec --quiet scan both print one summary line. A usage error prints
Click's message and exits 2, with no traceback.
sfsec versionPrints sfsec and the package version from src/sfsec/version.py.
sfsec doctorChecks connectivity, negotiates the API version, reads org limits, and
describes each dataset. It does not query rows. For every dataset the user
cannot read, it prints the missing permission or feature and the commands
that deploy scanner-permset. Exit 2 on auth or config failure. A describe
that Salesforce refuses is reported in the text. It is not a finding.
sfsec collectWrites one snapshot and nothing else. The client cannot send a write.
sfsec collect --target-org my-org --out snapshot.json
Flags:
--target-org, --instance-url, --access-token-stdin, --api-version
(default 62.0), --allow-custom-host. See Authentication.--concurrency (default 4) and --max-records (default 50000). Both must
be at least 1.--force skips the preflight that remaining daily API requests are at
least 500. It does not raise the org's limit. If the limit is hit mid-run,
datasets that have not finished are error with reason api_limit.--no-source skips Apex, Visualforce, Aura, and LWC bodies.--redact-pii replaces usernames, emails, names, and IP addresses before
the snapshot is returned. See docs/PRIVACY.md.--deep runs capped aggregate queries for ownership skew and account data
skew. Those rules stay NOT_EVALUATED without it. The query cost is stored
on the snapshot.--strict exits 3 when any dataset status is error. The snapshot is
still written.--out is required and is a file path.The summary line is ok, unavailable, error, skipped, and api_calls.
sfsec scanCollects a snapshot and analyses it. --out is always a directory. When it
is omitted, the directory is ./sfsec-report-<orgid>-<timestamp>/, with the
org id and timestamp reduced to letters and digits. The default formats are
console,json,html, so the directory receives snapshot.json (unless
--no-save-snapshot), report.json, and report.html.
sfsec scan --target-org my-org --format json,html,sarif,csv,md --out ./sfsec-out
Flags shared with collect: auth, --api-version, --allow-custom-host,
--concurrency, --max-records, --force, --no-source, --redact-pii,
--deep, --strict. Additional flags:
--format is a comma-separated list of console, json, html, sarif,
csv, and md. Unknown names are an error. Duplicates are dropped.--open / --no-open (default open). When html is one of the formats,
the command opens report.html in the local browser after the file is
written. See the HTML section.--save-snapshot / --no-save-snapshot (default save).--config points at a YAML file. See Configuration.--fail-on is critical, high, medium, low, info, or none.
It applies to security findings only. The flag overrides the config. When
neither is set, the threshold is high. none does not fail the process
on findings.--fail-on-practices is the same scale for Platform Health findings.
Omitted means the process does not fail on practices findings.--modules is a comma-separated list of security and practices.
Omitted means both. --modules security,practices is both. At least one
name is required.--only and --skip take a rule id or a category, and can be repeated.--baseline is a previous report JSON file. --fail-on-new fails only
findings that are new versus that baseline, at the same threshold. It
requires --baseline. none does not fail on new findings either. A
baseline from another org, or from another major version of sfsec, still
produces the diff and adds a warning. The warning does not include the
org id.--overwrite is required when --out already exists and is not empty.
A symlink is refused.--quiet prints one line, for example
score=49 grade=F high=3 coverage=80% health=72. A practices-only run
starts with health= and has no score=.A file path passed to scan --out is an error. Report files are written
inside the directory as report.json, report.html, report.sarif,
report.csv, and report.md.
sfsec analyzeReads a snapshot and writes reports. No network calls.
sfsec analyze snapshot.json --format json,html,sarif,csv,md --out ./sfsec-out
The default format is console,json,html. --out may be a single file when
its suffix is the only file format (.json, .html, .htm, .sarif,
.csv, .md, .markdown). A mix of formats needs a directory. Without
--out, files are report.json and report.html in the working directory.
--overwrite is required for a non-empty directory. --max-snapshot-bytes
defaults to 64 MiB and refuses a larger snapshot. The other analysis flags
match scan: --config, --fail-on, --fail-on-practices, --modules,
--only, --skip, --baseline, --fail-on-new, and --open / --no-open.
--strict is not on analyze. A dataset that was already error in the
snapshot stays a coverage gap or an empty input. It does not by itself exit 3.
sfsec rulessfsec rules list
sfsec rules list --format md
sfsec rules list --format json --module practices --category "Apex Quality"
sfsec rules show PRIV-001
list prints a table, JSON, or the markdown catalogue. --module is
security or practices. --category matches the rule's category,
case-insensitive. show prints one rule's module, category, severity,
required datasets, description, risk, remediation, and reference URLs.
An unknown id exits 2.
sfsec diffCompares two report JSON files by fingerprint. The first argument is the baseline. The second is the current run.
sfsec diff previous.json current.json
sfsec diff previous.json current.json --format json
The console report is new, resolved, and unchanged. JSON is those same
three fields. This command does not write HTML and does not open a browser.
Suppressed findings are not part of the diff. The org and version warnings
described under --baseline are printed by scan and analyze, not by
diff.
There is no --access-token flag, so the token does not land in shell
history. --target-org and --instance-url together are a config error.
Resolution order:
--target-org runs sf org display --target-org <alias> --json.
sfdx force:org:display is used only when the sf binary is missing.
On Windows the sf.cmd shim is resolved with which.--instance-url plus SFSEC_ACCESS_TOKEN, or --access-token-stdin.A 401 retries once with a refreshed session when a target org can be
refreshed. The requested --api-version is then capped at the highest
version the org lists.
The instance URL must be https, without embedded credentials. The host must
match one of these suffixes, exactly or as a subdomain, unless
--allow-custom-host is set: salesforce.com, force.com,
salesforce-setup.com, sfcrmproducts.cn, salesforce.mil,
cloudforce.com, crmforce.mil. salesforce.com covers
my.salesforce.com, sandbox, scratch, and enhanced domains. Government
Cloud uses salesforce.mil and crmforce.mil.
TLS verification cannot be turned off. A corporate proxy is the standard
HTTPS_PROXY variable. Point SSL_CERT_FILE or REQUESTS_CA_BUNDLE at a
corporate CA bundle.
Each rule has a stable id, a category, a severity, the datasets it needs, a
description, a risk, a remediation that names a Setup path, and at least one
https reference. sfsec rules show <id> prints that record.
docs/RULES.md is the full catalogue.
Missing permissions, missing fields, unlicensed features, and API errors do
not crash a scan. Dataset statuses are ok, unavailable, error, or
skipped. A rule whose dataset is missing becomes NOT_EVALUATED with the
dataset reason and, when it is known, the permission name. One rule that
raises becomes ERROR. The other rules still run.
The security module is the score you gate CI on.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.