27
Advanced Fusebox: Securing a Fusebox Application By Steve Nelson SecretAgents.com

Advanced Fusebox: Securing a Fusebox Application

  • Upload
    porter

  • View
    48

  • Download
    0

Embed Size (px)

DESCRIPTION

Advanced Fusebox: Securing a Fusebox Application. By Steve Nelson SecretAgents.com. Securing a Fusebox Application. Understand Fusebox terminology Understand your users Understand how to use App_Secure.cfm, App_login.cfm, App_logout.cfm Finally, Understand Secured SQL Statements. - PowerPoint PPT Presentation

Citation preview

Page 1: Advanced Fusebox: Securing a Fusebox Application

Advanced Fusebox:

Securing a Fusebox Application

By Steve Nelson

SecretAgents.com

Page 2: Advanced Fusebox: Securing a Fusebox Application

Securing a Fusebox Application

1. Understand Fusebox terminology

2. Understand your users

3. Understand how to use App_Secure.cfm, App_login.cfm, App_logout.cfm

4. Finally, Understand Secured SQL Statements

Page 3: Advanced Fusebox: Securing a Fusebox Application

1. Fusebox Terminology

Home Application Circuit Applications Fusebox Fuseactions Fuses

Page 4: Advanced Fusebox: Securing a Fusebox Application

Home Application

This is made up of many circuit applications

Example: SecretAgents.com

Page 5: Advanced Fusebox: Securing a Fusebox Application

Circuit Applications

A section of a larger application Example: SecretAgents.com/members

Page 6: Advanced Fusebox: Securing a Fusebox Application

The Fusebox

This controls what a user is attempting to do The default web server template Index.cfm

is the “Fusebox”

Page 7: Advanced Fusebox: Securing a Fusebox Application

Fuseactions

This is a single action that the user is attempting to perform

Allows for one or more Fuses in each Fuseaction

Page 8: Advanced Fusebox: Securing a Fusebox Application

Fuses One of the .cfm files containing the code

needed to run a Fuseaction File naming convention: dsp_file.cfm (display)

act_file.cfm (action) qry_file.cfm (query) and app_file.cfm (application)

Page 9: Advanced Fusebox: Securing a Fusebox Application

2. Who Are Your Users?

Public Users Registered Public Users Registered Private Users

Page 10: Advanced Fusebox: Securing a Fusebox Application

Public Users

Any user in the world who has not identified him/herself

Examples:– Reading threads in a forum– Viewing products– Reading news articles

Page 11: Advanced Fusebox: Securing a Fusebox Application

Registered Public Users

A user whom has freely registered These users can do certain public tasks that

need to be associated with the userExamples:– Posting a thread to a forum– Purchasing products– Suggest news article

Page 12: Advanced Fusebox: Securing a Fusebox Application

Registered Private Users

These are groups of users that have been granted access to private areas of a siteExamples:– Moderating a forums– Editing product data– Editing news articles

Page 13: Advanced Fusebox: Securing a Fusebox Application

3. Fusebox Security

App_Login.cfm – When a user is attempting to login

App_Logout.cfm – When a user is attempting to Logout

App_Secure.cfm – Securing an entire Circuit Application or Fuseaction

Page 14: Advanced Fusebox: Securing a Fusebox Application

Security Database Tables

These tables can be defined by you My Suggestion:

– Three tables: Users, Groups, User_Groups

Page 15: Advanced Fusebox: Securing a Fusebox Application

App_Login.cfm

This file can be defined by you Verify the user is who they say they are Assign them their #Client.User_ID# Assign them their list of Groups:

#Client.User_Groups# Return them to where they should be with

<CF_RETURNFUSEACTION>

Page 16: Advanced Fusebox: Securing a Fusebox Application

App_Logout.cfm

This file can be defined by you Reset CFID/CFTOKENS if coming from

another site Remove Client Variables Set/Delete CFID/CFTOKEN cookies App_Logout.cfm is commonly called in

App_globals.cfm

Page 17: Advanced Fusebox: Securing a Fusebox Application

App_Secure.cfm

This file can be defined by you Used for verifying Registered Public and

Private users If the user does not have permissions it will

send them to your login form

Page 18: Advanced Fusebox: Securing a Fusebox Application

Security Variables #Client.User_id# defines “who” the user is,

needed for Registered Public and Registered Private, this needs to be set by your login script

#Client.User_Groups# contains a list of “Groups” the user belongs to, needed for Registered Private, this needs to be set by your login script

#Attributes.Groups# contains a list of groups allowed to access the area used in App_Secure.cfm

Page 19: Advanced Fusebox: Securing a Fusebox Application

How to Use App_secure.cfm

How to secure a Circuit application How to secure a Fuseaction How to secure an area of a Fuse

Page 20: Advanced Fusebox: Securing a Fusebox Application

Securing a Circuit Application

If every Fuseaction in a Circuit application needs to be secured, call App_Secure.cfm with CFMODULE at the top of index.cfm

Assign the necessary groups to the “groups” attribute of App_Secure.cfm

Page 21: Advanced Fusebox: Securing a Fusebox Application

Securing a Fuseaction For each Fuseaction that needs to be secured,

call App_Secure.cfm in the CFCASE statement with the necessary groups

Page 22: Advanced Fusebox: Securing a Fusebox Application

Securing an Area of a Fuse

Place a simple CFIF statement looking at the #client.user_groups# list to see if a user belongs to the appropriate group and may view the area

Page 23: Advanced Fusebox: Securing a Fusebox Application

4. Secured SQL Statements

Even if a user belongs to a group, they should only be able to edit or delete “their” data

Associate new records (inserts) with #client.User_ID#, or other User specific variables

Verify edits/deletes with #client.User_id#, or other User specific variables

Page 24: Advanced Fusebox: Securing a Fusebox Application

User Specific Insert Statement

Associate #client.User_ID# to an Insert Statement when necessary

Page 25: Advanced Fusebox: Securing a Fusebox Application

Secured Update Statement

Verify #client.User_ID# in an Update Statement when necessary

Page 26: Advanced Fusebox: Securing a Fusebox Application

Secured Delete Statement

Verify #client.User_ID# in an Delete Statement when necessary

Page 27: Advanced Fusebox: Securing a Fusebox Application

Fusebox Makes Security Simple

The structure of Fusebox makes security simple.

Focus on securing:– Entire Circuit Applications– Individual Fuseactions– Areas of a Fuse– User specific records in the database