b2c-security
БесплатноБез исполняемых скриптовНе проверенFind and fix security problems in B2C Commerce code and site data with the b2c CLI. Covers cartridge JavaScript (SFRA, SiteGenesis, custom cartridges) and…
от SalesforceCommerceCloud★ 58 звёзд на GitHubОб этом скилле
B2C Security Skill
Use b2c security scan (preview) to find security problems in B2C Commerce cartridge code, then triage and fix them. The scan runs locally on the working tree, needs no instance or credentials, and takes well under a second for a typical storefront.
Tip: If
b2cis not installed globally, usenpx @salesforce/b2c-cliinstead.
MCP parity: If the
b2c-dx-mcpserver is connected,security_scancoversb2c security scanwith the same rules, suppressions, and baseline. Route findings depend on cartridge order: checkcartridgePathSourceand passsiteIdto use a site's path from the instance.
Scan
# Scan all cartridges under the current directory (folders with a .project file)
b2c security scan
# Scan one cartridge or file
b2c security scan cartridges/app_custom
# Structured output for analysis (prefer this when you will read the results)
b2c security scan --json
# List the rules and what they find
b2c security rules
Findings in SFRA and SiteGenesis base cartridges (app_storefront_base, modules, app_storefront_controllers, ...) are reported with referenceCartridge set. They are real for any storefront that deploys those cartridges; fix them from the project's own cartridge (for example server.prepend()), not by editing the base. --exclude-reference-cartridges leaves them out.
Site data in the project (such as a site_template folder) is checked too: services.xml, preferences.xml, attribute definitions, csrf-whitelists.xml, and OCAPI settings JSON. Server-side .js and .ds files are scanned; cartridge/client/, cartridge/static/, node_modules/, and minified files are skipped. Legacy .ds files with type annotations can't be parsed yet and are reported under errors.
Triage findings
Each finding in --json output has ruleId, severity, confidence, message, location (file, startLine, startColumn), snippet, remediation, and docsUrl.
- Read the code around each finding before changing it. Rules decide from one file at a time.
- Treat
confidence: highfindings as real unless the code proves otherwise. - For
mediumandlowconfidence, check what the rule could not see: whether a redirect target is validated in a helper, whether a "secret" is a test value, whether a query value is constant. - Explain each finding to the user in terms of impact (what an attacker could do) and the fix.
Rule references, with examples and fixes: b2c docs search "security rules" or the docsUrl on each finding.
Fix patterns
| Rule | Fix |
|---|---|
object-query-injection |
Use {0} placeholders and pass values as arguments: queryCustomObject(type, 'custom.email = {0}', email) |
file-path-from-request |
Return a directory from the processMultipart() callback (the platform names the file), or generate the name (UUID) with an allowlisted extension; return null for unexpected fields |
open-redirect |
Redirect to URLUtils URLs, or check the target against an allowlist before res.redirect() |
hardcoded-credentials |
Move the value to a service credential (read via LocalServiceRegistry) or a password site preference; rotate it |
weak-crypto |
Cipher with AES/GCM/NoPadding; MessageDigest/Mac with SHA-256 or stronger; avoid the Weak* classes |
insecure-cookie |
cookie.setSecure(true) and cookie.setHttpOnly(true) before response.addHttpCookie(cookie) |
ocapi-demo-client-id |
Replace the demo client ID aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa with a dedicated Account Manager client; remove it from OCAPI settings on every instance |
ocapi-broad-access |
Grant specific resources and methods; allow only your own HTTPS origins |
Установить b2c-security в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл b2c-security?
Find and fix security problems in B2C Commerce code and site data with the b2c CLI. Covers cartridge JavaScript (SFRA, SiteGenesis, custom cartridges) and site import/export data (OCAPI settings, services.xml, preferences). Use when the user asks to check code or a site_template for security issues, asks whether a specific snippet is safe (a query or redirect built from request input, credentials in code, crypto choices), audits a storefront before launch, reviews OCAPI settings or service credentials before an import, sets up security scanning in CI, or fixes findings such as open redirects, object query injection, CSRF gaps, weak crypto, hardcoded credentials, insecure cookies, mass assignment, or the OCAPI demo client ID.
Как установить скилл b2c-security?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл b2c-security запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic