{"action":"opened","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/4817","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/4817/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/4817/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/4817/events","html_url":"https://github.com/hashicorp/terraform/issues/4817","id":128507959,"number":4817,"title":"Bucket Policy in example Cloudtrail Code allows global write access","user":{"login":"eyj","id":9105111,"avatar_url":"https://avatars.githubusercontent.com/u/9105111?v=3","gravatar_id":"","url":"https://api.github.com/users/eyj","html_url":"https://github.com/eyj","followers_url":"https://api.github.com/users/eyj/followers","following_url":"https://api.github.com/users/eyj/following{/other_user}","gists_url":"https://api.github.com/users/eyj/gists{/gist_id}","starred_url":"https://api.github.com/users/eyj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyj/subscriptions","organizations_url":"https://api.github.com/users/eyj/orgs","repos_url":"https://api.github.com/users/eyj/repos","events_url":"https://api.github.com/users/eyj/events{/privacy}","received_events_url":"https://api.github.com/users/eyj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-25T10:41:58Z","updated_at":"2016-01-25T10:41:58Z","closed_at":null,"body":"Hi,\r\n\r\nIt appears to me that the example bucket policy given at \r\nhttps://www.terraform.io/docs/providers/aws/r/cloudtrail.html\r\nallows anyone (Principal: *) to write to the given bucket. In the corresponding AWS docs\r\nhttp://docs.aws.amazon.com/awscloudtrail/latest/userguide/create-s3-bucket-policy-for-cloudtrail.html\r\nthe principal is given as {\"Service\": \"cloudtrail.amazonaws.com\"}\r\n\r\nI'd suggest changing this in the example, since people might not check the permission too carefully."}}