The vulnerability lies in the @hulumi/baseline package's AccountFoundation component, which improperly handles the reuse of existing AWS GuardDuty and Security Hub services. The root cause is a failure to validate the configuration and lifecycle of these reused resources.
-
GuardDuty Reuse Vulnerability: When AccountFoundation was configured to use an existing GuardDuty detector, it only checked for the detector's existence, not its operational status. The createGuardDuty helper function did not verify if the detector was ENABLED or if its findingPublishingFrequency was set to the baseline FIFTEEN_MINUTES. An attacker could pre-create a suspended or misconfigured detector, which Hulumi would silently accept, leading to a false sense of security as the detective baseline would not be active. The patch in createGuardDuty adds explicit posture validation by using aws.guardduty.getDetectorOutput and throwing an error if the status or frequency is incorrect.
-
Security Hub Reuse Vulnerability: When reusing an existing Security Hub account, AccountFoundation created new StandardsSubscription resources (for CIS/NIST standards) but did not manage their lifecycle correctly upon stack destruction. The createSecurityHub helper function did not set retainOnDelete: true for these subscriptions in the reuse scenario. Consequently, running pulumi destroy on the stack would trigger a BatchDisableStandards call, turning off compliance monitoring for the entire account, even if it was enabled prior to Hulumi's deployment. The patch addresses this by setting retainOnDelete: true on StandardsSubscription resources when an existing Security Hub is being used.
The primary vulnerable function is the AccountFoundation.constructor, as it orchestrates this flawed logic. The helper functions createGuardDuty and createSecurityHub contain the direct implementation of these vulnerabilities.