pytm
Create threat models with Python and STRIDE analysis
Threat modeling is critical for secure system design but often gets skipped due to complexity. This skill provides programmatic threat modeling using Python and the pytm library. Define architecture as code, automatically generate data flow diagrams, and identify security threats across trust boundaries.
์คํฌ ZIP ๋ค์ด๋ก๋
Claude์์ ์ ๋ก๋
์ค์ โ ๊ธฐ๋ฅ โ ์คํฌ โ ์คํฌ ์ ๋ก๋๋ก ์ด๋
ํ ๊ธ์ ์ผ๊ณ ์ฌ์ฉ ์์
ํ ์คํธํด ๋ณด๊ธฐ
"pytm" ์ฌ์ฉ ์ค์ ๋๋ค. Create a pytm threat model for a three-tier web application with user, load balancer, web server, app server, and database
์์ ๊ฒฐ๊ณผ:
- Trust Boundaries defined: Internet, DMZ, Internal Network
- Components: Actor(User), Server(Load Balancer), Server(Web Server), Server(App Server), Datastore(Database)
- Identified STRIDE Threats:
- - Spoofing impersonation at: User authentication
- - Tampering: Unencrypted web-to-app HTTP flow
- - Information Disclosure: Database without encryption at rest
- - Denial of Service: Load balancer without rate limiting
- Data Flow Crossings: 4 trust boundary crossings require review
"pytm" ์ฌ์ฉ ์ค์ ๋๋ค. Generate a threat report for a microservices architecture with API gateway, auth service, and database
์์ ๊ฒฐ๊ณผ:
- Architecture Overview: Cloud Microservices with 3 Lambda functions, 2 data stores
- Trust Boundary: Cloud Provider VPC
- STRIDE Analysis Results:
- - Elevation of Privilege: API gateway without rate limiting
- - Information Disclosure: Cache without encryption in transit
- - Tampering: Auth function input validation missing
- Recommended Mitigations: Implement WAF rules, enable TLS for cache, add input sanitization
๋ณด์ ๊ฐ์ฌ
์์ Pure documentation skill containing only YAML frontmatter and markdown documentation teaching threat modeling concepts with the pytm library. No executable code, scripts, network calls, filesystem access, environment variable reads, or command execution capabilities are present. All static findings are false positives triggered by documentation patterns, not actual security risks.
์ํ ์์ธ
๐ ๋คํธ์ํฌ ์ ๊ทผ (11)
โ๏ธ ์ธ๋ถ ๋ช ๋ น์ด (55)
ํ์ง ์ ์
๋ง๋ค ์ ์๋ ๊ฒ
Architecture Security Review
Define system architecture in code and automatically identify security threats across trust boundaries before implementation
CI/CD Security Integration
Automate threat modeling in pull requests to catch security issues early in the development lifecycle
STRIDE Threat Enumeration
Generate comprehensive threat reports with categorized STRIDE threats and actionable mitigation strategies
์ด ํ๋กฌํํธ๋ฅผ ์ฌ์ฉํด ๋ณด์ธ์
Create a Python threat model using pytm for a web application with user authentication, a REST API backend, and a PostgreSQL database. Define trust boundaries for internet, DMZ, and internal network. Show how to generate the threat report.
Model a microservices architecture using pytm with Lambda functions for API gateway, auth service, and order service. Include Redis cache and DynamoDB. Generate a data flow diagram showing encrypted communication between services.
Show how to add custom threat definitions to a pytm threat model. Create a custom threat for API rate limiting bypass with specific conditions and mitigation guidance. Include it in the threat report output.
Create a GitHub Actions workflow that runs pytm threat modeling on every pull request. Include steps to install dependencies, generate the threat model, and upload the DFD as an artifact. Check for unmitigated threats and fail the build if high-severity threats lack mitigations.
๋ชจ๋ฒ ์ฌ๋ก
- Store threat models in version control alongside application code to track architecture changes
- Set accurate component security attributes (isEncrypted, implementsAuthentication) to reduce false positives
- Integrate threat model validation into CI/CD pipelines to catch security issues early
ํผํ๊ธฐ
- Hardcoding credentials or secrets in threat model Python files
- Skipping trust boundary definitions and modeling everything as a single zone
- Ignoring identified threats without documenting why they do not apply
์์ฃผ ๋ฌป๋ ์ง๋ฌธ
Does pytm require Python 3.7 or newer?
Can pytm generate diagrams without graphviz?
How does pytm integrate with CI/CD pipelines?
Is my threat model data safe to store in version control?
Why are expected threats not appearing in my report?
How does pytm compare to other threat modeling tools?
๊ฐ๋ฐ์ ์ธ๋ถ ์ ๋ณด
ํ์ผ ๊ตฌ์กฐ
๐ SKILL.md