title: putClassificationExportConfiguration error with Amazon Macie creating a bucket for discoveries retention
body: <p>We just started using Amazon Macie and we're having an issue when creating the bucket to keep findings for longer than 90 days.</p>
  <p>The error we get is:</p>
  <pre><code>putClassificationExportConfiguration: The operation can't be performed because you're not authorized to access the S3 bucket, the KMS key, or both.
  </code></pre>
  <p>We're using AWS SSO for connecting to the console and my user has Administrator rights, effectively * in resources and * in actions when I look at my IAM policy configuration.</p>
  <p>The S3 bucket policy is:</p>
  <pre><code>    {
    &quot;Version&quot;: &quot;2012-10-17&quot;,
    &quot;Statement&quot;: [
      {
        &quot;Sid&quot;: &quot;Deny non-HTTPS access&quot;,
        &quot;Effect&quot;: &quot;Deny&quot;,
        &quot;Principal&quot;: &quot;*&quot;,
        &quot;Action&quot;: &quot;s3:*&quot;,
        &quot;Resource&quot;: &quot;arn:aws:s3:::macie-investigations/*&quot;,
        &quot;Condition&quot;: {
          &quot;Bool&quot;: {
            &quot;aws:SecureTransport&quot;: &quot;false&quot;
          }
        }
      },
      {
        &quot;Sid&quot;: &quot;Deny incorrect encryption header. This is optional&quot;,
        &quot;Effect&quot;: &quot;Deny&quot;,
        &quot;Principal&quot;: {
          &quot;Service&quot;: &quot;macie.amazonaws.com&quot;
        },
        &quot;Action&quot;: &quot;s3:PutObject&quot;,
        &quot;Resource&quot;: &quot;arn:aws:s3:::macie-investigations/*&quot;,
        &quot;Condition&quot;: {
          &quot;StringNotEquals&quot;: {
            &quot;s3:x-amz-server-side-encryption-aws-kms-key-id&quot;: &quot;arn:aws:kms:eu-west-1:accountid:key/keynumber&quot;
          }
        }
      },
      {
        &quot;Sid&quot;: &quot;Deny unencrypted object uploads. This is optional&quot;,
        &quot;Effect&quot;: &quot;Deny&quot;,
        &quot;Principal&quot;: {
          &quot;Service&quot;: &quot;macie.amazonaws.com&quot;
        },
        &quot;Action&quot;: &quot;s3:PutObject&quot;,
        &quot;Resource&quot;: &quot;arn:aws:s3:::macie-investigations/*&quot;,
        &quot;Condition&quot;: {
          &quot;StringNotEquals&quot;: {
            &quot;s3:x-amz-server-side-encryption&quot;: &quot;aws:kms&quot;
          }
        }
      },
      {
        &quot;Sid&quot;: &quot;Allow Macie to upload objects to the bucket&quot;,
        &quot;Effect&quot;: &quot;Allow&quot;,
        &quot;Principal&quot;: {
          &quot;Service&quot;: &quot;macie.amazonaws.com&quot;
        },
        &quot;Action&quot;: &quot;s3:PutObject&quot;,
        &quot;Resource&quot;: &quot;arn:aws:s3:::macie-investigations/*&quot;
      },
      {
        &quot;Sid&quot;: &quot;Allow Macie to use the getBucketLocation operation&quot;,
        &quot;Effect&quot;: &quot;Allow&quot;,
        &quot;Principal&quot;: {
          &quot;Service&quot;: &quot;macie.amazonaws.com&quot;
        },
        &quot;Action&quot;: &quot;s3:GetBucketLocation&quot;,
        &quot;Resource&quot;: &quot;arn:aws:s3:::macie-investigations&quot;
      }
    ]
  }
  </code></pre>
  <p>And this is the policy for the symmetric key we've created:</p>
  <pre><code>    {
    &quot;Sid&quot;: &quot;Allow Macie to use the key&quot;,
    &quot;Effect&quot;: &quot;Allow&quot;,
    &quot;Principal&quot;: {
      &quot;Service&quot;: &quot;macie.amazonaws.com&quot;
    },
    &quot;Action&quot;: [
      &quot;kms:GenerateDataKey&quot;,
      &quot;kms:Encrypt&quot;
    ],
    &quot;Resource&quot;: &quot;*&quot;
  }
  </code></pre>
  <p>The kms key have allowed my role and macie's role as admin configuration as well as usage configuration as seen here:</p>
  <pre><code>{
      &quot;Id&quot;: &quot;key-consolepolicy-3&quot;,
      &quot;Version&quot;: &quot;2012-10-17&quot;,
      &quot;Statement&quot;: [
          {
              &quot;Sid&quot;: &quot;Enable IAM User Permissions&quot;,
              &quot;Effect&quot;: &quot;Allow&quot;,
              &quot;Principal&quot;: {
                  &quot;AWS&quot;: &quot;arn:aws:iam::accountid:root&quot;
              },
              &quot;Action&quot;: &quot;kms:*&quot;,
              &quot;Resource&quot;: &quot;*&quot;
          },
          {
              &quot;Sid&quot;: &quot;Allow access for Key Administrators&quot;,
              &quot;Effect&quot;: &quot;Allow&quot;,
              &quot;Principal&quot;: {
                  &quot;AWS&quot;: [
                      &quot;arn:aws:iam::accountid:role/aws-reserved/sso.amazonaws.com/eu-west-1/AWSReservedSSO_admin&quot;,
                      &quot;arn:aws:iam::accountid:user/username&quot;
                  ]
              },
              &quot;Action&quot;: [
                  &quot;kms:Create*&quot;,
                  &quot;kms:Describe*&quot;,
                  &quot;kms:Enable*&quot;,
                  &quot;kms:List*&quot;,
                  &quot;kms:Put*&quot;,
                  &quot;kms:Update*&quot;,
                  &quot;kms:Revoke*&quot;,
                  &quot;kms:Disable*&quot;,
                  &quot;kms:Get*&quot;,
                  &quot;kms:Delete*&quot;,
                  &quot;kms:TagResource&quot;,
                  &quot;kms:UntagResource&quot;,
                  &quot;kms:ScheduleKeyDeletion&quot;,
                  &quot;kms:CancelKeyDeletion&quot;
              ],
              &quot;Resource&quot;: &quot;*&quot;
          },
          {
              &quot;Sid&quot;: &quot;Allow use of the key&quot;,
              &quot;Effect&quot;: &quot;Allow&quot;,
              &quot;Principal&quot;: {
                  &quot;AWS&quot;: [
                      &quot;arn:aws:iam::accountid:role/aws-service-role/macie.amazonaws.com/AWSServiceRoleForAmazonMacie&quot;,
                      &quot;arn:aws:iam::accountid:role/aws-reserved/sso.amazonaws.com/eu-west-1/AWSReservedSSO_admin&quot;,
                      &quot;arn:aws:iam::accountid:user/username&quot;
                  ]
              },
              &quot;Action&quot;: [
                  &quot;kms:Encrypt&quot;,
                  &quot;kms:Decrypt&quot;,
                  &quot;kms:ReEncrypt*&quot;,
                  &quot;kms:GenerateDataKey*&quot;,
                  &quot;kms:DescribeKey&quot;
              ],
              &quot;Resource&quot;: &quot;*&quot;
          },
          {
              &quot;Sid&quot;: &quot;Allow attachment of persistent resources&quot;,
              &quot;Effect&quot;: &quot;Allow&quot;,
              &quot;Principal&quot;: {
                  &quot;AWS&quot;: [
                      &quot;arn:aws:iam::accountid:role/aws-service-role/macie.amazonaws.com/AWSServiceRoleForAmazonMacie&quot;,
                      &quot;arn:aws:iam::accountid:role/aws-reserved/sso.amazonaws.com/eu-west-1/AWSReservedSSO_admin&quot;,
                      &quot;arn:aws:iam::accountid:user/username&quot;
                  ]
              },
              &quot;Action&quot;: [
                  &quot;kms:CreateGrant&quot;,
                  &quot;kms:ListGrants&quot;,
                  &quot;kms:RevokeGrant&quot;
              ],
              &quot;Resource&quot;: &quot;*&quot;,
              &quot;Condition&quot;: {
                  &quot;Bool&quot;: {
                      &quot;kms:GrantIsForAWSResource&quot;: &quot;true&quot;
                  }
              }
          }
      ]
  }
  </code></pre>
  <p>We have tried to create an IAM user with specific: macie2:PutClassificationExportConfiguration to not avail.</p>
  <p>Creating a new bucket, both public or private, also to not avail.
  We've also tried to add our admin user in the bucket policy explicitly and grant all permissions to macie service in the policy, also to not avail. We always get the same error. Buckets are in the same region and account than the key.</p>
  <p>The only thing that comes from a different account is the AWS SSO managed roles, which are for the master account within the organization.</p>
  <p>Does anyone have any idea where is the missing link that we're obviously not realizing where to look for?</p>
  <p>Thanks a lot for your help!</p>