Security in AWS

Introduction to AWS Identity and Access Management

  1. Authentication
  2. Authorization 
  3. Users
  4. Groups
  5. Password Policy
  6. Multifactor Authentication

Demo: Creating a User and Group (IAM)

Demo: Creating access Keys

Permissions and Policies

  1. Permissions(authorization) granted via policies
  2. Policies written in JSON
  3. Policy Types - Managed Policy : AWS managed, Customer managed Inline Policy
  4. Create policies via - Generator, Hand written policies
  5. Evaluation logic - Defaults to implicit deny, Explicit deny, Explicit allow

Amazon Resource Name:

Format Pattern:

  1. arn:partition:service:region:account-id:resourceType/resource
  2. arn:partition:service:region:account-id:resourceType:resource

Example ARNs

  1. arn:aws:iam::123456789012:user/bsmith
  2. arn:aws:s3:::mybucket/*
  3. arn:aws:rds:us-west-2:123456789012:db:mysql-db

Policies are collections of statements

Statements specify

  • Principal(resource-based policies) - resource-based policies
  • Actions 
    • ec2:RunInstances
    • s3:ListBucket
  • Resources
    • EC2 instances
    • S3 buckets (or objects)
  • Conditions 
    • Time of day
    • From specific IP address
    • Resource contains particular tag
    • Etc

Demo: Creating and Attaching Policies

Understanding Roles:

https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html

An IAM role is an IAM identity that you can create in your account that has specific permissions. An IAM role is similar to an IAM user, in that it is an AWS identity with permission policies that determine what the identity can and cannot do in AWS. However, instead of being uniquely associated with one person, a role is intended to be assumable by anyone who needs it. Also, a role does not have standard long-term credentials such as a password or access keys associated with it. Instead, when you assume a role, it provides you with temporary security credentials for your role session.

  • Alternate form of authentication
  • Uses temporary credenticals
  • Allow access from:
    • EC2 instance
    • AWS service
    • A user
    • Separate account
      • Third party
      • One you own

What not to do

  • Embed access keys in code
  • Embed in environment variables
  • Share with 
    • Third parties
    • Hundreds of enterprise users
    • Thousands(millions?) of web users

Demo: Creating Roles

Federated Users

  • Organizational users:
    • LEverage existing user directories:
      • LDAP
      • Active Directory
    • Temporary credentials
    • Single sign on
  • Web/mobile applications users:
    • Apps bypass backend APSs/proxies

Demo: managing an MFA Device

Resource Policies

  • Policies applied to a resource (not limited to):
    • Amazon Simple Storage Service (S3) bucket
    • Amazon DynamoDB table
    • Amazon Simple Queue Service (SQS) queue
  • Written in JSON
  • Can provide cross-account resource sharing
  • Can allow anonymous use

Use Case: Using Roles for Cross Account Access

Best Practices

  • Leverage groups
  • Grant least privilege
  • Implement strong password policy
  • Leverage roles for cross-account access
  • Use deny statements for added security
  • Never share credentials
  • Never email, print, or pubilsh to repos
  • Multiple accounts for isolation
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值