SlideShare a Scribd company logo
cbSecurity - Secure All Things
LED BY
Luis Majano
SESSION
@lmajano
@ortussolutions
• Salvadorean Born!
• Imported to the USA
• Computer Engineering
• CEO of Ortus Solutions
LUIS MAJANO
Your Host
Inspiration
Applying security concerns to our web applications is paramount.
Every application will need it.
Many forms of application security and many levels.
What is cbSecurity?
https://coldbox-security.ortusbooks.com/
Module Composition
What is needed for security?
• Validates user credentials
• Logs them in and out
• Tracks their security in session, custom
storage, or none.
• Validates Permissions
• Validates Roles
• Validates nothing 😜
What is needed for security?
What is needed for security?
• Use ANY auth service: IAuthenticationService
• Includes cbauth
• Login/Logout
• Session Tracking in session/request/cache
• You Provide a user service: IUserService
• You Provide a user object: IAuthUser
• Permission and Role Based
• Interfaces:
• IAuthUser - Roles and Permissions
• IJwtSubject - Jwt Scopes, etc.
1. What do we secure?
1. Events
2. URIs
2. How do we secure?
1. Security Rules
2. Handler + Action Annotations
3. JWT Headers
4. cbSecurity explicit methods
3. Who validates?
Security Firewall
V
Who validates? ➡ Validators
• Con
fi
gured globally or per-module
• Determine the type of authentication/authorization services to use
• The
fi
rewall calls the validator for a 👍 or 👎
• Core Validators
• Auth: role/permission-based security via IAuthService and IAuthUser interfaces
• CFML : Leverages CFML c
fl
ogin/c
fl
ogout features
• Basic Auth : Prompts users for credentials using HTTP Basic Auth
• JWT Validator : Checks headers for a JWT token and refresh token
• Custom Validators: ISecurityValidator
Validators
`
Security Rules
• Rules
• are evaluated from top to bottom (Order is important)
• secure incoming events/urls via regex patterns
• can have white-listed patterns
• can have roles and permissions
• can have ip, host header restrictions
• can be global or per-module
• can come from:
• Con
fi
g Inline
• Database
• XML, JSON
• Object Calls
Security Rules
Security Rules
• Each rule determines what action to occur if the request is not valid:
• Redirect to another event/URL
• Override the incoming event to another event
• Block the request with a 401 Not Authorized
• If there is no action in the rule, what happens?
• Cascades to module settings ➡ global settings
• defaultAuthenticationAction
• invalidAuthenticationEvent
• defaultAuthorizationAction
• invalidAuthorizationEvent
Security Rule Actions
Security Rule
• Cascading Security
• Component
• Access to all actions
• Actions
• Speci
fi
c action security
• Secure Annotation Value
• Nothing - Authenticated
• List - Authorizations
Handler Annotation Security
Security Rule
• cbSecurity stores &
fl
ashes the incoming URL
• rc._securedURL
• Better login experiences
Secured URL
• Security Helper Object
• Fluent constructs
• cbsecure() mixin (handlers/layouts/views/interceptors)
• Injection @cbsecurity (models)
• Different Types of Methods:
• Authentication: Verify if logged in, logout, authenticate
• Authorization Contexts: Fluent secure block
• Blocking: Throw a NotAuthorized exception
• Secure Views: Secure rendering of views
• Utility: Generating passwords, checking ip, hostnames, etc
• Veri
fi
cation: Verify permissions, etc
cbSecurity Model
getAuthService()
getUserService()
authenticate( username, password )
getUser()
isLoggedIn()
logout()
Authentication Methods
cbSecuriry
when( permissions, success, fail )
whenAll( permissions, success, fail )
whenNone( permissions, success, fail )
Security Context Methods
cbSecuriry
secure( permissions, [message] )
secureAll( permissions, [message] )
secureNone( permissions, [message] )
secureSameUser( user, [message])
secureWhen( context, [errorMessage] )
If context = true, then throw a NotAuthorized exception
Blocking Methods
cbSecuriry
secureView( permissions, successView,
failView )
Secure Views Methods
cbSecuriry
createPassword( length:32, letters:true, numbers:true, symbols:true )
getRealIP( trustUpstream:true )
getRealHost( trustUpstream:true )
Utility Methods
cbSecuriry
has( permissions ):boolean
all( permissions ):boolean
none( permissions ):boolean
sameUser( user ):boolean
Verification Methods
cbSecuriry
Security Visualizer
• Visualize all con
fi
guration settings
• Firewall activity
• Firewall rules simulator
• Security Headers
• Can also be secured
Security Visualizer
• Activate
fi
rewall logging
• Firewall > logs
Firewall Logs
• Collection of security best
practices
• Highly con
fi
gurable
• Several on by default
Security Headers
Cross-Site Request Forgery
CSRF
Cross-Site Request Forgery
CSRF
csrfToken()
csrfVerify()
csrf()
csrfField()
csrfRotate()
• Leverages the cbcsrf module
• Generate & validate tokens
• Highly con
fi
gurable
Cross-Site Request Forgery
CSRF
JWT Security
https://jwt.io/introduction/
JWT Security
Secure all things with CBSecurity 3
• https://forgebox.io/view/jwt-cfml
• Encode/Decode JSON Web Tokens
• HS256
• HS384
• HS512
• RS256
• RS384
• RS512
• ES256
• ES384
• ES512
JWT-CFML
Database
CacheBox
WireBox ID
IJwtStorage
Settings
• Issuer (iss) - The issuer of the token (defaults to the application's base URL)
• Issued At (iat) - When the token was issued (unix timestamp)
• Subject (sub) - This holds the identi
fi
er for the token (defaults to user id)
• Expiration time (exp) - The token expiry date (unix timestamp)
• Unique ID (jti) - A unique identi
fi
er for the token (md5 of the sub and iat claims)
• Scopes (scope) - A space-delimited string of scopes attached to the token
• Refresh Token (cbsecurity_refresh) - If you use refresh tokens, this custom claim
will be added to the payload.
Base Claims
Base Claims
• JWTService
• Helper: jwtAuth()
• Injection: JWTService@cbSecurity
• Rest and rest-hmvc templates give a full working example
JWT Service
JWT Service
JWT Service
JWT Service
JWT Service
JWT Service
JWT Service
JWT Service
JWT Controller
cbSecurity_onInvalidAuthentication
cbSecurity_onInvalidAuthorization
Login Interceptions
preAuthentication
postAuthentication
preLogin
postLogin
preLogout
postLogout
cbauth Interceptions
Jwt Interceptions
cbSecurity_onJWTCreation
cbSecurity_onJWTInvalidation
cbSecurity_onJWTValidAuthentication
cbSecurity_onJWTInvalidUser
cbSecurity_onJWTInvalidClaims
cbSecurity_onJWTExpiration
cbSecurity_onJWTStorageRejection
cbSecurity_onJWTValidParsing
cbSecurity_onJWTInvalidateAllTokens
Security Events
THANK YOU
Thanks to our sponsors

More Related Content

PPTX
CBSecurity 3 - Secure Your ColdBox Applications
PPTX
Bsidesnova- Pentesting Methodology - Making bits less complicated
PPTX
Intro to Apache Shiro
PDF
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
PPTX
Continuous Security Testing with Devops - OWASP EU 2014
PDF
SSL Everywhere!
PDF
7.1. SDLC try me to implenment
PDF
Super simple application security with Apache Shiro
CBSecurity 3 - Secure Your ColdBox Applications
Bsidesnova- Pentesting Methodology - Making bits less complicated
Intro to Apache Shiro
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
Continuous Security Testing with Devops - OWASP EU 2014
SSL Everywhere!
7.1. SDLC try me to implenment
Super simple application security with Apache Shiro

Similar to Secure all things with CBSecurity 3 (20)

PPTX
Alexey Sintsov- SDLC - try me to implement
PDF
Spring4 security
PPTX
Ten Commandments of Secure Coding - OWASP Top Ten Proactive Controls
PPTX
Ten Commandments of Secure Coding
PPT
Top Ten Proactive Web Security Controls v5
PDF
Securing Microservices using Play and Akka HTTP
PPTX
Spa Secure Coding Guide
PDF
Vault
PPTX
Essential security measures in ASP.NET MVC
PPTX
What Does a Full Featured Security Strategy Look Like?
PDF
Building a secure BFF at Postman
PPTX
JWT Authentication with AngularJS
PDF
Web security and OWASP
PPTX
Hacking mobile apps
PPTX
SSecuring Your MongoDB Deployment
PPTX
Securing Your MongoDB Deployment
PPTX
How to Test for The OWASP Top Ten
PDF
IT Camp 19: Top Azure security fails and how to avoid them
PPTX
Architecting for Microservices Part 2
PDF
H4CK1N6 - Web Application Security
Alexey Sintsov- SDLC - try me to implement
Spring4 security
Ten Commandments of Secure Coding - OWASP Top Ten Proactive Controls
Ten Commandments of Secure Coding
Top Ten Proactive Web Security Controls v5
Securing Microservices using Play and Akka HTTP
Spa Secure Coding Guide
Vault
Essential security measures in ASP.NET MVC
What Does a Full Featured Security Strategy Look Like?
Building a secure BFF at Postman
JWT Authentication with AngularJS
Web security and OWASP
Hacking mobile apps
SSecuring Your MongoDB Deployment
Securing Your MongoDB Deployment
How to Test for The OWASP Top Ten
IT Camp 19: Top Azure security fails and how to avoid them
Architecting for Microservices Part 2
H4CK1N6 - Web Application Security
Ad

More from Ortus Solutions, Corp (20)

PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
PDF
June Webinar: BoxLang-Dynamic-AWS-Lambda
PDF
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
PDF
What's-New-with-BoxLang-Brad Wood.pptx.pdf
PDF
Getting Started with BoxLang - CFCamp 2025.pdf
PDF
CFCamp2025 - Keynote Day 1 led by Luis Majano.pdf
PDF
What's New with BoxLang Led by Brad Wood.pdf
PDF
Vector Databases and the BoxLangCFML Developer.pdf
PDF
Using cbSSO in a ColdBox App Led by Jacob Beers.pdf
PDF
Use JSON to Slash Your Database Performance.pdf
PDF
Portable CI wGitLab and Github led by Gavin Pickin.pdf
PDF
Tame the Mesh An intro to cross-platform tracing and troubleshooting.pdf
PDF
Supercharging CommandBox with Let's Encrypt.pdf
PDF
Spice up your site with cool animations using GSAP..pdf
PDF
Passkeys and cbSecurity Led by Eric Peterson.pdf
PDF
Legacy Code Nightmares , Hellscapes, and Lessons Learned.pdf
PDF
Integrating the OpenAI API in Your Coldfusion Apps.pdf
PDF
Hidden Gems in FusionReactor for BoxLang, ACF, and Lucee Users.pdf
PDF
Geting-started with BoxLang Led By Raymon Camden.pdf
PDF
From Zero to CRUD with ORM - Led by Annette Liskey.pdf
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
June Webinar: BoxLang-Dynamic-AWS-Lambda
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
What's-New-with-BoxLang-Brad Wood.pptx.pdf
Getting Started with BoxLang - CFCamp 2025.pdf
CFCamp2025 - Keynote Day 1 led by Luis Majano.pdf
What's New with BoxLang Led by Brad Wood.pdf
Vector Databases and the BoxLangCFML Developer.pdf
Using cbSSO in a ColdBox App Led by Jacob Beers.pdf
Use JSON to Slash Your Database Performance.pdf
Portable CI wGitLab and Github led by Gavin Pickin.pdf
Tame the Mesh An intro to cross-platform tracing and troubleshooting.pdf
Supercharging CommandBox with Let's Encrypt.pdf
Spice up your site with cool animations using GSAP..pdf
Passkeys and cbSecurity Led by Eric Peterson.pdf
Legacy Code Nightmares , Hellscapes, and Lessons Learned.pdf
Integrating the OpenAI API in Your Coldfusion Apps.pdf
Hidden Gems in FusionReactor for BoxLang, ACF, and Lucee Users.pdf
Geting-started with BoxLang Led By Raymon Camden.pdf
From Zero to CRUD with ORM - Led by Annette Liskey.pdf
Ad

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Electronic commerce courselecture one. Pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Machine learning based COVID-19 study performance prediction
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Cloud computing and distributed systems.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Big Data Technologies - Introduction.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Encapsulation theory and applications.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Programs and apps: productivity, graphics, security and other tools
PPT
Teaching material agriculture food technology
PDF
cuic standard and advanced reporting.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Electronic commerce courselecture one. Pdf
Empathic Computing: Creating Shared Understanding
Diabetes mellitus diagnosis method based random forest with bat algorithm
Machine learning based COVID-19 study performance prediction
MYSQL Presentation for SQL database connectivity
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Spectroscopy.pptx food analysis technology
Cloud computing and distributed systems.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Big Data Technologies - Introduction.pptx
sap open course for s4hana steps from ECC to s4
Encapsulation theory and applications.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
The AUB Centre for AI in Media Proposal.docx
Programs and apps: productivity, graphics, security and other tools
Teaching material agriculture food technology
cuic standard and advanced reporting.pdf
Review of recent advances in non-invasive hemoglobin estimation

Secure all things with CBSecurity 3