Abdullah Şamil Güser

Cloud Security and Access Management

Shared Responsibility Model, Compliance, Delegation, Federation (Lesson 115)

AWS Shared Responsibility Model

Identity and Access Management (IAM)

Credentials, MFA, Identity-based, Resources-based Policy (Lesson 116)

Best Practices for User Management

Access Management Methods

Policy Structure

Inline and Managed Policy, Amazon Resource Naming (ARN) Convention (Lesson 117)

Policy Documents in AWS

Types of Policies

Amazon Resource Naming (ARN)

Principal, Effect, Action, Resource, Not Clause (Lesson 118)

Policy Document Structure

Using Not Clauses

Conditional Access, Implicit Deny, Explicit Allow and Deny, Permission Boundary (Lesson 119)

Limit access to S3 buckets by IP

VPC Endpoint Only Access

Context Information in AWS Requests

Tag-Based Resource Access

Access Management Approaches

Role-Based Access Control (RBAC)

Attribute-Based Access Control (ABAC)

Policy Evaluation

IAM Roles, Cross-account access options (Lesson 120)

Application Access to AWS Resources : IAM Roles

Security Token Service (STS)

Role Concepts

  1. Access Policy: When you create a Role in IAM, you need to attach an Access Policy to it. Determines what the role can do (e.g., DynamoDB access).
  2. Trust Policy: Specifies who can assume the role (e.g., EC2 service, Lambda, another AWS account).

Recommendations and Use Cases

Cross-Account Access Scenarios

Same Account Access

Cross-Account Scenarios

Cross-Account Access Examples

  1. S3 Bucket Access:
    • Account B grants access to Account A through resource-based policies.
    • Account A delegates permission to its users or roles.
  2. Services Without Resource-Based Policies (e.g., DynamoDB, Kinesis):
    • Account B creates a role with necessary permissions.
    • Account B allows Account A to assume the role.
    • Account A users get temporary credentials via STS AssumeRole API.

Federation, SSO, SAML, Active Directory, AWS Organizations, Cognito (Lesson 121)

Corporate Identity Federation

Single Account Access

Federation Protocols (Identity Management Solutions)

AWS Organizations for Multiple Accounts

Internet Identity Federation with Amazon Cognito

Integrating Social Identities

Role Mapping and Access

Cognito - Supported Federation Protocols

Labs

Identity-based policy, Implicit Deny, Explicit Allow (Lesson 123)

  1. Create a new S3 bucket.
  2. Create a new IAM user (alice). Refer to Section 1.9 for how to create IAM users.
  3. Use aws configure --profile alice to set up Alice’s profile.
  4. Enter access key and secret access key from the downloaded CSV file.
  5. Run aws s3 ls --profile alice to list S3 buckets.
    • Expect an “access denied” error.
  6. Add AmazonS3ReadOnlyAccess permission to Alice.
  7. Alice can now view buckets from the management console.
  8. Try uploading a file using Alice’s profile.
     aws s3 cp text.txt s3://samil-demo --profile alice
    
  9. Expect an “access denied” error for ‘PutObject’, indicating no write access.

Policy Generator, Managed Policy, Versions, Groups (Lesson 124)

Grant write access to Alice to S3

  1. Select ‘policies’ from the IAM console then ‘create policy’
    • Select S3 service, choose all S3 actions.
    • From Resources, add ARN to bucket : samil-demo and samil-demo/*
    • Name the policy as custom-s3-access
  2. Edit the Policy JSON, remove the first statement.
    • Notice that now you have 2 versions of the policy.
  3. Assign Policy to Alice: Attach the newly created custom policy ‘custom-s3-access’.
  4. Alice can now upload files to S3.

Grant Same Permissions to Another User

  1. Create a new user ‘bob’ and configure CLI.
  2. Remove the existing permissions from Alice.
  3. Create a new user group ‘ProjectAlpha’ and attach the custom policy and ‘AmazonS3ReadOnlyAccess’ policy.
  4. Add both Alice and Bob to the group.
  5. Both Alice and Bob can now read and write to the bucket.

Resource-based policy, Policy Generator, Principals (Lesson 126)

  1. Remove the permissions that are attached to the ‘ProjectAlpha’ group.
  2. Open S3 console with ‘myadmin’ session. Go to your bucket and select ‘Permissions’.
  3. Select ‘Bucket Policy’ and click ‘Policy Generator’.
    • Type of Policy: S3 Bucket Policy.
    • Effect: Allow.
    • Principal: * (wildcard)
    • AWS Service: Amazon S3
    • Actions: All actions.
    • ARNs: Add bucket ARN : arn:aws:s3:::samil-demo,arn:aws:s3:::samil-demo/*
    • Click ‘Add Statement’ and then ‘Generate Policy’.
    • Copy the generated policy and paste it in the bucket policy editor.
  4. Try to add ProjectAlpha ARN as a Principal to the policy.
     "Principal": {
       "AWS": "arn:aws:iam::587865868937:group/ProjectAlpha"
     }
    
    • Expect an error: Invalid principal in policy.
  5. Confirm that both users can read the specified bucket.
     aws s3 ls s3://samil-demo --profile alice