-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3 server access logs are inherently incomplete #5043
Comments
@hannes-ucsc to fill in details. |
The two logging options are 1) CloudTrail data event logging and 2) S3 server access logs. We currently use the latter and will make them searchable by forwarding them to CloudWatch. A comparison of the two options can be found here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/logging-with-S3.html For compliance reasons (scoping of information spillage) we need the ability to definitively say that an object was NOT accessed. Due to the best effort implementation of S3 server access logs, the absence of a log record does not necessarily mean the absence of a request. The CloudTrail logging option does not come with that "best-effort" caveat. On the other hand, CloudTrail does not log authentication failures and the log does not contain certain fields. It is more expensive. We should implement both logging options. Enable data event logging for all buckets by specifying an event selector on the trail. See Logging All S3 Object Events By Using Basic Event Selectors on https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudtrail |
@hannes-ucsc: "Ideally we'd want all events in one trail, that is all existing events that are currently logged plus the S3 data events. If that is not possible, we should create a second trail just for S3 data events, but try to send both trails to the same log group." |
For demo, show that both management and data events are logged concurrently in the shared trail in |
@hannes-ucsc to provide design to prevent excessive |
Modify the This changes the pattern from what the SecurityHub best-practices rules expect, and will result in a finding. We'll address that finding again in #5255. {
"@timestamp": "2023-05-24 18:03:30.575",
"@message": {
"eventVersion": "1.08",
"userIdentity": {
"type": "AWSService",
"invokedBy": "cloudfront.amazonaws.com"
},
"eventTime": "2023-05-24T18:02:27Z",
"eventSource": "s3.amazonaws.com",
"eventName": "GetObject",
"awsRegion": "us-east-1",
"sourceIPAddress": "cloudfront.amazonaws.com",
"userAgent": "cloudfront.amazonaws.com",
"errorCode": "AccessDenied",
"errorMessage": "Access Denied",
"requestParameters": {
"bucketName": "anvil.gi.ucsc.edu",
"Host": "anvil.gi.ucsc.edu.s3.us-east-1.amazonaws.com",
"key": "apidocs/swagger.json"
},
"responseElements": null,
"additionalEventData": {
"SignatureVersion": "SigV4",
"CipherSuite": "ECDHE-RSA-AES128-GCM-SHA256",
"bytesTransferredIn": 0,
"AuthenticationMethod": "AuthHeader",
"x-amz-id-2": "EIZYDF+R3WH7fai/lDigrFG5u7otASV0h3jEzCoPnWGMeD08Oo0PHOWouwSBxAswyJqok7kqurs=",
"bytesTransferredOut": 243
},
"requestID": "DN11SE4RA2MT18Q3",
"eventID": "b935d261-f9ea-407e-b61b-ec61d606d89e",
"readOnly": true,
"resources": [
{
"type": "AWS::S3::Object",
"ARN": "arn:aws:s3:::anvil.gi.ucsc.edu/apidocs/swagger.json"
},
{
"accountId": "289950828509",
"type": "AWS::S3::Bucket",
"ARN": "arn:aws:s3:::anvil.gi.ucsc.edu"
}
],
"eventType": "AwsApiCall",
"managementEvent": false,
"recipientAccountId": "289950828509",
"sharedEventID": "778e1726-50c7-4704-9047-fdb41fa24e82",
"eventCategory": "Data"
}
} |
https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerLogs.html#LogDeliveryBestEffort
The text was updated successfully, but these errors were encountered: