40 lines
1.3 KiB
YAML
40 lines
1.3 KiB
YAML
|
id: k8s-etcd-files-set
|
||
|
|
||
|
info:
|
||
|
name: Ensure etcd cert and key set
|
||
|
author: princechaddha
|
||
|
severity: medium
|
||
|
description: Checks if the etcd-certfile and etcd-keyfile arguments are properly set in the etcd server configuration, crucial for secure communication.
|
||
|
impact: |
|
||
|
If the etcd-certfile and etcd-keyfile arguments are not set, the etcd server might not encrypt its communications, potentially allowing unauthorized access to sensitive data.
|
||
|
remediation: |
|
||
|
Configure the etcd server to use etcd-certfile and etcd-keyfile arguments that point to valid certificate and key files respectively. This ensures that communications to and from the etcd server are properly encrypted.
|
||
|
reference:
|
||
|
- https://etcd.io/docs/v3.4.0/op-guide/security/
|
||
|
tags: cloud,devops,kubernetes,security,devsecops,etcd
|
||
|
|
||
|
self-contained: true
|
||
|
code:
|
||
|
- engine:
|
||
|
- sh
|
||
|
- bash
|
||
|
source: |
|
||
|
kubectl get pods -n kube-system -l component=etcd -o jsonpath="{.items[*].spec.containers[*].command}"
|
||
|
|
||
|
matchers-condition: and
|
||
|
matchers:
|
||
|
- type: word
|
||
|
words:
|
||
|
- 'etcd'
|
||
|
|
||
|
- type: word
|
||
|
words:
|
||
|
- "etcd-certfile"
|
||
|
- "etcd-keyfile"
|
||
|
negative: true
|
||
|
|
||
|
extractors:
|
||
|
- type: dsl
|
||
|
dsl:
|
||
|
- "etcd server configuration is missing the etcd-certfile or etcd-keyfile arguments."
|