Slide 1

Slide 1 text

Pieces of Auth Chris Cornutt - @enygma

Slide 2

Slide 2 text

Thanks to our Sponsors! PHP[TEK] 2017 Thanks to our Sponsors!

Slide 3

Slide 3 text

Current State

Slide 4

Slide 4 text

Current State Evaluation Risk assessment What controls are in place now? Are they working? Are they even used? Define the users of your system

Slide 5

Slide 5 text

Current State Evaluation Modeling (application and services) Compliance requirements (home and abroad) Data storage locations Policies and procedures

Slide 6

Slide 6 text

Authentication

Slide 7

Slide 7 text

Authentication Defined The act of confirming the truth of an attribute of a single piece of data (a datum) claimed true by an entity. In contrast with identification, which refers to the act of stating or otherwise indicating a claim purportedly attesting to a person or thing's identity, authentication is the process of actually confirming that identity. -Wikipedia

Slide 8

Slide 8 text

Authentication Methods Credential based (username/password, etc) One-time use codes Third-party services Federated identity (OAuth) Certificate based

Slide 9

Slide 9 text

Authentication questions What is the minimum you need? Should you implement multi-factor? (protip: yes) HTTPS all the things Am I preventing brute force attacks? What is your password policy?

Slide 10

Slide 10 text

Passwords bringing the pain Why won’t you die… People are terrible at passwords Password policies Single point of failure Password reuse

Slide 11

Slide 11 text

Authorization

Slide 12

Slide 12 text

Authorization Defined The function of specifying access rights to resources related to information security and computer security in general and to access control in particular. More formally, "to authorize" is to define an access policy. For example, human resources staff is normally authorized to access employee records and this policy is usually formalized as access control rules in a computer system. -Wikipedia

Slide 13

Slide 13 text

Authorization Methods Permissions Roles Access Control List Role Based Access Control Properties/Policies

Slide 14

Slide 14 text

Authorization in detail On the OWASP Top 10 Quickly becomes complex Multiple layers Multiple types

Slide 15

Slide 15 text

Authorization in detail Resource access allowed? Data access allowed? Action access allowed? Does environment matter?

Slide 16

Slide 16 text

Authorization questions What is the minimum you need? Where are the highest risk areas? Is it user controllable? (admin=true) Does it rely on “hidden” functionality?

Slide 17

Slide 17 text

Session Management

Slide 18

Slide 18 text

Session Management in detail Information about the current user Session ID entropy/hash (php.ini setting) Cookie protection (HTTPOnly, Secure flag, etc) Recycle on permission change

Slide 19

Slide 19 text

Session Management questions What information is safe to store? Should I encrypt the contents? When should it timeout? Am I protecting from session fixation? Should it be one user at a time or allow multiple?

Slide 20

Slide 20 text

Log All The Things

Slide 21

Slide 21 text

Log All The Things in detail Flying blind without it Fine balance between too much and not enough Let alerting help (thresholds) Graphs never hurt NEVER log sensitive data

Slide 22

Slide 22 text

Log All The Things questions What’s important to log in our system? What data should be included? Should I use a third-party service? How can I protect my logs? How long should I keep my logs? (compliance)

Slide 23

Slide 23 text

A Comprehensive Strategy The worst thing you can do for your application is create a fragmented authentication and authorization solution. Define your needs, lay out a plan and stick with it. Auth flaws can be some of the most dangerous and difficult to find.

Slide 24

Slide 24 text

Thanks! Chris Cornutt @enygma https://websec.io