すべてのプロダクト
Search
ドキュメントセンター

Elastic Compute Service:RAM ユーザーへの Cloud Assistant 権限の付与

最終更新日:May 16, 2026

Alibaba Cloud アカウントの AccessKey ペアが漏洩しないように、カスタムポリシーまたはシステムポリシーを使用して、RAM ユーザーにきめ細かい Cloud Assistant へのアクセスを付与してください。

バックグラウンド

クラウドアシスタントは、カスタムポリシーと Alibaba Cloud システムポリシーをサポートしています。カスタムポリシーは、リージョン、ECS インスタンス、コマンド、マネージドインスタンスのアクティベーションコードなどのディメンションでアクセスをコントロールします。

手順

  1. Alibaba Cloud アカウントで RAM ユーザーを作成します。

    RAM ユーザーの作成」をご参照ください。

  2. Alibaba Cloud アカウントでカスタムポリシーを作成します。「カスタムポリシーの作成」をご参照ください。

    次の表に、一般的な Cloud Assistant 機能のカスタムポリシーのサンプルを示します。

    Cloud Assistant 機能

    カスタムポリシーのサンプル

    Cloud Assistant

    Cloud Assistant Agent

    Cloud Assistant コマンド

    ファイルの送信

    O&M タスク実行記録の配信

    マネージドインスタンス

    セッション管理

    セッション管理 (Session Manager):作成と照会

  3. Alibaba Cloud アカウントで RAM ユーザーに権限を付与します。

    RAM ユーザーの権限管理」をご参照ください。

    • カスタムポリシーを指定します。Grant permissions to RAM user - authorization

    • Alibaba Cloud が提供するシステムポリシーを指定します。

      • AliyunECSAssistantFullAccess: Cloud Assistant の完全な管理権限。

      • AliyunECSAssistantReadonlyAccess: Cloud Assistant の読み取り専用権限。

      ポリシーコンテンツなどのシステムポリシーの詳細は、RAM コンソールで確認できます。「ポリシー情報」をご参照ください。

  4. RAM ユーザーにコンソールアクセスが付与されていることを確認します。

    [コンソールアクセス] が有効になっていない場合、RAM ユーザーは API 操作の呼び出しによってのみ Cloud Assistant を使用できます。「RAM ユーザーの権限の表示」をご参照ください。Grant permissions to RAM user - enable console access

  5. RAM ユーザーとして Alibaba Cloud 管理コンソールにログオンします。

  6. RAM ユーザーとして ECS コンソールの Cloud Assistant ページにログオンして、Cloud Assistant を使用します。

Cloud Assistant 機能のカスタムポリシー例

Cloud Assistant の管理者権限 (読み取りおよび書き込み)

すべての Cloud Assistant API に対する完全なクエリおよび操作権限を付与します。

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:DescribeInstances",
                "ecs:DescribeTag*",
                "ecs:*Command",
                "ecs:DescribeCommand*",
                "ecs:DescribeInvocation*",
                "ecs:StopInvocation",
                "ecs:*CloudAssistant*",
                "ecs:SendFile",
                "ecs:DescribeSendFileResults",
                "ecs:*ManagedInstance",
                "ecs:DescribeManagedInstances",
                "ecs:*Activation",
                "ecs:DescribeActivations",
                "ecs:ListPluginStatus",
                "ecs:ModifyInvocationAttribute",
                "ecs:StartTerminalSession",
                "ecs:DescribeTerminalSessions",
                "ecs:RunCommand"
            ],
            "Resource": [
                "acs:ecs:*:*:instance/*",
                "acs:ecs:*:*:command/*",
                "acs:ecs:*:*:activation/*",
                "acs:ecs:*:*:invocation/*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "ram:CreateServiceLinkedRole"
            ],
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "ram:ServiceName": [
                        "archiving.ecs.aliyuncs.com"
                    ]
                }
            }
        },
        {
            "Effect": "Allow",
            "Action": [
                "ecs:ModifyCloudAssistantSettings",
                "ecs:DescribeCloudAssistantSettings"
            ],
            "Resource": [
                "acs:ecs:*:*:servicesettings/*"

            ]
        }
    ]
}

Cloud Assistant の読み取り専用権限

すべての Cloud Assistant API に対するクエリ専用の権限を付与します。

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:DescribeInstances",
                "ecs:DescribeTag*",
                "ecs:DescribeCommand*",
                "ecs:DescribeInvocation*",
                "ecs:DescribeCloudAssistant*",
                "ecs:DescribeSendFileResults",
                "ecs:DescribeManagedInstances",
                "ecs:DescribeActivations",
                "ecs:ListPluginStatus",
                "ecs:DescribeTerminalSessions"
            ],
            "Resource": [
                "acs:ecs:*:*:instance/*",
                "acs:ecs:*:*:command/*",
                "acs:ecs:*:*:activation/*",
                "acs:ecs:*:*:invocation/*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "ecs:DescribeCloudAssistantSettings"
            ],
            "Resource": [
                "acs:ecs:*:*:servicesettings/*"
            ]
        }
    ]
}

Cloud Assistant に対するリージョン制限の設定

Cloud Assistant の権限を特定のリージョンに制限します。この例では、アクセスを中国 (杭州) に制限します。

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:DescribeInstances",
                "ecs:DescribeTag*",
                "ecs:*Command",
                "ecs:DescribeCommand*",
                "ecs:DescribeInvocation*",
                "ecs:StopInvocation",
                "ecs:*CloudAssistant*",
                "ecs:SendFile",
                "ecs:DescribeSendFileResults",
                "ecs:*ManagedInstance",
                "ecs:DescribeManagedInstances",
                "ecs:*Activation",
                "ecs:DescribeActivations",
                "ecs:ListPluginStatus",
                "ecs:ModifyInvocationAttribute",
                "ecs:StartTerminalSession",
                "ecs:DescribeTerminalSessions",
                "ecs:RunCommand"
            ],
            "Resource": [
                "acs:ecs:cn-hangzhou:*:instance/*",
                "acs:ecs:cn-hangzhou:*:command/*",
                "acs:ecs:cn-hangzhou:*:activation/*",
                "acs:ecs:cn-hangzhou:*:invocation/*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "ram:CreateServiceLinkedRole"
            ],
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "ram:ServiceName": [
                        "archiving.ecs.aliyuncs.com"
                    ]
                }
            }
        },
        {
            "Effect": "Allow",
            "Action": [
                "ecs:ModifyCloudAssistantSettings",
                "ecs:DescribeCloudAssistantSettings"
            ],
            "Resource": [
                "acs:ecs:cn-hangzhou:*:servicesettings/*"
            ]
        }
    ]
}

Cloud Assistant エージェント

照会Cloud Assistant エージェントインストールステータス

API オペレーション: DescribeCloudAssistantStatus

  • すべての ECS インスタンスの Cloud Assistant エージェントのインストールステータスを照会します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeInstances",
                    "ecs:DescribeCloudAssistantStatus"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/*"
                ]
            }
        ]
    }
  • リソースでインスタンス ID を設定して、指定した ECS インスタンスに照会を制限します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeInstances",
                    "ecs:DescribeCloudAssistantStatus"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/i-instancexxx000a",
                    "acs:ecs:*:*:instance/i-instancexxx000b"
                ]
            }
        ]
    }

インストールCloud Assistant エージェント

API オペレーション: InstallCloudAssistant

  • 任意の ECS インスタンスに Cloud Assistant エージェントをインストールします。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:InstallCloudAssistant"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/*"
                ]
            }
        ]
    }
  • リソースでインスタンス ID を設定して、指定した ECS インスタンスにインストールを制限します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:InstallCloudAssistant"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/i-instancexxx00a",
                      "acs:ecs:*:*:instance/i-instancexxx00b"
                ]
            }
        ]
    }

コマンド向けカスタムポリシーのサンプル

Cloud Assistant コマンドの参照

API オペレーション: DescribeCommands

  • すべての Cloud Assistant コマンドを参照します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeCommands"
                ],
                "Resource": [
                    "acs:ecs:*:*:command/*"
                ]
            }
        ]
    }
  • リソースでコマンド ID を設定し、表示を指定のコマンドに制限します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeCommands"
                ],
                "Resource": [
                    "acs:ecs:*:*:command/c-commandxxx000a",
                    "acs:ecs:*:*:command/c-commandxxx000b"
                ]
            }
        ]
    }

Cloud Assistant コマンドの削除

API オペレーション: DeleteCommand

  • すべての Cloud Assistant コマンドを削除します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DeleteCommand"
                ],
                "Resource": [
                    "acs:ecs:*:*:command/*"
                ]
            }
        ]
    }
  • 指定されたコマンドへの削除を制限するには、リソースでコマンド ID を設定します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DeleteCommand"
                ],
                "Resource": [
                    "acs:ecs:*:*:command/c-commandxxx000a",
                    "acs:ecs:*:*:command/c-commandxxx000b"
                ]
            }
        ]
    }

Cloud Assistant コマンドの作成

API オペレーション: CreateCommand

Cloud Assistant コマンドを作成するために必要な最小権限です。

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:CreateCommand"
            ],
            "Resource": [
                "acs:ecs:*:*:command/*"
            ]
        }
    ]
}

Cloud Assistant コマンドの変更

API オペレーション: ModifyCommand

  • 任意の Cloud Assistant コマンドを変更します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:ModifyCommand"
                ],
                "Resource": [
                    "acs:ecs:*:*:command/*"
                ]
            }
        ]
    }
  • [リソース] にコマンド ID を設定し、指定されたコマンドへの変更を制限します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:ModifyCommand"
                ],
                "Resource": [
                    "acs:ecs:*:*:command/c-commandxxx000a",
                    "acs:ecs:*:*:command/c-commandxxx000b"
                ]
            }
        ]
    }

コマンドの実行

API オペレーション: InvokeCommand

  • 任意のインスタンスでコマンドを実行します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:InvokeCommand"
                ],
                "Resource": [
                    "acs:ecs:*:*:command/*",
                    "acs:ecs:*:*:instance/*"
                ]
            }
        ]
    }
  • [リソース]にインスタンス ID を設定して、コマンドの実行を指定の ECS インスタンスに限定します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:InvokeCommand"
                ],
                "Resource": [
                    "acs:ecs:*:*:command/*",
                    "acs:ecs:*:*:instance/i-instancexxx00a",
                    "acs:ecs:*:*:instance/i-instancexxx00b"
                ]
            }
        ]
    }
  • [リソース]にコマンド ID を設定することで、任意の ECS インスタンスでの実行を指定されたコマンドに制限できます。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:InvokeCommand"
                ],
                "Resource": [
                    "acs:ecs:*:*:command/c-commandxxx00a",
                    "acs:ecs:*:*:command/c-commandxxx00b",
                    "acs:ecs:*:*:instance/*"
                ]
            }
        ]
    }
  • [リソース] にコマンド ID とインスタンス ID の両方を設定することで、指定した ECS インスタンス上の指定したコマンドに実行を制限できます。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:InvokeCommand"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/i-instancexxx00a",
                    "acs:ecs:*:*:instance/i-instancexxx00b",
                    "acs:ecs:*:*:command/c-commandxxx00a",
                    "acs:ecs:*:*:command/c-commandxxx00b"
                ]
            }
        ]
    }
  • 実行可能なプラグインを制限します。この例では、プラグイン test-plugin に対応するパブリックコマンド ACS-ECS-ExecutePlugin-for-linux.sh のみを許可します。

    {
      "Version": "1",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": "ecs:InvokeCommand",
          "Resource": [
            "acs:ecs:*:*:command/ACS-ECS-ExecutePlugin-for-linux.sh",
            "acs:ecs:*:*:instance/*"
          ],
          "Condition": {
            "StringEqualsIgnoreCase": {
              "ecs:PluginName": [
                "test-plugin"
              ]
            }
          }
        }
      ]
    }
  • 条件にタグ条件を追加して、コマンドを実行できる ECS インスタンスを制限します。この例では、test:tony タグが付いたインスタンスでのみコマンドが許可されます。

    説明

    acs:ResourceTag 条件では、リソースにタグが付与されている必要があります。タグは ECS インスタンスにアタッチできますが、コマンドにはアタッチできません。

    {
      "Version": "1",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": "ecs:InvokeCommand",
          "Resource": [
            "acs:ecs:*:*:instance/*"
          ],
          "Condition": {
            "StringEquals": {
              "acs:ResourceTag/Owner": "zxy"
            }
          }
        },  
        {
          "Effect": "Allow",
          "Action": "ecs:InvokeCommand",
          "Resource": [
            "acs:ecs:*:*:command/*"
          ]
        }
      ]
    }

コマンドの即時実行

API オペレーション: RunCommand

説明

RunCommand を呼び出すときに KeepCommand を true に設定する場合は、Resource"acs::ecs:*:*:command/*" を追加します。

  • 任意のインスタンスでコマンドを即時実行します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:RunCommand"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/*"
                ]
            }
        ]
    }
  • [リソース] でインスタンス ID を設定すると、即時コマンドの実行が指定の ECS インスタンスに限定されます。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:RunCommand"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/i-instancexxx00a",
                    "acs:ecs:*:*:instance/i-instancexxx00b"
                ]
            }
        ]
    }
  • [条件] にタグ条件を追加して、コマンドをすぐに実行できる ECS インスタンスを制限します。この例では、test:tony タグを持つインスタンスのみが許可されます。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:RunCommand"
                ],
                "Resource": "acs:ecs:*:*:instance/*",
                "Condition": {
                    "StringEquals": {
                        "acs:ResourceTag/test": "tony"
                    }
                }
            }
        ]
    }

コマンド実行結果の照会

API オペレーション: DescribeInvocations

  • 任意のインスタンスでのコマンド実行結果を照会します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeInvocations"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/*",
                    "acs:ecs:*:*:command/*"
                ]
            }
        ]
    }
  • リソースにインスタンス ID を設定して、クエリを指定した ECS インスタンスに制限します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeInvocations"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/i-instancexxx00a",
                    "acs:ecs:*:*:instance/i-instancexxx00b",
                    "acs:ecs:*:*:command/*"
                ]
            }
        ]
    }
  • リソースにコマンド ID を設定すると、任意の ECS インスタンスで指定されたコマンドへのクエリを制限できます。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeInvocations"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/*",
                    "acs:ecs:*:*:command/c-commandxxx00a",
                    "acs:ecs:*:*:command/c-commandxxx00b"
                ]
            }
        ]
    }
  • 指定された ECS インスタンス上の指定されたコマンドへのクエリを制限するには、Resource にコマンド ID とインスタンス ID の両方を設定します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeInvocations"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/i-instancexxx00a",
                    "acs:ecs:*:*:instance/i-instancexxx00b",
                    "acs:ecs:*:*:command/c-commandxxx00a",
                    "acs:ecs:*:*:command/c-commandxxx00b"
                ]
            }
        ]
    }

定期タスク実行情報の変更

API オペレーション: ModifyInvocationAttribute

  • 任意の定期タスクの実行情報を変更し、任意のインスタンスを追加します。

    InvokeCommand または RunCommand を呼び出すときに、CommandContent を変更し、KeepCommandtrue に設定すると、長期保存 (LTR) 用の新しいコマンドが作成されます。ModifyInvocationAttribute を呼び出す前に、acs:ecs:*:*:command/* を Resource に追加します。

    {
      "Version": "1",
      "Statement": [
        {
          "Action": "ecs:ModifyInvocationAttribute",
          "Resource": [
            "acs:ecs:*:*:instance/*",
            "acs:ecs:*:*:invocation/*",
            "acs:ecs:*:*:command/*"
          ],
          "Effect": "Allow"
        }
      ]
    }
  • [Resource] にタスク ID を設定することで、任意のインスタンスの追加を許可しつつ、指定されたタスクへの変更を制限します。

    {
      "Version": "1",
      "Statement": [
        {
          "Action": "ecs:ModifyInvocationAttribute",
          "Resource": [
            "acs:ecs:*:*:instance/*",
            "acs:ecs:*:*:invocation/task-xxx"
          ],
          "Effect": "Allow"
        }
      ]
    }
  • Resource にインスタンス ID を設定して、任意の定期タスクの実行情報を変更できるようにしつつ、追加できるインスタンスを指定したインスタンスのみに制限します。

    {
      "Version": "1",
      "Statement": [
        {
          "Action": "ecs:ModifyInvocationAttribute",
          "Resource": [
            "acs:ecs:*:*:instance/i-instance-xxx",
            "acs:ecs:*:*:invocation/*"
          ],
          "Effect": "Allow"
        }
      ]
    }
  • Resource にインスタンス ID とタスク ID の両方を設定して、変更とインスタンスの追加を指定したタスクとインスタンスに制限します。

    {
      "Version": "1",
      "Statement": [
        {
          "Action": "ecs:ModifyInvocationAttribute",
          "Resource": [
            "acs:ecs:*:*:instance/i-instance-xxx",
            "acs:ecs:*:*:invocation/task-xxx"
          ],
          "Effect": "Allow"
        }
      ]
    }

タスクの実行の停止

API オペレーション: StopInvocation

  • 任意のインスタンスで実行中の Cloud Assistant コマンドプロセスを停止します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:StopInvocation"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/*"
                ]
            }
        ]
    }
  • [リソース] にインスタンス ID を設定することで、この操作を指定された ECS インスタンスに限定できます。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:StopInvocation"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/i-instancexxx00a",
                    "acs:ecs:*:*:instance/i-instancexxx00b"
                ]
            }
        ]
    }

コマンドでの OOS 標準パラメーターの使用

OOS 標準パラメーターを含むコマンドを実行します。

{
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:DescribeInstances",
                "ecs:CreateCommand",
                "ecs:DescribeCommands",
                "ecs:InvokeCommand",
                "ecs:RunCommand",
                "ecs:DescribeInvocations",
                "ecs:DescribeInvocationResults",
                "ecs:DescribeCloudAssistantStatus",
                "oos:GetParameters",
                "oos:GetParameter"
            ],
            "Resource": "*"
        }
    ],
    "Version": "1"
}

コマンドでの OOS 暗号化パラメーターの使用

OOS 暗号化パラメーターを含むコマンドを実行します。

{
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:DescribeInstances",
                "ecs:CreateCommand",
                "ecs:DescribeCommands",
                "ecs:InvokeCommand",
                "ecs:RunCommand",
                "ecs:DescribeInvocations",
                "ecs:DescribeInvocationResults",
                "ecs:DescribeCloudAssistantStatus",
                "oos:GetParameters",
                "oos:GetSecretParameters",
                "oos:GetParameter",
                "oos:GetSecretParameter",
                "kms:GetSecretValue"
            ],
            "Resource": "*"
        }
    ],
    "Version": "1"
}

ファイル送信のカスタム権限ポリシーのサンプル

ローカルファイルのアップロード

API オペレーション: SendFile

  • 任意の ECS インスタンスにローカルファイルをアップロードします。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:SendFile"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/*"
                ]
            }
        ]
    }
  • [リソース] でインスタンス ID を設定して、指定された ECS インスタンスへのアップロードを制限します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:SendFile"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/i-instancexxx00a",
                    "acs:ecs:*:*:instance/i-instancexxx00b"
                ]
            }
        ]
    }
  • [条件] にタグ条件を追加して、ファイルを受信できる ECS インスタンスを制限します。 この例では、test:tony タグを持つインスタンスへのアップロードのみが許可されます。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:SendFile"
                ],
                "Resource": "acs:ecs:*:*:instance/*",
                "Condition": {
                    "StringEquals": {
                        "acs:ResourceTag/test": "tony"
                    }
                }
            }
        ]
    }

ファイルアップロード結果のクエリ

API オペレーション: DescribeSendFileResults

  • 任意のインスタンスのファイルアップロード結果をクエリします。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeSendFileResults"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/*"
                ]
            }
        ]
    }
  • クエリを指定された ECS インスタンスに制限するには、[リソース]にインスタンス ID を設定します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeSendFileResults"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/i-instancexxx00a",
                    "acs:ecs:*:*:instance/i-instancexxx00b"
                ]
            }
        ]
    }

O&M タスク実行記録配信のカスタムポリシーのサンプル

O&M タスク実行記録配信の設定を照会および変更する権限

O&M タスク実行記録配信の設定を照会および変更します。

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:ModifyCloudAssistantSettings",
                "ecs:DescribeCloudAssistantSettings"
            ],
            "Resource": [
                "acs:ecs:*:*:servicesettings/cloudassistantdeliverysettings"
            ]
        }
    ]
}

O&M タスク実行記録配信の設定を照会する権限

O&M タスク実行記録配信の設定を照会します。

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:DescribeCloudAssistantSettings"
            ],
            "Resource": [
                "acs:ecs:*:*:servicesettings/cloudassistantdeliverysettings"
            ]
        }
    ]
}

O&M タスク実行記録配信のリージョン固有の権限

リージョンを指定して、配信設定へのアクセスを制限します。

  • 中国 (杭州) でのみ O&M タスク実行記録配信の設定を照会および変更します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:ModifyCloudAssistantSettings",
                    "ecs:DescribeCloudAssistantSettings"
                ],
                "Resource": [
                    "acs:ecs:cn-hangzhou:*:servicesettings/cloudassistantdeliverysettings"
                ]
            }
        ]
    }
  • 中国 (杭州) でのみ O&M タスク実行記録配信の設定を照会します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeCloudAssistantSettings"
                ],
                "Resource": [
                    "acs:ecs:cn-hangzhou:*:servicesettings/cloudassistantdeliverysettings"
                ]
            }
        ]
    }

セッション記録配信の設定を照会および変更する権限

セッション記録配信の設定を照会および変更します。

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:ModifyCloudAssistantSettings",
                "ecs:DescribeCloudAssistantSettings"
            ],
            "Resource": [
                "acs:ecs:*:*:servicesettings/sessionmanagerdeliverysettings"
            ]
        }
    ]
}

セッション記録配信の設定を照会する権限

セッション記録配信の設定を照会します。

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:DescribeCloudAssistantSettings"
            ],
            "Resource": [
                "acs:ecs:*:*:servicesettings/sessionmanagerdeliverysettings"
            ]
        }
    ]
}

セッション記録配信のリージョン固有の権限

リージョンを指定して、セッション記録配信へのアクセスを制限します。

  • 中国 (杭州) でのみセッション記録配信の設定を照会および変更します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:ModifyCloudAssistantSettings",
                    "ecs:DescribeCloudAssistantSettings"
                ],
                "Resource": [
                    "acs:ecs:cn-hangzhou:*:servicesettings/sessionmanagerdeliverysettings"
                ]
            }
        ]
    }
  • 中国 (杭州) でのみセッション記録配信の設定を照会します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeCloudAssistantSettings"
                ],
                "Resource": [
                    "acs:ecs:cn-hangzhou:*:servicesettings/sessionmanagerdeliverysettings"
                ]
            }
        ]
    }

OSS バケットの照会

O&M タスク実行記録またはセッション記録を OSS に配信するには、次の権限を付与してください。

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "oss:ListBuckets"
            ],
            "Resource": "*"
        }
    ]
}

記録が OSS に配信された後、記録を照会および分析するには、OSS のアクセス制御ルールを理解してください。OSS の RAM ポリシーの概要およびOSS の RAM ポリシーの一般的な例をご参照ください。

SLS プロジェクトと Logstore の照会

O&M タスク実行記録またはセッション記録を SLS に配信するには、次の権限を付与してください。

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "log:ListProject",
                "log:ListLogStores"
            ],
            "Resource": "*"
        }
    ]
}

記録が SLS に配信された後、記録を照会および分析するには、SLS のアクセス制御ルールを理解してください。SLS 認証ルールの概要をご参照ください。

マネージドインスタンス向けカスタムポリシーのサンプル

マネージドインスタンスの登録解除

API オペレーション: DeregisterManagedInstance

  • 任意のマネージドインスタンスを登録解除します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DeregisterManagedInstance"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/*"
                ]
            }
        ]
    }
  • Resource にインスタンス ID を設定して、登録解除を指定したマネージドインスタンスに限定します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DeregisterManagedInstance"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/i-instancexxx00a",
                      "acs:ecs:*:*:instance/i-instancexxx00b"
                ]
            }
        ]
    }

マネージドインスタンスの照会

API オペレーション: DescribeManagedInstances

  • 任意のマネージドインスタンスを照会します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeManagedInstances"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/*"
                ]
            }
        ]
    }
  • Resource にインスタンス ID を設定して、照会を指定したマネージドインスタンスに限定します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeManagedInstances"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/i-instancexxx00a",
                      "acs:ecs:*:*:instance/i-instancexxx00b"
                ]
            }
        ]
    }

マネージドインスタンスのアクティベーションコードの作成

API オペレーション: CreateActivation

Alibaba Cloud 以外のサーバーをマネージドインスタンスとして登録するためのアクティベーションコードを作成するために必要な最小権限です。

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:CreateActivation"
            ],
            "Resource": [
                "acs:ecs:*:*:activation/*"
            ]
        }
    ]
}

マネージドインスタンスのアクティベーションコードの無効化

API オペレーション: DisableActivation

  • マネージドインスタンスの任意のアクティベーションコードを無効化します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DisableActivation"
                ],
                "Resource": [
                    "acs:ecs:*:*:activation/*"
                ]
            }
        ]
    }
  • Resource にアクティベーションコード ID を設定して、この操作を指定したアクティベーションコードに限定します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DisableActivation"
                ],
                "Resource": [
                    "acs:ecs:*:*:activation/*****-*****A",
                      "acs:ecs:*:*:activation/*****-*****B"
                ]
            }
        ]
    }

マネージドインスタンスのアクティベーションコードの照会

API オペレーション: DescribeActivations

  • マネージドインスタンスのアクティベーションコードとその使用状況を照会します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeActivations"
                ],
                "Resource": [
                    "acs:ecs:*:*:activation/*"
                ]
            }
        ]
    }
  • Resource にアクティベーションコード ID を設定して、照会を指定したアクティベーションコードに限定します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DescribeActivations"
                ],
                "Resource": [
                    "acs:ecs:*:*:activation/*****-*****A",
                      "acs:ecs:*:*:activation/*****-*****B"
                ]
            }
        ]
    }

マネージドインスタンスのアクティベーションコードの削除

API オペレーション: DeleteActivation

  • マネージドインスタンスの任意の未使用アクティベーションコードを削除します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DeleteActivation"
                ],
                "Resource": [
                    "acs:ecs:*:*:activation/*"
                ]
            }
        ]
    }
  • Resource にアクティベーションコード ID を設定して、削除を指定した未使用のアクティベーションコードに限定します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:DeleteActivation"
                ],
                "Resource": [
                    "acs:ecs:*:*:activation/*****-*****A",
                      "acs:ecs:*:*:activation/*****-*****B"
                ]
            }
        ]
    }

Cloud Assistant Agent アップグレードのカスタムポリシーのサンプル

API オペレーション:ModifyCloudAssistantSettings および DescribeCloudAssistantSettings

Cloud Assistant Agent アップグレード設定を照会および変更する権限

Cloud Assistant Agent アップグレード設定を照会および変更します。

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:ModifyCloudAssistantSettings",
                "ecs:DescribeCloudAssistantSettings"
            ],
            "Resource": [
                "acs:ecs:*:*:servicesettings/AgentUpgradeConfig"
            ]
        }
    ]
}

Cloud Assistant Agent アップグレード設定の照会

Cloud Assistant Agent アップグレード設定を照会します。

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:DescribeCloudAssistantSettings"
            ],
            "Resource": [
                "acs:ecs:*:*:servicesettings/AgentUpgradeConfig"
            ]
        }
    ]
}

セッションマネージャーのカスタムポリシーのサンプル

API オペレーション:StartTerminalSession および DescribeTerminalSessions

セッションマネージャーのセッションを作成および照会する権限

  • 任意のインスタンスでセッションマネージャーのセッションを作成および照会します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:StartTerminalSession",
                    "ecs:DescribeTerminalSessions"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/*"
                ]
            }
        ]
    }
  • Resource でインスタンス ID を設定し、セッションマネージャーの操作を指定されたインスタンスに制限します。

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:StartTerminalSession",
                    "ecs:DescribeTerminalSessions"
                ],
                "Resource": [
                    "acs:ecs:*:*:instance/i-instancexxx00a",
                    "acs:ecs:*:*:instance/i-instancexxx00b"
                ]
            }
        ]
    }