Jira Automation 用に AWS IAM を設定

AWS Identity and Access Management (IAM) is the mechanism AWS provides for managing permissions and resource access. It's very powerful and can be used to create fine-grained policies for any AWS resource.

Atlassian Automation では、IAM ベースの統合を使用して SNS 以外のあらゆるリソースに接続します。

これを行うには、次の操作を行う必要があります。

  1. Atlassian Automation で使用する新しい AWS IAM ロールを作成します

  2. Grant the Atlassian Automation AWS account access to the role using a trust policy

  3. 必要なアクションを実行できるように、ロールに必要な権限をセットアップします

  4. IAM ロールに接続します

これによって、Atlassian Automation アカウントに対して、ロールとそのロールでアクセスできるリソースへのアクセス権が付与されます。ロールの権限がルールの実行に必要となる最小限のセットになるよう、適切に制限しましょう。

1. 新しい IAM ロールを作成します

Atlassian Automation では、atlassian-automation- で始まる名前をロールに付ける必要があります。そのため、Atlassian Automation 向けに設定されたロールがまだない場合は、新しいロールを作成する必要があります。

AWS アカウントをハイライト
  1. Sign into AWS Console.

  2. Choose Roles from the navigation menu.

  3. Choose Create role.

  4. Select Other AWS Account.

  5. Enter the Atlassian Automation AWS account ID: 815843069303.

  6. Select Require external ID and enter an ID to use

    • This is used to increase the security of your Connection, and is considered best practice.

    • この ID は、特定の ARN に対してサイト全体で一貫しているため、接続ごとに設定する必要はありません。

    • この ID は秘密ではありませんが、パスワード マネージャーなどを使用して生成することをお勧めします。

  7. Click Next

  8. If you know the permissions you need to apply you can do that now. Otherwise, click Next.

  9. Enter a Role name and Description. The role name must begin with atlassian-automation-.

  10. Review your configuration, and then select Create role.

チェックボックスと JSON リソースをハイライト

2. Atlassian Automation AWS アカウントにアクセス権を付与する信頼ポリシーを設定します

前のセクションのステップを実行しなかった場合 (たとえば、CloudFormation などでロールを作成する場合) は、Atlassian Automation AWS アカウントがそのロールを使用できるように許可されていることを確認する必要があります。これを行うには、AWS アカウント ID 815843069303sts:AssumeRole を付与する信頼ポリシーを指定します。

Atlassian Automation AWS アカウントにアクセス権を付与する信頼ポリシー

信頼ポリシーは次のようになります。

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "815843069303" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "sts:ExternalId": "<<your-external-id>>" } } } ] }

This policy can be read as “Allow the AWS Account with ID 815843069303 to AssumeRole into this role, but only if it supplies the ExternalId that matches <<your-external-id>>.

このポリシーの最も重要な部分は次のとおりです。

  • The Effect is Allow

  • The Principal is the Atlassian Automation AWS account ID 815843069303

  • The Action is sts:AssumeRole; and

  • The Condition specifies the sts:ExternalId parameter must equal some string you have chosen

3. ルールで使用するアクションに必要な権限を設定します

The resource permissions that your role will need will depend on what actions you are using in your automation rule. The general approach, though, will be to add permissions to the role in the form of an inline resource policy.

 アクションに必要な権限を設定

ここでは、簡単に設定できるインライン ポリシーをお勧めしますが、管理ポリシーをご希望の場合も、同じように簡単に使用できます。

It is important to define the minimum set of permissions that will allow your rules to execute.

SNS トピックにメッセージを送信するために必要な権限

管理ポリシー

Action: sns:Publish
Resource: SNS topic ARN

{ "Version": "2012-10-17", "Statement": [ { "Sid": "allowpublish", "Effect": "Allow", "Action": "sns:Publish", "Resource": "arn:aws:sns:us-west-1:111111111111:automation-rule-topic" } ] }

SSM ドキュメントを実行するために必要な権限

AWS リージョンを取得するには

{ "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": [ "ec2:DescribeRegions" ], "Resource": "*" } ] }

SSM ドキュメントを取得して実行するには

{ "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": [ "ssm:ListDocuments", "ssm:GetDocument", "ssm:StartAutomationExecution" ], "Resource": "*" } ] }

SSM ドキュメントで手順を実行するには

SSM ドキュメントの設定済み手順をすべて実行するための IAM ロール関連の権限を付与していることを確認してください。たとえば、SSM ドキュメントが AWS-RestartEC2Instance の場合、必要な権限は次のとおりです。

{ "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": [ "ec2:StartInstances", "ec2:StopInstances", "ec2:DescribeInstanceStatus" ], "Resource": "*" } ] }

4. IAM ロールに接続します

正しい権限でロールを設定したら、最後の手順として、自動化ルールでそのロールに接続します。

 

  1. Navigate to Automation and select Create rule.

  2. ルールのトリガーを選択します。

  3. AWS のアクションを選択します。

  4. Click Connect.

  5. When prompted, enter the ARN of the role you wish to use. If you are using an External ID you will also need to provide it. 

IAM ロールに接続します

6. Click Save.

AWS SSM を実行

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。