æè¡2課ã®æ¾ç°ã§ããããã«ã¡ã¯ã
Fleet Managerã®ãªã¢ã¼ããã¹ã¯ãããï¼RDPï¼æ¥ç¶ã«é¢ããå°ãã¿ãããã¤ãã¾ã¨ãã¾ããã®ã§ãç´¹ä»ãã¾ãã
- Fleet Manager is ä½
- RDPæ¥ç¶ãã¦ã¿ã
- ã³ãããã§ããªãåé¡ã®å¯¾å¦æ¹æ³
- ãªã¢ã¼ããã¹ã¯ãããæ¥ç¶ã«å¿ è¦ãªIAM権é
- ãããã«
Fleet Manager is ä½
ç°¡åã«ã¾ã¨ããã¨ãFleet Managerã¯AWS Systems Managerï¼ä»¥ä¸ãSSMï¼ã®æ©è½ã®ä¸ã¤ã§ãSSMã®ããã¼ã¸ããã¼ãï¼ã¨ã¼ã¸ã§ã³ããã¼ã«ãã¤ã³ã¹ãã¼ã«ãããµã¼ãã¼ï¼ã«å¯¾ãAWSããã¸ã¡ã³ãã³ã³ã½ã¼ã«ããæ§ã ãªã¿ã¹ã¯ãå®è¡ã§ããã¨ãããã®ã§ããRDPæ¥ç¶ã¯ãã®ãã¿ã¹ã¯ãã«å«ã¾ãã¦ããããããå®è¡ãããã¨ã§Webãã©ã¦ã¶ä¸ã§ã®OSãã°ã¤ã³ãå¯è½ã¨ããããã§ããã
å ·ä½çã«ã¯ä»¥ä¸ã«è¨è¼ããã¦ããã®ã§ãããè¶ è¦ç´ããã¨ãæ¬æ¥OSãã°ã¤ã³ããªãã¨ã§ããªãæä½ãããã¸ã¡ã³ãã³ã³ã½ã¼ã«ããå¯è½ã«ãªãã¨ããæãã§ããã
ã¡ãªã¿ã«ããã¼ã¸ããã¼ãã¯ãSSMã®ã³ã³ã½ã¼ã«ã§ã¯ä»¥ä¸ã®æ§ã«è¡¨ç¤ºããã¾ãã
RDPæ¥ç¶ãã¦ã¿ã
Windows OSã®EC2ã¤ã³ã¹ã¿ã³ã¹ã対象ã¨ãã¦ãFleet ManagerããRDPæ¥ç¶ãã¦ã¿ã¾ãã
åææ¡ä»¶
Fleet ManagerããRDPæ¥ç¶ããã«ã¯ã以ä¸ã®åææ¡ä»¶ãæºããå¿ è¦ãããã¾ãã
- 対象ã®ã¤ã³ã¹ã¿ã³ã¹ãã¤ã³ã¿ã¼ãããã«ã¢ã¯ã»ã¹å¯è½ãªãã¨
- å³å¯ã«ã¯ãSSMã¨ã³ããã¤ã³ãã«ã¢ã¯ã»ã¹å¯è½ãªãã¨ã
- ã¤ã³ã¿ã¼ãããã¢ã¯ã»ã¹ã®ä»£æ¿ã¨ãã¦ãVPCã¨ã³ããã¤ã³ãçµç±ã§ã®ã¢ã¯ã»ã¹ãå¯è½ï¼åèï¼
- 対象ã®ã¤ã³ã¹ã¿ã³ã¹ã«SSM Agentãã¤ã³ã¹ãã¼ã«ããã¦ãããã¨
- Windowsã¤ã³ã¹ã¿ã³ã¹ã¯åºæ¬ããªã¤ã³ã¹ãã¼ã«æ¸ï¼åèï¼
- è足ã§ãããæ¥æ¬èªçã®å ¬å¼ããã¥ã¡ã³ãã ã¨Windows Server 2022ã¯ããªã¤ã³ã¹ãã¼ã«ããã¦ãªããã¨ã«ãªã£ã¦ãã¾ãããå®éã«ã¯ããªã¤ã³ã¹ãã¼ã«ããã¦ãã¾ããï¼2022/07/19æç¹ï¼
- 対象ã®ã¤ã³ã¹ã¿ã³ã¹ã«å¿
è¦ãªIAMã¤ã³ã¹ã¿ã³ã¹ãããã¡ã¤ã«ãé©ç¨ããã¦ãããã¨
- ããã¼ã¸ãããªã·ã¼
AmazonSSMManagedInstanceCore
ã使ãã®ãç°¡å
- ããã¼ã¸ãããªã·ã¼
äºåæºåã®è©³ç´°ã¯ä»¥ä¸ã®ããã¥ã¡ã³ãããåç §ãã ããã
äºåæºåãå®äºããã¨ãFleet Managerã®Managed nodesã«ã¤ã³ã¹ã¿ã³ã¹ã表示ãããããã«ãªãã¾ãã
æ¥ç¶ãã¦ã¿ã
RDPæ¥ç¶ãããã¤ã³ã¹ã¿ã³ã¹ãé¸æãããNode actionsãâãConnect with Remote DesktopãâID/ãã¹ã¯ã¼ãããã¼ãã¢ãé¸æãã¦ãConnectãã¨ããã¨ã¤ã³ã¹ã¿ã³ã¹ã«æ¥ç¶ã§ãã¾ãã
ã¨ããæãã§ãç¡äºã«RDPæ¥ç¶ã§ãã¾ããã
ãã¦é·ããªã£ã¦ãã¾ãã¾ããããããã¾ã§ãåç½®ãã«ãªãã¾ããããããæ¬é¡ã«å ¥ãã¾ãããå°ãã¿ãªã®ã§ãµã¯ãã¨çµãã£ã¦ãã¾ã£ã¦ãã容赦ãã ããã
ã³ãããã§ããªãåé¡ã®å¯¾å¦æ¹æ³
ç¡äºã«RDPæ¥ç¶ããå¾ã¯ãå½ç¶ã§ããOSä¸ã§ä½ããã®ä½æ¥ãè¡ãã¨æãã¾ããããã§éè¦ãªã®ããããã¼ã«ã«âãªã¢ã¼ããµã¼ãã¼ã¸ã®ã³ãããã§ãããã©ãããã§ãã
ä¾ãã°ã§ãããPowershellãã´ãªã´ãªä½¿ãä½æ¥ã§ããããµã¼ãã¼ã«RDPæ¥ç¶ãããæå ã®ç«¯æ«ã§æºåããã¹ã¯ãªãããã³ããã§ããªã...ãªãã¦ãã¨ã«ãªãã¨ã ãã¶æ²æ¨ã§ãã
ãããªæã¯ãã©ã¦ã¶ã®è¨å®ãå¤æ´ãã¦ã¿ã¾ããChromeã®å ´åã以ä¸ã試ãã¦ã¿ã¦ãã ããã
chrome://settings/content
ã«ã¢ã¯ã»ã¹âããã¹ã¦ã®ãµã¤ãã«ä¿åããã¦ãã権éã¨ãã¼ã¿ã表示ãâããµã¤ããã§ap-northeast-1.console.aws.amazon.com
ã¨ããé¸æâãã¯ãªãããã¼ãããã許å¯ãã«å¤æ´
Chrome以å¤ã®ãã©ã¦ã¶ã«é¢ãã¦ãããFirefoxãã¯ãªãããã¼ãã許å¯ãã¨ãã§ã°ã°ãã°åºã¦ããããããªããã¨æãã¾ãï¼ã¶ãæã
ãªã¢ã¼ããã¹ã¯ãããæ¥ç¶ã«å¿ è¦ãªIAM権é
ãã¡ãã®å ¬å¼ããã¥ã¡ã³ãã«ããéããFleet ManagerããRDPæ¥ç¶ãè¡ãã«ã¯ã以ä¸ã®ã¢ã¯ã·ã§ã³ã許å¯ããå¿ è¦ãããã¾ãã
Systems Manager ããã³ Session Manager ã«å¿ è¦ãª AWS Identity and Access Management (IAM) ã¢ã¯ã»ã¹è¨±å¯ã«å ãã¦ãã³ã³ã½ã¼ã«ã¸ã®ã¢ã¯ã»ã¹ã«ä½¿ç¨ããã¦ã¼ã¶ã¼ã¾ãã¯ãã¼ã«ã¯ã以ä¸ã®ã¢ã¯ã·ã§ã³ã許å¯ãã¦ããå¿ è¦ãããã¾ãã
ssm-guiconnect:CancelConnection
ssm-guiconnect:GetConnection
ssm-guiconnect:StartConnection
調ã¹ã¦ã¿ã¦ç¥ã£ãã®ã§ãããRDPæ¥ç¶ã®ããã®ã¢ã¯ã·ã§ã³ã¯ãssm
ã§ã¯ãªãssm-guiconnect
ãµã¼ãã¹ã«å±ãããæ±ãã¨ãªã£ã¦ãã¾ãã
IAMããªã·ã¼ã®ãã¸ã¥ã¢ã«ã¨ãã£ã¿ãè¦ã¦ã¿ãã¨ããGUI Connectãããµã¼ãã¹ã¨ããæ¬ãã§ç¨æããã¦ãã¾ãã
ããã¯ã¤ã¾ãRDPæ¥ç¶ã«å¿
è¦ãªã¢ã¯ã·ã§ã³ãssm:*
ã«å«ã¾ããªããã¨ãæå³ãã¾ãã®ã§ãAWS管çããªã·ã¼ã§ããAmazonSSMFullAccess
ãä»ä¸ãããã¦ã¼ã¶ã¼ã§ããFleet Managerããã®RDPæ¥ç¶ã¯ã§ããªãã¨ãããã¨ã«ãªãã¾ãã
ãã ãä»å¾ã®ã¢ãããã¼ãã§æ¹ä¿®ãããå¯è½æ§ãååã«ããã¾ãã®ã§ãããã¾ã§æ¬è¨äºå·çæç¹ï¼2022å¹´7æï¼ã§ã®æ å ±ã¨ãç解ãã ããã
ãµã³ãã«ã®IAMããªã·ã¼â
RDPæ¥ç¶ãå«ãFleet Managerã®å©ç¨æ¨©éãä»ä¸ããIAMããªã·ã¼ã®ãµã³ãã«ã§ãã
{ "Version":"2012-10-17", "Statement":[ { "Sid":"EC2", "Effect":"Allow", "Action":[ "ec2:CreateTags", "ec2:DeleteTags", "ec2:DescribeInstances", "ec2:DescribeTags" ], "Resource":"*" }, { "Sid":"General", "Effect":"Allow", "Action":[ "ssm:AddTagsToResource", "ssm:DescribeInstanceAssociationsStatus", "ssm:DescribeInstancePatches", "ssm:DescribeInstancePatchStates", "ssm:DescribeInstanceProperties", "ssm:GetCommandInvocation", "ssm:GetServiceSetting", "ssm:GetInventorySchema", "ssm:ListComplianceItems", "ssm:ListInventoryEntries", "ssm:ListTagsForResource", "ssm:ListCommandInvocations", "ssm:ListAssociations", "ssm:RemoveTagsFromResource" ], "Resource":"*" }, { "Sid":"SendCommand", "Effect":"Allow", "Action":[ "ssm:GetDocument", "ssm:SendCommand", "ssm:StartSession" ], "Resource":[ "arn:aws:ec2:*:account-id:instance/*", "arn:aws:ssm:*:account-id:managed-instance/*", "arn:aws:ssm:*:account-id:document/SSM-SessionManagerRunShell", "arn:aws:ssm:*:*:document/AWS-PasswordReset", "arn:aws:ssm:*:*:document/AWSFleetManager-AddUsersToGroups", "arn:aws:ssm:*:*:document/AWSFleetManager-CreateGroup", "arn:aws:ssm:*:*:document/AWSFleetManager-CreateUser", "arn:aws:ssm:*:*:document/AWSFleetManager-CreateUserInteractive", "arn:aws:ssm:*:*:document/AWSFleetManager-CreateWindowsRegistryKey", "arn:aws:ssm:*:*:document/AWSFleetManager-DeleteGroup", "arn:aws:ssm:*:*:document/AWSFleetManager-DeleteUser", "arn:aws:ssm:*:*:document/AWSFleetManager-DeleteWindowsRegistryKey", "arn:aws:ssm:*:*:document/AWSFleetManager-DeleteWindowsRegistryValue", "arn:aws:ssm:*:*:document/AWSFleetManager-GetFileContent", "arn:aws:ssm:*:*:document/AWSFleetManager-GetFileSystemContent", "arn:aws:ssm:*:*:document/AWSFleetManager-GetGroups", "arn:aws:ssm:*:*:document/AWSFleetManager-GetPerformanceCounters", "arn:aws:ssm:*:*:document/AWSFleetManager-GetUsers", "arn:aws:ssm:*:*:document/AWSFleetManager-GetWindowsEvents", "arn:aws:ssm:*:*:document/AWSFleetManager-GetWindowsRegistryContent", "arn:aws:ssm:*:*:document/AWSFleetManager-RemoveUsersFromGroups", "arn:aws:ssm:*:*:document/AWSFleetManager-SetWindowsRegistryValue" ], "Condition":{ "BoolIfExists":{ "ssm:SessionDocumentAccessCheck":"true" } } }, { "Sid":"TerminateSession", "Effect":"Allow", "Action":[ "ssm:TerminateSession" ], "Resource":"*", "Condition":{ "StringLike":{ "ssm:resourceTag/aws:ssmmessages:session-id":[ "${aws:userid}" ] } } }, { "Sid":"KMS", "Effect":"Allow", "Action":[ "kms:GenerateDataKey" ], "Resource":[ "arn:aws:kms:region:account-id:key/key-name" ] }, { "Sid":"RDP", "Effect": "Allow", "Action": [ "ssm-guiconnect:CancelConnection", "ssm-guiconnect:GetConnection", "ssm-guiconnect:StartConnection" ], "Resource": "*" } ] }
ã¡ãªã¿ã«å
ãã¿ã¯ãã¡ãã丸ãã¯ãªã§ãã
ãµã³ãã«ã®IAMããªã·ã¼â¡
AWS管çããªã·ã¼ã§ããAmazonSSMFullAccess
ã«RDPæ¥ç¶ã®æ¨©éã追å ãããã®ã§ããéè¦ç¡ããã
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "cloudwatch:PutMetricData", "ds:CreateComputer", "ds:DescribeDirectories", "ec2:DescribeInstanceStatus", "logs:*", "ssm:*", "ec2messages:*" ], "Resource": "*" }, { "Effect": "Allow", "Action": "iam:CreateServiceLinkedRole", "Resource": "arn:aws:iam::*:role/aws-service-role/ssm.amazonaws.com/AWSServiceRoleForAmazonSSM*", "Condition": { "StringLike": { "iam:AWSServiceName": "ssm.amazonaws.com" } } }, { "Effect": "Allow", "Action": [ "iam:DeleteServiceLinkedRole", "iam:GetServiceLinkedRoleDeletionStatus" ], "Resource": "arn:aws:iam::*:role/aws-service-role/ssm.amazonaws.com/AWSServiceRoleForAmazonSSM*" }, { "Effect": "Allow", "Action": [ "ssmmessages:CreateControlChannel", "ssmmessages:CreateDataChannel", "ssmmessages:OpenControlChannel", "ssmmessages:OpenDataChannel" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "ssm-guiconnect:CancelConnection", "ssm-guiconnect:GetConnection", "ssm-guiconnect:StartConnection" ], "Resource": "*" } ] }
ãµã³ãã«ã®IAMããªã·ã¼â¢
RDPæ¥ç¶ä»¥å¤ä½ãããããï¼ã¨ããæ½ã人åãã
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm-guiconnect:CancelConnection", "ssm-guiconnect:GetConnection", "ssm-guiconnect:StartConnection", "ssm:ResumeSession", "ssm:DescribeSessions", "ssm:TerminateSession", "ssm:StartSession", "ssm:DescribeInstanceProperties", "ssm:GetInventorySchema", "ssm:ListInstanceAssociations", "ec2:describeInstances", "ec2:GetPasswordData" ], "Resource": "*" } ] }
ãããã«
ssm-guiconnect
ã®åå¨ã¯åãã¦ç¥ã£ãã®ã§ã¸ãï½ã£ã¦æãã§ãããIAMè¨è¨ãããã¨ãã¯ãç¥ããªãã¨æ¡å¤ããããã¤ã³ãã«ãªãããããã¾ãããã
ã¨ãããã¨ã§ãããããããªãã¿ã§ããç´¹ä»ã§ããã
æ¾ç° æ¸(è¨äºä¸è¦§)
2021å¹´10æå
¥ç¤¾ãæ£æ©ãå¾æã§ãã