AWS Identity and Access Management (IAM) and Security Services
Last updated
Was this helpful?
Last updated
Was this helpful?
Key security services are:
IAM: AWS resource access control
STS: Temporary AWS credentials
Cognito: End-user authentication for applications
Use fine-grained IAM policies to control access
Implement automatic rotation where possible
Monitor access through AWS CloudTrail
Regular audits of stored secrets
IAM provides secure control over AWS resource access through several key components:
Identity-Based Policies: Attached directly to IAM users, groups, or roles. Define what actions these identities can perform on which resources.
Resource-Based Policies: Attached to resources themselves (like S3 buckets). Define who can access the resource and what actions they can perform.
Policies are written in JSON format and consist of:
Services: AWS services being accessed (e.g., S3, EC2)
Actions: Specific operations allowed or denied (e.g., s3:GetObject)
Resources: Specific AWS resources the policy applies to
Effect: Whether to Allow or Deny the specified actions
AWS STS (Security Token Service) provides providers short-term AWS access temporary credentials for IAM users or federated users.
Supports federation with external Identity Providers
Enables cross-account access
Credentials are short-lived, reducing security risks
AssumeRole: For cross-account access
AssumeRoleWithWebIdentity: For federation with web identity providers
AssumeRoleWithSAML: For SAML-based federation
Application initiates request to identity broker
Broker authenticates against Active Directory
Authorization details are retrieved
STS generates temporary security token
Token is provided to application
Application uses token to access AWS services
Use Amazon Cognito when you need user authentication and authorization for web/mobile applications with these requirements:
User authentication and authorization
User management (sign-up, sign-in, password reset)
Social identity federation (login with Google, Facebook, etc.)
Security features like MFA and adaptive authentication
Easy integration with other AWS services
Scalable user directories that sync with enterprise identity providers
Support for OAuth 2.0 and OpenID Connect
Built-in compliance with regulations like GDPR
It's particularly suitable for serverless applications and when you want to avoid building custom authentication systems. However, consider alternatives if you need highly customized authentication flows or have strict enterprise identity management requirements.
Cognito effectively serves as a modern replacement for the traditional TVM pattern.
Provides basic AWS service access
No user identity storage
Limited functionality
Supports user registration and login
Maintains user account information
Enhanced security features
Secure storage for sensitive information
Passwords
API keys
Encryption keys
Other credentials
API-based access control through IAM
Automatic credential rotation for RDS databases
MySQL
PostgreSQL
Aurora
Eliminates need for hardcoded credentials
Integration with application code
Centralized secret management