Slide 1

Slide 1 text

Access Control, Authorization, and Authentication Adam Englander Ijeoma Ezeonyebuchi Eric Mann

Slide 2

Slide 2 text

Hello. Adam Englander Architect, iovation Ijeoma Ezeonyebuchi Mobile Quality Assurance Engineer, NPR Eric Mann Director of Engineering, Vacasa

Slide 3

Slide 3 text

Today’s Session Terminology Access Control Systems Role-based Systems Attribute-based Systems Risk-based Systems Things to Consider

Slide 4

Slide 4 text

Terminology Authorization is the function of specifying access rights/privileges to resources. (Wikipedia) Authentication is the act of confirming the truth of an attribute of a single piece of data claimed true by an entity. (Wikipedia)

Slide 5

Slide 5 text

Terminology Access control is the selective restriction of access to a place or other resource. (Wikipedia)

Slide 6

Slide 6 text

For example ... if (! isset($_SESSION['user_id'])) { header('HTTP/1.1 403 Forbidden'); exit; } $filename = basename($_POST['filename']); $file = sprintf('/var/www/support/uploads/%s', $filename); if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header(sprintf('Content-Disposition: attachment; filename="%s"', $filename)); header(sprintf('Content-Length: %d', filesize($file))); readfile($file); exit; }

Slide 7

Slide 7 text

For example ... if (! isset($_SESSION['user_id'])) { header('HTTP/1.1 403 Forbidden'); exit; } $filename = basename($_POST['filename']); $file = sprintf('/var/www/support/uploads/%s', $filename); if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header(sprintf('Content-Disposition: attachment; filename="%s"', $filename)); header(sprintf('Content-Length: %d', filesize($file))); readfile($file); exit; }

Slide 8

Slide 8 text

Terminology Authorization is not Authentication is not Access Control

Slide 9

Slide 9 text

Authorization -vs- Authentication Authentication - proving a user is who they say they are Authorization - proving a user is allowed to do what they are attempting to do

Slide 10

Slide 10 text

Authorization -vs- Access Control Authorization - proving a user is allowed to do what they are attempting to do Access Control - actually enforcing authorization controls on systems or resources

Slide 11

Slide 11 text

Strong Security Requires all Three Authentication Authorization Access Control SECURITY

Slide 12

Slide 12 text

Role-based Access Control (RBAC) RBAC separates the concepts of Users, Roles and Permissions. Roles are defined in a system, then Permissions defined separately. Then the security administrator decides what role should be permitted to do what action, by assigning that role to the permission. Finally users are assigned to roles. The system does the rest. (PHP-RBAC)

Slide 13

Slide 13 text

Role-based Access Control Users are each assigned to one or more role Each role will have one or more permission Operations are restricted based on role membership (Based on the permissions that role grants)

Slide 14

Slide 14 text

Role-based Access Control (RBAC)

Slide 15

Slide 15 text

For example ... if (! isset($_SESSION['user_id'])) { header('HTTP/1.1 403 Forbidden'); exit; } $rbac = new \PhpRbac\Rbac(); $rbac->enforce('downloads_manager', 105); $filename = basename($_POST['filename']); $file = sprintf('/var/www/support/uploads/%s', $filename); if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header(sprintf('Content-Disposition: attachment; filename="%s"', $filename)); // ...

Slide 16

Slide 16 text

For example ... if (! isset($_SESSION['user_id'])) { header('HTTP/1.1 403 Forbidden'); exit; } $rbac = new \PhpRbac\Rbac(); $rbac->enforce('downloads_manager', $_SESSION['user_id']); $filename = basename($_POST['filename']); $file = sprintf('/var/www/support/uploads/%s', $filename); if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header(sprintf('Content-Disposition: attachment; filename="%s"', $filename)); // ...

Slide 17

Slide 17 text

Attribute-based Access Control (ABAC) Attribute-based access control, also known as Policy-based access control, defines an access control paradigm whereby access rights are granted to users through the use of policies which combine attributes together. (Wikipedia)

Slide 18

Slide 18 text

Attribute-based Access Control Users can still be assigned to one or more role Resources (and users) have specific attributes Users (or roles) have applied policies that use these attributes to allow or block access Policies are evaluated at request time based on current attributes

Slide 19

Slide 19 text

Attribute-based Access Control

Slide 20

Slide 20 text

For example ... if (! isset($_SESSION['user_id'])) { header('HTTP/1.1 403 Forbidden'); exit; } $user = new \User($_SESSION['user_id']); $filename = basename($_POST['filename']); $download = new \Download($filename); $abac = \PhpAbac\AbacFactory::getAbac(); $attributes = ['dynamic-attributes' => ['report-author' => $user->getId()]]; if ($abac->enforce('downloads-access', $user, $download, $attributes) !== true) { header('HTTP/1.1 403 Forbidden'); exit; } // ...

Slide 21

Slide 21 text

For example ... if (! isset($_SESSION['user_id'])) { header('HTTP/1.1 403 Forbidden'); exit; } $user = new \User($_SESSION['user_id']); $filename = basename($_POST['filename']); $download = new \Download($filename); $abac = \PhpAbac\AbacFactory::getAbac(); $attributes = ['dynamic-attributes' => ['report-author' => $user->getId()]]; if ($abac->enforce('downloads-access', $user, $download, $attributes) !== true) { header('HTTP/1.1 403 Forbidden'); exit; } // ...

Slide 22

Slide 22 text

For example ... if (! isset($_SESSION['user_id'])) { header('HTTP/1.1 403 Forbidden'); exit; } $user = new \User($_SESSION['user_id']); $filename = basename($_POST['filename']); $download = new \Download($filename); $abac = \PhpAbac\AbacFactory::getAbac(); $attributes = ['dynamic-attributes' => ['report-author' => $user->getId()]]; if ($abac->enforce('downloads-access', $user, $download, $attributes) !== true) { header('HTTP/1.1 403 Forbidden'); exit; } // ...

Slide 23

Slide 23 text

Risk-based Access Control In general, built upon an attribute-based system Leverages attributes that quantify risk ● How did the user authenticate? ● When and from where did they authenticate? ● How risky is the operation being performed? Effectively adds environmental info to the system

Slide 24

Slide 24 text

Final Items to Consider What does your application do? Who has access to the application? What is the potential impact of a breach? What is your overall threat model?

Slide 25

Slide 25 text

Questions?

Slide 26

Slide 26 text

Thank you! Please rate our talk: https://joind.in/talk/8b428