Skip to main content

Reviewing Kuroco security settings

This article summarizes the security settings to review before publishing a site built with Kuroco, and during periodic checks while it is in operation.
It focuses on the settings that prevent the following three types of serious damage. Check other settings on the security advisory screen.

  • Leaks of personal information
  • Takeover of the admin panel
  • Unexpected costs caused by attacks

Each item explains the risks of leaving the setting unset and what the setting prevents. Use them to decide how far to restrict access according to the purpose of your site.

To check and change each setting, you need the permission for its settings screen.

Settings that lead to leaks of personal information​

A leak of personal information usually results not from a single missing setting but from several missing settings combined. Pay particular attention to the following combinations.

  • Anyone can register as a member and log in, and the group assigned at member registration is allowed to access endpoints that return other members' information
  • Endpoints without an API request restriction return personal information such as member information or form submissions
  • :ALL is set in filter_request_allow_list, so filtering is possible even by items that are not included in the response

Keeping the endpoint URL unknown, or requiring login, is not a restriction by itself. The following items explain what each setting prevents.

Checking the current settings​

Checking settings on the security advisory screen​

Click [Security] in the header of the admin panel to open the security advisory screen. The [Security] link and the security advisory screen are shown only to groups that have the [View] permission for "Security advisory".
The [Security advisory] tab lists the site settings that need a security review as findings. The [Security inventory] tab shows the current values of the access restriction and authentication settings, divided into [Common], [Admin panel], and [Public API]. Click a setting name to go to the screen where you can change that setting.

Before reviewing the following items, check the findings and the current settings on this screen. Decide whether to change a reported setting based on the risks explained in the following items and the purpose of your site.

Checking settings with an AI agent​

With Admin MCP and kuroco-security-audit in Kuroco Skills, an AI agent can check settings such as the API security type, CORS, IP address restrictions, permission groups, and static access tokens, and create a report. kuroco-security-audit is read-only and does not change settings.

Reviewing the API settings​

Check the API security type​

When a static access token is included in the frontend JavaScript, anyone can see it with the browser's developer tools or similar. A third party who obtains the token can send requests to the API in the same way as the legitimate frontend. A static access token is therefore a setting to "refuse indiscriminate access without the token", not a means of protecting data.

  • Because the token is not a secret, operate it on the assumption that it is updated periodically.
  • To handle data whose access you want to restrict, such as information shown only to members, use login authentication with a dynamic access token or cookies, or restriction by viewer group.

Whatever the authentication type, the range of data that can be retrieved or updated through an endpoint is determined by the endpoint settings. Check the endpoint settings in Reviewing the endpoint settings.

Set CORS​

CORS determines from which origins (sites) JavaScript running in the browser can read API responses. If the allowed origins are too broad, JavaScript embedded in a third-party site can call the API through the browser of a user who visits that site.

In particular, if you specify a wildcard (*) in CORS_ALLOW_ORIGINS while CORS_ALLOW_CREDENTIALS is enabled, every origin is allowed to send requests with cookies and to read the responses. A member who simply visits an attacker's site may have the API executed with their session, and their member information may be read or updated.

  • In CORS_ALLOW_ORIGINS, explicitly specify only the origins of the frontends that use the API.
  • If test URLs remain, delete them after the site is published.
  • If you specify a subdomain wildcard (https://*.example.com), confirm that every subdomain it covers is under your control.
note

CORS is a restriction applied by browsers. It does not prevent requests sent directly from programs other than browsers. To restrict access to the API itself, also set the API security type, IP address restrictions, and the [Authentication] (request restriction) of endpoints.

Set IP address and country restrictions​

Even if the API URL or token becomes known externally, an IP address restriction refuses requests from access sources that are not allowed. If the access sources of the API are fixed, such as internal systems or server-to-server integrations, set [IP address restriction] in [Security] of the API.

For APIs open to the general public whose access sources cannot be identified, you can refuse access from unexpected countries with [Country restriction]. When both [IP address restriction] and [Country restriction] are set, a request that matches either of them is allowed. Country detection is not always accurate, and access from users on business trips abroad or through VPNs is also refused, so check the access sources in [Country code] of the API log before setting it.

Set a rate limit per IP address​

When a single access source sends a large volume of requests, API request charges increase, and that single source can use up the [Rate limit] of an endpoint so that requests from legitimate users are also refused (see Set rate limits).

[Rate limit per IP address] in [Security] of the API limits the total of requests from the same IP address to all endpoints in the API. On corporate networks and mobile connections, multiple users may share the same IP address, so set the limit with a margin for the expected usage.

Reviewing the endpoint settings​

Disable unused endpoints​

Unused endpoints still accept requests as long as they are enabled. Endpoints created for testing during development may remain without an API request restriction or allow list, and may be used to retrieve or update data if their URLs become known.

Disable unused endpoints in [Status] on the endpoint edit screen, or delete them.
Writing the purpose of each endpoint in its [Summary] makes it easier to identify endpoints that are no longer needed.
Published endpoints with no successful requests in the last 30 days are listed in [Unused APIs] on the [Security inventory] tab of the security advisory screen. [Unused APIs] is shown when you have the [View] permission for "API".

Set API request restrictions on endpoints used only by members​

Endpoints whose [Authentication] (request restriction) is None accept requests from users who are not logged in. Endpoint URLs can be found in the frontend JavaScript and network traffic, so "not linking to it from any page" is not a restriction.

For endpoints that only logged-in members should use, set GroupAuth or MemberCustomSearchAuth in [Authentication] (request restriction) so that the permissions of the requesting member are checked.

caution

For example, if Member::list and Member::details (member information) or InquiryMessage::list (form submissions) are published with None, anyone can retrieve personal information once the URL is leaked or identified by brute force.
Depending on the use case, take measures such as setting [Authentication] (request restriction) or limiting the response to the items to be published with an allow list.

Restrict the items that can be specified in filter​

filter_request_allow_list is a parameter that sets the items that can be specified in filter requests from the frontend.
Setting :ALL allows filtering by all items. Even for items excluded from the response with an allow list, values may be guessed by filtering with comparison operators while changing the value and checking whether results are returned.

Do not set :ALL; specify only the items actually used for search and filtering in the frontend.

Set an allow list​

By default, the endpoint response includes all items. Items not displayed on frontend pages can still be seen by viewing the response with the browser's developer tools or similar. For example, internal notes, extension fields not meant to be public, and member contact details may be unintentionally exposed.

Set an allow list in the endpoint post-processing so that only the items needed by the frontend are returned. On endpoints that return content details or member information, make sure in particular that the response does not include items that are not intended to be public.

Enable self_only on member information endpoints​

If self_only is not enabled on endpoints that logged-in members use to display or update their own information, such as a My Page, anyone who knows the endpoint URL can retrieve arbitrary member information. For update endpoints, other members' information may also be overwritten.

Enabling self_only restricts access to the logged-in member's own information.

Limit the input and output of AI endpoints​

When an AI endpoint is published, large volumes of questions unrelated to the purpose of the site or long input texts may be sent. As usage unrelated to the purpose of the site increases, the amount of AI processing increases, which also affects responses to the intended users.

For endpoints such as chat of the AI model, the following parameter settings are recommended.

ParameterRecommended settingPurpose
promptWrite instructions that limit the information and topics to answer.Reduces usage unrelated to the purpose of the site.
max_tokens_outSet a small maximum number of output tokens.Reduces the amount generated per request.
max_input_lengthSet the maximum number of characters in the input text.Reduces the increase in processing caused by long input texts.
safe_checkEnable it to perform a safety check on the input text.Reduces responses to inappropriate input texts.

Also consider limiting who can use the endpoint and the number of requests with an API request restriction and a rate limit.

Set rate limits​

Endpoints exposed to the public, such as form submission and login, are targets of mass submissions and login attempts by bots. Receiving a large volume of requests increases API request charges and causes damage such as form submissions being filled with spam.

[Rate limit] on the endpoint edit screen limits the number of requests accepted within the specified number of seconds.
However, [Rate limit] counts the total of all requests to the endpoint, not per source IP address or per access token. Once the limit is reached, requests from legitimate users are also refused, so to limit large volumes of requests from a specific IP address, also use [Rate limit per IP address] of the API (see Set a rate limit per IP address).

Reviewing the admin panel and user settings​

Set access restrictions for the admin panel, KurocoFiles, and Admin MCP​

Site settings, content, and member information can be operated from the admin panel and Admin MCP. If access sources are not restricted, a leaked password or Admin MCP token allows login and operations from anywhere.

If the access sources are fixed, such as a corporate network, set the following IP address restrictions in [Environment] -> [Admin panel].

TargetSetting
Admin panel[Admin panel access restriction (IP address)]
KurocoFiles[KurocoFiles access restriction (IP address)]
Admin MCP[Admin MCP access restriction (IP address)]

If you check "Enable" and select countries in [Country restriction], access from the selected countries is also allowed. A request is allowed when either its IP address or its country matches, and a request whose country cannot be determined is refused unless its IP address is allowed. Release version: β / RCversion

Require two-factor authentication for admin panel login​

If users can log in with only a password, a third party who learns a password through reuse of passwords leaked from other services or through phishing can log in to the admin panel. Requiring two-factor authentication prevents login with a password alone.

When you set [Authentication code] or [Enable Passkey Use] in [Environment] -> [Site settings] to required, two-factor authentication is required to log in to the admin panel. Existing users who have not registered two-factor authentication cannot log in to the admin panel until they register it, and the registration screen is shown when they log in.

Users who have not set up two-factor authentication are listed in [Users without two-factor authentication] on the [Security inventory] tab of the security advisory screen. It is shown when you have the [View] permission for both "Site settings" and "Member", and the members you can view are not limited by group.

Disable login for users who have not logged in for a long time​

If users who no longer use the site, such as former employees or users from external partners whose contracts have ended, remain able to log in, their accounts can be used for unauthorized login if their passwords are leaked. Because the users themselves no longer use the site, unauthorized logins are hard to notice.

Content editors and superusers who can log in but have not logged in during the last 90 days are listed in [Inactive users] on the [Security inventory] tab of the security advisory screen. It is shown when you have the [View] permission for "Log management". Users created less than 90 days ago are not included. Proxy logins and Admin MCP delegations are not counted as the user's own login.

For users who no longer need access, select the members in [Member] -> [Member] and click [Disable login].

Limit SSO login to users in your organization​

With OAuth SP, any account on the IdP (identity provider) can log in, regardless of its organization. For example, if [Automatic user registration] is enabled on an OAuth SP whose [Target domain] is the admin panel, anyone with an account on the IdP who knows the admin panel login URL can log in to the admin panel and operate it with the permissions of the [Group set at registration].

  • When using SSO for admin panel login, use SAML SP, which allows access control per organization.
  • If automatic user registration is not needed, disable [Automatic user registration] so that only members registered in the admin panel can log in.
  • If you enable [Automatic user registration], set a group with the minimum necessary permissions in [Group set at registration].

Even with SSO whose [Target domain] is the API, endpoints that allow the group assigned by automatic user registration in GroupAuth can be requested by anyone.

Enable "Disable management screen access" for groups that do not use the admin panel​

Even for content editor groups that are expected to log in only through the API, such as members of a membership site, if "Disable management screen access" is not checked, a member who learns the admin panel URL can log in to the admin panel with the same account and view and operate the admin panel within the permissions of the group.

For groups whose [User type] is "Content editor" and that are not expected to use the admin panel, check "Disable management screen access".
Groups whose [User type] is "Log in only" cannot view or edit contents on the management screens in the first place.

The groups that can log in to the admin panel are listed in [Groups that can log in to the admin panel] under [Admin panel] on the [Security inventory] tab of the security advisory screen. Check that no unintended groups, such as groups for a membership site, are included.

Monitoring costs​

Kuroco has no feature that automatically suspends usage when costs exceed a certain amount. Even if costs increase because of a large volume of requests from bots or similar, APIs and batch processes keep running until you notice.

When you set [Monthly cost monitoring alert threshold] in [Environment] -> [Account settings], you receive an e-mail notification when your monthly cost exceeds the amount you set. Setting an amount somewhat higher than your usual monthly cost helps you notice unexpected increases early.


Support

If you have any other questions, please contact us or check out Our Slack Community.