Back to Checks
vcf

Local user accounts are not stale

users_stale_accounts
Service: usersSeverity: medium
OfficialVerifiedVMware Cloud FoundationPrivate
Categories:identity-access
Resource Type:User

Local user accounts on the SDDC Manager have been created within the configured maximum age threshold, surfacing abandoned or forgotten accounts.

Risk

Stale local accounts that are no longer actively managed widen the attack surface and may retain elevated privileges beyond their intended lifecycle, weakening confidentiality of authenticated access.

Run this check with Prowler

Run in Prowler Cloud
Install
pip install --extra-index-url https://__token__:${PROWLER_REGISTRY_DOWNLOAD_API_KEY}@registry.prowler.com/simple/ "prowler-provider-vcf[runtime]"
Run
prowler vcf --checks users_stale_accounts

Recommendation

Remove or rotate local accounts that exceed the maximum age threshold so abandoned credentials cannot be reused after the user is gone.

Remediation

Other

1Review and remove stale local accounts in the **SDDC Manager** UI under **Administration > Users**, or call `DELETE /v1/users/{id}` on the VCF API.

Check Code

from datetime import datetime, timedelta, timezone

from prowler.lib.check.models import Check
from prowler_provider_vcf.check_report import CheckReportVCF
from prowler_provider_vcf.services.users.users_client import users_client


class users_stale_accounts(Check):
    def execute(self) -> list[CheckReportVCF]:
        findings = []
        max_age_days = users_client.audit_config.get("max_user_account_age_days", 365)
        now = datetime.now(timezone.utc)
        threshold = now - timedelta(days=max_age_days)

        for user in users_client.users:
            if not user.is_local:
                continue
            report = CheckReportVCF(
                metadata=self.metadata(),
                resource=user,
            )
            if user.creation_timestamp is None:
                report.status = "FAIL"
                report.status_extended = (
                    f"Local user {user.name} has no creation timestamp."
                )
            elif user.creation_timestamp < threshold:
                age_days = (now - user.creation_timestamp).days
                report.status = "FAIL"
                report.status_extended = (
                    f"Local user {user.name} was created {age_days} days ago "
                    f"(threshold: {max_age_days} days)."
                )
            else:
                age_days = (now - user.creation_timestamp).days
                report.status = "PASS"
                report.status_extended = (
                    f"Local user {user.name} was created {age_days} days ago."
                )
            findings.append(report)
        return findings