{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "SecurityIncidentResponseOrganizationsPolicy",
      "Effect": "Allow",
      "Action": [
        "organizations:ListAccounts",
        "organizations:ListChildren",
        "organizations:DescribeAccount",
        "organizations:ListDelegatedAdministrators"
      ],
      "Resource": "*"
    },
    {
      "Sid": "SecurityIncidentResponseCreateCasePolicyTagOnCreate",
      "Effect": "Allow",
      "Action": [
        "security-ir:TagResource",
        "security-ir:CreateCase"
      ],
      "Condition": {
        "ForAllValues:StringEquals": {
          "aws:TagKeys": [
            "SecurityIncidentResponseManaged"
          ]
        },
        "StringEquals": {
          "aws:RequestTag/SecurityIncidentResponseManaged": "true",
          "aws:ResourceTag/SecurityIncidentResponseManaged": "true"
        }
      },
      "Resource": "arn:aws:security-ir:*:*:case/*"
    },
    {
      "Sid": "SecurityIncidentResponseOperationsPolicy",
      "Effect": "Allow",
      "Action": [
        "security-ir:GetCase",
        "security-ir:UpdateCase",
        "security-ir:ListCases",
        "security-ir:CreateCaseComment",
        "security-ir:ListComments"
      ],
      "Resource": "arn:aws:security-ir:*:*:case/*",
      "Condition": {
        "StringEquals": {
          "aws:ResourceAccount": "${aws:PrincipalAccount}"
        }
      }
    }
  ]
}
