Skip to content

Commit 8b2c420

Browse files
committed
add
1 parent 032bf13 commit 8b2c420

3 files changed

Lines changed: 67 additions & 1 deletion

File tree

.github/workflows/build_master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
# Build the mdBook
3535
- name: Build mdBook
36-
run: MDBOOK_BOOK__LANGUAGE=en mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && echo "" && echo "" && echo "Debug logs" && (cat hacktricks-preprocessor.log | tail -n 20) && exit 1); ls -la; ls -la book
36+
run: MDBOOK_BOOK__LANGUAGE=en mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && echo "" && echo "" && echo "Debug logs" && (cat hacktricks-preprocessor.log | tail -n 20) && exit 1)
3737

3838
- name: Update searchindex.js in repo
3939
run: |

src/pentesting-cloud/kubernetes-security/abusing-roles-clusterroles-in-kubernetes/README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,68 @@ While an attacker in possession of a token with read permissions requires the ex
430430

431431
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.
432432

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
458+
- aesgcm:
459+
keys:
460+
- name: key1
461+
secret: c2VjcmV0IGlzIHNlY3VyZQ==
462+
- name: key2
463+
secret: dGhpcyBpcyBwYXNzd29yZA==
464+
- aescbc:
465+
keys:
466+
- name: key1
467+
secret: c2VjcmV0IGlzIHNlY3VyZQ==
468+
- name: key2
469+
secret: dGhpcyBpcyBwYXNzd29yZA==
470+
- secretbox:
471+
keys:
472+
- name: key1
473+
secret: YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY=
474+
- resources:
475+
- events
476+
providers:
477+
- 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+
433495
### Certificate Signing Requests
434496

435497
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.**

src/pentesting-cloud/kubernetes-security/kubernetes-network-attacks.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ Check more information about this attack in:
287287
abusing-roles-clusterroles-in-kubernetes/README.md
288288
{{/ref}}
289289

290+
## Abusing exposed kubernetes management services
291+
292+
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.
293+
290294
## Enumerating kubernetes network policies
291295

292296
Get configured **networkpolicies**:

0 commit comments

Comments
 (0)