APPLICATION DEVELOPMENT SECURE CODING WORKSHOP JIM MANICO VP, Security Architecture MARCH 2013.

Slides:



Advertisements
Similar presentations
Past, Present and Future By Eoin Keary and Jim Manico
Advertisements

Application Security Best Practices At Microsoft Ensuring the lowest possible exposure and vulnerability to attacks Published: January 2003.
OWASP’s Ten Most Critical Web Application Security Vulnerabilities
METALOGIC s o f t w a r e © Metalogic Software Corporation DACS Developer Overview DACS – the Distributed Access Control System.
Forms Authentication, Users, Roles, Membership Ventsislav Popov Crossroad Ltd.
Internet of Things Security Architecture
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the Creative Commons Attribution-ShareAlike.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Bypassing Client-Side Protection CSE 591 – Security and Vulnerability Analysis Spring 2015 Adam Doupé Arizona State University
WebGoat & WebScarab “What is computer security for $1000 Alex?”
Access Control Methodologies
COMP 321 Week 12. Overview Web Application Security  Authentication  Authorization  Confidentiality Cross-Site Scripting Lab 12-1 Introduction.
2009 Architecture Plan Overview 2009 Architecture Plan Overview.
Securing the Broker Pattern Patrick Morrison 12/08/2005.
Security Issues and Challenges in Cloud Computing
SOFTWARE SECURITY JORINA VAN MALSEN Attacking Access Control 1.
Information Networking Security and Assurance Lab National Chung Cheng University The Ten Most Critical Web Application Security Vulnerabilities Ryan J.W.
Using Internet Information Server And Microsoft ® Internet Explorer To Implement Security On The Intranet HTTP.
Hands-On Microsoft Windows Server 2003 Administration Chapter 5 Administering File Resources.
Customer confidential 1 Privilege Management Sean Moore Solutions Specialist.
Web App Access Control Design
Handling Security Threats in Kentico CMS Karol Jarkovsky Sr. Solution Architect Kentico Software
The OWASP Foundation Web App Access Control Design.
Designing Security In Web Applications Andrew Tomkowiak 10/8/2013 UW-Platteville Software Engineering Department
Security Risk Management Marcus Murray, CISSP, MVP (Security) Senior Security Advisor, Truesec
Web-based Document Management System By Group 3 Xinyi Dong Matthew Downs Joshua Ferguson Sriram Gopinath Sayan Kole.
D ATABASE S ECURITY Proposed by Abdulrahman Aldekhelallah University of Scranton – CS521 Spring2015.
Introduction to Application Penetration Testing
Security.NET Chapter 1. How Do Attacks Occur? Stages of attack Examples of attacker actions 1. FootprintRuns a port scan on the firewall 2. PenetrationExploits.
Forms Authentication, Users, Roles, Membership Svetlin Nakov Telerik Corporation
W. Sliwinski – eLTC – 7March08 1 LSA & Safety – Integration of RBAC and MCS in the LHC control system.
SSL / TLS in ITDS Arun Vishwanathan 23 rd Dec 2003.
M i SMob i S Mob i Store - Mobile i nternet File Storage Platform Chetna Kaur.
Design Patterns Phil Smith 28 th November Design Patterns There are many ways to produce content via Servlets and JSPs Understanding the good, the.
Lecture slides prepared for “Computer Security: Principles and Practice”, 3/e, by William Stallings and Lawrie Brown, Chapter 5 “Database and Cloud Security”.
1 22 August 2001 The Security Architecture of the M&M Mobile Agent Framework P. Marques, N. Santos, L. Silva, J. Silva CISUC, University of Coimbra, Portugal.
1 © 2004, Cisco Systems, Inc. All rights reserved. CISCO CONFIDENTIAL Using Internet Explorer 7.0 to Access Cisco Unity 5.0(1) Web Interfaces Unity 5.0(1)
Brent Mosher Senior Sales Consultant Applications Technology Oracle Corporation.
Chapter 2. Core Defense Mechanisms. Fundamental security problem All user input is untrusted.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
OWASP Top Ten #1 Unvalidated Input. Agenda What is the OWASP Top 10? Where can I find it? What is Unvalidated Input? What environments are effected? How.
 Chapter 14 – Security Engineering 1 Chapter 12 Dependability and Security Specification 1.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Crash Course in Web Hacking
Windows Role-Based Access Control Longhorn Update
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
February, TRANSCEND SHIRO-CAS INTEGRATION ANALYSIS.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Data Access with Spring.
Computer Security: Principles and Practice
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Securing Web Applications Lesson 4B / Slide 1 of 34 J2EE Web Components Pre-assessment Questions 1. Identify the correct return type returned by the doStartTag()
The Exchange Network Node Mentoring Workshop User Management on the Exchange Network Joe Carioti February 28, 2005.
LINUX Presented By Parvathy Subramanian. April 23, 2008LINUX, By Parvathy Subramanian2 Agenda ► Introduction ► Standard design for security systems ►
Security-Enhanced Linux Stephanie Stelling Center for Information Security Department of Computer Science University of Tulsa, Tulsa, OK
ASP.NET 2.0 Security Alex Mackman CM Group Ltd
Business Objects XIr2 Windows NT Authentication Single Sign-on 18 August 2006.
Windows Active Directory – What is it? Definition - Active Directory is a centralized and standardized system that automates network management of user.
James F. Fox MENA Cyber Security Practice Lead Presenters Cyber Security in a Mobile and “Always-on” World Booz | Allen | Hamilton.
Database and Cloud Security
Identity and Access Management
Threat Modeling for Cloud Computing
Server Concepts Dr. Charles W. Kann.
A Security Review Process for Existing Software Applications
Security & .NET 12/1/2018.
Real World Advanced Threat Protection
Fast-Track UiPath Developer Module 10: Sensitive Data Handling
9/8/ :03 PM © 2006 Microsoft Corporation. All rights reserved.
Presentation transcript:

APPLICATION DEVELOPMENT SECURE CODING WORKSHOP JIM MANICO VP, Security Architecture MARCH 2013

ACCESS CONTROL © 2013 WhiteHat Security, Inc.

Access Control Best Practices Build a centralized AuthZ mechanism Code to the permission, not the role Design AuthZ as a filter Deny by default, fail securely Server-side trusted data should drive AuthZ Be able to change entitlements in real time Design standardized data contextual AuthZ Build grouping for users and permissions ACCESS CONTROL © 2013 WhiteHat Security, Inc.

Access Control Anti-Patterns Hard-coded role checks in application code Lack of centralized access control logic Untrusted data driving access control decisions Access control that is “open by default” Lack of addressing horizontal access control in a standardized way (if at all) Access control logic that needs to be manually added to every endpoint in code Access Control that is “sticky” per session Access Control that requires per-user policy ACCESS CONTROL © 2013 WhiteHat Security, Inc

General Access Control Model ACCESS CONTROL AuthenticationAuthorization © 2013 WhiteHat Security, Inc

What is Access Control? Authorization is the process where a system determines if a specific user has access to a resource Permission: Represents app behavior only Entitlement: What a user is actually allowed to do Principle/User: Who/what you are entitling Implicit Role: Named permission, user associated – if (user.isRole(“Manager”)); Explicit Role: Named permission, resource associated –if (user.isAuthorized(“report:view:3324”); ACCESS CONTROL © 2013 WhiteHat Security, Inc.

Attacks on Access Control Vertical Access Control Attacks –A standard user accessing administration functionality Horizontal Access Control Aattacks –Same role, but accessing another user's private data Business Logic Access Control Attacks –Abuse of one or more linked activities that collectively realize a business objective ACCESS CONTROL © 2013 WhiteHat Security, Inc.

Access Controls Impact Loss of accountability –Attackers maliciously execute actions as other users –Attackers maliciously execute higher level actions Disclosure of confidential data –Compromising admin-level accounts often results in access to user’s confidential data Data tampering –Privilege levels do not distinguish users who can only view data and users permitted to modify data ACCESS CONTROL © 2013 WhiteHat Security, Inc.

HARD-CODED ROLES © 2013 WhiteHat Security, Inc.

Hard-Coded Roles void editProfile(User u, EditUser eu) { if (u.isManager()) { editUser(eu) } How do you change the policy of this code? HARD-CODED ROLES 10 © 2013 WhiteHat Security, Inc.

Hard-Coded Roles if ((user.isManager() || user.isAdministrator() || user.isEditor()) && user.id() != 1132)) { //execute action } HARD-CODED ROLES © 2013 WhiteHat Security, Inc. 11

Hard-Coded Roles Makes “proving” the policy of an application difficult for audit or Q/A purposes Any time access control policy needs to change, new code need to be pushed RBAC is often not granular enough Fragile, easy to make mistakes HARD-CODED ROLES 12 © 2013 WhiteHat Security, Inc. & BCC Risk Advisory Ltd

ORDER-SPECIFIC OPERATIONS 13 © 2013 WhiteHat Security, Inc. & BCC Risk Advisory Ltd

Order- Specific Operations Imagine the following parameters Can an attacker control the sequence? Can an attacker abuse this with concurrency? © 2013 WhiteHat Security, Inc. ORDER-SPECIFIC OPERATIONS 14

Rarely Depend on Untrusted Data Never trust request data for access control decisions Never make access control decisions in JavaScript Never make authorization decisions based solely on: –hidden fields –cookie values –form parameters –URL parameters –anything else from the request Never depend on the order of values sent from the client ORDER-SPECIFIC OPERATIONS © 2013 WhiteHat Security, Inc. 15

BEST PRACTICE © 2013 WhiteHat Security, Inc. 16

Best Practice: Centralized AuthZ Define a centralized access controller –ACLService.isAuthorized(PERMISSION_CONSTANT) –ACLService.assertAuthorized(PERMISSION_CONSTANT) Access control decisions go through these simple API’s Centralized logic to drive policy behavior and persistence May contain data-driven access control policy information BEST PRACTICE © 2013 WhiteHat Security, Inc. 17

Best Practice: Code to the Activity if (AC.hasAccess(“article:edit:12”)) { //execute activity } Code it once, never needs to change again Implies policy is centralized in some way Implies policy is persisted in some way Requires more design/work up front to get right BEST PRACTICE © 2013 WhiteHat Security, Inc. 18

Using a Centralized Access Controller In Presentation Layer if (isAuthorized(Permission.VIEW_LOG_PANEL)) { Here are the logs } BEST PRACTICE © 2013 WhiteHat Security, Inc. 19

Using a Centralized Access Controller In Controller try (assertAuthorized(Permission.DELETE_USER)) { deleteUser(); } catch (Exception e) { //SOUND THE ALARM } BEST PRACTICE © 2013 WhiteHat Security, Inc. 20

SQL Integrated Access Control Example Feature This SQL would be vulnerable to tampering select * from messages where messageid = Ensure the owner is referenced in the query! select * from messages where messageid = AND messages.message_owner = BEST PRACTICE 21 © 2013 WhiteHat Security, Inc. & BCC Risk Advisory Ltd

Data Contextual Access Control Data Contextual / Horizontal Access Control API examples: ACLService.isAuthorized(“car:view:321”) ACLService.assertAuthorized(“car:edit:321”) Long form: Is Authorized(user, Perm.EDIT_CAR, Car.class, 14) Check if the user has the right role in the context of a specific object Protecting data a the lowest level! BEST PRACTICE 22 © 2013 WhiteHat Security, Inc. & BCC Risk Advisory Ltd

Apache SHIRO Apache Shiro is a powerful and easy to use Java security framework. Offers developers an intuitive yet comprehensive solution to authentication, authorization, cryptography, and session management. Built on sound interface-driven design and OO principles. Enables custom behavior. Sensible and secure defaults for everything.

Solving Real World Access Control Problems with the Apache Shiro The Problem Web Application needs secure access control mechanism The Solution if ( currentUser.isPermitted( "lightsaber:weild" ) ) { log.info("You may use a lightsaber ring. Use it wisely."); } else { log.info("Sorry, lightsaber rings are for schwartz masters only."); } if ( currentUser.isPermitted( "lightsaber:weild" ) ) { log.info("You may use a lightsaber ring. Use it wisely."); } else { log.info("Sorry, lightsaber rings are for schwartz masters only."); }

Solving Real World Access Control Problems with the Apache Shiro The Problem Web Application needs to secure access to a specific object The Solution if ( currentUser.isPermitted( "winnebago:drive:eagle5" ) ) { log.info("You are permitted to 'drive' the 'winnebago' with license plate (id) 'eagle5'. Here are the keys - have fun!"); } else { log.info("Sorry, you aren't allowed to drive the 'eagle5' winnebago!"); } if ( currentUser.isPermitted( "winnebago:drive:eagle5" ) ) { log.info("You are permitted to 'drive' the 'winnebago' with license plate (id) 'eagle5'. Here are the keys - have fun!"); } else { log.info("Sorry, you aren't allowed to drive the 'eagle5' winnebago!"); }

Data Contextual Access Control BEST PRACTICE 26 © 2013 WhiteHat Security, Inc. & BCC Risk Advisory Ltd

QUESTIONS? JIM MANICO VP, Security Architecture