Skip to content

Security.json

Cautions

When changing parameters, please refer to "Confirmation When Changing Parameters".

Limitations

About Departments/Groups Set in IpRestrictionExcludeMembers

If you allow access to Pleasanter on a department/group basis, using the "Department Management Function" or "Group Management Function" to delete or disable the relevant department/group, or to delete the users belonging to it, will result in the users no longer being able to access Pleasanter. Suppose a user with important administrative privileges, such as a tenant manager, is no longer able to access Pleasanter. In that case, it may be necessary to change the IP address of the device they are using or reconfigure "Security.json". Please be careful when deleting/disabling departments/groups set in IpRestrictionExcludeMembers, or deleting users belonging to them.

*If you are not restricting access by IP address using AllowIpAddresses, there is no need to consider the above restrictions.

Setting Values

The setting values of this parameter file are as follows.

Parameter name e.g. Description
AllowIpAddresses ["10.10.10.10", "10.10.10.20", "10.10.1.0/24"] Used to restrict access by IP address. Specify the source IP address you want to allow. You can specify by IP address or CIDR notation. If null, there will be no restriction by IP address.
IpRestrictionExcludeMembers ["User1", "User100", "Dept1", "Group1"] Can be set when an IP address is set in AllowIpAddresses. Access will be allowed for users who meet the conditions specified in this parameter, even if the access is from an IP address other than the one set in AllowIpAddresses. For details, refer to "Combination of AllowIpAddresses/IpRestrictionExcludeMembers" below.
MimeTypeCheckOnApi false Set whether to strictly validate the Content-Type of API requests.

true
Validates strictly and allows only the following two Content-Types. Returns 400 Bad Request for invalid requests.

- Regular API
 → application/json only
- File import API
 → multipart/form-data only

false (default)
Does not validate strictly.
PrivilegedUsers ["Administrator", "AdminUser1", "AdminUser2"] Specify the login ID of the "Privileged User". "Privileged User" can perform all operations, including operations on sites for which they do not have permission. Multiple users can be specified by separating them with commas.
RevealUserDisabled false Specify true if you want to display an error message when logging in that the user is disabled.
LockoutCount 10 Automatically locks the account if the number of times the password is entered incorrectly exceeds the set number. Locked accounts must be unlocked in the user management screen. If set to 0, the account will not be locked.
PasswordExpirationPeriod 90 Specify the number of days to calculate the password expiration period for local users. If set to 0, there is no expiration period.
JoeAccountCheck true Specify true if you want to prohibit the use of the same login ID and password.
TokenCheck false As a countermeasure against CSRF (cross-site request forgery), specify true if you want to issue a token for each session and reject POST requests that do not include a token as an invalid request. When the Form function is enabled, this parameter has no effect (the standard CSRF countermeasure of ASP.NET Core is built in, so the CSRF countermeasure always works).
SecureCookies false Specify true if you want to assign the secure attribute to cookies in an environment that uses SSL/TLS communication.
DisableMvcResponseHeader false Specify true if you do not want to include the "X-AspNet-Mvc-Version" header in the response header. *Valid only for .NetFramework version
DisableDeletingSiteAuthentication false Specify true if you want to allow deletion without entering authentication information (login ID/password) when deleting a site.
AccessControlAllowOrigin ["*"] Specify the URLs of the sites that are allowed for cross-origin resource sharing (CORS). ["*"] allows all. null rejects all cross-origin requests.
EnforcePasswordHistories 12 Specify the number of times to record the history of previously set passwords. Prevents reuse of previously used passwords.
DisableCheckPasswordPolicyIfApi false Specify true if you want to ignore the password policy when creating a user with the API. Use this when you do not want to specify the password of the user you are creating, such as in the case of LDAP authentication.
PasswordPolicies See below for instructions on how to set it Specify the password policy and error message. You can set multiple policies in combination.
PasswordGenerator true Specify true to display the icon for automatic password generation (key icon) on the right side of the password input field in User Management and other screens.
SecondaryAuthentication See below for instructions on how to set it Set enabled to true if you want to perform two-step authentication.
AspNetCoreDataProtection For how to set it, see "Store ASP.NET Core Data Protection Keys Externally" A parameter that specifies the storage location of the data protection keys of ASP.NET Core Data Protection.
HttpStrictTransportSecurity See below for instructions on how to set it Applies the HTTP Strict Transport Security protocol and forces communication over HTTPS.
SecureCacheControl See below for instructions on how to set it Set the response header to include the Cache-Control header.
HealthCheck See below for instructions on how to set it Set Enabled to true when using the Health Check Function.
ContentSecurityPolicy See below for instructions on how to set it Set Enabled to true when using the Content Security Policy Function.
ShowLoginPageOnAuthError true Set true to move to the login screen, or false to move to the 404 page, when a URL that Pleasanter can interpret is accessed while not logged in to Pleasanter. For how to use it with the Form function, see "Settings for Safer Use".
CaptchaConfig See below for instructions on how to set it Configures the CAPTCHA used in the Form function.
ForwardedHeaders See below for instructions on how to set it Specify the networks and IP addresses of the reverse proxies to trust. Use it in combination with Trusted Reverse Proxy Authentication (the TrustedProxyParameters parameter of Authentication.json).
ExcludeCookiePrefixes ["AWSALB", "AWSELB"] Specify the prefixes of cookies to exclude from deletion at logout.

AllowIpAddresses/IpRestrictionExcludeMembers combination

Please set AllowIpAddresses/IpRestrictionExcludeMembers using any combination of 1. to 3. below.

  1. AllowIpAddresses:null / IpRestrictionExcludeMembers:null

    Content Target access
    Connections to allow access Access from any IP address
    Connections that restrict access None
  2. AllowIpAddresses: Set IP address / IpRestrictionExcludeMembers: null

    Content Target access
    Connections to allow access Access from the IP address set in AllowIpAddresses
    Connections that restrict access Access from IP addresses other than those set in AllowIpAddresses
  3. AllowIpAddresses: Set IP addresses / IpRestrictionExcludeMembers: Set user ID/department ID/group ID according to the "Example of IpRestrictionExcludeMembers settings" described later.

    Content Target access
    Connections that allow access (1) Access from IP addresses set in AllowIpAddresses
    (2) Access from IP addresses other than those set in AllowIpAddresses, and access by users permitted in the format of "Example of IpRestrictionExcludeMembers settings" described below
    Connections that restrict access Access from IP addresses other than those set in AllowIpAddresses, and access by users other than those permitted in the format of "Example of IpRestrictionExcludeMembers settings" described below

IpRestrictionExcludeMembers configuration example

Setting example Result
["User1"] Allow access for user ID:1.
["Dept1"] Allow access for users belonging to department ID:1.
["Group1"] Permit access to users belonging to group ID:1/users belonging to "Departments belonging to group ID:1".

If you specify multiple IDs in IpRestrictionExcludeMembers separated by commas, such as ["User1","Dept1","Group1"], access will be allowed for users that match any of them.

Set Password Policies

Parameter name e.g. Description
Enabled true Set whether to use this policy with true/false.
Regex The setting method is described later. Set the string that must be included in the password using a regular expression.
Languages Any error message Set error messages for each supported language.

Example of Regular Expression Set in Regex

Regular expression Description
".{8,}" Password length must be at least 8 characters.
"[a-z]+" At least one lowercase alphabetic character is required.
"[A-Z]+" At least one capital letter is required.
"[0-9]+" At least one number is required.
"[^a-zA-Z0-9]+" At least one character (symbol) other than alphabets and numbers is required.

Set SecondaryAuthentication

Parameter name e.g. Description
Enabled true ~~Set whether to use this policy with true/false. ~~ *1
Mode "None" Set whether to use the two-step authentication function.
NotificationType "Mail" Set the authentication method. Can be set to "Mail" or "Totp". *2
CountTolerances 1 Specify the number of generations of the verification code that will be valid when authenticating with TOTP. *2
NotificationMailBcc true Set whether to send the authentication code to the SupportFrom address by BCC with true/false.
AuthenticationCodeCharacterType "Number" Set the character type of the authentication code. (Number: numbers only, Letter: letters only, NumberAndLetter: numbers and letters)
AuthenticationCodeLength 128 Set the number of characters.
AuthenticationCodeExpirationPeriod 300 Set the validity period of the authentication code in seconds.

*1 It has been discontinued since Pleasanter 1.3.2.0 and Pleasanter .NET Framework version 0.51.2 and later versions. Please use Mode as an alternative parameter.

*2 For details on each authentication method, please refer to the following manuals.
Enable two-step authentication by email
Enable two-step authentication by TOTP (Time-based One-Time Password)

Set Mode

Set value Description
None Disable the two-step verification feature.
DefaultEnable Enables the two-step authentication function and enables two-step authentication for all users as the default setting. You can disable two-step authentication for any user from User Management.
DefaultDisable Enables the two-step authentication function and disables two-step authentication for all users as the default setting. You can enable two-step authentication for any user from User Management.

Set HttpStrictTransportSecurity

About HTTP Strict Transport Security (HSTS)

HTTP Strict Transport Security (HSTS) is an opt-in security enhancement specified by web apps using a response header. When a browser that supports HSTS receives this header:

  • The browser stores a configuration for domains that cannot send communication over HTTP. The browser forces all communication to occur over HTTPS.
  • The browser prevents users from using untrusted or invalid certificates. The browser disables prompts that allow users to temporarily trust such certificates.

For details, please refer to the document below.
HTTP Strict Transport Security Protocol (HSTS)|Microsoft Learn

Parameter List

Parameter name e.g. Description
Enabled true Enable the HSTS feature
Preload false Set the preload parameter of the Strict-Transport-Security header. Preloading is not part of the RFC HSTS specification, but web browsers support preloading HSTS sites during fresh installations.
IncludeSubDomains false Enable includeSubDomain. This ensures that HSTS policy applies to host subdomains.
MaxAge 30.00:00:00 Set the max-age parameter of the Strict-Transport-Security header. If not set, the default value is 30 days. Set the value according to the following format: "{days}.{hours}:{minutes}:{seconds}"
ExcludeHosts ["abc.example.com", "xyx.example.com"] Specify the hostnames to exclude in an array format.

Set SecureCacheControl

Parameter name e.g. Description
NoCache false Adds the no-cache parameter to the Cache-Control header.
NoStore false Adds the no-store parameter to the Cache-Control header.
Private false Adds the private parameter to the Cache-Control header.
MustRevalidate false Adds the must-revalidate parameter to the Cache-Control header.
PragmaNoCache false Includes the Pragma:no-cache header in the response.

*If any of NoCache, NoStore, Private, and MustRevalidate is set to true, a Cache-Control header will be added to the response.

*Please refer to the following document for details of each parameter.
Cache-Control|MDN
Pragma|MDN

Set HealthCheck

Parameter List

Parameter name e.g. Description
Enabled true Enables the health check function.
EnableDatabaseCheck true Enables the database connection check in the health check function. *
HealthQuery "select 1;" Specify the SQL used for the database connection check.
RequireHosts ["192.168.1.100"] Specify this to restrict health checks so that they can be performed only from the specified hosts.
EnableDetailedResponse false Enable this to return a detailed response from the health check.

*The database connection check is performed using the connection string set in UserConnectionString of Rds.json.

EnableDetailedResponse
Parameter name Description
status Indicates the aggregate status of all health checks.
totalDuration Indicates the time taken for the health check.
entries Indicates the result of each health check. For each parameter in the results, see "entries" below.
entries
Parameter name Description
data Indicates additional key-value pairs that describe the health of the component.
description Indicates the status of the component being checked.
duration Indicates the execution time of the health check.
exception Indicates the exception thrown while checking the status.
status Indicates the health status of the component being checked.
tags Indicates the tags associated with the health check.
Reference Information

For details on the above parameters (properties), please refer to the official Microsoft documentation.
Routing in ASP.NET Core > Host matching in routes with RequireHost
HealthReport Class (Microsoft.Extensions.Diagnostics.HealthChecks)
HealthReportEntry Struct (Microsoft.Extensions.Diagnostics.HealthChecks)

Set ContentSecurityPolicy

Parameter List

Parameter name e.g. Description
Enabled false Set to true or false to enable or disable the Content Security Policy (CSP) feature. *3 *5 *6
ReportOnlyEnabled true Set to true or false to enable or disable the Content Security Policy Report-Only feature. *4 *5
Values Configuration method described below Specify the settings to apply to the Content Security Policy feature.

*3 When set to true, if a policy violation is detected, a violation report will be output to the browser’s console log and the loading of the violating resource will be blocked.
*4 When set to true, if a policy violation is detected, a violation report will be output to the browser’s console log.
*5 If a report-uri is specified, a violation report will be sent.
*6 When setting Enabled to true, please first set ReportOnlyEnabled to true and confirm that there is no impact on the operation of Pleasanter before enabling it.

Values

Parameter name e.g. Description
default-src 'self' Specifies the default source for loading resources.
script-src 'self' 'strict-dynamic' Specifies the source for loading scripts.
script-src-attr 'self' 'unsafe-inline' Specifies allowed sources for inline script attributes.
script-src-elem - Specifies the sources for loading scripts loaded as <script> elements.
style-src 'self' Specifies the source for loading stylesheets.
style-src-attr 'self' 'unsafe-inline' Specifies allowed sources for inline style attributes.
style-src-elem 'self' 'unsafe-inline' Specifies allowed sources for style elements.
img-src 'self' data: Specifies the source for loading images.
font-src 'self' data: Specifies the source for loading fonts.
object-src 'none' Specifies the source for loading objects.
connect-src 'self' Specifies allowed URLs for external connections.
frame-src 'none' Specifies the source for loading frames.
manifest-src - Specifies the source for loading manifest files.
media-src - Specifies the source for loading media elements such as <audio> and <video>.
worker-src - Specifies the source for loading Worker, SharedWorker, and ServiceWorker scripts.
base-uri 'self' Specifies allowed sources for the base tag.
form-action 'self' Specifies the destination for form submissions.
frame-ancestors - Specifies the sources that can load the page in frames such as <frame>, <iframe>, <object>, and <embed>.
report-uri /CspReport/Report Specifies the URL for sending violation reports.
report-to - Specifies the endpoint for sending violation reports.
sandbox - Specifies sandbox restrictions applied to page operations, such as prohibiting scripts and form submissions.
upgrade-insecure-requests false Specifies whether to automatically rewrite HTTP resource requests to HTTPS so that they are loaded securely.

For details about each parameter’s configuration values please refer to MDN Web Docs: Content Security Policy (CSP).
If you change the parameter values, please set ReportOnlyEnabled to true and confirm that there is no impact on the operation of Pleasanter.

Set CaptchaConfig

Parameter name e.g. Description
Type None Set the name of the CAPTCHA service to use. For the setup procedure, see "Form: Operation: Configuring reCAPTCHA".
SiteKey - Set the site key issued by the CAPTCHA service provider. For how to obtain it, see "Form: Operation: Configuring reCAPTCHA".
SecretKey - Set the secret key issued by the CAPTCHA service provider.
RecaptchaV3 {"DefaultScoreThreshold": "0.7"} Set the score threshold for Google reCAPTCHA v3.

ForwardedHeaders

This parameter specifies the networks and IP addresses to trust as reverse proxies. It is used for the following two purposes, each of which has an independent effect.

  1. Restricting the sources for trusted proxy authentication (see TrustedProxyParameters in Authentication.json)
    If this parameter is set, only requests whose source IP matches either KnownNetworks or KnownProxies are subject to automatic login.
    If both are empty, 1.5.7.0 and later do not perform automatic login by trusted proxy authentication. In 1.5.6.x and earlier, verification of the source IP is skipped (requests from all sources are subject to automatic login).
  2. Suppressing warning logs from the Forwarded Headers Middleware
    In .NET 8 environments, when running Pleasanter in a clustering configuration, warning logs such as the following may be displayed.
pleasanter-1  | warn: Microsoft.AspNetCore.HttpOverrides.ForwardedHeadersMiddleware[1]
pleasanter-1  |       Unknown proxy: [::ffff:172.18.0.4]:45988

This occurs because the ASP.NET Core Forwarded Headers Middleware recognizes the IP address of the proxy that sent the request as untrusted. In a Docker environment, this warning may be displayed because the internal IP addresses used for communication between containers are assigned dynamically. Setting this parameter correctly suppresses this warning log.

Parameter name e.g. Description
KnownNetworks ["172.17.0.0/16", "172.18.0.0/16", "172.19.0.0/16"] Specify the network ranges to trust (in CIDR format).
KnownProxies ["10.0.0.5"] Specify specific IP addresses to trust.

Supported Versions

Supported Versions Details
1.4.8.0 and later Added the HealthCheck parameter
1.4.19.0 and later Added the ContentSecurityPolicy parameter
1.4.23.0 and later Added the following to the ContentSecurityPolicy parameter
- script-src-elem
- manifest-src
- media-src
- worker-src
- frame-ancestors
- report-to
- sandbox
- upgrade-insecure-requests

Added the ShowLoginPageOnAuthError parameter
1.5.2.0 and later Added the ForwardedHeaders parameter
Added the ExcludeCookiePrefixes parameter
1.5.7.0 and later Changed trusted proxy authentication not to perform automatic login when both KnownNetworks and KnownProxies are empty
Added the KeyValueStoreConnectionString and KeyValueStoreKeyName parameters to AspNetCoreDataProtection