The Identity Gap on Managed Compute

When you run workloads on infrastructure you control, bootstrapping your own identity is straightforward: you can inject certificates, configure init systems, or use your own PKI. On managed compute—like Amazon EMR, Cloud Run, or Azure Batch—the provider hands your process a cloud identity (IAM role, service account) and nothing else. Your internal services, however, don't speak that language. They expect mutual TLS with short-lived X.509 certificates issued by your private PKI.

The challenge is not the protocol; it's building a trustworthy bridge between two identity systems. This article breaks down a production pattern for Apache Spark on EMR, but the architecture generalizes to any managed compute environment.

Key concepts:

  • Internal identity system (e.g., SPIFFE/SPIRE, Netflix Metatron): issues short-lived certs after attestation.
  • Data Project: a unit of ownership with its own identity, mapped 1:1 to a cloud IAM role.
  • Attestation: proving a workload is what it claims to be, using environment-specific evidence.

Abstract diagram showing two identity systems bridging via attestation with signed claims and pre-signed URLs Software Concept Art

The Two-Claim Attestation Pattern

The core idea: never trust a single claim. Combine two independent statements that fail in complementary ways.

Claim 1: The Platform's Statement (Signed Metadata)

Your control plane—the only service allowed to launch jobs—builds a payload describing the workload: application identity, mapped IAM role, environment, stack. It signs this payload with a dedicated key and passes it as job configuration.

# Pseudocode: control plane signs workload metadata
import json, jwt

payload = {
    "app_identity": "data-project-42",
    "iam_role": "arn:aws:iam::123456789012:role/dp-42-exec",
    "environment": "prod",
    "stack": "spark-emr"
}
signed_metadata = jwt.encode(payload, private_key, algorithm="RS256")
# Pass signed_metadata as job config

Properties: Well-specified but replayable—anyone who reads the job config can replay it.

Claim 2: The Provider's Statement (Pre-signed URL)

The workload uses its cloud credentials to sign (but not send) a request to sts:GetCallerIdentity. The result is a pre-signed URL that anyone can fetch, but only the credential holder could have produced. The response comes from AWS, stating which role signed.

# Pseudocode: workload generates pre-signed STS URL
import boto3
from botocore.auth import SigV4Auth

session = boto3.Session()
credentials = session.get_credentials()
request = AWSRequest(method='POST', url='https://sts.amazonaws.com/',
                     data={'Action': 'GetCallerIdentity', 'Version': '2011-06-15'})
SigV4Auth(credentials, 'sts', 'us-east-1').add_auth(request)
pre_signed_url = request.url

Properties: Unforgeable but under-specified—it proves a role, not a workload.

Corroboration: The Identity Service

The identity service receives both artifacts and:

  1. Fetches the pre-signed URL → reads the role AWS reports.
  2. Verifies the metadata signature → reads the role the control plane dispatched.
  3. Corroborates: the roles must match for the named identity.
  4. Issues short-lived certificates scoped to the environment/stack.
# Pseudocode: identity service corroboration
def attest(signed_metadata, pre_signed_url):
    metadata = jwt.decode(signed_metadata, control_plane_public_key)
    aws_response = requests.post(pre_signed_url)  # STS GetCallerIdentity
    aws_role = parse_arn(aws_response.text)
    if aws_role != metadata['iam_role']:
        raise AttestationError("Role mismatch")
    return issue_certificate(metadata['app_identity'], metadata['environment'])

Why this works: Neither party trusts the workload's self-report. The signature proves legitimate dispatch; the pre-signed URL proves actual possession.

Cloud provider IAM role and internal PKI certificate exchanging trust through a control plane Coding Session Visual

Scaling Attestation: The Fan-Out Problem

A Spark application is one driver plus thousands of executors, created and destroyed throughout the job. Per-process attestation doesn't scale.

Option A: Independent Attestation

Each executor attests independently. Uniform, no new trust boundary, but amplification: one job can trigger thousands of STS calls in a burst—indistinguishable from an attack.

Option B: Credential Inheritance (Recommended)

The driver attests once and distributes credentials to executors over Spark's internal RPC (with authentication and AES-GCM encryption). Load on the identity service stays constant. Trade-off: the driver becomes a credential distribution point.

Decision rule: Identity amplification is a capacity question. Answer it on purpose—don't let an incident answer it for you.

Lifecycle Management

  • Driver: runs a timer to re-attest before certificate expiry (e.g., every 4 hours for 6-hour certs).
  • Executors: do not refresh; they're short-lived and can be replaced.
  • Credential storage: temporary directory readable only by process owner, removed on exit.

Critical rule: Attestation must be repeatable, not a one-time bootstrap. Anything that can only happen at process start will eventually kill a long-running job.

Common Pitfalls

  • Role name ≠ application name: deriving app identity from role names is fragile string matching. Take identity from signed metadata; use the provider's answer only for corroboration.
  • IAM role limits: AWS accounts cap at ~5,000 roles. Shard data project roles across dedicated accounts.
  • Replay attacks: signed metadata alone is insufficient—always require the pre-signed URL.

Apache Spark driver and executors on managed compute inheriting short-lived certificates IT Technology Image

Key Takeaways for Your Own Implementation

  1. Anchor on one exchangeable primitive: a 1:1 mapping between your identity and a provider identity (e.g., Data Project ↔ IAM role). Commit to it and keep it authoritative.
  2. Require two independent claims: one unforgeable (provider), one well-specified (control plane). Trust the intersection.
  3. Keep the signer scarce: exactly one service should be able to make the platform's claim.
  4. Hook the layer you own: on managed compute, you rarely control the host—but you control the runtime (plugin, agent, entrypoint). Attestation belongs there.
  5. Decide amplification policy on purpose: distributed engines multiply per-process operations by parallelism.
  6. Make attestation repeatable: renewal is a requirement, not a follow-up.

Limitations & Caveats:

  • This pattern assumes you control the job submission path (the control plane). If workloads can be launched outside your control plane, the trust model breaks.
  • The pre-signed URL approach depends on provider-specific APIs (STS, metadata servers). Porting to another cloud requires re-implementing Claim 2.
  • Certificate revocation and rotation add operational complexity—plan for it.

Next Steps:

This content was drafted using AI tools based on reliable sources, and has been reviewed by our editorial team before publication. It is not intended to replace professional advice.