# Protection Mechanism Failure (CWE-693) The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product. **Stack:** Docker - Prevalence: Alta Frequentemente explorada - Impact: Alto 1 regras de severidade alta - Prevention: Documentada 8 exemplos de correção **OWASP:** Security Misconfiguration (A05:2021-Security Misconfiguration) - #5 ## Description This weakness covers three distinct situations: Missing a protection mechanism, using a faulty protection mechanism, or incorrectly applying a protection mechanism. A missing protection mechanism occurs when the application does not defend against a specific attack. A faulty protection mechanism occurs when the application does defend against a specific attack, but the protection mechanism is not implemented correctly. ## Prevention Estratégias de prevenção para Protection Mechanism Failure baseadas em 1 regras de detecção do Shoulder. ### Docker Add a HEALTHCHECK instruction to enable container health monitoring ## Warning Signs - [LOW] Dockerfile has no HEALTHCHECK instruction for container health monitoring - [LOW] Dockerfiles missing HEALTHCHECK instructions for container monitoring ## Consequences - Burlar mecanismo de proteção - Executar código não autorizado - Obter privilégios ## Mitigations - Implemente múltiplas camadas de segurança (defesa em profundidade) - Use mecanismos de segurança padrão da indústria e testados em vez de implementações personalizadas - Garanta que os mecanismos de proteção não possam ser burlados ou desativados ## Detection - Total rules: 8 - Languages: dockerfile, go, javascript, typescript ## Rules by Language ### Dockerfile (1 rules) - **Missing Healthcheck Configuration** [LOW]: Detects Dockerfiles missing HEALTHCHECK instructions for container monitoring. - Remediation: Add a HEALTHCHECK instruction to monitor container health. ```dockerfile HEALTHCHECK --interval=30s --timeout=10s --retries=3 \ CMD curl -f http://localhost:8080/health || exit 1 ``` Learn more: https://shoulder.dev/learn/docker/cwe-693/missing-healthcheck