Skip to content
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-10475. Refine audit logging for bucket creation operation #6366

Merged
merged 1 commit into from Mar 12, 2024

Conversation

tanvipenumudy
Copy link
Contributor

@tanvipenumudy tanvipenumudy commented Mar 12, 2024

What changes were proposed in this pull request?

As part of a review comment over HDDS-10460 (PR: #6329), it has been observed that the audit logs pertaining to the bucket creation operation do not capture the bucket quota, owner and replication-related properties.

Capturing these details is important for improving debugging capabilities.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-10475

How was this patch tested?

Before changes:

bash-4.2$ ozone sh bucket create voltest/bucktest2 --type=RATIS --replication=THREE --space-quota=1GB --namespace-quota=5

bash-4.2$ ozone sh bucket info voltest/bucktest2
{
  "metadata" : { },
  "volumeName" : "voltest",
  "name" : "bucktest2",
  "storageType" : "DISK",
  "versioning" : false,
  "listCacheSize" : 1000,
  "usedBytes" : 0,
  "usedNamespace" : 0,
  "creationTime" : "2024-03-12T05:11:15.574Z",
  "modificationTime" : "2024-03-12T05:11:15.574Z",
  "sourcePathExist" : true,
  "quotaInBytes" : 1073741824,
  "quotaInNamespace" : 5,
  "bucketLayout" : "FILE_SYSTEM_OPTIMIZED",
  "owner" : "hadoop",
  "link" : false,
  "replicationConfig" : {
    "replicationFactor" : "THREE",
    "requiredNodes" : 3,
    "replicationType" : "RATIS"
  }
}

om-audit.log:

2024-03-12 05:11:15,577 | INFO  | OMAudit | user=hadoop | ip=172.18.0.2 | op=CREATE_BUCKET {volume=voltest, bucket=bucktest2, bucketLayout=FILE_SYSTEM_OPTIMIZED, gdprEnabled=null, acls=[user:hadoop:a[ACCESS], group:hadoop:a[ACCESS]], isVersionEnabled=false, storageType=DISK, creationTime=1710220275574, bucketEncryptionKey=null, modificationTime=1710220275574, usedBytes=0, usedNamespace=0} | ret=SUCCESS | 

After changes:

bash-4.2$ ozone sh bucket create voltest/bucktest --type=RATIS --replication=THREE --space-quota=1GB --namespace-quota=5

bash-4.2$ ozone sh bucket info voltest/bucktest
{
  "metadata" : { },
  "volumeName" : "voltest",
  "name" : "bucktest",
  "storageType" : "DISK",
  "versioning" : false,
  "listCacheSize" : 1000,
  "usedBytes" : 0,
  "usedNamespace" : 0,
  "creationTime" : "2024-03-12T05:05:40.002Z",
  "modificationTime" : "2024-03-12T05:05:40.002Z",
  "sourcePathExist" : true,
  "quotaInBytes" : 1073741824,
  "quotaInNamespace" : 5,
  "bucketLayout" : "FILE_SYSTEM_OPTIMIZED",
  "owner" : "hadoop",
  "replicationConfig" : {
    "replicationFactor" : "THREE",
    "requiredNodes" : 3,
    "replicationType" : "RATIS"
  },
  "link" : false
}

om-audit.log:

2024-03-12 05:05:40,008 | INFO  | OMAudit | user=hadoop | ip=172.18.0.3 | op=CREATE_BUCKET {volume=voltest, bucket=bucktest, bucketLayout=FILE_SYSTEM_OPTIMIZED, gdprEnabled=null, acls=[user:hadoop:a[ACCESS], group:hadoop:a[ACCESS]], isVersionEnabled=false, storageType=DISK, creationTime=1710219940002, bucketEncryptionKey=null, modificationTime=1710219940002, usedBytes=0, usedNamespace=0, owner=hadoop, replicationType=RATIS, replicationConfig=THREE, quotaInBytes=1073741824, quotaInNamespace=5} | ret=SUCCESS |  

@tanvipenumudy tanvipenumudy marked this pull request as ready for review March 12, 2024 05:15
@tanvipenumudy
Copy link
Contributor Author

@adoroszlai could you please review the changes, thanks!

@adoroszlai adoroszlai merged commit a8dd1c2 into apache:master Mar 12, 2024
16 checks passed
@adoroszlai
Copy link
Contributor

Thanks @tanvipenumudy for the patch.

myskov pushed a commit to myskov/ozone that referenced this pull request Apr 3, 2024
myskov pushed a commit to myskov/ozone that referenced this pull request Apr 3, 2024
myskov pushed a commit to myskov/ozone that referenced this pull request Apr 3, 2024
myskov pushed a commit to myskov/ozone that referenced this pull request Apr 4, 2024
myskov pushed a commit to myskov/ozone that referenced this pull request Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants