- vừa được xem lúc

AWS Certified Solutions Architect Professional - Identity Federation & Cognito

0 0 10

Người đăng: Quân Huỳnh

Theo Viblo Asia

Introduction

Quick note about AWS Identity Federation & Cognito. This post is a quick note from the course Ultimate AWS Certified Solutions Architect Professional of Stephane Maarek. The only purpose of this post is summary, if you want detail learning, please buy a Stephane Maarek's course.

image.png

Identity Federation

Give user outside of AWS permission to acess AWS resource in your account. We don't need create IAM user because we want manage user outside AWS.

image.png

Identity Federation work like that:

  • Fist, we setting trust relationship between Identity Provider and AWS. We tell AWS that it's fine to get an identity from this Provider.
  • Then the user perform a login to Identity Provider and receive back temporary credentials for AWS.
  • The user will access AWS using these temporary credentials.

image.png

Use cases

  1. We build the application (web/app) that needs access to AWS resource. For exampe, we need build the web app that allow only login user can upload file to AWS S3 bucket.

image.png

  1. A corporate has its own identity system and they want user their system. For example, a corporate use window server and have Active Directory identity system.

image.png

Identity Federation implement

Identity Federation have some way to implment:

  • SAML 2.0 Federation.
  • Custom Identity Borker.
  • Web Identity Federation.
  • Single Sign-On (SSO).

SAML 2.0 Federation

SAML stand for Security Assertion Markup Language 2.0 (SAML 2.0). Its primary role in online security is that enable you to access multiple web applications that using one set of login credentials.

Support integration with Microsoft Active Directory Federation Service (ADFS) or any SAML 2.0 that compatible identity provider (IdP) with AWS.

To receive temporary credentials, identity provider use the STS API AssumeRoleWithSAML.

Note, SAML is the old way, AWS SSO Federation is the new and simpler way. We will talk about this later.

Use SAML 2.0 Federation to receive credentials for AWS API Access

For example, The user login to Identity Provider use SAML 2.0 and receive back temporary credentials for access S3 bucket.

image.png

  1. User perform authentication to the IdP.
  2. IdP will verify user through an Identity Store.
  3. Return SAML Assertion if login is successful.
  4. The user can call the STS API AssumeRoleWithSAML, and STS will verify the assertion and return back temporary credentials if the assertion is trust.
  5. The user can access S3 bucket with temporary credentials.

Use SAML 2.0 Federation to receive credentials for AWS Console Access

The left side is similar to the above example, but the right side have a little different. We use SAML 2.0 Federation for access AWS Console.

image.png

  1. User perform authentication to the IdP.
  2. IdP will verify user through an Identity Store.
  3. Return SAML Assertion if login is successful.
  4. The user post to AWS sign-in url that end with /saml.
  5. Request temporary credentials.
  6. Return back for user a sign-in url.
  7. User redirect to AWS Console.

Use SAML 2.0 Federation with Active Directory

The right side is similar to the above example, but the left side have a little different. We use SAML 2.0 Federation with Active Directory for access AWS Console.

image.png

Custom Identity Borker

Use only if Identity Provider is not compatible with SAML 2.0, the broker application authenticates users, requests temporary credentials for users from AWS, and then provides them to the user to access AWS resources.

image.png

  1. User browse to a URL and access custom identity broker.
  2. Identity Borker authenticates users.
  3. If user able to login, Identity Borker will requests temporary credentials.
  4. Identity Borker return token or url back to user.
  5. User use token or url to access AWS resources.

This scenario is similar to the previous one (a mobile app that uses a custom authentication system), except that the applications that need access to AWS resources all run within the corporate network, and the company has an existing authentication system.

Note, Custom Identity Borker is the old way, AWS SSO Federation is the new and simpler way.

Web Identity Federation

With web identity federation, you don't need to create custom sign-in code or manage your own user identities. Instead, users of your app can sign in using a well-known external identity provider (IdP), such as Login with Amazon, Facebook, Google, or any other OpenID Connect Compatible IdP.

Without Cognito (Not recommended by AWS)

image.png

  1. Client login into the Third Party Identity Provider.
  2. The Web Identity Token return back to the clients.
  3. The client will call a STS AssumeRoleWithWebIdentity API with Web Identity Token to receive temporary credentials.
  4. The STS return back to client temporary credentials.
  5. Client access AWS resources.

With Cognito (Recommended by AWS)

With Cognito it's a little bit more secure and more simple.

image.png

  1. Client login into the Third Party Identity Provider.
  2. The ID Token return back to the clients.
  3. The app uses Amazon Cognito API operations to exchange the Login with ID Token.
  4. Amazon Cognito return back Cognito Token to client.
  5. The app requests temporary security credentials from AWS STS, passing the Amazon Cognito token.
  6. STS return back temporary credentials to client.
  7. The temporary security credentials can be used by the app to access any AWS resources.

End

End quick note about AWS Identity Federation & Cognito.

Bình luận

Bài viết tương tự

- vừa được xem lúc

PDF Export, cẩn thận với những input có thể truyền vào

Giới thiệu. Dạo gần đây mình tình cờ gặp rất nhiều lỗi XSS, tuy nhiên trang đó lại có sử dụng dữ liệu người dùng input vào để export ra PDF.

0 0 66

- vừa được xem lúc

Giới thiệu về AWS Batch

Khi sử dụng hệ thống cloud service, điều chúng ta thường phải quan tâm đến không chỉ là hiệu suất hoạt động (performance) mà còn phải chú ý đến cả chi phí bỏ ra để duy trì hoạt động của hệ thống. Chắn hẳn là hệ thống lớn hay nhỏ nào cũng đã từng phải dùng đến những instance chuyên để chạy batch thực

0 0 143

- vừa được xem lúc

Tìm hiểu về AWS KMS

1. AWS KMS là gì. Ở KMS bạn có thể lựa chọn tạo symetric key (khóa đối xứng) hoặc asymetric key (khóa bất đối xứng) để làm CMK (Customer Master Key). Sau khi tạo key thì có thể thiết đặt key policy để control quyền access và sử dụng key.

0 0 66

- vừa được xem lúc

AWS VPC cho người mới bắt đầu

Tuần này, tôi trình bày lại những gì tôi đã học được về Virtual Private Cloud (VPC) của Amazon. Nếu bạn muốn xem những gì tôi đã học được về AWS, hãy xem Tổng quan về DynamoDB và Tổng quan về S3. VPC là gì. Những điều cần lưu ý:.

0 0 84

- vừa được xem lúc

AWS Essentials (Phần 6): Guildline SNS Basic trên AWS

Tiếp tục với chuỗi bài viết về Basic AWS Setting, chúng ta tiếp tục tìm hiểu tiếp tới SNS (Simple Notification Service). Đây là một service của AWS cho phép người dùng setting thực hiện gửi email, text message hay push notification tự động tới mobile device dựa trên event người dùng setting phía AWS

0 0 145

- vừa được xem lúc

Sử dụng Amazon CloudFront Content Delivery Network với Private S3 Bucket — Signing URLs

Trong nhiều trường hợp, thì việc sử dụng CDN là bắt buộc. Mình đã trải nghiệm với một số CDN nhưng cuối cùng mình lựa chọn sử dụng AWS CloudFront.

0 0 117