Open zmb3 opened 2 years ago
Revisiting the code, I think I understand better why it isn't just a simple caution to get the earliest version. It appears that when versioning is disabled, the objects in the bucket can be overwritten. By requiring versioning to be turned on, Teleport will always get the original version of the object to ensure that the integrity of the session hasn't been compromised by someone trying to alter the object.
I was curious to see if there was a way to make objects in a bucket immutable, and found Amazon S3 Object Lock. That requires that bucket versioning is enabled. I presume this is to protect against the possibility of an object being deleted and then later recreated with the same name.
Here's a terraform snippet creating a version enabled bucket with private canned ACL.
variable "bucket_name" {
type = string
description = "AWS S3 Bucket Name. Must be globally unique."
}
resource "aws_s3_bucket" "session_recording_bucket" {
bucket = var.bucket_name
}
resource "aws_s3_bucket_acl" "session_recording_bucket" {
bucket = aws_s3_bucket.session_recording_bucket.id
acl = "private"
}
resource "aws_s3_bucket_versioning" "session_recording_bucket" {
bucket = aws_s3_bucket.session_recording_bucket.id
versioning_configuration {
status = "Enabled"
}
}
Details
Teleport implicitly requires versioned S3 buckets for session recordings, but this requirement is not documented or enforced anywhere.
Category