mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 14:30:28 -05:00
chore(iam): report enforcement state at startup and cover IAM management actions (#3935)
* chore(iam): report enforcement state at startup and cover IAM management actions Issue #3931 reported that an IAM user with an S3-only policy could call CreateUser, CreateGroup, AttachUserPolicy and DeleteUser. The reporter had set FLOCI_IAM_STRICT_VALIDATION, which is not a Floci flag, so enforcement was never on; with FLOCI_SERVICES_IAM_ENFORCEMENT_ENABLED=true those calls already return AccessDenied, including under an explicit Deny on iam:*. Make that state visible: the startup banner now prints whether IAM policy enforcement is enabled and names the correct variable when it is off. The IAM docs state that management actions are enforced too and that any other flag spelling is silently ignored. A regression test pins the issue's scenario (group-attached S3-only policy, plus a direct explicit-deny policy) against the four actions over HTTP with enforcement enabled. * chore(iam): use explicit types and imports in the enforcement regression test * chore(iam): stub the IAM config in EmulatorLifecycleTest and cover the enforcement banner line
This commit is contained in:
1 parent
52941e90ef
commit
5ac07733e9
4 files changed
+172
-2
No files matched your search
@@ -179,6 +179,11 @@ public class EmulatorLifecycle {
|
||||
LOG.infof("Region: %s Account: %s", config.defaultRegion(), config.defaultAccountId());
|
||||
LOG.infov("Storage: {0} Path: {1}", config.storage().mode(), config.storage().persistentPath());
|
||||
LOG.infov("TLS: {0}", config.tls().enabled() ? "enabled (HTTPS + HTTP dual mode)" : "disabled (HTTP only)");
|
||||
// Surfaced in the banner because a mistyped flag name (issue #3931) silently leaves
|
||||
// enforcement off, and nothing else in the logs reveals that policies are not evaluated.
|
||||
LOG.infov("IAM: {0}", config.services().iam().enforcementEnabled()
|
||||
? "policy enforcement enabled"
|
||||
: "policy enforcement disabled (set FLOCI_SERVICES_IAM_ENFORCEMENT_ENABLED=true to enforce)");
|
||||
|
||||
// BOOT hooks run before service initialization — scripts cannot use AWS APIs yet.
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user