Easily add Azure AD Authentication to any app running in Kubernetes (Get your EAK on)
Перейти к файлу
Isabelle Bersano f95096ea62
fix: updated job output for version number to docker build (#102)
2023-04-03 14:29:39 -04:00
.github/workflows fix: updated job output for version number to docker build (#102) 2023-04-03 14:29:39 -04:00
AutoGeneratedFiles rename folders, remove unused files, update documentation, update automation script 2021-10-12 18:41:16 +00:00
AutomationScripts Workflow Updates and Container Versioning Strategy (#93) 2023-04-03 10:51:08 -04:00
TemplateFiles Fixing a couple of oddball nginx behavior issues 2021-12-01 08:04:21 -05:00
charts/easyauth-proxy update version number 2022-02-25 19:10:02 +00:00
docs Workflow Updates and Container Versioning Strategy (#93) 2023-04-03 10:51:08 -04:00
sample fix exception error when header settings mismatch 2022-02-15 17:49:59 -08:00
src Fixing issue with invalid header names 2022-02-17 09:53:37 -05:00
.gitignore dotnet6 progress 2021-10-25 16:29:23 -04:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2019-11-15 19:30:07 -08:00
Dockerfile update docker image repo for testing 2021-11-29 10:15:30 -05:00
LICENSE Initial LICENSE commit 2019-11-15 19:30:09 -08:00
README.md clarifying quickstart documentation 2022-02-12 00:37:33 +00:00
SECURITY.md Initial SECURITY.md commit 2019-11-15 19:30:09 -08:00
main.sh Workflow Updates and Container Versioning Strategy (#93) 2023-04-03 10:51:08 -04:00
test.sh Add test workflow for PRs (#88) 2023-01-24 16:40:56 -05:00

README.md

Build, test, push to multiple registries and e2e test

EasyAuth for Kubernetes

EasyAuth for Kubernetes is a simple Identity and Access Management module that allows you to protect applications in a kubernetes cluster without having to modify application source code.

Similar to the security features of Azure App Service, EasyAuth for Kubernetes is designed to do four basic functions:

  • Authenticate callers via Azure Active Directory
  • Authorize callers based on required roles or scopes
  • Manage authenticated sessions
  • Inject basic information about the user into the request received by your application

EasyAuth uses Azure AD v2 endpoints, which allows you leverage all features of the Microsoft Identity Platform.

A few of these features include:

  • Authenticating employees or business partners
  • Azure AD B2C custom policies for complex identity flows
  • MFA and conditional access
  • Role-based access control
  • Multitenant applications

Concepts

EasyAuth for Kubernetes integrates with your cluster's ingress controller. When a request is received, the EasyAuth service validates the user's session. If the caller isn't authenticated yet, the service will route the caller to the appropriate Azure AD tenant to sign in. The service then starts a managed session for the user and adds a cookie to the response that will be used to authenticate the caller on future requests.

Note: The authentication flow supports single sign on, so the user will not be prompted for credentials if they are already signed via the Azure AD tenant.

Basic Flow

The diagram above conveys the basic interaction between the components for a user accessing a web application. For simplicity, this shows a single protected application and a single EasyAuth service. You can, however, configure as many EasyAuth services as you would like within your cluster. Each service can protect one or more applications, and have different Azure AD tenant configurations.

For example, you could have one set of applications accessible only by internal employees and another set of applications for customers or external users all running in the same cluster and using the same ingress controller.

Quickstart using Azure Cloud Shell

Try it out by setting up a new AKS cluster with a sample application that uses EasyAuth. Launch Cloud Shell, then run the following bash commands:

git clone https://github.com/Azure/EasyAuthForK8s.git
cd EasyAuthForK8s

# Hint - run bash main.sh -h for parameter help
# Note: AAD app name (-a) must be *globally* unique
# Note: Cluster name (-c) must be unique
# Estimated Runtime: 15 minutes
bash main.sh -a {insert-unique-app-name} -c {insert-unique-cluster-name} -r easy-auth -e email@contoso.com -l eastus

What the quickstart script does:

  1. Deploy an AKS cluster
  2. Install an Nginx Ingress controller
  3. Configure DNS for the cluster public IP
  4. Register an AAD Application
  5. Install Cert Manager
  6. Deploy the Easy Auth Proxy
  7. Deploy the Application

Documentation

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.