# Az - Table Storage {{#include ../../../banners/hacktricks-training.md}} ## 基本情報 **Azure Table Storage** は、大量の構造化された非リレーショナルデータを保存するために設計された NoSQL キー-バリューストアです。高い可用性、低遅延、およびスケーラビリティを提供し、大規模なデータセットを効率的に処理します。データはテーブルに整理され、各エンティティはパーティションキーと行キーによって識別され、迅速な検索を可能にします。データは静止時の暗号化、ロールベースのアクセス制御、および安全で管理されたストレージのための共有アクセス署名などの機能をサポートしており、幅広いアプリケーションに適しています。 テーブルストレージには**組み込みのバックアップメカニズム**はありません。 ### キー #### **PartitionKey** - **PartitionKey はエンティティを論理パーティションにグループ化します**。同じ PartitionKey を持つエンティティは一緒に保存され、クエリパフォーマンスとスケーラビリティが向上します。 - 例: 従業員データを保存するテーブルでは、`PartitionKey` は部門を表すことがあります。例えば、`"HR"` または `"IT"`。 #### **RowKey** - **RowKey はパーティション内のエンティティの一意の識別子**です。PartitionKey と組み合わせることで、テーブル内の各エンティティがグローバルに一意の識別子を持つことを保証します。 - 例: `"HR"` パーティションの場合、`RowKey` は従業員 ID であることがあります。例えば、`"12345"`。 #### **その他のプロパティ (カスタムプロパティ)** - PartitionKey と RowKey に加えて、エンティティはデータを保存するための追加の**カスタムプロパティ**を持つことができます。これらはユーザー定義であり、従来のデータベースの列のように機能します。 - プロパティは**キー-バリューペア**として保存されます。 - 例: `Name`、`Age`、`Title` は従業員のカスタムプロパティである可能性があります。 ## 列挙 {{#tabs}} {{#tab name="az cli"}} ```bash # Get storage accounts az storage account list # List tables az storage table list --account-name # Read table az storage entity query \ --account-name \ --table-name \ --top 10 # Write table az storage entity insert \ --account-name \ --table-name \ --entity PartitionKey= RowKey= = # Write example az storage entity insert \ --account-name mystorageaccount \ --table-name mytable \ --entity PartitionKey=HR RowKey=12345 Name="John Doe" Age=30 Title="Manager" # Update row az storage entity merge \ --account-name mystorageaccount \ --table-name mytable \ --entity PartitionKey=pk1 RowKey=rk1 Age=31 ``` {{#endtab}} {{#tab name="PowerShell"}} ```powershell # Get storage accounts Get-AzStorageAccount # List tables Get-AzStorageTable -Context (Get-AzStorageAccount -Name -ResourceGroupName ).Context ``` {{#endtab}} {{#endtabs}} > [!NOTE] > デフォルトでは `az` cli はアカウントキーを使用してキーに署名し、アクションを実行します。Entra ID プリンシパルの権限を使用するには、パラメータ `--auth-mode login` を使用してください。 > [!TIP] > 使用するアカウントキーを示すには、パラメータ `--account-key` を使用します\ > SAS トークンを使用してアクセスするには、SAS トークンと共にパラメータ `--sas-token` を使用します ## Privilege Escalation ストレージの特権昇格と同様です: {{#ref}} ../az-privilege-escalation/az-storage-privesc.md {{#endref}} ## Post Exploitation {{#ref}} ../az-post-exploitation/az-table-storage-post-exploitation.md {{#endref}} ## Persistence ストレージの永続性と同様です: {{#ref}} ../az-persistence/az-storage-persistence.md {{#endref}} {{#include ../../../banners/hacktricks-training.md}}