Receber por email
← Voltar para o catálogo

security-sensitive-path-instrumenter

Instruments authentication, authorization, and input-handling code paths to monitor security-relevant events and states at runtime. Use this skill when developers need to add security monitoring and logging to their code, including tracking authentication attempts (login/logout), authorization decisions (access control checks), input validation failures, session management events, and other securi

105estrelas
Atualizado há 8 meses

Ver no GitHub ↗ Licença: Apache-2.0

Como adicionar

/plugin marketplace add ArabelaTso/Skills-4-SE

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/security-sensitive-path-instrumenter/svg)](https://www.skillteca.com.br/skills/security-sensitive-path-instrumenter)
#ai

Skills relacionadas

Ver todas de Desenvolvimento →

Alerta por categoria

Receba novas skills de Desenvolvimento toda segunda

1 email curto, só com as skills novas de Desenvolvimento. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

Security-Sensitive Path Instrumenter

Add structured logging instrumentation to security-critical code paths for runtime monitoring of authentication, authorization, input validation, session management, and other security-relevant events.

Workflow

  1. Identify security-sensitive code paths - Locate authentication, authorization, input validation, or session management code that needs instrumentation
  1. Determine event types - Classify the security events to monitor (see [security_events.md](references/security_events.md) for taxonomy)
  1. Review best practices - Check [best_practices.md](references/best_practices.md) for what to log and what to avoid (never log passwords, secrets, or sensitive PII)
  1. Select language patterns - Use [language_patterns.md](references/language_patterns.md) for language-specific instrumentation code (Python, JavaScript/TypeScript, Java)
  1. Add instrumentation - Insert structured logging calls at key decision points:
  2. Before and after authentication attempts
  3. At authorization check points
  4. When validation fails
  5. During session lifecycle events
  1. Include context - Log relevant data points:
  2. User identifier
  3. Timestamp (automatically added)
  4. IP address
  5. Resource accessed
  6. Success/failure status
  7. Failure reasons
  1. Verify instrumentation - Ensure:
  2. No sensitive data (passwords, tokens, secrets) is logged
  3. Structured format (JSON) is used for machine parsing
  4. Appropriate log levels are set
  5. Performance impact is minimal

Quick Reference

Event Categories

  • Authentication: Login attempts, logout, password changes, MFA, token validation
  • Authorization: Access control decisions, permission checks, RBAC evaluations
  • Input Validation: Validation failures, injection detection, format violations
  • Session Management: Session creation/expiration, IP changes, hijacking detection
  • Sensitive Data Access: PII access, financial data, encryption key usage
  • Configuration Changes: Permission changes, role assignments, security policy updates

Common Patterns

Authentication (Python/Flask):

log_security_event(
    event_type='authentication_attempt',
    username=username,
    ip_address=request.remote_addr
)

Authorization (JavaScript/Express):

logSecurityEvent('authorization_check', {
  user_id: user.id,
  resource: resourceId,
  permission: requiredPermission,
  decision: hasPermission ? 'granted' : 'denied'
});

Validation (Java/Spring):

Map<String, Object> data = new HashMap<>();
data.put("user_id", user.getId());
data.put("errors", validationErrors);
SecurityLogger.logSecurityEvent("validation_failure", data);

Helper Script

Use scripts/generate_instrumentation.py to generate code snippets:

# Generate Python authentication instrumentation
python scripts/generate_instrumentation.py python authentication

# Generate JavaScript authorization instrumentation
python scripts/generate_instrumentation.py javascript authorization

# Generate Java validation instrumentation
python scripts/generate_instrumentation.py java validation

Important Reminders

Never log:

  • Passwords (plaintext or hashed)
  • API keys or secrets
  • Full session tokens
  • Credit card numbers
  • Social Security numbers
  • Encryption keys

Always log:

  • Event type and timestamp
  • User identifier (when available)
  • Success/failure status
  • IP address (consider GDPR)
  • Resource accessed
  • Action performed

Use structured logging (JSON format) for machine parsing and analysis.

Compartilhar X LinkedIn