Lesson 1 of 6 Data Security

Authenticating Services and People to the Data Platform

This lesson explains how every service and person that touches data authenticates with an identity whose permissions are known, temporary and auditable, the starting point for securing a data platform.

Learning outcomes

After completing this lesson, you will be able to:

  • Assign IAM roles to data services.
  • Federate people through IAM Identity Center.
  • Authenticate to databases without long-lived passwords.

Identities for services

Every data service acts through an IAM role, which gives it temporary credentials that rotate automatically. A Glue job role is used by jobs and crawlers to read sources, write targets and update the catalogue. Amazon EMR uses a service role to create the cluster's resources and an instance profile for the nodes; runtime roles can give each job its own permissions on a shared cluster. Redshift uses roles attached to the cluster or namespace for COPY, UNLOAD and Spectrum, and Lambda, MWAA and Step Functions each run with an execution role. The following table summarises the roles.

ServiceRole
AWS GlueJob role, used by jobs and crawlers
Amazon EMRService role, and an instance profile for cluster nodes (or runtime roles per job)
Amazon RedshiftRoles attached to the cluster or namespace for COPY, UNLOAD and Spectrum
Lambda, MWAA, Step FunctionsExecution roles

Long-term access keys should never be used by services. Workloads outside AWS use IAM Roles Anywhere or OIDC federation instead.

Match the pairs

Service roles

Exam skills 4.1.4 · 4.1.2

Match each service with the IAM role it uses.

Log in to try this activity Interactive activities are free with an account.

Identities for people

People should sign in to data services through a central identity provider rather than with separate users in each service. AWS IAM Identity Center provides single sign-on to AWS accounts and to services such as Amazon Redshift, Amazon Quick Sight and Amazon SageMaker Unified Studio, using the identities in the corporate directory. Permissions are granted to groups that are synchronised from that directory, so when someone changes role or leaves, their access changes automatically.

Trusted identity propagation passes the signed-in user's identity through to services such as Redshift, AWS Lake Formation and Amazon S3 Access Grants. Access is then authorised and audited for each individual user, rather than for a shared service role, so audit logs show which person queried which data.

The following diagram shows how analysts sign in and how each analyst's identity reaches the data services.

Per-user access for analysts. Analysts sign in with corporate credentials through IAM Identity Center, whose groups map to Redshift roles. Trusted identity propagation carries each analyst's identity from Quick Sight to Redshift and Lake Formation, so every query is authorised and audited as that person, and leavers lose access when they are removed from the directory.
The user name is illustrative.

Authentication to databases

Database access should avoid long-lived passwords stored in code. IAM database authentication lets a role obtain a short-lived token, valid for minutes, to sign in to RDS, Aurora or Redshift instead of a password, so access is governed by IAM policies. Where passwords are needed, they are kept in Secrets Manager, which rotates them automatically, and jobs and Glue connections reference the secret rather than the password. For people, federation through IAM Identity Center lets users sign in to Redshift with their corporate identity, so access ends when they leave. The following table summarises the methods.

MethodUse
IAM database authenticationShort-lived tokens instead of passwords for RDS, Aurora and Redshift
Credentials in Secrets ManagerPasswords with automatic rotation, referenced by jobs and connections
Federation through Identity CenterUsers sign in to Redshift with their corporate identity
Scenario questions

Database authentication

Exam skills 4.1.3 · 4.2.2

Choose the authentication method for each requirement.

Log in to try this activity Interactive activities are free with an account.
Worked example

Per-user access with corporate identities

Analysts sign in to Quick Sight and Redshift with shared database users, so audit logs cannot show who ran which query, and permissions cannot follow job roles. The team redesigns access as shown in the following table.

RequirementDesign
Sign in with corporate credentialsIAM Identity Center connected to the corporate identity provider
Access by job roleIdentity Center groups mapped to Redshift roles
Per-user audit of data accessTrusted identity propagation from Quick Sight to Redshift and Lake Formation
No shared passwordsShared database users removed

Each query in Redshift's audit log now carries the analyst's identity, and leavers lose access as soon as they are removed from the directory.

Check yourself

What does trusted identity propagation add to analytics services?

Show answer

Data access is authorised and audited per user, rather than per shared service role.

Exam Tips

Remember for the exam

  • Services use IAM roles, never long-term access keys.
  • For workforce single sign-on to analytics tools, use IAM Identity Center.
  • Trusted identity propagation authorises and audits data access per user.
  • For database access without stored passwords, use IAM database authentication.
  • EMR runtime roles give each job its own permissions.