forked from mtusi2026/mtusi2026lab7
fix(security): enforce S3 boundaries and configure persistent audit
This commit is contained in:
@@ -389,7 +389,13 @@ func runHTTP(c Config, b Boundary) error {
|
||||
}
|
||||
}
|
||||
if !allowed {
|
||||
http.Error(w, "Operation denied", 403)
|
||||
if c.Role == "s3" {
|
||||
w.Header().Set("Content-Type", "application/xml")
|
||||
w.WriteHeader(http.StatusForbidden)
|
||||
io.WriteString(w, "<Error><Code>AccessDenied</Code><Message>Operation denied</Message><RequestId>tls-boundary</RequestId><HostId>local</HostId></Error>")
|
||||
} else {
|
||||
http.Error(w, "Operation denied", http.StatusForbidden)
|
||||
}
|
||||
return
|
||||
}
|
||||
r.Header.Del("X-Forwarded-Client-Cert")
|
||||
|
||||
+12
-3
@@ -17,13 +17,22 @@
|
||||
"protocol": "http",
|
||||
"allow": {
|
||||
"spiffe://messenger/api": [
|
||||
"* /"
|
||||
"GET /messenger/objects/",
|
||||
"HEAD /messenger/objects/",
|
||||
"PUT /messenger/objects/staging/",
|
||||
"GET /minio/health/"
|
||||
],
|
||||
"spiffe://messenger/worker": [
|
||||
"* /"
|
||||
"GET /messenger/objects/",
|
||||
"HEAD /messenger/objects/",
|
||||
"PUT /messenger/objects/",
|
||||
"GET /minio/health/"
|
||||
],
|
||||
"spiffe://messenger/reconciler": [
|
||||
"* /"
|
||||
"GET /messenger",
|
||||
"HEAD /messenger/objects/",
|
||||
"DELETE /messenger/objects/",
|
||||
"GET /minio/health/"
|
||||
],
|
||||
"spiffe://messenger/operator": [
|
||||
"* /"
|
||||
|
||||
Reference in New Issue
Block a user