SlideShare a Scribd company logo
1 of 28
Download to read offline
Microsoft 365 Dev Security
From Full Trust to Zero Trust
2
COLLABDAYS BREMEN 2024
BREMEN, GERMANY – FEBRUARY 09-10, 2024
THANK YOU!
“Originally I wanted to talk about M365
Copilot but then it turned out I am such a fool
that even Copilot didn’t want to play with me
…”
The presenter
Agenda
About
•Me
Authentication
•SP Rest vs Graph
•SSO
•Credential Handling
Managed
Identities
•Permissions
SPFx & 3rd
party API
•MSGraphClient
•AadHttpClient
•Domain isolated?
Permission
Scope
•App
•Delegated
•RSC
Summary
•Wrap up
•Resources
•Q&A
• Markus Moeller
• Microsoft 365 Developer Expert
• Microsoft MVP
• Microsoft 365 & Power Platform
Community (PnP) team member
• Avanade Germany
• @moeller2_0
• https://mmsharepoint.wordpress.com
• Proud dad of 1 (3yrs)
• Cancer fighter
About me
Authentication
SPFx
• User context login est.
• “No need to care for”
• MSGraphClient
• Prepped ServicePrincipal
• Tenant-Wide access
• AadHttpClient
• Prepped ServicePrincipal
• Tenant-Wide access (to backend
process only)
“Other” app
• Context ID / bootstrap token →
SSO
• MSAL2
• App individual access
• More effort
Credential Handling
Not only
Exercise for our
developers
delivering that
way ...
8
Azure Key Vault
• Read/Write from Application
• Access via Code or SecretUri reference in App Service Config
• Auth via Secret Endpoint / Managed Identity
• Azure App Config btw a similar service for less sensitive values?
Managed Identities
• Can simply be added to “any” Azure resource
• No credential / secret / key management
• User Managed Identities to be shared with several resources
• NO multi-tenant
• (Graph) permissions to be applied via code (PS, Rest, …)
• To ServicePrincipal only
• Graph / SPO Permissions “app only”
ManagedIdentity (Credential)?
Credentials
Credentials
Managed Identity
STOP
Demo
Managed Identity - Scenarios
Assign Identity easy, but permissions…?
• UI? Not possible…
• PowerShell?
• Rest?
• Azure CLI the leanest way
3rd party Api access
• In SPFx: MSGraphClient, AadHttpClient
• Prefer: AadHttpClient !!!
• No anonymous access in Azure Functions / Apps
• Restrict client-side to “hide” buttons
• Restrict server-side to really prevent access
Enable Auth for Azure Function
[FunctionName("WriteListItem")]
public static async Task<IActionResult> Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]
HttpRequest req, ILogger log) { ...
SharePoint
SharePoint – Enterprise Application
Delegated vs App permissions
User Delegated
• Access to resources of a kind
“the user” has access to
• User access needs to be granted
• Eventually “Create”, too
• User login / token needed for
operations
Application
• Access to ALL resources of a kind
• Access without a user
• Unattended processes
• Can be partially limited by
“.Selected” (RSC)
Use delegated permissions
• Benefit from user login / context / SSO
• Grant users access to all data / resources needed
• Users should be able to create resources and take ownership
• Do you really think your app is the only one that can treat your data /
resources in the right manner?
If app permissions needed
• Use LOWEST permissions possible
• Try to restrict by resource specific consent (RSC)
• MAXIMIZE restriction to your app
• Limit access to appId to small # of programmers / admins
• Take care of code base
RSC (resource specific consent)
• One app creates (with higher privileges) resource
• Teams Team, SharePoint Site
• Enables other app on this one
• App permission Sites.Selected
RSC
Sites Sites.FullControl Sites.Selected Delegated
CEO personal site 💣 [💣] ✅ ❌
Homesite [💣] ✅ [💣] ✅ ✅❌
Intranet sites [💣] ✅ [💣] ✅❌ ✅❌
Collaboration sites [💣] ✅ [💣] ✅❌ ✅❌
RSC – 2023
RSC – Q2 / 2024
• SharePoint: Application Site Creation without Sites.FullControl.All
• Sites.Create.All
• More granular RSC permission also coming around
Summary – Key takeaways
• Security is a moving target
• Always challenge: Least privilege
• Sample code / snippets simplify to demonstrate
• (Mine, too!!!) Always challenge before taking into Prod
• AI doesn’t help here so far 😜
• Security usually makes dev more complex
• Convince your client, more effort → More security
• Nevertheless, there is great functionality/tools out there
• Get to know them → NOW!
• RSC esp with SharePoint becoming a gamechanger in 2024 …
Resources
• M365 Development Security - From full trust to ZeroTrust
(pnp.github.io)
• Speaker's blog
• On this specific topic
• Azure Key Vault
Questions?
Now, or later …:
• Markus Moeller
• @moeller2_0
• https://mmsharepoint.wordpress.com

More Related Content

Similar to Microsoft 365 De Security pdf

Making your API behave like a big boy
Making your API behave like a big boyMaking your API behave like a big boy
Making your API behave like a big boy
Andrew Siemer
 

Similar to Microsoft 365 De Security pdf (20)

How to use Microsoft Graph in your applications
How to use Microsoft Graph in your applicationsHow to use Microsoft Graph in your applications
How to use Microsoft Graph in your applications
 
DEF CON 27 - DIRK JAN MOLLEMA - im in your cloud pwning your azure environment
DEF CON 27 - DIRK JAN MOLLEMA - im in your cloud pwning your azure environmentDEF CON 27 - DIRK JAN MOLLEMA - im in your cloud pwning your azure environment
DEF CON 27 - DIRK JAN MOLLEMA - im in your cloud pwning your azure environment
 
Антон Бойко (Microsoft Azure MVP, Ukrainian Azure Community Founder) «Azure M...
Антон Бойко (Microsoft Azure MVP, Ukrainian Azure Community Founder) «Azure M...Антон Бойко (Microsoft Azure MVP, Ukrainian Azure Community Founder) «Azure M...
Антон Бойко (Microsoft Azure MVP, Ukrainian Azure Community Founder) «Azure M...
 
O365 saturday: How to (remote) control office 365 with windows azure-slideshare
O365 saturday: How to (remote) control office 365 with windows azure-slideshareO365 saturday: How to (remote) control office 365 with windows azure-slideshare
O365 saturday: How to (remote) control office 365 with windows azure-slideshare
 
#SPSottawa The SharePoint Framework and The Microsoft Graph on steroids with ...
#SPSottawa The SharePoint Framework and The Microsoft Graph on steroids with ...#SPSottawa The SharePoint Framework and The Microsoft Graph on steroids with ...
#SPSottawa The SharePoint Framework and The Microsoft Graph on steroids with ...
 
Bsidesnova- Pentesting Methodology - Making bits less complicated
Bsidesnova- Pentesting Methodology - Making bits less complicatedBsidesnova- Pentesting Methodology - Making bits less complicated
Bsidesnova- Pentesting Methodology - Making bits less complicated
 
#SPSToronto The SharePoint Framework and the Microsoft Graph on steroids with...
#SPSToronto The SharePoint Framework and the Microsoft Graph on steroids with...#SPSToronto The SharePoint Framework and the Microsoft Graph on steroids with...
#SPSToronto The SharePoint Framework and the Microsoft Graph on steroids with...
 
Make your Azure PaaS Deployment More Safe
Make your Azure PaaS Deployment More SafeMake your Azure PaaS Deployment More Safe
Make your Azure PaaS Deployment More Safe
 
Can you keep a secret? (XP Days 2017)
Can you keep a secret? (XP Days 2017)Can you keep a secret? (XP Days 2017)
Can you keep a secret? (XP Days 2017)
 
TechNet Conference 2013 Berlin-Wie Sie Office 365 mit Windows Azure steuern b...
TechNet Conference 2013 Berlin-Wie Sie Office 365 mit Windows Azure steuern b...TechNet Conference 2013 Berlin-Wie Sie Office 365 mit Windows Azure steuern b...
TechNet Conference 2013 Berlin-Wie Sie Office 365 mit Windows Azure steuern b...
 
Keynote - Cloudy Vision: How Cloud Integration Complicates Security
Keynote - Cloudy Vision: How Cloud Integration Complicates SecurityKeynote - Cloudy Vision: How Cloud Integration Complicates Security
Keynote - Cloudy Vision: How Cloud Integration Complicates Security
 
Security in an age of collaboration 201903 - tvaug
Security in an age of collaboration   201903 - tvaugSecurity in an age of collaboration   201903 - tvaug
Security in an age of collaboration 201903 - tvaug
 
Logic apps and PowerApps - Integrate across your APIs
Logic apps and PowerApps - Integrate across your APIsLogic apps and PowerApps - Integrate across your APIs
Logic apps and PowerApps - Integrate across your APIs
 
SharePoint 2013 App or Not to App
SharePoint 2013 App or Not to AppSharePoint 2013 App or Not to App
SharePoint 2013 App or Not to App
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
Making your API behave like a big boy
Making your API behave like a big boyMaking your API behave like a big boy
Making your API behave like a big boy
 
Windays14 - How to (remote) control Office 365 with Azure
Windays14 - How to (remote) control Office 365 with AzureWindays14 - How to (remote) control Office 365 with Azure
Windays14 - How to (remote) control Office 365 with Azure
 
Covert Attack Mystery Box: A few novel techniques for exploiting Microsoft “f...
Covert Attack Mystery Box: A few novel techniques for exploiting Microsoft “f...Covert Attack Mystery Box: A few novel techniques for exploiting Microsoft “f...
Covert Attack Mystery Box: A few novel techniques for exploiting Microsoft “f...
 
Cloud Foundry API for Fun and Ops
Cloud Foundry API for Fun and OpsCloud Foundry API for Fun and Ops
Cloud Foundry API for Fun and Ops
 
Feedback on building Production-Ready Microsoft Teams Apps
Feedback on building Production-Ready Microsoft Teams AppsFeedback on building Production-Ready Microsoft Teams Apps
Feedback on building Production-Ready Microsoft Teams Apps
 

Recently uploaded

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 

Microsoft 365 De Security pdf

  • 1. Microsoft 365 Dev Security From Full Trust to Zero Trust
  • 2. 2 COLLABDAYS BREMEN 2024 BREMEN, GERMANY – FEBRUARY 09-10, 2024 THANK YOU!
  • 3. “Originally I wanted to talk about M365 Copilot but then it turned out I am such a fool that even Copilot didn’t want to play with me …” The presenter
  • 4. Agenda About •Me Authentication •SP Rest vs Graph •SSO •Credential Handling Managed Identities •Permissions SPFx & 3rd party API •MSGraphClient •AadHttpClient •Domain isolated? Permission Scope •App •Delegated •RSC Summary •Wrap up •Resources •Q&A
  • 5. • Markus Moeller • Microsoft 365 Developer Expert • Microsoft MVP • Microsoft 365 & Power Platform Community (PnP) team member • Avanade Germany • @moeller2_0 • https://mmsharepoint.wordpress.com • Proud dad of 1 (3yrs) • Cancer fighter About me
  • 6. Authentication SPFx • User context login est. • “No need to care for” • MSGraphClient • Prepped ServicePrincipal • Tenant-Wide access • AadHttpClient • Prepped ServicePrincipal • Tenant-Wide access (to backend process only) “Other” app • Context ID / bootstrap token → SSO • MSAL2 • App individual access • More effort
  • 9. Azure Key Vault • Read/Write from Application • Access via Code or SecretUri reference in App Service Config • Auth via Secret Endpoint / Managed Identity • Azure App Config btw a similar service for less sensitive values?
  • 10. Managed Identities • Can simply be added to “any” Azure resource • No credential / secret / key management • User Managed Identities to be shared with several resources • NO multi-tenant • (Graph) permissions to be applied via code (PS, Rest, …) • To ServicePrincipal only • Graph / SPO Permissions “app only”
  • 12. Demo
  • 13. Managed Identity - Scenarios
  • 14. Assign Identity easy, but permissions…? • UI? Not possible… • PowerShell? • Rest? • Azure CLI the leanest way
  • 15. 3rd party Api access • In SPFx: MSGraphClient, AadHttpClient • Prefer: AadHttpClient !!! • No anonymous access in Azure Functions / Apps • Restrict client-side to “hide” buttons • Restrict server-side to really prevent access
  • 16. Enable Auth for Azure Function [FunctionName("WriteListItem")] public static async Task<IActionResult> Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req, ILogger log) { ...
  • 19. Delegated vs App permissions User Delegated • Access to resources of a kind “the user” has access to • User access needs to be granted • Eventually “Create”, too • User login / token needed for operations Application • Access to ALL resources of a kind • Access without a user • Unattended processes • Can be partially limited by “.Selected” (RSC)
  • 20. Use delegated permissions • Benefit from user login / context / SSO • Grant users access to all data / resources needed • Users should be able to create resources and take ownership • Do you really think your app is the only one that can treat your data / resources in the right manner?
  • 21. If app permissions needed • Use LOWEST permissions possible • Try to restrict by resource specific consent (RSC) • MAXIMIZE restriction to your app • Limit access to appId to small # of programmers / admins • Take care of code base
  • 22. RSC (resource specific consent) • One app creates (with higher privileges) resource • Teams Team, SharePoint Site • Enables other app on this one • App permission Sites.Selected
  • 23. RSC Sites Sites.FullControl Sites.Selected Delegated CEO personal site 💣 [💣] ✅ ❌ Homesite [💣] ✅ [💣] ✅ ✅❌ Intranet sites [💣] ✅ [💣] ✅❌ ✅❌ Collaboration sites [💣] ✅ [💣] ✅❌ ✅❌
  • 25. RSC – Q2 / 2024 • SharePoint: Application Site Creation without Sites.FullControl.All • Sites.Create.All • More granular RSC permission also coming around
  • 26. Summary – Key takeaways • Security is a moving target • Always challenge: Least privilege • Sample code / snippets simplify to demonstrate • (Mine, too!!!) Always challenge before taking into Prod • AI doesn’t help here so far 😜 • Security usually makes dev more complex • Convince your client, more effort → More security • Nevertheless, there is great functionality/tools out there • Get to know them → NOW! • RSC esp with SharePoint becoming a gamechanger in 2024 …
  • 27. Resources • M365 Development Security - From full trust to ZeroTrust (pnp.github.io) • Speaker's blog • On this specific topic • Azure Key Vault
  • 28. Questions? Now, or later …: • Markus Moeller • @moeller2_0 • https://mmsharepoint.wordpress.com