S3 Object lock in compliance mode, file uploaded thru cli, file properties shows compliance mode, I can still delete it.

0

I have a bucket with Object lock and compliance mode of 7 days. I upload a file thru the CLI. I show the file in the bucket with compliance mode of 7 days. I can immediately delete the file thru the CLI or the console. I am using an assumed role account from the Org parent that does have full permissions. But compliance mode should still not let me remove the file even with full permissions on the account? It says even the root account shouldn't be able to delete. Is this a bug?

3 個答案
1
已接受的答案

Hi,

The behavior you're seeing here is due to versioning. Versioning is mandatory when you enable object lock, so when you delete an object it places a delete marker on the object, but the original version of the object is retained. If you want to see the delete marker and original version of the object, in the management console toggle the "show versions" switch.

For reference: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html#object-lock-managing-lifecycle

AWS
Tom-B
已回答 2 年前
AWS
專家
Hernito
已審閱 2 年前
0

I had read about the versioning, but assumed in compliance mode you could not even add the delete marker. That we would get an error trying to remove, not add the marker and hide it? That seems counter intuitive.

已回答 2 年前
0

Is the file definitely being deleted? In S3 when you delete a versioned file a delete marker is added but the previous version still remains - this can be seen by toggling the 'Show Versions' switch in the console.

This file was set with default object lock of 7 days with compliance mode and could be 'deleted' via the CLI, but the previous version is still available.

Phurl
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南