For the complete documentation index, see llms.txt. This page is also available as Markdown.

Overview

What cbsecurity does and which part of it to reach for.

For any security system you need to know who the user is (authentication) and what they are allowed to do (authorization). cbsecurity provides both:

  • Authentication: validates credentials, logs users in and out, and tracks them in sessions or any custom storage.

  • Authorization: validates permissions, roles, both or neither.

Ways to Secure Your App

Pick the one that matches where you want the rule to live. They share the same validators, invalid actions, interceptions and logging, so you can mix them.

Approach
Where the rule lives
Best for

Config, JSON, XML, a database or a model

Central, data-driven policies. Rules can protect events and URLs, and admins can edit them at runtime.

On the handler or action

Security that travels with the code.

Next to the route in config/Router

Securing routes and groups with no rules file, plus throttling, API keys, IP filtering and more.

In your code

Securing any code context: services, views, blocks of logic.

When combined, rules run first, then annotations, then route middleware.

ColdBox Security Firewall

Validators

A validator knows how to authenticate and authorize a request. cbsecurity ships with:

Validator
Use it for

The default. Authentication and permission security through IAuthService and IAuthUser.

The engine's cflogin security. Authentication and role security.

HTTP Basic challenges, with optional in-config user storage.

JSON Web Tokens for REST APIs.

Your own authentication and authorization engine.

Security Validators Process Flow

How a Request Is Checked

The firewall asks the validator at preProcess. If the answer is no, it logs the block, announces an interception and runs a redirect, an override or a block. See How the Firewall Works.

Next Steps

Last updated

Was this helpful?