-
Notifications
You must be signed in to change notification settings - Fork 511
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
HDDS-10460. Refine audit logging for bucket property updation operations #6329
Conversation
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.
Thanks @tanvipenumudy for the patch.
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketArgs.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketArgs.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketArgs.java
Outdated
Show resolved
Hide resolved
…elpers/OmBucketArgs.java Co-authored-by: Doroszlai, Attila <6454655+adoroszlai@users.noreply.github.com>
…elpers/OmBucketArgs.java Co-authored-by: Doroszlai, Attila <6454655+adoroszlai@users.noreply.github.com>
…elpers/OmBucketArgs.java Co-authored-by: Doroszlai, Attila <6454655+adoroszlai@users.noreply.github.com>
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java
Outdated
Show resolved
Hide resolved
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.
Thanks for the patch @tanvipenumudy , LGTM
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.
Thanks again @tanvipenumudy for the patch.
On another look, similar change is needed in OmBucketInfo
, which is used as source of audit data during bucket creation:
ozone/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketInfo.java
Lines 306 to 333 in 4243721
@Override | |
public Map<String, String> toAuditMap() { | |
Map<String, String> auditMap = new LinkedHashMap<>(); | |
auditMap.put(OzoneConsts.VOLUME, this.volumeName); | |
auditMap.put(OzoneConsts.BUCKET, this.bucketName); | |
auditMap.put(OzoneConsts.BUCKET_LAYOUT, String.valueOf(this.bucketLayout)); | |
auditMap.put(OzoneConsts.GDPR_FLAG, | |
getMetadata().get(OzoneConsts.GDPR_FLAG)); | |
auditMap.put(OzoneConsts.ACLS, | |
(this.acls != null) ? this.acls.toString() : null); | |
auditMap.put(OzoneConsts.IS_VERSION_ENABLED, | |
String.valueOf(this.isVersionEnabled)); | |
auditMap.put(OzoneConsts.STORAGE_TYPE, | |
(this.storageType != null) ? this.storageType.name() : null); | |
auditMap.put(OzoneConsts.CREATION_TIME, String.valueOf(this.creationTime)); | |
auditMap.put(OzoneConsts.BUCKET_ENCRYPTION_KEY, | |
(bekInfo != null) ? bekInfo.getKeyName() : null); | |
auditMap.put(OzoneConsts.MODIFICATION_TIME, | |
String.valueOf(this.modificationTime)); | |
if (isLink()) { | |
auditMap.put(OzoneConsts.SOURCE_VOLUME, sourceVolume); | |
auditMap.put(OzoneConsts.SOURCE_BUCKET, sourceBucket); | |
} | |
auditMap.put(OzoneConsts.USED_BYTES, String.valueOf(this.usedBytes)); | |
auditMap.put(OzoneConsts.USED_NAMESPACE, | |
String.valueOf(this.usedNamespace)); | |
return auditMap; | |
} |
Quotas and default replication config need to be added (please double-check I did not miss anything).
It is OK to make these additional changes in follow-up PR if you prefer, since the task is currently specific to property update operations.
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java
Outdated
Show resolved
Hide resolved
Thank you @adoroszlai and @myskov for the reviews. I have filed a ticket: HDDS-10475 for tracking the suggested change! |
Thanks @tanvipenumudy for the patch, @myskov for the review. |
apache#6329) (cherry picked from commit 418528a) Change-Id: Ic89d26f3ab4a75508547b590f190a58f675738c3
apache#6329) (cherry picked from commit 418528a)
apache#6329) (cherry picked from commit 418528a)
apache#6329) (cherry picked from commit 418528a)
apache#6329) (cherry picked from commit 418528a)
What changes were proposed in this pull request?
We should refine audit logging for operations modifying bucket properties.
How can this be useful?
As of today, we are only capturing basic information such as volume, bucket, gdprEnabled, isVersionEnabled, storageType and owner properties for any given bucket.
We should also be capturing bucket quota, encryption and replication-related properties.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10460
How was this patch tested?
Create a bucket with replication-type:
RATIS
, replication-factor:THREE
:Set
quotaInBytes
,quotaInNamespace
for the created bucket:om-audit.log
:Set replication-config from replication-factor:
THREE
to replication-factor:ONE
:om-audit.log
: