Cloud cross account tenant trust

From xalgorix/xalgorix · View interactive version

Cloud cross account tenant trust is an AI agent skill from the GitHub repository xalgorix/xalgorix. Cross-account and cross-tenant trust testing — AWS role trust and resource policies, Azure cross-tenant applications and federated credentials, GCP IAM inheritance and service-account impersonation, requiring full trust-edge verification before claiming an attack path

How to use this skill

Skill file

Cloud Cross-Account / Cross-Tenant Trust

Purpose

Test trust boundaries between identities, accounts, tenants, and projects: whether an attacker-reachable principal can cross a trust edge into a target with meaningful new privileges or resources.

Entry Conditions

Attack Model

source principal
→ trust edge (role trust / resource policy / federation / org grant)
→ conditions (ExternalId, MFA, org-id, IP, audience)
→ target principal/resource
→ effective action actually performed
→ report only the verified path

Methodology

AWS — Role Trust

aws iam get-role --role-name <role> --query "Role.AssumeRolePolicyDocument"
# A trust policy with Principal: arn:aws:iam::<account>:root is only a CANDIDATE:
# it delegates to the whole account, not to you. You also need sts:AssumeRole in YOUR
# identity policy, and every condition satisfied (ExternalId, MFA, aws:SourceOrgID...).
aws sts assume-role --role-arn <arn> --role-session-name xalgorix-test --external-id <id-if-known>

AWS — Resource Policies

S3, KMS, SNS/SQS, ECR, Lambda, and secrets all support resource policies that can grant external principals:

aws s3api get-bucket-policy --bucket <b>
aws ecr get-repository-policy --repository-name <r>
aws kms get-key-policy --key-id <k> --policy-name default
# Then actually perform the cross-account action from the source context

Snapshot/AMI/RDS sharing is an adjacent surface: describe-snapshots --owner <self> and check restorableByUserIds for foreign accounts (and reverse: what the target shares outward).

Azure — Cross-Tenant

- multi-tenant app registrations: consent from a foreign tenant grants the app rights there
- B2B/external identities and their effective role assignments
- federated identity credentials on apps/service principals: an issuer/subject match
  lets the holder mint tokens AS the app — verify by requesting a token with the
  matching issuer and testing app roles
- cross-tenant service principals with privileged Graph app roles

GCP — Cross-Project and Federation

- org/folder/project IAM inheritance: a grant at org level flows down — enumerate the
  effective policy at each level (gcloud projects get-iam-policy, --flatten)
- external principals / allUsers / allAuthenticatedUsers in bindings
- workforce/workload identity federation configs: attribute-condition bypasses
- service-account impersonation chains: actAs/getAccessToken across projects

Classification Rules (high-value false-positive traps)

Evidence Contract

trust candidate (policy/registration/federation observed)
→ source context established
→ conditions satisfied
→ assumption/authorization call SUCCEEDS (usable credentials/token obtained)
→ meaningful resource access or privilege in the target context performed
→ report the complete path

NOT evidence: trust-policy text alone, a missing ExternalId, PMapper/Pacu graph edges (hypothesis), cross-tenant app existing without demonstrated consent/token abuse

Common Misses

False Positives / Non-Findings

Xalgorix Tool Strategy

Specialist Handoffs

Stopping Rule

Verify the full chain for the top-value trust candidates (privileged roles, resource-rich accounts, Graph-privileged apps). Do not enumerate every trust policy in an org when one verified privileged path already proves the class.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.