You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pentesting-cloud/kubernetes-security/abusing-roles-clusterroles-in-kubernetes/README.md
+62Lines changed: 62 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -430,6 +430,68 @@ While an attacker in possession of a token with read permissions requires the ex
430
430
431
431
The token is generated from a limited 27-character set (`bcdfghjklmnpqrstvwxz2456789`), rather than the full alphanumeric range. This limitation reduces the total possible combinations to 14,348,907 (27^5). Consequently, an attacker could feasibly execute a brute-force attack to deduce the token in a matter of hours, potentially leading to privilege escalation by accessing sensitive service accounts.
432
432
433
+
### EncrpytionConfiguration in clear text
434
+
435
+
It's possible to find clear text keys to encrypt data at rest in this type of object like:
436
+
437
+
```yaml
438
+
# From https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/
439
+
440
+
#
441
+
# CAUTION: this is an example configuration.
442
+
# Do not use this for your own cluster!
443
+
#
444
+
445
+
apiVersion: apiserver.config.k8s.io/v1
446
+
kind: EncryptionConfiguration
447
+
resources:
448
+
- resources:
449
+
- secrets
450
+
- configmaps
451
+
- pandas.awesome.bears.example # a custom resource API
452
+
providers:
453
+
# This configuration does not provide data confidentiality. The first
454
+
# configured provider is specifying the "identity" mechanism, which
455
+
# stores resources as plain text.
456
+
#
457
+
- identity: {} # plain text, in other words NO encryption
- identity: {} # do not encrypt Events even though *.* is specified below
478
+
- resources:
479
+
- '*.apps' # wildcard match requires Kubernetes 1.27 or later
480
+
providers:
481
+
- aescbc:
482
+
keys:
483
+
- name: key2
484
+
secret: c2VjcmV0IGlzIHNlY3VyZSwgb3IgaXMgaXQ/Cg==
485
+
- resources:
486
+
- '*.*' # wildcard match requires Kubernetes 1.27 or later
487
+
providers:
488
+
- aescbc:
489
+
keys:
490
+
- name: key3
491
+
secret: c2VjcmV0IGlzIHNlY3VyZSwgSSB0aGluaw==
492
+
```
493
+
494
+
433
495
### Certificate Signing Requests
434
496
435
497
If you have the verbs **`create`** in the resource `certificatesigningrequests` ( or at least in `certificatesigningrequests/nodeClient`). You can **create** a new CeSR of a **new node.**
Services like Apache NiFi, Kubeflow, Argo Workflows, Weave Scope, and the Kubernetes dashboard are often exposed either to the internet or within the kubernetes network. An attacker that manage to **find any platform used to manage kubernetes and access it** can abuse it to get access to the kubernetes API and perform actions like creating new pods, modifying existing ones, or even deleting them.
0 commit comments