AWS - IAM

news2024/9/27 12:15:03

AWS IAM

自用笔记。

Terms

IAM - Identity and Access Management, a global service

  • it gives:

    • Centralized control of AWS account
    • Shared access to AWS account
    • Granular permissions
    • Identity Federation, i.e., Facebook, LinkedIn etc.
  • it allows:

    • Multi-Factor Authentications
    • Temporary access for users/devices and services
    • Set up own password rotationpolicy.
    • Integrates with many different AWS services
    • Suppor PCI DSS compliance

Root Account - created by default, shouldn’t be used or shared

Users - people within the organizations, and can be grouped. Users don’t have to belong to a group, and also can be belong to multiple groups

Groups - a collection of users under one set of permissions. Only contain users, not other groups

Roles - can be assigned to users, applications, and services to give access to AWS resources

AKA IAM roles, that will assign permissions to AWS services. Common roles: EC2 Instance Roles, Lambda Function Roles, Roles for CloudFormation

Policy - a (JSON) documnet that defines one or more permissions. It can be attached to a user, group or a role. The policy defines the permissions of the users. In AWS, the least privilege principle should be applied.

Practice Creating and Managing Users/Groups

  1. access user section

    在这里插入图片描述

  2. create user

    1. provide user details

      在这里插入图片描述

    2. grant user permissions

      在这里插入图片描述

    3. review and create

      在这里插入图片描述

      在这里插入图片描述

      在这里插入图片描述

  3. create user groups

    1. select group & click on create group

      在这里插入图片描述

    2. Name the group, add useer and attach policy

      在这里插入图片描述

      Scroll to the end of page and create group.

Alias

alias, after setting account with alias, IAM user can sign in using the alias address, can only be set under root account.

It can be viewed and changed on dashboard:

在这里插入图片描述

在这里插入图片描述

IAM Policy

Policy can be inherited from different group, i.e., if an user is in both group A and group B, then this user will have policy A from group A and policy B from group B attached to this user.

The format of policy looks like:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "service-prefix:action-name",
      "Resource": "*",
      "Condition": {
        "DateGreaterThan": { "aws:CurrentTime": "2020-04-01T00:00:00Z" },
        "DateLessThan": { "aws:CurrentTime": "2020-06-30T23:59:59Z" }
      }
    }
  ]
}

A policy is consists of:

  • version number - policy language version, always include “2012-10-17” (required)

    2008-10-17 exists on older policy, but do not use this value as its outdated

  • id: an identifier for the policy(optional)

  • Statements: one or more individual statements (required)

statements consists of:

  • sid: an identifier for the statement (optional)

  • Effect: whether allow/deny access

  • Principal: account/user/role to which this polic applied to

    required in resource-based policies

  • Action: list of actions this policy allows or denies

  • NotAction: all the actions except listed actions this policy allows or denies

    A statement must include Action or NoAction

  • Resource: list of resources to which the actions applied to

  • NoResource: similar to NoAction

    A statement must include Resource or NoResource

  • Condition: conditions for when this policy is in effect (optional)

IAM Password and MFA

Right now the password has default value, and can be changed under account settings:

在这里插入图片描述

MFA can be generated under users > security credentials:

在这里插入图片描述

Access key can be found below MFA.

Access Key

There a 3 way to access AWS:

  • AWS Management Console(website), protected by password + MFA
  • AWS Command Line Interface(CLI), protected by access keys
  • AWS Software Developer Kit(SDK), protected by access keys

Access keys are generated through the AWS console, the secret access key is only shown during the process of creation, if user loses it, the user will need to create it again.

Users manage their own access keys, DO NOT SHARE

Connect process:

  1. download and install CLI

    Download: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

    on Mac:

    $ curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
    $ sudo installer -pkg AWSCLIV2.pkg -target /
    
  2. Create access key using IAM User, DO NOT use root account for it.

  3. configure aws cli:

    ➜  ~ aws configure
    AWS Access Key ID [None]: ......
    AWS Secret Access Key [None]: ......
    Default region name [None]: us-east-1
    Default output format [None]:
    ➜  ~ aws iam list-users
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    {
        "Users": [
            {
                "Path": "/",
                "UserName": "GA",
                "UserId": "........",
                "Arn": "arn:aws:iam::.......",
                "CreateDate": "2023-01-21T08:20:10+00:00",
                "PasswordLastUsed": "2023-01-21T11:30:22+00:00"
            }
        ]
    }
    

Alternative: AWS Cloud Shell (not global): https://docs.aws.amazon.com/general/latest/gr/cloudshell.html

IAM Security Tools

  • IAM Credentials Report (account-level)
  • IAM Access Advisor (user-level)

IAM Guidelines & Best Practices

  • Don’t use the root account except for AWS account setup
  • One physical user = One AWS user
  • Assign users to groups and assign permissions to group
  • Create a strong password policy
  • Use and enforce the use of Multi Factor Authentication(MFA)
  • Create and use Roles for giving permissions to AWS services
  • Use Access Keys for Programmatic Access (CLI/SDK)
  • Audit permissions of account with the IAM Credentials Report
  • Never share IAM users & Access Keys

Questions:

  1. In AWS, what is IAM used for (choose 3)

    • Assigning permissions, to allow and deny access to AWS resources
    • Managing access to AWS Services
    • Creating and managing users and groups
  2. Which of the following is NOT a feature of IAM

    • Allows you to set up biometric authentication, so that no passwords are required
  3. Which IAM entity can you use to delegate access to trusted entities such as IAM users, applications, or AWS services such as EC2?

    • IAM Role

    You can use IAM roles to delegate access to IAM users managed within your account, to IAM users under a different AWS account, to a web service offered by AWS such as Amazon Elastic Compute Cloud (Amazon EC2), or to an external user authenticated by an external identity provider (IdP) service that is compatible with SAML 2.0 or OpenID Connect, or a custom-built identity broker. IAM Roles.

  4. True or False? AWS recommends that EC2 instances have credentials stored on them so that the instances can access other resources (such as S3 buckets).

    • False
  5. Which is the best way to enable S3 read-access for an EC2 instance?

    • Create an IAM role with read-access to S3 and assign the role to the EC2 instance
  6. Which of the following can you use to test that an IAM policy attached to a user, group or role works as expected?

    • IAM Policy Simulator
  7. What is an IAM Policy?

    • A JSON document which defines one or more permissions
  8. What is a proper definition of an IAM Role?

    • An IAM entity that defines a set of permissions for making requests to AWS services, and will be used by an AWS service
  9. Which of the following is an IAM Security Tool?

    • IAM Credentials Report
  10. Which answer is INCORRECT regarding IAM Users?

    • IAM Users access AWS services using root account credentials
  11. Which of the following is an IAM best practice?

    • Don’t use the root user account
  12. What are IAM Policies?

    • JSON documents that define a set of permissions for making requests to AWS services, and can be used by IAM Users, User Groups, and IAM Roles
  13. Which principle should you apply regarding IAM Permissions?

    • Grant least privilege
  14. What should you do to increase your root account security?

    • Enable Multi-Factor Authentication (MFA)
  15. IAM User Groups can contain IAM Users and other User Groups.

    • False

    IAM User Groups can not be part of other User Groups.

  16. An IAM policy consists of one or more statements. A statement in an IAM Policy consists of the following, EXCEPT:

    • Version

    Version is part of the IAM Policy itself, not the statement.

  17. According to the AWS Shared Responsibility Model, which of the following is AWS responsibility?

    • AWS Infrastructure

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/175425.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

20230121解决AIO-3568J开发板无法刷机以及串口异常的问题

20230121解决AIO-3568J开发板无法刷机以及串口异常的问题 2023/1/21 22:31 一片比较旧的AIO-3568J开发板,症状: 1、无法刷机&启动。【Loader模式 & MASKROM模式】 2、串口输出乱码! (一)刷机问题的解决&#x…

一起自学SLAM算法:7.3 估计理论

连载文章,长期更新,欢迎关注: 不管是用贝叶斯网络还是因子图,一旦SLAM问题用概率图模型得到表示后,接下来就是利用可观测量(和)推理不可观测量(和),也就是说S…

初识C语言(上)

写在前面 我们正式开始接触到C语言,这是我在学习过C语言后重新写的博客,我把之前的稍微优化了一下,希望能用更加朴素的语言和大家分享,我希望给大家带来一个可以看的懂,理论和实践并行的内容.当然里面也会存在一些错误和不恰当的地方,还请诸位指正. 为何学习C语言 我想从两个…

mac 疑难问题汇总

macos 更改zsh到bash查看当前系统有哪些bash命令行:cat /etc/shells切换成bash命令行:chsh -s /bin/bashmac触摸屏轻点设置Mac通过crontab设置定时任务报错Operation not permitted1、系统偏好设置->安全性和隐私->完全磁盘访问权限2、解除锁定允许…

【双向链表】java代码实现

前言: 大家好,我是良辰丫🍓🍓🍓,上一篇文章我和大家一起去探索了单链表的知识世界,今天我们去接触双向链表,什么?没听错,就是双向链表,比单链表更…

UE INI文件操作 INI File Operation [ Read / Write ] 插件说明

在 Windows 平台上的 INI 文件读写操作 1. Write INI String 输入: Directory: 选择保存目录 Project Directory : 当前项目目录Project Content Directory:当前项目 Content 目录Project Config Directory:当前项目…

JVM内存区域的划分

根据 JVM 规范,JVM 内存共分为虚拟机栈、堆、方法区、程序计数器、本地方法栈五个部分。 程序计数器(线程私有): 是当前线程所执行的字节码的行号指示器,每条线程都要有一个独立的程序计数器,这类内存也称为…

Java基础08:面向对象进阶(上)

Java基础08:面向对象进阶(上)一、static1. 静态变量2. 静态方法3. 工具类4. static注意事项5. 重新认识main方法二、继承1. 继承的概念2. 继承的特点3. 继承中访问成员变量4. 继承中访问成员方法(方法重写)5. 继承中访…

给大家准备了程序员专属红包封面,审核通过后我哭了,太心酸了(┬_┬)

大家好,我是小悟 今天就是除夕了,也就是大年三十,小伙伴们应该都回家了吧,小悟祝大家新年快乐,身体健康,万事如意,兔飞猛进哦。 春节临近,收到微信定制红包封面并送了四千个名额的…

【深度学习】详解 MoCo

目录 摘要 一、引言 二、相关工作 三、方法 3.1 Contrastive Learning as Dictionary Look-up 3.2 Momentum Contrast 3.3 Pretext Task 四、实验 4.1 Linear Classification Protocol 总结 ☆ 实现 参考资料 Title:Momentum Contrast for Unsupervised…

AlmaLinux 9 安装Kasm Workspaces

今天尝试一下AlmaLinux 9 安装Kasm Workspaces。 前提条件 安装了Docker和Docker Compose,已经最新版本要求, docker 18.06 docker compose 2.1.1 创建一个Swap分区 下面的步骤将创建一个2千兆字节(2048MB)的交换分区。请根据…

我的创作纪念日——“永远相信美好的事情即将发生”

作者:非妃是公主 专栏:《程序人生》 个性签:顺境不惰,逆境不馁,以心制境,万事可成。——曾国藩 文章目录序与CSDN的往事机缘收获憧憬碎碎念序 第一次写创作纪念日的文章!哈哈哈哈,今…

一起自学SLAM算法:7.5 基于因子图的状态估计

连载文章,长期更新,欢迎关注: 虽然式(7-90)所示的完全SLAM系统可以用滤波方法求解,比如著名的Fast-SLAM实现框架。但是,贝叶斯网络表示下的完全SLAM系统能很方面地转换成因子图表示,…

字符串匹配: BF与KMP算法

文章目录一. BF算法1. 算法思想2. 代码实现二. KMP算法1. 算法思想概述2. 理解基于最长相等前后缀进行匹配3. 代码中如何实现next数组5. 代码实现6. next数组的优化一. BF算法 1. 算法思想 BF 算法, 即暴力(Brute Force)算法, 是普通的模式匹配算法, 假设现在我们面临这样一个…

24/365 java 观测线程状态 线程优先级

1.观测线程 JDK中定义的线程的六个状态 &#xff1a; 可以用getState()来观测线程 public static void main(String[] args) throws InterruptedException {Thread thread new Thread(()->{for (int i 0; i < 10; i) {try {Thread.sleep(100);} catch (InterruptedExc…

2023适合新手的免费编曲软件FL Studio水果21中文版

水果软件即FL Studio&#xff0c;这是一款较为专业的编曲软件&#xff0c;这款软件自带高品质打击乐、钢琴、弦乐以及吉他等107种乐器效果&#xff0c;内置了包括经典电子音色、合成利器3xosc、sytrus、slicex等多种插件&#xff0c;可以帮助音乐制作人创作不同的音乐曲风&…

数据结构进阶 哈希表

作者&#xff1a;小萌新 专栏&#xff1a;数据结构进阶 作者简介&#xff1a;大二学生 希望能和大家一起进步&#xff01; 本篇博客简介&#xff1a;模拟实现高阶数据结构 哈希表 哈希表 哈希桶哈希概念举例哈希冲突哈希函数哈希冲突的解决方式之一闭散列 --开放定址法哈希表的…

Python CalmAn(Calcium Imaging Analysis)神经生物学工具包安装及环境配置过程

文章目录CalmAn简介安装要求我的设备1>CalmAn压缩包解压&#xff08;caiman文件夹要改名&#xff09;2>conda创建虚拟环境3>requirements依赖包配置&#xff08;包括tensorflow&#xff09;4>caiman安装(mamba install)5>caimanmanager.py install6>PyCharm添…

51单片机独立按键

文章目录前言一、按键原理图二、代码编写三、模块化管理按键总结前言 本篇文章将带大家学习独立按键按键的基本操作。 独立按键式直接用I/O口线构成的单个按键电路&#xff0c;其特点是每个按键单独占用一根I/O口线&#xff0c;每个按键的工作不会影响其他I/O口线的状态。 一…

MongoDB学习笔记【part5】基于 MongoRepository 开发CURD

一、MongoRepository Spring Data 提供了对 mongodb 数据访问的支持&#xff0c;只需继承 MongoRepository 类&#xff0c;并按照 Spring Data 规范就可以实现对 mongodb 的操作。 SpringData 方法定义规范&#xff1a; 注意事项&#xff1a; 不能随便声明&#xff0c;必须要…