Security assessor

From matteocervelli/llms · View interactive version

Security assessor is an AI agent skill from the GitHub repository matteocervelli/llms. Auto-activates during requirements analysis to assess security risks using OWASP Top 10 framework, identify security requirements, and recommend mitigation strategies.

How to use this skill

Skill file

Purpose

The security-assessor skill provides comprehensive security risk assessment capabilities for feature implementations. It evaluates potential security vulnerabilities using the OWASP Top 10 framework, identifies security requirements, and recommends appropriate mitigation strategies to ensure secure-by-design implementations.

When to Use

This skill auto-activates when you:

Provided Capabilities

1. OWASP Top 10 Risk Assessment

Evaluate each of the 10 critical security risks:

  1. Broken Access Control
  2. Cryptographic Failures
  3. Injection
  4. Insecure Design
  5. Security Misconfiguration
  6. Vulnerable and Outdated Components
  7. Identification and Authentication Failures
  8. Software and Data Integrity Failures
  9. Security Logging and Monitoring Failures
  10. Server-Side Request Forgery (SSRF)

2. Security Requirements Identification

3. Threat Modeling

4. Security Testing Strategy

Usage Guide

Step 1: Understand Feature Context

Read the requirements to understand:

Step 2: OWASP Top 10 Assessment

Use security-checklist.md to systematically evaluate each risk:

1. Broken Access Control

Check for:

Assessment Questions:

Risk Level: [None | Low | Medium | High | Critical]

Mitigation:

2. Cryptographic Failures

Check for:

Assessment Questions:

Risk Level: [None | Low | Medium | High | Critical]

Mitigation:

3. Injection

Check for:

Assessment Questions:

Risk Level: [None | Low | Medium | High | Critical]

Mitigation:

4. Insecure Design

Check for:

Assessment Questions:

Risk Level: [None | Low | Medium | High | Critical]

Mitigation:

5. Security Misconfiguration

Check for:

Assessment Questions:

Risk Level: [None | Low | Medium | High | Critical]

Mitigation:

6. Vulnerable and Outdated Components

Check for:

Assessment Questions:

Risk Level: [None | Low | Medium | High | Critical]

Mitigation:

7. Identification and Authentication Failures

Check for:

Assessment Questions:

Risk Level: [None | Low | Medium | High | Critical]

Mitigation:

8. Software and Data Integrity Failures

Check for:

Assessment Questions:

Risk Level: [None | Low | Medium | High | Critical]

Mitigation:

9. Security Logging and Monitoring Failures

Check for:

Assessment Questions:

Risk Level: [None | Low | Medium | High | Critical]

Mitigation:

10. Server-Side Request Forgery (SSRF)

Check for:

Assessment Questions:

Risk Level: [None | Low | Medium | High | Critical]

Mitigation:

Step 3: Identify Security Requirements

Based on OWASP assessment, document specific security requirements:

## Security Requirements

### Authentication
- **SR-AUTH-001**: Implement secure password storage (bcrypt, cost ≥12)
- **SR-AUTH-002**: Enforce password complexity (min 12 chars, mixed case, numbers, symbols)
- **SR-AUTH-003**: Implement account lockout after 5 failed attempts
- **SR-AUTH-004**: Session timeout after 30 minutes of inactivity

### Authorization
- **SR-AUTHZ-001**: Implement role-based access control (RBAC)
- **SR-AUTHZ-002**: Check permissions on every protected resource access
- **SR-AUTHZ-003**: Use indirect references to prevent ID enumeration

### Input Validation
- **SR-INPUT-001**: Validate all user input (whitelist approach)
- **SR-INPUT-002**: Sanitize input before database operations
- **SR-INPUT-003**: Limit input length to prevent DoS
- **SR-INPUT-004**: Validate file uploads (type, size, content)

### Data Protection
- **SR-DATA-001**: Encrypt sensitive data at rest (AES-256)
- **SR-DATA-002**: Use TLS 1.3+ for all data in transit
- **SR-DATA-003**: Never log sensitive data (passwords, tokens, PII)
- **SR-DATA-004**: Implement secure data deletion

### API Security
- **SR-API-001**: Implement rate limiting (100 requests/minute per user)
- **SR-API-002**: Use API keys with proper rotation
- **SR-API-003**: Validate content-type headers
- **SR-API-004**: Implement CORS properly

### Logging and Monitoring
- **SR-LOG-001**: Log all authentication attempts (success and failure)
- **SR-LOG-002**: Log all authorization failures
- **SR-LOG-003**: Implement anomaly detection
- **SR-LOG-004**: Alert on suspicious patterns

Step 4: Threat Modeling

Use threat-modeling-guide.md to systematically identify threats:

Assets
Threat Actors
Attack Vectors
STRIDE Analysis

Step 5: Security Testing Strategy

Define testing approach:

## Security Testing Strategy

### Static Analysis
- Run security linters (Bandit for Python, ESLint security plugins)
- Check for hardcoded secrets
- Analyze dependency vulnerabilities

### Dynamic Analysis
- Penetration testing for authentication/authorization
- Input fuzzing for injection vulnerabilities
- Session management testing
- API security testing

### Code Review Focus
- Input validation implementation
- Authentication/authorization logic
- Cryptographic operations
- Error handling
- Logging implementation

### Automated Scanning
- Dependency vulnerability scanning (daily)
- SAST tools in CI/CD
- Container image scanning

Best Practices

1. Security-by-Design

2. Input Validation

3. Output Encoding

4. Authentication Best Practices

5. Authorization Best Practices

6. Cryptography Best Practices

7. API Security

8. Error Handling

9. Logging

10. Dependencies

Resources

security-checklist.md

Comprehensive OWASP Top 10 checklist with:

threat-modeling-guide.md

Guide for conducting threat modeling:

Example Usage

Input (Feature Description)

Feature: User login with email and password
- Users enter email and password
- System authenticates and creates session
- Users can reset forgotten passwords

Output (Security Assessment)

## Security Assessment

### OWASP Top 10 Risks

1. **Broken Access Control**: LOW
   - Feature implements authentication (positive control)
   - Need to ensure session validation on all protected endpoints

2. **Cryptographic Failures**: MEDIUM
   - Passwords must be hashed with bcrypt (cost ≥12)
   - TLS required for credential transmission
   - Session tokens must be cryptographically secure

3. **Injection**: LOW
   - Email input must be validated
   - Use parameterized queries for database operations

7. **Identification and Authentication Failures**: HIGH
   - Primary authentication feature - critical risk
   - Requires strong password policy
   - Needs brute-force protection
   - Must implement secure password reset

9. **Security Logging and Monitoring Failures**: MEDIUM
   - Must log all authentication attempts
   - Alert on suspicious patterns (multiple failures)

### Security Requirements
- **SR-AUTH-001**: Hash passwords with bcrypt (cost ≥12)
- **SR-AUTH-002**: Enforce strong passwords (min 12 chars)
- **SR-AUTH-003**: Implement rate limiting (5 attempts per 15min)
- **SR-AUTH-004**: Session timeout after 30min inactivity
- **SR-INPUT-001**: Validate email format
- **SR-DATA-001**: Use TLS 1.3+ for credential transmission
- **SR-LOG-001**: Log all authentication attempts
- **SR-LOG-002**: Alert on 10+ failures from same IP

### Recommendations
1. Implement MFA as optional enhancement
2. Consider passwordless authentication for future
3. Implement CAPTCHA after 3 failed attempts
4. Use secure password reset tokens (expiring, one-time use)

Integration

This skill is used by:


Version: 2.0.0

Auto-Activation: Yes (when assessing security)

Phase: 1 (Requirements Analysis)

Created: 2025-10-29

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.