Slide 1

Slide 1 text

Securing web applications using Azure AD https://damienbod.com

Slide 2

Slide 2 text

HTTPS Certificates TLS 1.2, 1.3 Session Protection, HTTP headers Hosting GDPR, Data breaches Infrastructure security Accounting, MFA and IAM Security governance Security focus of this talk Authentication and Authorization

Slide 3

Slide 3 text

Applications with users Applications with no user Secure APIs Azure continuous access evaluation

Slide 4

Slide 4 text

Modern security uses Zero Trust Zero Trust is a security strategy. • Verify explicitly (Never trust, always verify) • Least privilege (Blast radius) • Assume breach • Continuous evaluation

Slide 5

Slide 5 text

The old way…

Slide 6

Slide 6 text

Authentication is the new boundary

Slide 7

Slide 7 text

Identity and service principals User identities? Internal and external users Workload identities? In Microsoft Entra, workload identities are applications, service principals, and managed identities. Device identities? Device identities represent devices such as desktop computers, mobile, IoT sensors, and IoT managed devices.

Slide 8

Slide 8 text

Identity and service principals We authenticate identities! Human identities user + application is authenticated Machine identities Service principal, application, managed identity or device is authenticated

Slide 9

Slide 9 text

Multi/single tenant applications

Slide 10

Slide 10 text

Azure App registrations Never mix application permissions and delegated permissions in a single Azure App registration

Slide 11

Slide 11 text

Azure App registrations Require a secret, certificate or service managed identity when using admin permissions

Slide 12

Slide 12 text

Azure Enterprise applications Avoid multi-tenant Enterprise applications unless required. Grant consent with extreme caution!

Slide 13

Slide 13 text

Typical user session Authentication Authorization Signout Session

Slide 14

Slide 14 text

USE Standards Don’t implement this yourself, use certified libs, packages, tested

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

OAuth2 OpenID Connect Authentication Delegated Authorization

Slide 17

Slide 17 text

OpenID Connect • Standard, Specification • Authentication and Authorization • built on top of OAuth2 (access control) • Identity (Person can have n Identities) • UserInfo Endpoint http://openid.net/connect/

Slide 18

Slide 18 text

Open ID Connect (OIDC) is supported by almost all systems. Azure AD, Auth0, OKTA, IdentityServer4, google accounts, Openiddict, node-oidc-provider, Azure B2C

Slide 19

Slide 19 text

Typical user session Authentication Authorization Signout Session

Slide 20

Slide 20 text

Authentication with users

Slide 21

Slide 21 text

OpenID Connect Flows in Azure OAuth2 Flows with users http://openid.net/specs/openid- connect-core-1_0.html OpenID Connect Code flow + PKCE with client secret OpenID Connect Hybrid flow OpenID Connect Code flow + PKCE with no secret OAuth Device Flow

Slide 22

Slide 22 text

OpenID Connect Authorization Code flow + PKCE + secret • Server to server applications with User • Can keep secrets, is trusted • Client is authenticated • response_type = code

Slide 23

Slide 23 text

OIDC Authorization Code flow

Slide 24

Slide 24 text

Microsoft.Identity.Web https://github.com/damienbod/AzureADAuthRazorUiServiceApiCertificate

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

Microsoft.Identity.Web https://github.com/AzureAD/microsoft-identity-web

Slide 27

Slide 27 text

Authorization with no users

Slide 28

Slide 28 text

Only TRUSTED applications can do this. Microsoft Identity authentication with no users

Slide 29

Slide 29 text

No users http://openid.net/specs/openid- connect-core-1_0.html OAuth2 Resource Owner Credentials Flow Azure Managed Identities On Behalf Of (OBO) Flow

Slide 30

Slide 30 text

OAuth2 Resource Owner Credentials Flow • MC to MC applications • trusted client • grant_type=client_credenti al&client_id=xxxxxxxxxx&cli ent_secret=xxxxxxxxxx • Limited user cases

Slide 31

Slide 31 text

OAuth2 Resource Owner Credentials Flow

Slide 32

Slide 32 text

Microsoft.Identity.Client https://github.com/AzureAD/microsoft-authentication-library-for-dotnet

Slide 33

Slide 33 text

Microsoft.Identity.Client "Scope": "api://--clientId--/.default" https://github.com/damienbod/AzureADAuthRazorUiServiceApiCertificate

Slide 34

Slide 34 text

Azure Managed identities

Slide 35

Slide 35 text

src: https://www.youtube.com/watch?v=vYUKC0mZFqI

Slide 36

Slide 36 text

OAuth On Behalf of OBO Flow • - RFC 6749 • https://tools.ietf.org/html/r fc6749 • https://docs.microsoft.com/ en-us/azure/active- directory/develop/v2-oauth2- on-behalf-of-flow

Slide 37

Slide 37 text

src: https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow

Slide 38

Slide 38 text

Microsoft.Identity.Web https://github.com/damienbod/AzureADAuthRazorUiServiceApiCertificate

Slide 39

Slide 39 text

Microsoft.Identity.Web

Slide 40

Slide 40 text

Securing APIs

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

Azure continuous access & continuous access evaluation

Slide 47

Slide 47 text

Using conditional access Create an authentication context using Graph or the Portal 1 Create a Conditional Access | Policies to use the context 2 Force the context in an application 3

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

https://github.com/damienbod/AspNetCoreAzureADCAE

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

What about continuous access evaluation? CAE setup in Azure Active Directory

Slide 55

Slide 55 text

No content