> For the complete documentation index, see [llms.txt](https://coldbox-security.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coldbox-security.ortusbooks.com/get-started/overview.md).

# 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.

![](https://2859563563-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LA-UVvPgjhMENW3Vxyw%2F-MibRWSfuXG8SMgIWYtQ%2F-MibRo_dQtNni4Hpsjq7%2Fimage.png?alt=media\&token=0e96a455-4c0a-44b2-9506-546108e34022)

## 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                                                                                                   |
| -------------------------------------------------------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| [Security rules](/secure-your-app/security-rules.md)     | 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. |
| [Annotations](/secure-your-app/security-annotations.md)  | On the handler or action                 | Security that travels with the code.                                                                       |
| [Route middleware](/secure-your-app/route-middleware.md) | Next to the route in `config/Router`     | Securing routes and groups with no rules file, plus throttling, API keys, IP filtering and more.           |
| [The `cbSecurity` model](/reference/cbsecurity-model.md) | 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](https://2859563563-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LA-UVvPgjhMENW3Vxyw%2F-MibSS421J_J1se3qwY6%2F-MibTkPJXqBEKXpSN5FW%2Fimage.png?alt=media\&token=696c622b-c113-4d70-8e61-3e2f7a7b6f01)

## Validators

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

| Validator                                                          | Use it for                                                                                  |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- |
| [Auth Validator](/reference/auth-validator.md)                     | The default. Authentication and permission security through `IAuthService` and `IAuthUser`. |
| [CFML Security Validator](/reference/default-security.md)          | The engine's `cflogin` security. Authentication and role security.                          |
| [Basic Auth Validator](/reference/basicauth-validator.md)          | HTTP Basic challenges, with optional in-config user storage.                                |
| [JWT Validator](/jwt/jwt-validator.md)                             | JSON Web Tokens for REST APIs.                                                              |
| [Custom Validator](/reference/custom-security-validator-object.md) | Your own authentication and authorization engine.                                           |

<figure><img src="https://2859563563-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQRx6Yt4XoVCeRC7Rgbxy%2Fuploads%2FQqc104KAUddQmBJ0acJN%2FCBSecurity%20Validators.png?alt=media&amp;token=0fd3256c-9bc2-49b8-986e-9f3f22e72470" alt=""><figcaption><p>Security Validators Process Flow</p></figcaption></figure>

## 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](/get-started/how-the-firewall-works.md).

## Next Steps

* New to cbsecurity? Start with [Installation](/get-started/installation.md) and [Configuration](/get-started/configuration.md).
* Securing a REST API? See [JWT](/jwt/jwt-services.md).
* Protecting forms? See [Cross Site Request Forgery](/csrf-and-headers/cross-site-request-forgery-cbcsrf.md).
* Debugging rules? Turn on the [Visualizer](/get-started/configuration/visualizer.md).
* Looking up an event? See [Interceptions](/reference/interceptions.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://coldbox-security.ortusbooks.com/get-started/overview.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
