-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HADOOP-19365. AAL support for auditing. #7723
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
base: trunk
Are you sure you want to change the base?
Conversation
@steveloughran I am starting work for auditing support. This is how I think we should do it:
The span-ID here will actually be the ID for the We will also need to something similar for the referrer header:
All of this feels a bit hacky, but I can't figure out a better way to do this. Can't think of a way to attach the S3 request in AAL to the span, so we going with this overwriting values approach. it does achieve the desired end result. Always find it a bit hard to navigate around this auditing code..let me know if you think there's a better way to do this. If you're ok with my current approach, i will work on finishing up this PR. |
💔 -1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core design looks good
@@ -49,6 +50,7 @@ | |||
import org.apache.hadoop.fs.store.LogExactlyOnce; | |||
import org.apache.hadoop.fs.store.audit.HttpReferrerAuditHeader; | |||
import org.apache.hadoop.security.UserGroupInformation; | |||
import software.amazon.s3.analyticsaccelerator.request.RequestAttributes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now forcing this to always be on the classpath...best off just to copy them into S3AInternalAuditConstants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
annoyingly, if you create a new Execution attribute the SDK throws and exception:
No duplicate ExecutionAttribute names allowed but both ExecutionAttributes 16f8b8be and 234dd4d6 have the same name: span. ExecutionAttributes should be referenced from a shared static constant to protect against erroneous or unexpected collisions.
So to get the attribute, you need to use the shared attribute, which is why i need to take the dependency here.
doesn't make any sense to me why on a GET the attribute needs to be shared, will reach out to the SDK team.. but not much else I can do right now.
@@ -400,6 +403,18 @@ public SdkHttpRequest modifyHttpRequest(Context.ModifyHttpRequest context, | |||
.appendHeader(HEADER_REFERRER, header) | |||
.build(); | |||
} | |||
|
|||
String spanId = executionAttributes.getAttribute(RequestAttributes.SPAN_ID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these would need to go above 393 and passsed into the referrer, as done with the range and delete key size; having the range from the request would be good too.
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Description of PR
Relevant AAL PR: awslabs/analytics-accelerator-s3#280
modifyHttpRequest
executionInterceptor in the LoggingAuditor called, these are now available in theExecutionAttributes
and can be used for logging.Example logs:
Pending release of new AAL version which attaches the execution attributes.
How was this patch tested?
Testing in progress.
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?