pasta-decompose
This skill should be used when the user asks to "decompose the application", "map trust boundaries", "identify components and roles", "catalog permissions", or is running PASTA stage 3. Also triggers when the user asks about role-based access control mapping, data classification, or service-to-service trust in a threat modeling context. Part of the PASTA threat modeling methodology (Stage 3 of 7).
What this skill does
# PASTA Stage 3: Application Decomposition Break the application into its constituent components and analyze trust boundaries, user roles, privilege levels, and data sensitivity at each layer. This produces the component map that Stages 4-7 use to identify where threats and attacks focus. ## Supported Flags Read `../../shared/schemas/flags.md` for the full flag specification. Key behaviors: | Flag | Stage 3 Behavior | |------|------------------| | `--scope` | Default `changed`. Scans middleware, auth modules, role definitions, permission configs, database schemas. | | `--depth quick` | Component inventory from project structure and imports only. | | `--depth standard` | Full decomposition + role-permission matrix + data classification. | | `--depth deep` | Standard + cross-component data flows, inter-service auth, shared resource access patterns. | | `--depth expert` | Deep + formal trust boundary analysis with privilege escalation path mapping. | | `--severity` | Not applicable at this stage. | ## Framework Context Read `../../shared/frameworks/pasta.md`, Stage 3 section. PASTA is SEQUENTIAL. Stage 3 consumes Stage 2 output and feeds Stage 4. ## Prerequisites **Required**: Stage 2 output -- entry point inventory, DFD, technology stack, and external dependencies. If unavailable, warn and proceed with assumptions. ## Workflow ### Step 1: Determine Scope Parse `--scope` flag (default: `changed`). Prioritize: middleware, auth modules, role/permission definitions, policy files (RBAC, ABAC, ACL), database schemas, service definitions, module boundaries. ### Step 2: Identify Components Decompose into functional units: authentication, authorization, core business logic, data access layer, API layer, background processing, admin/management, integration layer (third-party clients, webhooks), and infrastructure (logging, caching, sessions). ### Step 3: Map Roles and Permissions For each component: identify user roles (anonymous, authenticated, admin, service account), permission model (RBAC/ABAC/ACL), enforcement location (middleware, decorators, inline), default permissions, and permission gaps. ### Step 4: Map Trust Boundaries Identify where trust levels change: external-to-app, unauthenticated-to-authenticated, user-to-admin, service-to-service (mTLS, API keys, JWT), app-to-datastore, and app-to-third-party. ### Step 5: Classify Data For each data entity: **Public** (marketing, public APIs), **Internal** (analytics, internal docs), **Confidential** (PII, credentials, tokens), **Restricted** (payment data, health records, encryption keys). ### Step 6: Document Auth/Authz Flows Trace end-to-end: credential validation, session/token issuance, per-request permission checks, and bypass paths (debug endpoints, feature flags, test accounts). ## Analysis Checklist 1. What trust boundaries does data cross between components? 2. Which components run with elevated privileges? 3. How are service-to-service calls authenticated? 4. Where does data sensitivity change (encryption, masking, aggregation)? 5. Are there shared databases or caches across trust boundaries? 6. What is the default permission level for new users or services? 7. Are there components that lack authorization checks entirely? 8. Do admin interfaces share authentication with user-facing interfaces? ## Output Format Stage 3 produces a **Component Inventory with Trust Boundaries**. ID prefix: **PASTA** (e.g., `PASTA-S3-001`). ``` ## PASTA Stage 3: Application Decomposition ### Component Inventory | ID | Component | Function | Trust Level | Auth Mechanism | |----|-----------|----------|-------------|---------------| | C-01 | Auth Service | Login, registration, JWT | High | N/A (is the auth) | | C-02 | API Gateway | Request routing | Medium | JWT validation | | C-03 | Payment Module | Charge processing | High | JWT + role check | ### Role-Permission Matrix | Role | C-01 Auth | C-02 API | C-03 Payment | C-04 Admin | |------|----------|---------|-------------|-----------| | Anonymous | register, login | public endpoints | none | none | | User | profile, logout | CRUD own data | pay, history | none | | Admin | manage users | all endpoints | refunds | full access | ### Data Classification | Data Entity | Classification | Components | Encrypted Rest/Transit | |------------|---------------|------------|----------------------| | Credentials | Restricted | Auth Service | Hashed / TLS | | Payment tokens | Restricted | Payment | Yes / TLS | ### Trust Boundaries | Boundary | From | To | Mechanism | Validated | |----------|------|----|-----------|-----------| | TB-01 | Internet | API Gateway | HTTPS | TLS | | TB-02 | Gateway | Auth Service | Internal HTTP | JWT | ### Authorization Gaps [Components or endpoints without proper authorization enforcement] ``` Findings follow `../../shared/schemas/findings.md` with: - `metadata.tool`: `"pasta-decompose"`, `metadata.framework`: `"pasta"`, `metadata.category`: `"Stage-3"` ## Next Stage **Stage 4: Threat Analysis** (`pasta-threats`). Pass the Component Inventory, Role-Permission Matrix, Data Classification, and Trust Boundaries. Stage 4 cross-references with real-world threat intelligence to identify relevant threats.
Related in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.