Skip to content

Commit

Permalink
Abort for SSE-KMS encryption type and not SSL/TLS specified
Browse files Browse the repository at this point in the history
  • Loading branch information
ggtakec committed Feb 23, 2024
1 parent 4d7fd60 commit f3959f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/man/s3fs.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ You can use "k" for short "kmsid".
If you san specify SSE-KMS type with your <kms id> in AWS KMS, you can set it after "kmsid:" (or "k:").
If you specify only "kmsid" ("k"), you need to set AWSSSEKMSID environment which value is <kms id>.
You must be careful about that you can not use the KMS id which is not same EC2 region.
Additionally, if you specify SSE-KMS, your endpoints must use Secure Sockets Layer(SSL) or Transport Layer Security(TLS).
.TP
\fB\-o\fR load_sse_c - specify SSE-C keys
Specify the custom-provided encryption keys file path for decrypting at downloading.
Expand Down
7 changes: 7 additions & 0 deletions src/curl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,13 @@ bool S3fsCurl::FinalCheckSse()
S3FS_PRN_ERR("sse type is SSE-KMS, but signature type is not v4. SSE-KMS require signature v4.");
return false;
}

// SSL/TLS is required for KMS
//
if(!is_prefix(s3host.c_str(), "https://")){
S3FS_PRN_ERR("The sse type is SSE-KMS, but it is not configured to use SSL/TLS. SSE-KMS requires SSL/TLS communication.");
return false;
}
return true;
}
S3FS_PRN_ERR("sse type is unknown(%d).", static_cast<int>(S3fsCurl::ssetype));
Expand Down
2 changes: 2 additions & 0 deletions src/s3fs_help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ static constexpr char help_string[] =
" environment which value is <kms id>. You must be careful\n"
" about that you can not use the KMS id which is not same EC2\n"
" region.\n"
" Additionally, if you specify SSE-KMS, your endpoints must use\n"
" Secure Sockets Layer(SSL) or Transport Layer Security(TLS).\n"
"\n"
" load_sse_c - specify SSE-C keys\n"
" Specify the custom-provided encryption keys file path for decrypting\n"
Expand Down

0 comments on commit f3959f0

Please sign in to comment.