mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-01-18 15:45:54 -08:00
Translated ['src/README.md', 'src/banners/hacktricks-training.md', 'src/
This commit is contained in:
@@ -2,76 +2,75 @@
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
## Basic Information
|
||||
## 基本情報
|
||||
|
||||
The **Relational Database Service (RDS)** offered by AWS is designed to streamline the deployment, operation, and scaling of a **relational database in the cloud**. This service offers the advantages of cost efficiency and scalability while automating labor-intensive tasks like hardware provisioning, database configuration, patching, and backups.
|
||||
AWSが提供する**リレーショナルデータベースサービス(RDS)**は、**クラウド内のリレーショナルデータベースの展開、運用、スケーリングを簡素化する**ことを目的としています。このサービスは、コスト効率とスケーラビリティの利点を提供し、ハードウェアのプロビジョニング、データベースの構成、パッチ適用、バックアップなどの労働集約的なタスクを自動化します。
|
||||
|
||||
AWS RDS supports various widely-used relational database engines including MySQL, PostgreSQL, MariaDB, Oracle Database, Microsoft SQL Server, and Amazon Aurora, with compatibility for both MySQL and PostgreSQL.
|
||||
AWS RDSは、MySQL、PostgreSQL、MariaDB、Oracle Database、Microsoft SQL Server、Amazon Auroraなど、広く使用されているさまざまなリレーショナルデータベースエンジンをサポートしており、MySQLとPostgreSQLの両方に互換性があります。
|
||||
|
||||
Key features of RDS include:
|
||||
RDSの主な機能は以下の通りです:
|
||||
|
||||
- **Management of database instances** is simplified.
|
||||
- Creation of **read replicas** to enhance read performance.
|
||||
- Configuration of **multi-Availability Zone (AZ) deployments** to ensure high availability and failover mechanisms.
|
||||
- **Integration** with other AWS services, such as:
|
||||
- AWS Identity and Access Management (**IAM**) for robust access control.
|
||||
- AWS **CloudWatch** for comprehensive monitoring and metrics.
|
||||
- AWS Key Management Service (**KMS**) for ensuring encryption at rest.
|
||||
- **データベースインスタンスの管理**が簡素化されています。
|
||||
- 読み取り性能を向上させるための**リードレプリカ**の作成。
|
||||
- 高可用性とフェイルオーバー機構を確保するための**マルチアベイラビリティゾーン(AZ)デプロイメント**の構成。
|
||||
- 他のAWSサービスとの**統合**、例えば:
|
||||
- AWSアイデンティティおよびアクセス管理(**IAM**)による堅牢なアクセス制御。
|
||||
- AWS **CloudWatch**による包括的な監視とメトリクス。
|
||||
- AWSキー管理サービス(**KMS**)による静止データの暗号化の確保。
|
||||
|
||||
## Credentials
|
||||
## 認証情報
|
||||
|
||||
When creating the DB cluster the master **username** can be configured (**`admin`** by default). To generate the password of this user you can:
|
||||
DBクラスターを作成する際、マスター**ユーザー名**は設定可能です(デフォルトは**`admin`**)。このユーザーのパスワードを生成するには、以下の方法があります:
|
||||
|
||||
- **Indicate** a **password** yourself
|
||||
- Tell RDS to **auto generate** it
|
||||
- Tell RDS to manage it in **AWS Secret Manager** encrypted with a KMS key
|
||||
- **自分で**パスワードを指定する
|
||||
- RDSに**自動生成**させる
|
||||
- RDSに**AWS Secret Manager**でKMSキーで暗号化して管理させる
|
||||
|
||||
<figure><img src="../../../images/image (144).png" alt=""><figcaption></figcaption></figure>
|
||||
|
||||
### Authentication
|
||||
### 認証
|
||||
|
||||
There are 3 types of authentication options, but using the **master password is always allowed**:
|
||||
認証オプションは3種類ありますが、**マスターパスワードの使用は常に許可されています**:
|
||||
|
||||
<figure><img src="../../../images/image (227).png" alt=""><figcaption></figcaption></figure>
|
||||
|
||||
### Public Access & VPC
|
||||
### 公開アクセスとVPC
|
||||
|
||||
By default **no public access is granted** to the databases, however it **could be granted**. Therefore, by default only machines from the same VPC will be able to access it if the selected **security group** (are stored in EC2 SG)allows it.
|
||||
デフォルトでは**データベースに対する公開アクセスは付与されていません**が、**付与される可能性があります**。したがって、デフォルトでは、選択した**セキュリティグループ**(EC2 SGに保存されている)が許可している場合にのみ、同じVPC内のマシンがアクセスできます。
|
||||
|
||||
Instead of exposing a DB instance, it’s possible to create a **RDS Proxy** which **improves** the **scalability** & **availability** of the DB cluster.
|
||||
DBインスタンスを公開する代わりに、**RDSプロキシ**を作成することが可能で、これによりDBクラスターの**スケーラビリティ**と**可用性**が向上します。
|
||||
|
||||
Moreover, the **database port can be modified** also.
|
||||
さらに、**データベースポートも変更可能**です。
|
||||
|
||||
### Encryption
|
||||
### 暗号化
|
||||
|
||||
**Encryption is enabled by default** using a AWS managed key (a CMK could be chosen instead).
|
||||
**暗号化はデフォルトで有効**になっており、AWS管理キーを使用します(代わりにCMKを選択することも可能です)。
|
||||
|
||||
By enabling your encryption, you are enabling **encryption at rest for your storage, snapshots, read replicas and your back-ups**. Keys to manage this encryption can be issued by using **KMS**.\
|
||||
It's not possible to add this level of encryption after your database has been created. **It has to be done during its creation**.
|
||||
暗号化を有効にすることで、**ストレージ、スナップショット、リードレプリカ、およびバックアップの静止データの暗号化が有効になります**。この暗号化を管理するためのキーは**KMS**を使用して発行できます。\
|
||||
データベースが作成された後にこのレベルの暗号化を追加することはできません。**作成時に行う必要があります**。
|
||||
|
||||
However, there is a **workaround allowing you to encrypt an unencrypted database as follows**. You can create a snapshot of your unencrypted database, create an encrypted copy of that snapshot, use that encrypted snapshot to create a new database, and then, finally, your database would then be encrypted.
|
||||
ただし、**暗号化されていないデータベースを暗号化するための回避策があります**。暗号化されていないデータベースのスナップショットを作成し、そのスナップショットの暗号化されたコピーを作成し、その暗号化されたスナップショットを使用して新しいデータベースを作成し、最後にデータベースが暗号化されます。
|
||||
|
||||
#### Transparent Data Encryption (TDE)
|
||||
#### 透過的データ暗号化(TDE)
|
||||
|
||||
Alongside the encryption capabilities inherent to RDS at the application level, RDS also supports **additional platform-level encryption mechanisms** to safeguard data at rest. This includes **Transparent Data Encryption (TDE)** for Oracle and SQL Server. However, it's crucial to note that while TDE enhances security by encrypting data at rest, it may also **affect database performance**. This performance impact is especially noticeable when used in conjunction with MySQL cryptographic functions or Microsoft Transact-SQL cryptographic functions.
|
||||
RDSに内在する暗号化機能に加えて、RDSは静止データを保護するための**追加のプラットフォームレベルの暗号化メカニズム**もサポートしています。これには、OracleおよびSQL Server用の**透過的データ暗号化(TDE)**が含まれます。ただし、TDEは静止データを暗号化することでセキュリティを強化しますが、**データベースのパフォーマンスに影響を与える可能性がある**ことに注意が必要です。このパフォーマンスへの影響は、MySQLの暗号化関数やMicrosoft Transact-SQLの暗号化関数と併用した場合に特に顕著です。
|
||||
|
||||
To utilize TDE, certain preliminary steps are required:
|
||||
TDEを利用するには、いくつかの前提条件が必要です:
|
||||
|
||||
1. **Option Group Association**:
|
||||
- The database must be associated with an option group. Option groups serve as containers for settings and features, facilitating database management, including security enhancements.
|
||||
- However, it's important to note that option groups are only available for specific database engines and versions.
|
||||
2. **Inclusion of TDE in Option Group**:
|
||||
- Once associated with an option group, the Oracle Transparent Data Encryption option needs to be included in that group.
|
||||
- It's essential to recognize that once the TDE option is added to an option group, it becomes a permanent fixture and cannot be removed.
|
||||
3. **TDE Encryption Modes**:
|
||||
- TDE offers two distinct encryption modes:
|
||||
- **TDE Tablespace Encryption**: This mode encrypts entire tables, providing a broader scope of data protection.
|
||||
- **TDE Column Encryption**: This mode focuses on encrypting specific, individual elements within the database, allowing for more granular control over what data is encrypted.
|
||||
1. **オプショングループの関連付け**:
|
||||
- データベースはオプショングループに関連付けられている必要があります。オプショングループは、設定や機能のコンテナとして機能し、セキュリティの強化を含むデータベース管理を容易にします。
|
||||
- ただし、オプショングループは特定のデータベースエンジンとバージョンにのみ利用可能であることに注意が必要です。
|
||||
2. **オプショングループへのTDEの含有**:
|
||||
- オプショングループに関連付けられた後、Oracleの透過的データ暗号化オプションをそのグループに含める必要があります。
|
||||
- TDEオプションがオプショングループに追加されると、それは永久的なものであり、削除することはできません。
|
||||
3. **TDE暗号化モード**:
|
||||
- TDEは2つの異なる暗号化モードを提供します:
|
||||
- **TDEテーブルスペース暗号化**:このモードは、全体のテーブルを暗号化し、より広範なデータ保護を提供します。
|
||||
- **TDEカラム暗号化**:このモードは、データベース内の特定の個別要素を暗号化することに焦点を当て、どのデータが暗号化されるかをより細かく制御できます。
|
||||
|
||||
Understanding these prerequisites and the operational intricacies of TDE is crucial for effectively implementing and managing encryption within RDS, ensuring both data security and compliance with necessary standards.
|
||||
|
||||
### Enumeration
|
||||
これらの前提条件とTDEの運用の複雑さを理解することは、RDS内での暗号化の効果的な実装と管理において重要であり、データのセキュリティと必要な基準への準拠を確保します。
|
||||
|
||||
### 列挙
|
||||
```bash
|
||||
# Clusters info
|
||||
## Get Endpoints, username, port, iam auth enabled, attached roles, SG
|
||||
@@ -106,41 +105,36 @@ aws rds describe-db-proxy-targets
|
||||
## reset credentials of MasterUsername
|
||||
aws rds modify-db-instance --db-instance-identifier <ID> --master-user-password <NewPassword> --apply-immediately
|
||||
```
|
||||
|
||||
### Unauthenticated Access
|
||||
### 認証されていないアクセス
|
||||
|
||||
{{#ref}}
|
||||
../aws-unauthenticated-enum-access/aws-rds-unauthenticated-enum.md
|
||||
{{#endref}}
|
||||
|
||||
### Privesc
|
||||
### 権限昇格
|
||||
|
||||
{{#ref}}
|
||||
../aws-privilege-escalation/aws-rds-privesc.md
|
||||
{{#endref}}
|
||||
|
||||
### Post Exploitation
|
||||
### ポストエクスプロイト
|
||||
|
||||
{{#ref}}
|
||||
../aws-post-exploitation/aws-rds-post-exploitation.md
|
||||
{{#endref}}
|
||||
|
||||
### Persistence
|
||||
### 永続性
|
||||
|
||||
{{#ref}}
|
||||
../aws-persistence/aws-rds-persistence.md
|
||||
{{#endref}}
|
||||
|
||||
### SQL Injection
|
||||
### SQLインジェクション
|
||||
|
||||
There are ways to access DynamoDB data with **SQL syntax**, therefore, typical **SQL injections are also possible**.
|
||||
DynamoDBデータに**SQL構文**でアクセスする方法があるため、典型的な**SQLインジェクションも可能です**。
|
||||
|
||||
{{#ref}}
|
||||
https://book.hacktricks.xyz/pentesting-web/sql-injection
|
||||
{{#endref}}
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user