Spark Storage & FileSystem Foundation
Hadoop FileSystem, scheme implementation, credential provider và raw path bypass risk.
Câu hỏi
Spark đọc object storage qua abstraction nào, và vì sao đây là bypass surface lớn?
Mental model
Spark/Hadoop thường đọc path qua Hadoop FileSystem:
s3a://bucket/path
-> fs.s3a.impl
-> S3AFileSystem
-> credential provider chain
-> AWS APITương tự với ADLS/GCS/DBFS/local file. Config như core-site.xml quyết định scheme nào map tới implementation nào.
Vì sao đây là governance risk
Nếu user/query bị chặn ở catalog nhưng vẫn có credential đọc object storage trực tiếp, họ có thể đi vòng:
spark.read.table("secure.table") # bị policy chặn
spark.read.parquet("s3a://raw/path") # có thể bypass nếu credential quá rộngVì vậy storage boundary phải gắn với identity/policy, không thể chỉ dựa vào table ACL.
Vì sao liên quan Databricks Runtime
Trong snapshot, Databricks thay/wrap rất nhiều filesystem:
LokiFileSystemcho nhiều cloud schemes;CredentialScopeFileSystemcho UC credential scope;CredentialPassthroughFileSystem/FixedCredentialsFileSystem;WorkspaceLocalFileSystemchofile://;hadoop-safety-jarsshadow class Hadoop gốc.
Để hiểu mấy thứ đó, trước hết phải hiểu fs.<scheme>.impl, credential provider chain, FileSystem cache, và raw path bypass risk.