# Improper Access Control (CWE-284) The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. **Stack:** Kubernetes - Prevalence: उच्च बार-बार शोषित - Impact: उच्च 3 उच्च गंभीरता वाले नियम - Prevention: प्रलेखित 4 फिक्स उदाहरण **OWASP:** Broken Access Control (A01:2021-Broken Access Control) - #1 ## Description Access control involves determining which subjects can access which objects. When access control is implemented incorrectly, it can lead to unauthorized access to sensitive data or functionality. ## Prevention 1 Shoulder डिटेक्शन नियमों पर आधारित Improper Access Control के लिए रोकथाम रणनीतियाँ। ### Kubernetes Define NetworkPolicy resources to restrict pod-to-pod traffic and enforce network segmentation ## Warning Signs - [MEDIUM] Workload has no NetworkPolicy for network segmentation - [MEDIUM] Kubernetes deployments without associated NetworkPolicy resources ## Consequences - एप्लिकेशन डेटा पढ़ना - एप्लिकेशन डेटा संशोधित करना - अनधिकृत कोड निष्पादित करना - विशेषाधिकार प्राप्त करना ## Mitigations - सभी संसाधनों पर उचित पहुँच नियंत्रण जाँच लागू करें - न्यूनतम विशेषाधिकार के सिद्धांत का उपयोग करें - केवल UI में नहीं, सर्वर-साइड पर पहुँच नियंत्रण लागू करें ## Detection - Total rules: 4 - Languages: go, javascript, typescript, kubernetes, yaml, python ## Rules by Language ### Kubernetes (1 rules) - **Missing Network Policy** [MEDIUM]: Detects Kubernetes deployments without associated NetworkPolicy resources. - Remediation: Define a NetworkPolicy to control pod network access. ```yaml kind: NetworkPolicy spec: podSelector: {} policyTypes: [Ingress] ``` Learn more: https://shoulder.dev/learn/kubernetes/cwe-284/missing-network-policy ### Yaml (1 rules) - **Missing Network Policy** [MEDIUM]: Detects Kubernetes deployments without associated NetworkPolicy resources. - Remediation: Define a NetworkPolicy to control pod network access. ```yaml kind: NetworkPolicy spec: podSelector: {} policyTypes: [Ingress] ``` Learn more: https://shoulder.dev/learn/kubernetes/cwe-284/missing-network-policy