This article details Netflix's architecture for securely bridging AWS IAM identities with their internal Metatron PKI system for Apache Spark workloads running on Amazon EMR. It focuses on the attestation process, where a workload proves its cloud identity to exchange it for a first-class internal identity, enabling secure service-to-service authentication and access control for data projects. The solution emphasizes a 1:1 mapping between internal identities and AWS IAM roles, corroborated by both AWS STS and a trusted control plane, to ensure trustworthiness at Netflix's scale.
Read original on Netflix Tech BlogOrganizations often manage two distinct identity systems: one provided by the cloud vendor (e.g., AWS IAM) and an internal system (e.g., a private PKI for mTLS). Bridging these two securely, especially for workloads on managed compute where direct control over bootstrapping is limited, presents a significant system design challenge. Netflix addressed this by designing a robust workload attestation mechanism for Spark jobs on Amazon EMR.
Netflix's internal service-to-service authentication relies on Metatron, a private PKI issuing short-lived X.509 certificates. Workloads authenticate via mutual TLS. Crucially, a workload must first *attest* its identity to the identity service to receive a certificate. On managed platforms like EMR, a Spark job initially only possesses an AWS execution role, lacking the internal identity required for accessing sensitive resources (e.g., encrypted data, ACL-controlled tables).
The core of Netflix's solution involves a 1:1 mapping between internal "Data Project" identities and dedicated AWS IAM roles. This mapping, maintained by a Data Project service, allows translating a cloud provider's statement ("this process is running as role R") into an internal statement ("this process is workload W"). To handle tens of thousands of Data Projects without hitting IAM role limits, they shard roles deterministically across a pool of dedicated AWS accounts.
Key Design Principle
The trustworthiness of the entire system hinges on requiring two independent claims and corroborating them: one from the cloud provider (unforgeable but underspecified) and one from the internal control plane (well-specified but replayable). Neither is sufficient alone; trust is established at their intersection.
Spark jobs involve one driver and potentially thousands of short-lived executors. Independent attestation by each executor would lead to significant load amplification on AWS STS and the internal identity service, resembling a DDoS attack. Netflix chose for executors to inherit credentials from the driver. The driver attests once and securely distributes credentials to executors via Spark's authenticated and encrypted internal RPC. This shifts the trust boundary to the driver but prevents massive, bursty attestation requests.
Certificates are short-lived. Since managed compute lacks OS-level hooks for renewal, the Spark driver JVM runs a timer to re-attest on a fixed interval before expiry. Executors do not renew; if they outlive their credentials, they exit and are replaced, which is more cost-effective. A crucial lesson: attestation must be a repeatable operation, not just a bootstrap step, to prevent long-running jobs from failing due to expired credentials.