---
title: "Security best practices"
description: "Rotate credentials, limit what each application can access, and protect data in transit."
url: "https://nov18-prod-sg.movespot.fyi/guides/security"
image: "https://nov18-prod-sg.movespot.fyi/_og/d/c_Ocean.takumi,title_Security+best+practices,description_~Um90YXRlIGNyZWRlbnRpYWxzLCBsaW1pdCB3aGF0IGVhY2ggYXBwbGljYXRpb24gY2FuIGFjY2VzcywgYW5kIHByb3RlY3QgZGF0YSBpbiB0cmFuc2l0Lg,props_eyJ0aGVtZSI6eyJtb2RlIjoibGlnaHQiLCJjb2xvcnMiOnsicHJpbWFyeSI6IiNDQjUzMjQifX19,p_Ii9ndWlkZXMvc2VjdXJpdHki,s_koKViArya_GVxjqo.png"
---

# Security best practices

Rotate credentials, limit what each application can access, and protect data in transit.

## [Start with least privilege](#start-with-least-privilege)

Register each application with only the APIs it actually calls. When an application's scope matches its purpose, a leaked key exposes far less:

-   One application per project or environment, not one shared key for everything.
-   Separate applications for staging and production, so test traffic can never touch production data.
-   Revoke registrations your project no longer needs. See [Applications and credentials](https://nov18-prod-sg.movespot.fyi/guides/applications).

## [Rotate credentials on a schedule](#rotate-credentials-on-a-schedule)

Treat every credential as short-lived, even if it doesn't expire on its own:

1.  Generate a new credential on your application page.
2.  Update your service to use it.
3.  Revoke the old credential once traffic has moved over.

Rotate at least every 90 days, and immediately after anyone with access leaves the team or a secret may have been exposed.

You can only see a key once

Store keys in a secrets manager or environment variables the moment you generate them. A key pasted into a ticket, chat message, or git history should be treated as compromised. Revoke it and rotate.

## [Prefer short-lived tokens](#prefer-short-lived-tokens)

Where an API supports OAuth 2.0 client credentials, prefer them over long-lived API keys:

| Credential             | Lifetime                 | Blast radius if leaked               |
| :--------------------- | :----------------------- | :----------------------------------- |
| API key                | Valid until revoked      | Everything the application can reach |
| OAuth 2.0 access token | Expires in about an hour | One hour of scoped access            |

Cache tokens and refresh them before they lapse. See [Authentication](https://nov18-prod-sg.movespot.fyi/guides/authentication).

## [Verify every webhook](#verify-every-webhook)

If you consume webhooks, verify the `X-Signature` header on every delivery using your signing secret, and reject anything that fails. Redeliveries mean duplicate events can arrive, so process events idempotently by their `id`. See [Webhooks](https://nov18-prod-sg.movespot.fyi/guides/webhooks).

## [Protect data in transit](#protect-data-in-transit)

-   Only call the APIs over HTTPS. Requests over plain HTTP fail with a `4xx` response; never disable certificate verification to work around one.
-   Keep your TLS stack current. Out-of-date clients are the most common cause of handshake failures.
-   Point webhooks at HTTPS endpoints with valid certificates. Unsigned or unverified endpoints invite forged events.

## [Handle failures without leaking data](#handle-failures-without-leaking-data)

Log status codes and `request_id` values, not full request bodies. Error payloads can contain customer data, and logs outlive the incident that produced them. See [Errors](https://nov18-prod-sg.movespot.fyi/guides/errors).

## [Next steps](#next-steps)

### Applications and credentials

How applications, API registrations, and credentials fit together.

<https://nov18-prod-sg.movespot.fyi/guides/applications>

### Authentication

API keys, OAuth 2.0 tokens, and rotating credentials safely.

<https://nov18-prod-sg.movespot.fyi/guides/authentication>

### Webhooks

Get notified when resources change instead of polling, and verify every event.

<https://nov18-prod-sg.movespot.fyi/guides/webhooks>