The Invisible Tenant: Hacking the Shared Responsibility Gap

The temporary role still works. The application can reach metadata. A logging change has an ordinary API name. The shared-responsibility gap appears in the permissions and records connecting those three facts.

The temporary administrator role survives the project. The developer leaves. The access key stays. Six months later, somebody uses it and the API accepts the request.

No lock was picked in that last step. The permission was already there. Now the investigation has to find who obtained it, which actions it authorized, and what the monitoring recorded.

The shared flat metaphor still fits. It needs a tenancy agreement with actual service names on it.

The provider secures a different layer

For EC2, AWS describes customer responsibilities including the guest operating system, applications, and security-group configuration. Managed services shift some operational tasks to the provider; they do not erase the customer's identity and data decisions. The AWS shared-responsibility model describes the division by service.

An exposed application endpoint and a flaw in the provider's virtualization layer are different findings. Name the service, deployment, component, and owner before assigning the fix. “Someone else's computer” is a good joke and a terrible incident ticket.

A valid credential can leave a very useful trail

An accepted credential establishes an authenticated principal. It does not establish that the operator is the intended human, workload, or agent. A compromised key can still encounter explicit denies, session restrictions, resource policies, and other controls. AWS's evaluation documentation sets out how those policies interact.

For a scoped test, save the principal, role/session context, requested action and resource, policy versions, result, and corresponding audit event. A permitted DescribeInstances call demonstrates enumeration within its scope. It does not by itself demonstrate access to application data or lateral movement into another workload. Add the next permission and effect to the record before drawing the next arrow.

The same applies to AI agents. A task prompt cannot reduce the permissions of the role executing its tools. Put the restriction in the role, service boundary, or executor that actually authorizes the action, then check that a legitimate task still succeeds.

Metadata is a boundary, not a membership card

The earlier version called IMDSv2 a vulnerability. AWS introduced it as a session-oriented defense-in-depth mechanism against several routes to metadata abuse, including some server-side request forgery (SSRF) paths. Its design explanation describes the token exchange and additional protections.

An application that can be induced to request internal resources creates one problem. Whether it can reach the instance metadata service, satisfy the required exchange, obtain role credentials, and exercise useful permissions creates several more. Requiring IMDSv2 helps at one boundary. It does not repair the application's arbitrary-fetch behavior or grant a guarantee against all SSRF.

It also does not confer membership in every software-defined perimeter. That claim needs the actual controller, identity integration, and authorization decision. In an owned environment, inspect the instance metadata settings, application egress, workload role, and downstream permissions separately. A metadata response is not a map of everything the role can do.

The logging policy is another permission

CloudTrail distinguishes management events from data events. Configuring collection for one category does not establish complete visibility into the other. AWS's event documentation describes the event types, and its management-event guidance describes read/write collection choices.

An attacker changing collection needs permission to make that change. An attempted StopLogging with an access-denied error is different from an event with no API error, and both are different from independently confirming the resulting collection state. A flood of events may burden a pipeline. It does not automatically hide another event from every detector.

This Python 3.9+ helper reviews a decoded CloudTrail JSON file for four logging-change operations. It keeps recorded errors attached to the attempted action. It does not contact AWS.

WATCHED = {'StopLogging', 'DeleteTrail', 'PutEventSelectors', 'UpdateTrail'}


def review_events(document):
    if not isinstance(document, dict) or not isinstance(document.get('Records'), list):
        raise ValueError('Expected a decoded CloudTrail object containing Records')
    findings = []
    for event in document['Records']:
        if not isinstance(event, dict):
            raise ValueError('Each record must be an object')
        if event.get('eventSource') != 'cloudtrail.amazonaws.com':
            continue
        name = event.get('eventName')
        if name not in WATCHED:
            continue
        findings.append({
            'event_id': event.get('eventID'),
            'time': event.get('eventTime'),
            'region': event.get('awsRegion'),
            'action': name,
            'error_code': event.get('errorCode'),
            'observation': ('api_error_recorded' if event.get('errorCode')
                            else 'no_api_error_recorded'),
            'effective_logging_state_verified': False,
        })
    return findings

The complete runnable helper includes ten synthetic checks. Save it as cloudtrail_logging_review.py and run:

python3 cloudtrail_logging_review.py --self-test

All ten passed locally on October 25, 2026. To inspect a locally held decoded CloudTrail file, use --file with its path. The expected input has a Records array; an API LookupEvents response or gzip file needs appropriate decoding first. The helper is a four-action triage filter, not a complete defense-evasion detector or evidence-authentication tool.

A match calls for checking the approved change, actor, target trail, selectors, destination, and resulting service state. The output does not declare the actor malicious or logging disabled. No matches means those four operations were absent from the supplied records. It does not establish that collection was complete or untouched.

Close the loop on the temporary role

The useful October 2026 exercise starts with the legitimate workload. Record the actions it needs. Introduce one bounded excess permission in an owned fixture, observe the additional action and its event, then remove that permission and replay both paths. Keep the policy change and executor decision with the result.

Do the same for telemetry: generate a known event, confirm its arrival, verify that an unauthorized logging change is denied, and check collection afterward. Those are acceptance criteria for a future cloud exercise, not a live test performed for this article.

The role expires. The denied request stays in the evidence. The legitimate job still finishes. That is a better handoff than telling the next administrator to be less tired.

Refreshed October 25, 2026: corrected the IMDSv2 claim, separated authentication from authorization and detection, and replaced unsupported book-specific claims with primary AWS documentation. Added a tested offline logging-change triage helper. No credentials, cloud account, metadata endpoint, or live logging configuration was accessed.

GhostInThePrompt.com // The temporary role outlived the task. Start with the permission that stayed.