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

Consider legal holds on NeoFS objects #247

Open
alexvanin opened this issue Jun 9, 2022 · 2 comments
Open

Consider legal holds on NeoFS objects #247

alexvanin opened this issue Jun 9, 2022 · 2 comments
Labels
feature Completely new functionality I2 Regular impact S3 Minimally significant U4 Nothing urgent

Comments

@alexvanin
Copy link
Contributor

alexvanin commented Jun 9, 2022

Is your feature request related to a problem? Please describe.

S3 protocol defines Object Lock legal hold operation. This operation locks object for indefinite period of time. This lock can be removed.

As we decided here, NeoFS locks cannot be removed and must have expiration, see nspcc-dev/neofs-api#221. This is suitable for retention locks in compliance mode, but it does not work with legal holds.

Describe the solution you'd like

As we discussed this with @realloc some time ago, there was a proposal to implement legal holds as a smart contract. This way we avoid API changes.

sequenceDiagram
    actor User
    User->> Alphabet Nodes: Lock cid/oid
    note right of User: Notary invocation of Legal Hold contract
    Alphabet Nodes-->>Alphabet Nodes: Collect multisignature
    Alphabet Nodes->>Legal Hold Contract: Lock cid/oid
    Legal Hold Contract ->> Storage Nodes: Notification
    User ->> Storage Nodes: Delete cid/oid
    activate Storage Nodes
    Storage Nodes --x User: Deny
    deactivate Storage Nodes
   
    User->> Alphabet Nodes: Unlock cid/oid
    Alphabet Nodes-->>Alphabet Nodes: Collect multisignature
    Alphabet Nodes->>Legal Hold Contract: Unlock cid/oid
    Legal Hold Contract ->> Storage Nodes: Notification
    User ->> Storage Nodes: Delete cid/oid
    activate Storage Nodes
    Storage Nodes ->> User: Ok
    deactivate Storage Nodes
Loading

Q: Who has the right to trigger legal hold?
A: In public network -- nobody. In private network -- some set of keys defined in legal hold contract.

Q: How storage node stores legal hold information?
A: In metabase. Maybe we can ask contract on every DELETE request.

Q: What if metabase is lost in SN?
A: Resync the list of legal hold objects from contract at startup.

@fyrchik
Copy link
Contributor

fyrchik commented Jun 23, 2022

  1. Add methods to the container contract.
  2. Node make some local marks.
  3. Syncronize during restart and on epoch tick.
  4. TODO determine who can create legal holds
  5. TODO try hold containers, check if it plays nicely with S3 spec
  6. Container with active holds should not be removed.

@KirillovDenis
Copy link
Contributor

Determine who can create legal holds
AWS allows create legal hold users that have s3:PutObjectLegalHold persmission (it's related to revising ACL in s3-gw) https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectLegalHold.html. So we can either:

Try hold containers, check if it plays nicely with S3 spec
I don't see any appropriate S3 API method that can be used to hold the bucket/container. There is only one method to change legal hold PutObjectLegalHold and it's per object version. Besides the bucket cannot be deleted if it isn't empty. So it's strange to introduce method to hold bucket in AWS mind.

There is one option though.
Using https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectLockConfiguration.html. We can extend body to accept param to hold bucket. But this will be incompatible with S3 protocol so I don't like it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Completely new functionality I2 Regular impact S3 Minimally significant U4 Nothing urgent
Projects
None yet
Development

No branches or pull requests

5 participants