All Tools View Categories About Contact Privacy

External ID Generator

Generate a cryptographically random External ID for third-party cross-account role trust, with a matching trust-policy Condition snippet.

Runs entirely in your browser using window.crypto.getRandomValues — the generated value is never transmitted anywhere.

256 bits (32 random bytes) from window.crypto.getRandomValues, not Math.random.


    

    

About External ID Generator

Third-party cross-account access in AWS almost always needs an External ID, but the value itself is easy to get wrong in a way that quietly defeats its own purpose: typing a short, memorable, or predictable string undermines the exact guarantee AWS designed the External ID condition to provide. External ID Generator produces a genuinely unpredictable value using the browser's cryptographically secure random number generator, so the value you paste into a trust policy actually resists guessing.

The generator draws 256 bits (32 bytes) from window.crypto.getRandomValues() - the Web Crypto API backed by the operating system's CSPRNG - rather than Math.random(), which is explicitly not designed to be unpredictable and should never be used for anything where guessability matters. Those random bytes are then encoded as either lowercase hex (64 characters, digits and a-f only) or base64url (43 characters, using the full base64url alphabet without padding), your choice, with both encodings carrying the identical amount of real entropy.

AWS documents the External ID as the standard mitigation for the confused-deputy problem: when a third-party service is given a role ARN to assume on behalf of multiple customers, requiring each customer's calls to also present a unique, hard-to-guess External ID via a StringEquals condition on sts:ExternalId prevents one customer's intermediary from being tricked (or misused) into accessing a different customer's resources through the same role. The External ID is not a password and does not replace the Principal check in a trust policy - it is an additional required condition layered on top of an already-scoped trust relationship, so it only strengthens a correctly-configured trust policy, it cannot make an overly broad one safe on its own.

A snippet below the generated value shows exactly how the value fits into a trust policy's Condition block, built with the same condition-assembly logic the site's trust-policy generator tools use, so what you see here is guaranteed to match the shape those tools produce. Give the generated External ID to whichever third party or automation needs it, and add the matching condition to the target role's trust policy using the IAM Trust Policy Generator or IAM Role Trust Relationship Generator elsewhere in this category.

Features

  • Cryptographically secure randomness via window.crypto.getRandomValues(), never Math.random().
  • 256 bits (32 random bytes) of entropy per generated value.
  • Hex or base64url encoding, your choice, both carrying identical entropy.
  • Live trust-policy Condition snippet showing exactly how the value fits into a real trust policy.
  • One-click regenerate for a fresh value.
  • Copy button for both the raw value and the condition snippet.
  • 100% client-side - the value is never transmitted anywhere.

How to Use

  1. Choose an encoding - hex or base64url.
  2. Click Generate to produce a fresh cryptographically random External ID.
  3. Copy the value and give it to the third party or automation that needs it.
  4. Copy the Condition snippet and add it to the target role's trust policy - or use the IAM Trust Policy Generator / IAM Role Trust Relationship Generator, which both have a dedicated External ID field.
  5. Regenerate any time you need a fresh, independent value for a different third party.

Examples

Example 1 - hex encoding. A 64-character lowercase hex string such as 3f9a1c... (64 hex digits), suitable for pasting into any system without special-character concerns.

Example 2 - base64url encoding. A shorter 43-character string using letters, digits, - and _, carrying the same 256 bits of entropy in less visual space.

Example 3 - condition snippet. Generating a value and copying the snippet produces exactly "Condition": {"StringEquals": {"sts:ExternalId": "<your generated value>"}}, ready to merge into a trust policy's Statement.

Benefits

  • Actually unpredictable - sourced from a real CSPRNG, not a UI-grade random function.
  • Matches the exact condition shape the site's trust-policy tools produce.
  • No format guesswork - both offered encodings are safe to paste anywhere.
  • Private - the value never leaves your browser.

Frequently Asked Questions

What is an External ID and what problem does it solve?
An External ID is an opaque string that a role's trust policy can require via an <code>sts:ExternalId</code> condition. AWS documents it specifically as the mitigation for the "confused deputy" problem in third-party cross-account access: without it, if two different customers give a third-party SaaS provider the same role ARN to assume, the provider (or anyone who tricks it) could potentially use one customer's credentials to access another customer's resources. Requiring a unique, hard-to-guess External ID per customer means an assume-role call only succeeds when the caller also presents the exact value that customer agreed to.
Why does this generator use window.crypto.getRandomValues() instead of Math.random()?
Because an External ID's entire security value comes from being hard to guess, and <code>Math.random()</code> is explicitly not a cryptographically secure random number generator - it is fine for shuffling a UI animation, not for anything meant to resist guessing. This tool sources its randomness from the browser's <code>window.crypto.getRandomValues()</code> API, backed by the operating system's CSPRNG, generating 32 random bytes (256 bits) before encoding them to a string.
Hex or base64url — which should I use?
Either is fine from a security standpoint; both encode the same 256 bits of randomness. Hex is longer (64 characters) but uses only digits and lowercase a-f, which is occasionally friendlier for humans reading it out loud or pasting into systems with limited character sets. Base64url is shorter (43 characters) and uses the full base64url alphabet (letters, digits, <code>-</code> and <code>_</code>), avoiding characters like <code>+</code>, <code>/</code>, and <code>=</code> that can cause problems in URLs or shell arguments if not quoted.
Does AWS require the External ID to have a specific length or format?
AWS's own constraints on the <code>sts:ExternalId</code> condition value are permissive - up to 1224 characters, most printable ASCII characters allowed. AWS's recommendation is about the value's unpredictability, not its format: make it hard to guess and unique per third party or per integration, which is exactly what a 256-bit CSPRNG-sourced value provides regardless of whether you encode it as hex or base64url.
Is the External ID a secret, like a password?
It should be treated with real care but it is not a substitute for IAM permissions or a password: AWS explicitly still requires the calling principal in the trust policy to also be correct. The External ID adds an additional required condition on top of that Principal check - it narrows an already-scoped trust relationship rather than being the sole thing standing between an attacker and your account. That said, since its only value comes from being hard to guess, do not publish it somewhere public or reuse the same one across unrelated third parties.
How do I actually use the value this tool generates?
Give it to the third party (or your own automation) as the External ID they must supply on every <code>sts:AssumeRole</code> call, and add a matching <code>Condition</code> block requiring it on the target role's trust policy - the snippet below shows exactly what that condition block looks like. The IAM Trust Policy Generator and IAM Role Trust Relationship Generator tools in this category both have a dedicated External ID field that builds this same condition into a full trust policy.
Is the generated value sent anywhere?
No - randomness generation and encoding both happen entirely in your browser via the Web Crypto API. Nothing is transmitted.
Can I export the result?
Yes, a Copy button appears next to the generated value.