Where should I store API keys and application passwords so they are not exposed on my website?

Ce contenu n'est disponible qu'en roumain et en anglais ; le texte anglais est affiché ci-dessous.

Where should I store API keys and application passwords so they are not exposed on my website?

Do not put secret keys in JavaScript sent to the browser, public pages or a Git repository. Visitors can read anything delivered to their browser. Keys explicitly designed for public use are different from those that authorise sensitive operations.

Store application secrets using the method recommended by your application: environment variables or configuration files outside the public directory, where your hosting environment supports this. Restrict file access and check that configuration copies or archives are not publicly accessible.

If a key is accidentally published, revoke it and generate a replacement. Deleting it from a file is not enough if it remains in Git history. Limit each key’s permissions to the operations it actually needs.

QUESTIONS SIMILAIRES

Voici quelques questions dont les réponses pourraient vous intéresser. Nous répondons aux questions importantes et pratiques de nos clients.

ABONNEZ-VOUS À LA NEWSLETTER

Abonnez-vous à notre newsletter. Nous l’utilisons uniquement pour les informations importantes.

Illustration abonnement à la newsletter