You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/06/27 07:11:44 UTC
[GitHub] [ozone] kerneltime opened a new pull request, #3552: HDDS-6949. Add audit of change bucket ACL S3 API.
kerneltime opened a new pull request, #3552:
URL: https://github.com/apache/ozone/pull/3552
## What changes were proposed in this pull request?
Add audit of change bucket ACL S3 API.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-6949
## How was this patch tested?
Only exceptions were caught before
```
aws s3api --endpoint-url http://localhost:9878 put-bucket-acl --bucket bucket2 --grant-full-control id=testuser2
```
```
2022-06-27 06:58:10,980 | ERROR | S3GAudit | user=key | ip=127.0.0.1 | op=PUT_ACL {bucket=[bucket], acl=[]} | ret=FAILURE | javax.ws.rs.WebApplicationException: Can't parse request body to XML.
at org.apache.hadoop.ozone.s3.endpoint.PutBucketAclRequestUnmarshaller.readFrom(PutBucketAclRequestUnmarshaller.java:82)
at org.apache.hadoop.ozone.s3.endpoint.BucketEndpoint.putAcl(BucketEndpoint.java:502)
2022-06-27 06:59:33,640 | INFO | S3GAudit | user=key | ip=127.0.0.1 | op=CREATE_BUCKET {bucket=[bucket2]} | ret=SUCCESS |
```
post fix
```
2022-06-27 07:11:07,715 | INFO | S3GAudit | user=key | ip=127.0.0.1 | op=CREATE_BUCKET {bucket=[bucket2]} | ret=SUCCESS |
2022-06-27 07:11:10,779 | INFO | S3GAudit | user=key | ip=127.0.0.1 | op=PUT_ACL {bucket=[bucket2], acl=[]} | ret=SUCCESS |
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] kerneltime commented on a diff in pull request #3552: HDDS-6949. Add audit of change bucket ACL S3 API.
Posted by GitBox <gi...@apache.org>.
kerneltime commented on code in PR #3552:
URL: https://github.com/apache/ozone/pull/3552#discussion_r907572888
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -244,6 +244,8 @@ public Response put(@PathParam("bucket") String bucketName,
try {
if (aclMarker != null) {
s3GAction = S3GAction.PUT_ACL;
+ AUDIT.logWriteSuccess(
+ buildAuditMessageForSuccess(s3GAction, getAuditParameters()));
Review Comment:
The config is defined in https://github.com/apache/ozone/blob/master/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/acl/OzoneAclConfig.java#L42-L48
Which is used by the Rpc Client. https://github.com/apache/ozone/blob/master/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java#L221
This is a bit awkward for 2 reasons, the actual string for configuration cannot be searched as plain test as the configuration splits it into 2 parts. Also, the defaults are set deep inside RpcClient vs being set close to the business logic in s3g. Ideally the group security setting should have been part of the Bucket Endpoint processing itself.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] adoroszlai commented on a diff in pull request #3552: HDDS-6949. Add audit of change bucket ACL S3 API.
Posted by GitBox <gi...@apache.org>.
adoroszlai commented on code in PR #3552:
URL: https://github.com/apache/ozone/pull/3552#discussion_r907091355
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -244,6 +244,8 @@ public Response put(@PathParam("bucket") String bucketName,
try {
if (aclMarker != null) {
s3GAction = S3GAction.PUT_ACL;
+ AUDIT.logWriteSuccess(
+ buildAuditMessageForSuccess(s3GAction, getAuditParameters()));
Review Comment:
`logWriteSuccess` should be moved to the normal, non-exception code path in `putAcl`. Otherwise we might end up logging both success and failure for failed requests.
https://github.com/apache/ozone/blob/6354406b4a06a7d13c1bde19c95c268dd6debfbd/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java#L579-L580
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] kerneltime commented on a diff in pull request #3552: HDDS-6949. Add audit of change bucket ACL S3 API.
Posted by GitBox <gi...@apache.org>.
kerneltime commented on code in PR #3552:
URL: https://github.com/apache/ozone/pull/3552#discussion_r907572888
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -244,6 +244,8 @@ public Response put(@PathParam("bucket") String bucketName,
try {
if (aclMarker != null) {
s3GAction = S3GAction.PUT_ACL;
+ AUDIT.logWriteSuccess(
+ buildAuditMessageForSuccess(s3GAction, getAuditParameters()));
Review Comment:
The config is defined in https://github.com/apache/ozone/blob/master/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/acl/OzoneAclConfig.java#L42-L48
Which is used by the Rpc Client. https://github.com/apache/ozone/blob/master/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java#L221
This is a bit awkward for 2 reasons, the actual string for configuration cannot be searched as plain text as the configuration splits it into 2 parts. Also, the defaults are set deep inside RpcClient vs being set close to the business logic in s3g. Ideally the group security setting should have been part of the Bucket Endpoint processing itself.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] kerneltime commented on a diff in pull request #3552: HDDS-6949. Add audit of change bucket ACL S3 API.
Posted by GitBox <gi...@apache.org>.
kerneltime commented on code in PR #3552:
URL: https://github.com/apache/ozone/pull/3552#discussion_r907572888
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -244,6 +244,8 @@ public Response put(@PathParam("bucket") String bucketName,
try {
if (aclMarker != null) {
s3GAction = S3GAction.PUT_ACL;
+ AUDIT.logWriteSuccess(
+ buildAuditMessageForSuccess(s3GAction, getAuditParameters()));
Review Comment:
The config is defined in https://github.com/apache/ozone/blob/master/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/acl/OzoneAclConfig.java#L42-L48
Which is used by the Rpc Client. https://github.com/apache/ozone/blob/master/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java#L221
This is a bit awkward for 2 reasons, the actual string for configuration cannot be searched as plain text as the configuration splits it into 2 parts. Also, the defaults are set deep inside RpcClient vs being set close to the business logic in s3g. Ideally the group security setting should have been part of the Bucket Endpoint processing itself.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] kerneltime commented on pull request #3552: HDDS-6949. Add audit of change bucket ACL S3 API.
Posted by GitBox <gi...@apache.org>.
kerneltime commented on PR #3552:
URL: https://github.com/apache/ozone/pull/3552#issuecomment-1167908774
> Thanks @kerneltime for updating the patch. I think moving the log statement to `putAcl` method would be more consistent, since error is also logged there, but this is good enough for fixing the bug.
>
> Also, please try to avoid force-push next time.
There is a separate effort on going to not log customer generated messages into s3g log. The audit log should be at the higher level and this should be the right place.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] adoroszlai merged pull request #3552: HDDS-6949. Add audit of change bucket ACL S3 API.
Posted by GitBox <gi...@apache.org>.
adoroszlai merged PR #3552:
URL: https://github.com/apache/ozone/pull/3552
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org