Benjamin Day Role-based Security Stinks: Better Authorization in ASP.NET.

Slides:



Advertisements
Similar presentations
Eric J. Oszakiewski MCTS: SharePoint Application Development SharePoint Configuration.
Advertisements

Software Testing with Visual Studio 2013 & Team Foundation Server 2013 Benjamin Day.
Real World Scrum with TFS2013 Benjamin Day. Brookline, MA Consultant, Coach, & Trainer Microsoft MVP for Visual Studio ALM Team Foundation Server, Software.
How to be a C# ninja in 10 easy steps. Benjamin Day.
Real World Scrum with Team Foundation Server 2013 Benjamin
Design for Testability: Mocks, Stubs, Refactoring, and User Interfaces Benjamin Day benday.com |
Team Foundation Server 2010 Builds: Understand, Configure, and Customize Benjamin Day benday.com |
Security in.NET Jørgen Thyme Microsoft Denmark. Topics & non-topics  Cryptography  App domains  Impersonation / delegation  Authentication  Authorization.
Performed by:Gidi Getter Svetlana Klinovsky Supervised by:Viktor Kulikov 08/03/2009.
Managing Identity and Permissions
Train The Trainer Employee Central Administration
Delivering Excellence in Software Engineering ® EPAM Systems. All rights reserved. ASP.NET Authentication.
Design for Testability: Mocks, Stubs, Refactoring, and User Interfaces Benjamin Day.
SharePoint External Login Access – Forms Authentication vs Azure ACS.
@benday #vslive Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
Doing Something Useful with Enterprise Library 3.0 Benjamin Day Level: Intermediate.
@benday #vslive Automated Build, Test & Deploy with TFS, ASP.NET, and SQL Server Benjamin
Security David Frommer Principal Architect Business Intelligence Microsoft Partner of the Year 2005 & 2007.
Goals One ASP.NET Membership story – Web APIs and Web Apps Profile. Extensibility allows for non SQL persistence model. Improve unit testability of.
Team Foundation Server 2012 Builds: Understand, Configure, and Customize Benjamin Day.
Microsoft SharePoint Server 2010 for the Microsoft ASP.NET Developer Yaroslav Pentsarskyy
Module 5 Configuring Authentication. Module Overview Lesson 1: Understanding Classic SharePoint Authentication Providers Lesson 2: Understanding Federated.
SQL Server Security By Mattias Lind For PASS Security VC.
How to be a C# ninja in 10 easy steps Benjamin Day.
Securing Your ASP.NET Application Presented by: Rob Bagby Developer Evangelist Microsoft ( )
SECURITY ISSUES. Introduction The.NET Framework includes a comprehensive set of security tools –Low-level classes and an overall framework –Managing code.
Windows Role-Based Access Control Longhorn Update
ASP.Net Role-based Security Chapter 10 (Freeman and Jones) CS795/895.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Search Overview Search Features: WSS and Office Search Architecture Content Sources and.
GUDURU PRAVEEN REDDY.NET IMPERSONATION. Contents Introduction Impersonation Enabled Impersonation Disabled Impersonation Class Libraries Impersonation.
Zero to Hero: Untested to Tested with Visual Studio Fakes Benjamin
Mirek Sztajno SQL Server Security PM
Impersonation Bharat Kadia CS-795. What is Impersonation ? Dictionary-: To assume the character or appearance of someone ASP.NET-: Impersonation is the.
Administrator Data Entry Training for Maintenance (Mx) LOSA and Ramp LOSA Database Software 11/26/2016.
Real World SQL Server Data Tools Benjamin
Autorisierung und rollenbasierte Sicherheit in.NET Anwendungen Jürgen Pfeifer Senior Architect Evangelist Developer & Platform Strategy Group Microsoft.
Windows Security -- Archana Galipalli. Agenda  Windows Security  Windows Security and CLR  Implementing Windows Security for IIS  Configuring Security.
To Git or Not to Git for Enterprise Development Benjamin Edward Thomson
ASP.NET Identity System
SQL SERVER AUDITING. Jean Joseph DBA/Consultant Contact Info: Blog:
Spaso Lazarević Microsoft MVP Nova banka ad Banja Luka Building business application using Visual Studio 2013 LightSwitch.
Benjamin Day Get Good at DevOps: Feature Flag Deployments with ASP.NET, WebAPI, & JavaScript.
Benjamin Unit Testing & Test-Driven Development for Mere Mortals.
Using abstract data layers in Microsoft SQL Server Speaker:Uwe Ricken (db Berater GmbH)
Benjamin Day Real World Scrum with TFS 2015 & VSTS.
DevOps with ASP.NET Core and Entity Framework Core
Stop Those Prying Eyes Getting to Your Data
Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
ASP .NET MVC Authorization Training Videos
6/16/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
SQL Server Security For Everyone
Unit Testing & Test-Driven Development for Mere Mortals
Unit Testing & Test-Driven Development for Mere Mortals
What Is Sharepoint? Mohsen Ashkboos
Get Good at DevOps: Feature Flag Deployments with ASP
SQL Server Security from the ground up
Authorization in Asp.Net Core
Introduction to Authentication Authentication සදහා හැදින්වීම
Implementing Database Roles in the Enterprise Geodatababse
Intermediate Security Topics in SQL SERver
Unit Testing & Test-Driven Development for Mere Mortals
Real World Scrum with TFS & VSTS / Azure DevOps
Entity Framework Core for Enterprise Applications
Implementing Security in ASP.NET Core: Claims, Patterns, and Policies
SharePoint services Provides team collaboration through SharePoint Sites and makes it easy for communities to work together on documents, tasks, contacts,
07 | Introduction to Authentication
SQL Server Security from the ground up
Mark Quirk Head of Technology Developer & Platform Group
Security - Forms Authentication
06 | SQL Server and the Cloud
Presentation transcript:

Benjamin Day Role-based Security Stinks: Better Authorization in ASP.NET

Benjamin Day Brookline, MA Consultant, Coach, & Trainer Microsoft MVP for Visual Studio ALM Scrum, Team Foundation Server, Software Testing, Software Architecture Scrum.org Classes – Professional Scrum Master (PSM) – Professional Scrum Developer (PSD) – Professional Scrum Foundations (PSF)

Got ?

The Goal Design a flexible authorization framework Security constraints within the application should be configurable at runtime User permissions can vary between different instances of the same object Works with.NET Security Easy to administer

What is “Role-based” Security? Application authorization is based on membership in roles Based on IPrincipal – System.Security.Principal – IsInRole(string roleName) WindowsPrincipal – Role Name = Group Name – Uses user’s Windows group membership to do authorization

HR Application Hire Employee – –CreateEmployee.aspx Edit Compensation – –EditSalary.aspx, EditVacationTime.aspx Edit Employee Info – –ViewEmployee.aspx, EditContactInfo.aspx

What if you start adding new offices? New Requirement: –HR Managers & HR Associates have permissions only for their office  “context” How to implement this using IsInRole()? –You could add the additional groups (roles) but your app will have to know what office the employee is in

More Complexity What happens when even more offices are added? What if you need to start adding new roles? What if you want to create groups of employees for someone in HR to manage? – Arbitrary groupings of employees across locations – One person becomes the “HR Manager” for that group

Role-based Security Limitations Role-based works well until you need context – Granting permissions to a particular “employee” Broadness and lack of context  limited configurability – Security starts getting hard-coded – Not configurable at run-time

Claims-based Security Declarative security System.Security.Claims namespace Name / Value Pairs

“Rights-based” Security? Architecture for using Claims in the app Breaks “what you can do” into small pieces  Rights Rights have context – User is granted rights to perform an action on a particular item User’s permissions (principal) becomes the set of these small granted rights The Database Perspective  Establishes row-level permissions

Roles vs. Claims / Rights Roles are broad – Secure large sections of an app – Grant blanket permissions to all securable items No context Rights are granular – Uses a Claim – Permissions relate to one item Have context – Secure at the operation level – Reduce actions to the least common denominator – Store permissions as small pieces  flexibility

Claims-Based Security To Do’s During development, identify – Securable Items – Securable Actions (Rights) – Broad Rights (Roles) Keep these as actions as small (granular) as possible

Ease of Administration User Groups – Group similar users together – Assign rights / roles for the group – Eliminates the bother of administering users individually Item Groups – Group similar securable items – Like a “folder” – Minimizes the number of “right grants” you need Library has thousands of items (entries) Rights are granted at run-time

Hooking into.NET Security System.Security.Principal namespace Use IIdentity to establish “who you are” Use IPrincipal to establish “what you can do” IPrincipal can be set onto – Thread.CurrentPrincipal – HttpContext.User IPrincipal is available in all tiers

IPrincipal Through The Tiers ASP.MVC / Web API – Should check IPrincipal to avoid giving the user an opportunity to cause security exceptions Other Tier(s) – Makes certain that the users cannot access data or perform unauthorized operations – (Optional) Filter unauthorized records

ASP.NET MVC Security Schema AspNetUsers – User account info – Local accounts – Username, password, etc AspNetUserLogins – “Social” logins – Mappings between external logins & local info – Microsoft Account, Facebook, Twitter AspNetRoles – List of roles in application AspNetUserRoles – Roles per user AspNetUserClaims – Custom claims – ClaimType – ClaimValue

Adjusting Claims at Login ApplicationUser class – Extends System.Security.Claims.IdentityUser GenerateUserIdentityAsync() – Any claims adjustments go here

DEMOS! Demos in ASP.NET – Roles – Claims Demos in ASP.NET Core – Policies – Microsoft Account Provider

@benday Any last questions?

@benday Thank you. |