# How do I edit a bucket policy deployed by organizational-level CloudTrail

**URL:** <https://awshq.com/t/how-do-i-edit-a-bucket-policy-deployed-by-organizational-level-cloudtrail/16203>\
**Category:** AWS Cloud Talk\
**Tags:** cloudwatch, organizations, athena, s3\
**Created:** [January 30, 2023, 11:10am UTC](https://awshq.com/t/how-do-i-edit-a-bucket-policy-deployed-by-organizational-level-cloudtrail/16203 "2023-01-30T11:10:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![HelpImFishZA](https://awshq.com/letter_avatar_proxy/v4/letter/h/f05b48/32.png) [@HelpImFishZA](https://awshq.com/u/HelpImFishZA)\
**Post date:** [January 30, 2023, 11:10am UTC](https://awshq.com/t/how-do-i-edit-a-bucket-policy-deployed-by-organizational-level-cloudtrail/16203/1 "2023-01-30T11:10:14Z")

</div>

Hi guys, we have a multi-account setup where we deployed an organizational-level CloudTrail in our root account’s Control Tower.

Organizational-level CloudTrail allows us to deploy CloudTrail in each of our respective accounts and provides them the ability to send logs to CloudWatch in our Root account and to an S3 logging bucket in our central logging account.

Now I have AWS Athena set up in our logging account to try and run queries on the logs generated through our organizational-level CloudTrail deployment. So far, I have managed to create the Athena Table that is built on the mentioned logging bucket and I also created a destination bucket for the query results.

When I try to run a simple “preview table” query, I get the following error:

**Permission denied on S3 path: s3://BUCKET\_NAME/PREFIX/AWSLogs/LOGGING\_ACCOUNT\_NUMBER/CloudTrail/LOGS\_DESTINATION This query ran against the “default” database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query Id: f72e7dbf-929c-4096-bd29-b55c6c41f582**

I figured that the error is caused by the logging bucket’s policy lacking any statement allowing Athena access, but when I try to edit the bucket policy I get the following error:

**Your bucket policy changes can’t be saved: You either don’t have permissions to edit the bucket policy, or your bucket policy grants a level of public access that conflicts with your Block Public Access settings. To edit a bucket policy, you need s3:PutBucketPolicy permissions. To review which Block Public Access settings are turned on, view your account and bucket settings. Learn more about Identity and access management in Amazon S3**

This is strange since the role I am using has full admin access to this account.

Please advise.

Thanks in advance!

* * *

**Related discussions:**

- [SIEM on AWS.](https://awshq.com/t/siem-on-aws/16208)
- [Anybody knows how to show AWS Account ID and Name on top of the AWS Console?](https://awshq.com/t/anybody-knows-how-to-show-aws-account-id-and-name-on-top-of-the-aws-console/15786)
- [Amazon Athena quietly got a lot better — Engine version 3](https://awshq.com/t/amazon-athena-quietly-got-a-lot-better-engine-version-3/16325)
- [TIFU by causing an incident](https://awshq.com/t/tifu-by-causing-an-incident/20971)
- [Analyzing AWS VPC Flow Logs using Apache Parquet Files and Amazon Athena](https://awshq.com/t/analyzing-aws-vpc-flow-logs-using-apache-parquet-files-and-amazon-athena/5173)

---

<div class="post-metadata">

**Author:** ![Flakmaster92](https://awshq.com/letter_avatar_proxy/v4/letter/f/a88e4f/32.png) [@Flakmaster92](https://awshq.com/u/Flakmaster92)\
**Post date:** [January 30, 2023, 1:43pm UTC](https://awshq.com/t/how-do-i-edit-a-bucket-policy-deployed-by-organizational-level-cloudtrail/16203/2 "2023-01-30T13:43:47Z")

</div>

You would need to go into the payer account, into organizations, and start flipping through the Service Control Policies to see if there’s a blocker on modifying that bucket.

Also I don’t think the problem is that Athena doesn’t have permission, just that your account you’re creating Athena in doesn’t have permission because the docs don’t mention explicitly allowing the Athena service when you’re setting up Athena → Cloudtrail integration, though the docs so assume same account.

---

<div class="post-metadata">

**Author:** ![HelpImFishZA](https://awshq.com/letter_avatar_proxy/v4/letter/h/f05b48/32.png) [@HelpImFishZA](https://awshq.com/u/HelpImFishZA)\
**Post date:** [January 30, 2023, 2:32pm UTC](https://awshq.com/t/how-do-i-edit-a-bucket-policy-deployed-by-organizational-level-cloudtrail/16203/3 "2023-01-30T14:32:39Z")

</div>

> [@Flakmaster92](#):
>
> You would need to go into the payer account, into organizations, and start flipping through the Service Control Policies to see if there’s a blocker on modifying that bucket. Also I don’t think the problem is that …

u/Flakmaster92 Thanks for the answer! How would I go about providing my account with the needed permissions to use Athena?

---

<div class="post-metadata">

**Author:** ![HelpImFishZA](https://awshq.com/letter_avatar_proxy/v4/letter/h/f05b48/32.png) [@HelpImFishZA](https://awshq.com/u/HelpImFishZA)\
**Post date:** [January 30, 2023, 2:36pm UTC](https://awshq.com/t/how-do-i-edit-a-bucket-policy-deployed-by-organizational-level-cloudtrail/16203/4 "2023-01-30T14:36:24Z")

</div>

> [@Flakmaster92](#):
>
> You would need to go into the payer account, into organizations, and start flipping through the Service Control Policies to see if there’s a blocker on modifying that bucket. Also I don’t think the problem is that …

u/Flakmaster92, also, the account where my S3 bucket resides in is the same account as where I am trying to deploy Athena in.

---

<div class="post-metadata">

**Author:** ![Flakmaster92](https://awshq.com/letter_avatar_proxy/v4/letter/f/a88e4f/32.png) [@Flakmaster92](https://awshq.com/u/Flakmaster92)\
**Post date:** [January 30, 2023, 7:01pm UTC](https://awshq.com/t/how-do-i-edit-a-bucket-policy-deployed-by-organizational-level-cloudtrail/16203/5 "2023-01-30T19:01:29Z")

</div>

> [@HelpImFishZA](#):
>
> u/Flakmaster92, also, the account where my S3 bucket resides in is the same account as where I am trying to deploy Athena in.

Well crap, there goes that idea then. Yeah I’d start digging through Service Control Policies and/or Cloudtrail

---

<div class="post-metadata">

**Author:** ![BuzzsawDingle](https://awshq.com/letter_avatar_proxy/v4/letter/b/ebca7d/32.png) [@BuzzsawDingle](https://awshq.com/u/BuzzsawDingle)\
**Post date:** [January 30, 2023, 9:49pm UTC](https://awshq.com/t/how-do-i-edit-a-bucket-policy-deployed-by-organizational-level-cloudtrail/16203/6 "2023-01-30T21:49:00Z")

</div>

> [@Flakmaster92](#):
>
> You would need to go into the payer account, into organizations, and start flipping through the Service Control Policies to see if there’s a blocker on modifying that bucket. Also I don’t think the problem is that …

Agreed,

There are lack of permissions stopping you from looking at it, you need to look at your permissions,

Is this an IAM account looking at it? If so look at your IAM permissions, due to the deny all you might not of given permissions to you IAM to do it,

Check the OU and SCR (organizational unit and service control policy ) for anything that would block access to S3 athina etc.

After this it may be policies on your S3 buckets and / or athena
