# Insecure Default Initialization of Resource (CWE-1188) The product initializes a resource in an insecure way that is not in line with the intended privileges for the resource. **Stack:** Kubernetes - Prevalence: 高 频繁被利用 - Impact: 中 建议审查 - Prevention: 已记录 2 个修复示例 **OWASP:** Security Misconfiguration (A05:2021-Security Misconfiguration) - #5 ## Description When resources are initialized with insecure default settings, they may expose functionality or data that should be protected. Users may not realize they need to change default settings. ## Prevention 基于 2 条 Shoulder 检测规则的 Insecure Default Initialization 预防策略。 ### Kubernetes Deploy resources to an explicit namespace instead of 'default' for better isolation Add liveness and readiness probes to ensure Kubernetes can monitor container health ## Warning Signs - [LOW] Resource deployed to default namespace instead of explicit namespace - [LOW] resources deployed to the default namespace - [LOW] Container is missing liveness and/or readiness probes. - [LOW] containers missing liveness and/or readiness probes ## Consequences - 绕过保护机制 - 读取应用程序数据 - 获取权限 ## Mitigations - 为所有配置使用安全的默认值 - 记录配置项的安全影响 - 对不安全的选项要求显式启用 ## Detection - Total rules: 2 - Languages: yaml ## Rules by Language ### Yaml (2 rules) - **Using Default Namespace** [LOW]: Detects resources deployed to the default namespace. - Remediation: Use an explicit namespace instead of 'default' for better organization and isolation. - **Missing Health Probes** [LOW]: Detects containers missing liveness and/or readiness probes. - Remediation: Add liveness and readiness probes. ```yaml livenessProbe: httpGet: path: /healthz port: 8080 ``` Learn more: https://shoulder.dev/learn/kubernetes/cwe-1188/missing-health-probes