github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/rules/kubernetes/policies/cisbenchmarks/etcd/peer_auto_tls.rego (about) 1 # METADATA 2 # title: "Ensure that the --peer-auto-tls argument is not set to true" 3 # description: "Do not use self-signed certificates for TLS." 4 # scope: package 5 # schemas: 6 # - input: schema["kubernetes"] 7 # related_resources: 8 # - https://www.cisecurity.org/benchmark/kubernetes 9 # custom: 10 # id: KCV0047 11 # avd_id: AVD-KCV-0047 12 # severity: LOW 13 # short_code: ensure-peer-auto-tls-argument-is-not-set-to-true 14 # recommended_action: "Edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml on the master node and either remove the --peer-auto-tls parameter or set it to false." 15 # input: 16 # selector: 17 # - type: kubernetes 18 package builtin.kubernetes.KCV0047 19 20 import data.lib.kubernetes 21 22 checkFlag[container] { 23 container := kubernetes.containers[_] 24 kubernetes.is_etcd(container) 25 kubernetes.command_has_flag(container.command, "--peer-auto-tls=true") 26 } 27 28 deny[res] { 29 output := checkFlag[_] 30 msg := "Ensure that the --peer-auto-tls argument is not set to true" 31 res := result.new(msg, output) 32 }