> For the complete documentation index, see [llms.txt](https://docs.appfarm.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.appfarm.io/how-to/security-testing-and-deployment/security-checklist.md). Agents can also search and read this documentation through its [MCP server](https://docs.appfarm.io/~gitbook/mcp).

# Security checklist

The primary aim of this checklist is to assist you in building apps that exemplify best-practice security measures. Covering a spectrum of considerations, the checklist addresses areas from environment configuration, roles, and permissions, to scripts embedded within coded components. Depending on the diverse building blocks you've employed, some checkpoints might be optional, offering flexibility within the framework while maintaining security standards.

**Please read and understand how to** [**design secure permissions** ](https://docs.appfarm.io/reference/security/permissions/designing-secure-permissions.md)**before you put anything into production!**

## Roles

### Built-in roles

Most Appfarm Create users have at least one of the [built-in roles](#built-in-roles): **Owners**, **Maintainers**, or **Developers**, which defines their basic access rights. In the Development environment, the built-in roles describe access to apps, services, and object classes, as well as modification of user accounts, updating app secrets, etc. The built-in roles, however, do not have access to Test, Staging, or Production. To access a client app in these environments, you must have a custom role with the necessary permissions.

* [ ] Correct built-in roles are granted to all team members according to the development team’s needs.

### Custom roles

All users with access to your apps should be members of at least one [custom role](https://docs.appfarm.io/reference/security/roles#custom-roles). Roles should have descriptive names and clear descriptions.

* [ ] All custom roles have descriptive names and meaningful descriptions.
* [ ] Correct custom roles are granted to all app users.

Learn more about how to [add users and assign roles](https://docs.appfarm.io/how-to/authentication-and-access-control/add-users-assign-roles.md).

***

## Permissions

When setting [permissions](https://docs.appfarm.io/reference/security/permissions), operate with the principle of least privilege in mind: all users are given the minimum levels of access – or permissions – needed to perform their job functions. Collaborate on a permissions model together with your stakeholders to leave out any doubts about access control.

* [ ] All custom roles have access to the needed apps.
* [ ] Access to services is granted to the correct service account.
* [ ] All custom roles have access only to the Flows and Flow actions they need (**Flows** and **Flow Actions** tabs).
* [ ] All custom roles have the correct create, read, update, delete, and aggregate permission to all object classes.
* [ ] Object class permissions and conditional permissions, not data source filters, decide what each role can read. They are reviewed regularly.
* [ ] All custom roles have access to the correct environments.
* [ ] All custom roles have correct permissions to accounts and roles.
* [ ] **Flow DevTools** access is granted only to the people who need it, especially in Production.

***

## Secrets

[Secrets](https://docs.appfarm.io/reference/security/secrets) are a storage mechanism for sensitive values. All secrets within your app should have descriptive names and a clear description of the secret's purpose. Where possible, secrets should be environment-specific to minimize the damage in case of a potential attack. If, for some reason, users have permission to delete but not to create or edit secrets, consider locking the secret to reduce the risk of unwanted changes.

* [ ] All secrets have descriptive names and clear descriptions.
* [ ] Every secret is **Environment Specific**.
* [ ] Few people hold **Read any Secret value** or permission to update secrets.
* [ ] Secrets are locked, except those updated by an Update secret action node (those cannot be locked). A lock guards against accidents only: anyone who can update the secret can unlock it.

***

## Service accounts

All [service accounts](https://docs.appfarm.io/reference/security/service-accounts) should have descriptive names and a clear description of the secret's purpose. Select a relevant role for the service account. Where possible, each service account should have a separate role granting only the necessary permissions.

* [ ] All service accounts have descriptive names and clear descriptions.
* [ ] All service accounts have correct roles, granting necessary permissions.

***

## Create user account

On creation, all users should be assigned a suitable role granting correct permissions.

* [ ] All [Create user account](https://docs.appfarm.io/library/action-nodes/create-user-account) action nodes create users with correct roles and permissions.

***

## Login config and Custom Auth

* [ ] [Login](https://docs.appfarm.io/reference/configuration/login) configuration is set up according to company guidelines.
* [ ] Only authentication providers that are in use are enabled.

***

## Logs

Review [logs](https://docs.appfarm.io/reference/operations/logs) regularly as a pre-emptive measure to check if any irregularities occur, as well as in case of any problems being reported, in order to debug.

* [ ] **Enable Client Log** is on only in Development, and only while debugging. With it on, every user's browser receives detailed action logs.

***

## Snapshots

Backups are important. A [snapshot](https://docs.appfarm.io/reference/operations/deploy#snapshots) is a copy of your solution model at a certain point in time.

A snapshot procedure should be in place to minimize the risk of functionality loss in case of unwanted changes or irreparable errors.

* [ ] A snapshots procedure is in place, and snapshots are taken regularly.
* [ ] Snapshots are taken before major changes.
* [ ] Auto-snapshots are enabled.

***

## Service endpoints

* [ ] All [service endpoints](https://docs.appfarm.io/reference/services#endpoints) have descriptive names and clear descriptions.
* [ ] Logging is enabled (can be turned off once the development is completed).
* [ ] A readable ID is set.
* [ ] The correct service account has access to each service.
* [ ] For requests and response, only input and output needed for the service to function is allowed.

***

## Flows

Treat every Flow [API endpoint](https://docs.appfarm.io/reference/flows/api-endpoints.md), [MCP server](https://docs.appfarm.io/reference/flows/mcp-servers.md), and Flow action that apps can run as a public API.

* [ ] Flow API endpoints and MCP servers have descriptive names and clear descriptions.
* [ ] Flow actions validate their inputs and return only the data that is needed.
* [ ] Each Flow [schedule](https://docs.appfarm.io/reference/flows/schedules.md) runs as a service account whose role grants only what that Flow needs.
* [ ] Service accounts used to call Flow API endpoints have access only to the Flows they call.

***

## **API keys for service accounts**

* [ ] All [API keys](https://docs.appfarm.io/reference/security/service-accounts#api-keys) have descriptive names.
* [ ] All API keys have an **Expire date** and a routine for renewal. Consider an **Inactivity expiration** for keys that are used rarely.
* [ ] The **Scope** of each key (**Services**, **Flows**, **GraphQL**, **Time series**, **Data extract**) includes only what the caller needs.

***

## Environment configurations

Make sure only to enable what you need.

* [ ] GraphQL is only enabled in test environments. Only enable in Production when in active use.
* [ ] API Services: API explorer is only enabled in test environments. Only enable in Production when in active use.
* [ ] **Enable Service schedules** and **Enable Flow endpoints and schedules**: only enabled when in active use.
* [ ] Log options: **Enable Flow DevTools** is turned off outside Development unless you are debugging.
* [ ] App security: unauthenticated access is by default turned off and should not be enabled unless unauthenticated access to an app is required.
* [ ] User account manipulation: by default, the user account manipulation is turned off. It should only be enabled when necessary and in active use.

***

## Testing

* [ ] Test cases are defined, allowing thorough testing of an app under development and before deployment.


---

# 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://docs.appfarm.io/how-to/security-testing-and-deployment/security-checklist.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.
