-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Support S3 life-cycle policies and deletion prevention #4215
Comments
Hey @sandstrom, thanks for the detailed writeup. In general, Loki avoids all but the most simplistic forms of auth{entication,orization}. We only use a header P.S. |
@owen-d Thanks for taking time looking at this! I've read those docs, but what I'm looking for here is basically an explanation of:
Answer to (1) and (2) could look something like this:
(I'm not sure this example answer is actually accurate, so feel free to correct me) |
Hi! This issue has been automatically marked as stale because it has not had any We use a stalebot among other tools to help manage the state of issues in this project. Stalebots are also emotionless and cruel and can close issues which are still very relevant. If this issue is important to you, please add a comment to keep it open. More importantly, please add a thumbs-up to the original issue entry. We regularly sort for closed issues which have a We may also:
We are doing our best to respond, organize, and prioritize all issues but it can be a challenging task, |
ping |
Hi! This issue has been automatically marked as stale because it has not had any We use a stalebot among other tools to help manage the state of issues in this project. Stalebots are also emotionless and cruel and can close issues which are still very relevant. If this issue is important to you, please add a comment to keep it open. More importantly, please add a thumbs-up to the original issue entry. We regularly sort for closed issues which have a We may also:
We are doing our best to respond, organize, and prioritize all issues but it can be a challenging task, |
ping |
Hi! This issue has been automatically marked as stale because it has not had any We use a stalebot among other tools to help manage the state of issues in this project. Stalebots are also emotionless and cruel and can close issues which are still very relevant. If this issue is important to you, please add a comment to keep it open. More importantly, please add a thumbs-up to the original issue entry. We regularly sort for closed issues which have a We may also:
We are doing our best to respond, organize, and prioritize all issues but it can be a challenging task, |
Still relevant |
I have a similar use case but am wanting to take it a step further by replicating all objects in the S3 bucket to another S3 bucket in a different region/account. Then on the replicated bucket applying a S3 lifecycle policy to apply retention to the files in the bucket. From what I've seen in practice, Loki for the most part does not need permission to delete objects from S3. The exception to this is the compactor component of Loki which compacts the indexes. This is mentioned in the storage docs here and here. Though I have not tested running Loki without DeleteObject permission. |
I'm also interested in this use case. I might make some tests with MinIO. Update: I made some tests and as expected it's not working:
|
After running Loki for a while it seems that...
So it doesn't look like you can enable WORM on the S3 bucket if you run the compactor component. I'm running Loki in simple-scalable-deployment mode + a separate compactor. The read/write statefulSets only have I've been testing S3 bucket replication for DR purposes. So far I am able to read the replicated objects from the destination bucket with a test Loki instance. I haven't yet tested S3 lifecycle policy to apply retention to the files in the bucket, but will do in the coming weeks. It would be interesting to hear how disaster recovery (DR) is handled in Grafana Cloud. |
@elliotdobson Those are some good points! A few additions:
One thing that might help would be if the compactor could leave old index files in place somehow, such that they could also be used, albeit with less efficiency. That way, one could lock them down and delete after Y days via life-cycle rules. |
Problem Description
Making sure logs can't deleted (by e.g. a hacker) is a common desire. One way of doing this is to use S3 life-cycle policies and object lock to prevent early deletion.
Basically, you can configure something like "delete all files 6 months after they were created, and don't allow deletion of any files until 3 months after their creation at the earliest.". This assumes that all files are 'write-only'.
Using this to handle automatic deletion with loki has some benefits over using the log deletion APIs:
Proposed Solutions
ALT1: I know Loki is mostly an append-only service, i.e. files are generally not modified, only written once. If I've understood it correctly, there are the actual log files under the
fake/
directory, and those are append-only. Then there are index files underindex/loki_index_18723/
(incremented number), and those seems to be append-only too, correct?So this may be possible today, without further modifications to Loki. In that case all that's needed is documentation, basically mentioning that this is one way of doing log deletion. I hope this may be the case!
ALT2: If Loki have some files that are updated, they'd have to be either unimportant (so it's fine to have them deleted), or rearchitected into something that's append only.
Describe alternatives you've considered
Don't support log deletion prevention.
Some earlier discussion #577 (comment)
The text was updated successfully, but these errors were encountered: