agentleFS
BappozBappoz/My-Claude-Skills/skills/engineering/security/SKILL.md

security

Skill1 starsChanged 5 months agoMITView on GitHub

Segurança de aplicações production-grade: OWASP Top 10, autenticação/autorização, gestão de segredos, threat modeling (STRIDE), validação de input e secure defaults. Use quando o usuário mencionar: "segurança", "vulnerabilidade", "OWASP", "autenticação", "autorização", "SQL injection", "XSS", "CSRF", "segredos", "threat model", "é seguro?", "hardening", "pentest". Não auxilia ataques maliciosos — foco em defesa e testes autorizados.

78 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use cost-reducer, trigger-dev and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • daianepepes-labSkill

    cost-reducer

    Analyze and reduce costs across cloud infrastructure, code, and services. Use when asked to cut costs, optimize spending, reduce bills, or improve cost efficiency.

    Also in 5 projects that use this

  • xfstudioSkill

    trigger-dev

    Trigger.dev expert for background jobs, AI workflows, and reliable async execution with excellent developer experience and TypeScript-first design. Use when: trigger.dev, trigger dev, background task, ai background job, long running task.

    Also in 4 projects that use this

  • ffsshhttiikkSkill

    scalability

    Core foundational concepts and principles for Scalability

    Also in 4 projects that use this

  • daianepepes-labSkill

    self-healing

    Detect, diagnose, and automatically fix recurring errors, memory issues, and system degradation. Use when a system has recurring failures, memory leaks, performance degradation, or needs automatic recovery mechanisms.

    Also in 5 projects that use this

  • xfstudioSkill

    customer-support

    Elite AI-powered customer support specialist mastering

    Also in 4 projects that use this

  • ffsshhttiikkSkill

    cicd

    Continuous integration and delivery pipelines

    Also in 4 projects that use this

  • +1 more from daianepepes-lab

The file

Files
SKILL.md

Security

Você atua como engenheiro de segurança de aplicações. Objetivo: construir com secure defaults e pensar como atacante para defender — nunca confiar em input, sempre minimizar privilégio, e falhar fechado.

Leis inegociáveis

  1. Nunca confie no input — todo dado externo (form, query, header, arquivo, API) é hostil até validado/sanitizado no servidor.
  2. Least privilege — cada componente/usuário tem o mínimo de acesso necessário. Credencial de DB da app não é admin.
  3. Fail closed — em erro/dúvida, negue. Um catch que libera acesso é uma brecha.
  4. Defesa em profundidade — não dependa de uma única camada; combine validação + authz + WAF + monitoração.
  5. Segredos fora do código — nunca hardcode/logue chaves; use gerenciador de segredos e rotação.

OWASP Top 10 — o que verificar

RiscoDefesa
Broken Access ControlAutorização no servidor por objeto (IDOR!); negar por padrão; testar acesso cruzado
Cryptographic FailuresTLS everywhere; hash de senha com bcrypt/argon2; não inventar cripto
Injection (SQL/NoSQL/cmd)Queries parametrizadas / ORM; nunca concatenar input em query/shell
Insecure DesignThreat modeling desde o design; abuse cases
Security MisconfigurationSecure defaults; remover debug/headers verbosos; CSP
Vulnerable ComponentsScan de dependências (SCA); atualizar; SBOM
Auth FailuresMFA; rate limit em login; sessão segura; senha forte
Integrity FailuresVerificar assinatura de updates/deserialização segura
Logging FailuresLogar eventos de segurança (sem PII/segredo); alertar
SSRFValidar/allowlist URLs de saída; bloquear metadata IP

Autenticação & autorização

  • AuthN (quem é você): senhas com argon2id/bcrypt; MFA; sessões com cookies HttpOnly, Secure, SameSite; tokens com expiração curta + refresh. Prefira provedores testados (OAuth/OIDC) a rolar o seu.
  • AuthZ (o que você pode): cheque permissão por recurso no servidor, sempre. O erro nº1 é IDOR — /orders/123 sem verificar se a ordem é do usuário. Nunca confie em esconder botão no front.
  • Não vaze — mensagens de erro de login iguais para "usuário não existe" e "senha errada".

Validação de input & output

  • Input: allowlist (o que é permitido) > denylist. Valide tipo, tamanho, formato no servidor.
  • Output: escape por contexto — HTML-encode contra XSS, parametrize contra SQLi, quote contra command injection.
  • Upload: valide tipo real (magic bytes), limite tamanho, sirva de domínio isolado, nunca execute.

Threat modeling — STRIDE

Para cada componente, pergunte:

LetraAmeaçaMitigação típica
SpoofingFingir ser outroAuthN forte, MFA
TamperingAlterar dadosIntegridade, assinatura, authz
RepudiationNegar açãoLogs/auditoria
Info disclosureVazar dadosCripto, least privilege
Denial of serviceDerrubarRate limit, timeouts, quotas
Elevation of privilegeGanhar acessoAuthz por recurso, sandbox

Recursos externos

RecursoO que pegar
OWASP Top 10Os 10 riscos e como mitigar.
OWASP Cheat Sheet SeriesGuias práticos por tema (authn, session, XSS, upload…).
OWASP ASVSChecklist de verificação por nível.
NIST SSDFPráticas de desenvolvimento seguro.
Have I Been Pwned — Pwned PasswordsBloquear senhas vazadas.
Google — BeyondCorp / Zero TrustModelo de confiança zero.

Do / Don't

DoDon't
Queries parametrizadasConcatenar input em SQL
Authz por recurso no servidorEsconder botão e confiar no front
Segredos em vault, rotacionadosChave no código/commit
Hash argon2/bcryptSenha em texto ou MD5/SHA1
Fail closedLiberar acesso no catch

Checklist

  • Input validado no servidor (allowlist); output escapado por contexto
  • Autorização por recurso testada contra IDOR/acesso cruzado
  • Senhas com argon2id/bcrypt; MFA; sessão/cookie seguros
  • Segredos fora do código, em vault, rotacionáveis
  • Dependências escaneadas (SCA) e atualizadas
  • Threat model STRIDE dos fluxos sensíveis
  • Eventos de segurança logados (sem PII/segredo) e alertados

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.