# Security

Grayspar decides who can reach your app, logs people in and keeps your variables encrypted. This page explains how each part works, and which parts stay your app's job.

## Every request is checked

A private project's address points at Grayspar, and your app has no public address of its own. Grayspar checks every request before it reaches your app. A request reaches your app only when one of these is true:

- The person is logged in and belongs to the team that owns the project.
- The person is logged in with an address or a company on the project's list.
- The request is for one of the project's open paths.
- The project is open to anyone with the link.

Anyone who isn't allowed in sees a login page or a page saying the project is private. Those pages show the project's address and nothing else about the project.

## Ways to share

A project starts private, and only an owner of the team can open it wider.

| Mode                     | Who gets in                                    | Does the app learn who it is? |
| ------------------------ | ---------------------------------------------- | ----------------------------- |
| On the list, the default | Your team, and the people and companies listed | Yes, through the headers      |
| Open path                | Anyone, on that path and below it              | No                            |
| Anyone with the link     | Anyone, on every path                          | No                            |

Grayspar refuses a public mail provider as a company, because anyone can get an address there. Grayspar also asks search engines to leave every project out of their results.

## Login

People log in with Google, GitHub or a six-digit code sent to their email. Grayspar accepts an address from a provider only after the provider has confirmed the address, and Grayspar never asks for or stores a password. A share therefore reaches only an account holding that confirmed address.

Grayspar keeps no access tokens from Google or GitHub, because Grayspar never calls those services on your behalf.

Each project gets its own login token, which opens that project only. Grayspar takes the token out of every request before it reaches your app, so your app never sees it, and refuses a cookie your app sets under the token's name. A person's login lasts seven days from its last use and at most thirty days in total. Logging out closes every project in that browser within a second, and removing someone from a project refuses their next request.

The CLI logs in through your browser, where you approve the login, so you never paste a key. The CLI's session belongs to that computer. To end it, run `grayspar logout`, or log it out from the dashboard under **CLI logins** on your Profile.

## Identity headers

Grayspar removes every `X-User-` header from an incoming request and sets its own, so your app can trust the [identity headers](/docs/sharing/identity-headers/) on a request that passed the check. Requests through an open path or to an open project carry none.

## Variables

Grayspar encrypts the values of variables before it saves them, and each service's encrypted values open only for that service. Neither the CLI nor the dashboard shows a saved value. Your running service reads the values from its environment. Owners and members of the team can replace a value, and viewers can't see names or values.

Your `.env` files are never uploaded, so a value from them can't end up in the image by accident. Everything else in your folder is uploaded, apart from what your `.gitignore` leaves out, so a secret written into a source file ends up in the build like any other file.

## Where your app runs

Each service runs in its own container under gVisor, which gives the container a kernel of its own in place of the server's, and the services of one project can't reach the services of another project over the network. Teams share servers, so this separation is what stands between your app and another team's app. Limits on each team's CPU, memory and disk use keep one team from crowding out another.

## What stays with you

Grayspar decides who reaches your app. Your app still decides what each person may do once inside, such as who can edit a record, and still has to guard against mistakes in its own code. An open path is your app's to protect, because Grayspar checks nothing there. Everyone in your team and everyone on the list can reach every path that isn't open, so put apps for different people in different projects.

## Report a problem

If you think you've found a security problem, email [support@grayspar.com](mailto:support@grayspar.com).