> For the complete documentation index, see [llms.txt](https://docs.chamilo.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chamilo.org/administration-guide/admin-guide/platform-settings/security-settings.md).

# Security

Login protection, password policy, content security headers, two-factor authentication, and the lightweight intrusion detection system.

This page covers security *policy*. For the monitoring tools that watch the platform using this policy (login attempt logs, intrusion detection events, password strength scans, and file integrity checks), see [Security](https://docs.chamilo.org/administration-guide/admin-guide/security.md).

Access these settings under **Administration > Configuration settings > Security**. The settings below describe this category; the platform settings fixtures (`SettingsCurrentFixtures.php`) are the source of truth for setting names and titles.

> The variable name in code is shown in monospace. Use it when scripting via the API or when you need to change those settings at a global level by editing [`config/settings_override.yaml`](https://github.com/chamilo/chamilo-lms/wiki/Configurations#configsettings_overridesyaml).

## Teacher-authored JavaScript

### `teacher_use_js`

**Teachers can use JavaScript in WYSIWYG editors**

This global setting (`security.teacher_use_js`) applies to all Access URLs. By default (`true`), existing behavior is preserved for content explicitly treated as trusted teacher HTML. When set to `false`, those paths use the teacher HTMLPurifier profile, removing scripts and unsafe HTML attributes such as JavaScript event handlers while retaining permitted formatting.

Previously saved Course Description HTML is also filtered when read with the setting disabled; saved database content is not rewritten. Re-enabling the setting can therefore expose previously stored trusted content again. This is not a general-purpose sanitization of every stored HTML field or a replacement for content security policy and other application security controls. Coverage for historical HTML in other tools should be verified separately.

To check the policy on a staging portal, create a Course Description with harmless formatting and a harmless JavaScript event attribute using a test teacher. Compare rendering with the setting enabled and disabled, including content saved before disabling it. See [PR #9505](https://github.com/chamilo/chamilo-lms/pull/9505).

## Settings

### `2fa_enable`

**Enable 2FA**

Add fields in the password update page to enable 2FA using a TOTP authenticator app. When disabled globally, users won't see 2FA fields and won't be prompted for 2FA at login, even if they had enabled it previously.

*Default: `false`*

### `access_to_personal_file_for_all`

**Access to personal file for all**

Allows access to all personal files without restriction

*Default: `false`*

### `antivirus_upload_enabled`

**Enable antivirus upload scanning**

Require ClamAV scanning for guarded upload operations. Configure and test the server-side daemon first; failed scans and detections block the upload. See [Antivirus Upload Scanning](https://docs.chamilo.org/administration-guide/admin-guide/security/antivirus-upload-scanning.md) for installation, testing and audit reporting.

*Default: `false` (global)*

### `admins_can_set_users_pass`

**Admins can set users passwords manually**

\[inferred] When enabled, administrators can manually set user passwords directly without requiring users to reset them.

### `allow_captcha`

**CAPTCHA**

Enable a CAPTCHA on the login form, inscription form and lost password form to avoid password hammering

*Default: `false`*

### `allow_online_users_by_status`

**Filter users that can be seen as online**

Limits online user visibility to specific user roles.

### `allow_strength_pass_checker`

**Password strength checker**

Enable this option to add a visual indicator of password strength, when the user changes his/her password. This will NOT prevent bad passwords to be added, it only acts as a visual helper.

*Default: `true`*

### `anonymous_autoprovisioning`

**Auto-provision more anonymous users**

Dynamically creates new anonymous users to support high visitor traffic.

*Default: `false`*

### `captcha_number_mistakes_to_block_account`

**CAPTCHA mistakes allowance**

The number of times a user can make a mistake on the CAPTCHA box before his account is locked out.

### `captcha_time_to_block`

**CAPTCHA account locking time**

If the user reaches the maximum allowance for login mistakes (when using the CAPTCHA), his/her account will be locked for this number of minutes.

### `check_password`

**Check password requirements**

Enable validation of the password requirements defined above during password creation or password update.

*Default: `false`*

### `content_security_policy_mode` **v3.1**

**Content Security Policy mode**

Select `disabled`, `report_only` or `enforce` to control the optional application CSP for pages rendered with Chamilo's shared layout. Report only observes violations without blocking resources; Enforce applies the configured policy. Test on a staging portal before enforcing a policy. See [Content Security Policy](https://docs.chamilo.org/administration-guide/admin-guide/platform-settings/security-settings/content-security-policy.md) for policy examples, scope and emergency recovery.

*Default: `disabled`*

### `confidential_reporting_attachments_enabled`

**Allow confidential evidence attachments**

Controls whether reporters can attach evidence files to a confidential report.

*Default: `true`*

### `confidential_reporting_enabled`

**Enable confidential welfare reporting**

Turns on the confidential reporting and investigation workflow. Private encryption-key storage must be ready before enabling it. See [Confidential Reporting](https://docs.chamilo.org/administration-guide/admin-guide/security/confidential-reporting.md).

*Default: `false`*

### `confidential_reporting_min_reporters`

**Minimum distinct reporters for an investigation**

An investigation becomes visible to authorized investigators only after this number of distinct reporters has submitted reports concerning the same person. Valid range: **2–10**.

*Default: `2`*

### `confidential_reporting_notifications_enabled`

**Show confidential investigation notifications**

Displays an internal indication of eligible investigations. **It does not send emails or external notifications.**

*Default: `false`*

### `dynamic_client_registration`

**Enable OAuth Dynamic Client Registration beyond MCP**

Controls additional OAuth client registration scope validation when the OAuth server is enabled. The rate-limited registration endpoint remains available for the supported MCP registration flow. This setting does not grant access to arbitrary future OAuth protected resources. See [OAuth Authorization Server](https://docs.chamilo.org/administration-guide/admin-guide/authentication/oauth-server.md).

*Default: `false`*

### `file_integrity_check_notify_admins` **v3**

**File integrity check notification recipients**

Comma-separated list of e-mail addresses to notify when a file integrity scan detects a change. Leave empty to notify every global administrator instead.

### `filter_terms`

**Filter terms**

Give a list of terms, one by line, to be filtered out of web pages and e-mails. These terms will be replaced by \*\*\*.

### `force_renew_password_at_first_login`

**Force password renewal at first login**

This is one simple measure to increase the security of your portal by asking users to immediately change their password, so the one that was transfered by e-mail is no longer valid and they then will use one that they came up with and that they are the only person to know.

*Default: `false`*

### `hide_breadcrumb_if_not_allowed`

**Hide breadcrumb if 'not allowed'**

If the user is not allowed to access a specific page, also hide the breadcrumb. This increases security by avoiding the display of unnecessary information.

*Default: `false`*

### `login_max_attempt_before_blocking_account`

**Max login attempts before lockdown**

Number of failed login attempts to tolerate before the user account is locked and has to be unlocked by an admin.

*Default: `0`*

### `mcp_allowed_roles`

**Allow MCP by roles**

JSON map of Chamilo user roles allowed to use MCP. A user must match at least one enabled role. This restriction also applies to previously generated API keys and existing OAuth connections. Recognized keys are `ADMIN`, `COURSEMANAGER`, `STUDENT`, `HRM`, `SESSIONADMIN`, `STUDENT_BOSS` and `INVITEE`; invalid JSON denies MCP to every role. Existing configurations can still use `DRH` when `HRM` is absent; when both keys exist, `HRM` takes precedence. See [MCP](https://docs.chamilo.org/administration-guide/admin-guide/mcp.md).

*Default: `{"ADMIN":true,"COURSEMANAGER":true,"STUDENT":false,"HRM":false,"SESSIONADMIN":false,"STUDENT_BOSS":false,"INVITEE":false}`*

### `mcp_enabled`

**Enable MCP server**

Enables the Chamilo MCP endpoint and the personal MCP API key interface. When disabled, existing API keys, OAuth access tokens and JWT credentials cannot be used on /mcp. While disabled, the **MCP API key** button is not shown on the user's social network page. See [MCP](https://docs.chamilo.org/administration-guide/admin-guide/mcp.md).

*Default: `false`*

### `password_requirements`

**Minimal password syntax requirements**

Defines the required structure for user passwords. Example: {"min":{"length":8,"lowercase":1,"uppercase":1,"numeric":1,"specials":1}}. Use "specials" (plural) to require special characters.

### `password_rotation_days`

**Password rotation interval (days)**

Number of days before users must rotate their password (0 = disabled).

*Default: `0`*

### `prevent_multiple_simultaneous_login`

**Prevent simultaneous login**

Prevent users connecting with the same account more than once. This is a good option on pay-per-access portals, but might be restrictive during testing as only one browser can connect with any given account.

*Default: `false`*

### `proxy_settings`

**Proxy settings**

Some features of Chamilo will connect to the exterior from the server. For example to make sure an external content exists when creating a link or showing an embedded page in the learning path. If your Chamilo server uses a proxy to get out of its network, this would be the place to configure it.

### `remember_me_days`

**Remember me duration (days)**

Sets the duration of persistent login cookies and their database tokens. Accepts **0–90** days; `0` disables the Remember me option, and the login form only displays this option on HTTPS connections.

*Default: `14` days*

### `security_block_inactive_users_immediately`

**Block disabled users immediately**

Immediately block users who have been disabled by the admin through users management. Otherwise, users who have been disabled will keep their previous privileges until they logout.

*Default: `false`*

### `security_content_policy`

**Content Security Policy**

Policy sent in the `Content-Security-Policy` header when the mode is `enforce`. The existing value is preserved on upgrade. Use the quoted placeholder `'nonce-{nonce}'` to authorize explicitly marked core scripts with a fresh nonce per response. An empty value omits the selected header. Existing compatibility-oriented defaults containing `'unsafe-inline'` and `'unsafe-eval'` are not strict CSP policies. See [Content Security Policy](https://docs.chamilo.org/administration-guide/admin-guide/platform-settings/security-settings/content-security-policy.md) before enabling enforcement.

### `security_content_policy_report_only`

**Content Security Policy report only**

Policy sent in the `Content-Security-Policy-Report-Only` header when the mode is `report_only`. Violations can be inspected in browser developer tools without blocking the resources under this policy. The existing value is preserved on upgrade; an empty value omits the selected header. Configure a reporting receiver separately if centralized reports are required.

### `security_public_key_pins`

**HTTP Public Key Pinning**

HTTP Public Key Pinning protects your site from MiTM attacks using rogue X.509 certificates. By whitelisting only the identities that the browser should trust, your users are protected in the event a certificate authority is compromised.

### `security_public_key_pins_report_only`

**HTTP Public Key Pinning report only**

This setting allows you to experiment by reporting but not enforcing some HTTP Public Key Pinning.

### `security_referrer_policy`

**Security Referrer Policy**

Referrer Policy is a new header that allows a site to control how much information the browser includes with navigation away from a document and should be set by all sites.

*Default: `origin-when-cross-origin`*

### `security_session_cookie_samesite_none`

**Session cookie samesite**

Enable samesite:None parameter for session cookie. More info: <https://www.chromium.org/updates/same-site> and <https://developers.google.com/search/blog/2020/01/get-ready-for-new-samesitenone-secure>

*Default: `false`*

### `security_strict_transport`

**HTTP Strict Transport Security**

HTTP Strict Transport Security is an excellent feature to support on your site and strengthens your implementation of TLS by getting the User Agent to enforce the use of HTTPS. Recommended value: 'strict-transport-security: max-age=63072000; includeSubDomains'. See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security>. You can include the 'preload' suffix, but this has consequences on the top level domain (TLD), so probably not to be done lightly. See <https://hstspreload.org/>. Leave blank to disable.

### `security_x_content_type_options`

**X-Content-Type-Options**

X-Content-Type-Options stops a browser from trying to MIME-sniff the content type and forces it to stick with the declared content-type. The only valid value for this header is 'nosniff'.

*Default: `nosniff`*

### `security_x_frame_options`

**X-Frame-Options**

X-Frame-Options tells the browser whether you want to allow your site to be framed or not. By preventing a browser from framing your site you can defend against attacks like clickjacking. If defining a URL here, it should define the URL(s) from which your content should be visible, not the URLs from which your site accepts content. For example, if your main URL (root\_web above) is <https://11.chamilo.org/>, then this setting should be: 'ALLOW-FROM <https://11.chamilo.org>'. These headers only apply to pages where Chamilo is responsible of the HTTP headers generation (i.e. '.php' files). It does not apply to static files. If playing with this feature, make sure you also update your web server configuration to add the right headers for static files. See CDN configuration documentation above (search for 'add\_header') for more information. Recommended (strict) value for this setting, if enabled: 'SAMEORIGIN'.

*Default: `SAMEORIGIN`*

### `security_xss_protection`

**X-XSS-Protection**

X-XSS-Protection sets the configuration for the cross-site scripting filter built into most browsers. Recommended value '1; mode=block'.

*Default: `1; mode=block`*

### `user_reset_password`

**Enable password reset token**

This option allows to generate a expiring single-use token sent by e-mail to the user to reset his/her password.

*Default: `false`*

### `user_reset_password_token_limit`

**Time limit for password reset token**

The number of seconds before the generated token automatically expires and cannot be used anymore (a new token needs to be generated).

*Default: `3600`*
