d9-key-secret-env — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited d9-key-secret-env (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Prevent authentication failures in d9 (Directus 9 fork by La Webcapsule) caused by missing or identical KEY and SECRET environment variables. d9 requires BOTH variables to be set with distinct values. The server starts successfully without them, but auth operations fail silently or with misleading errors, making the root cause hard to diagnose.
docker-compose.yml, .env file, or deployment manifest for a d9 service.SECRET.docker-compose.yml, .env, Kubernetes manifests, or the hosting platform's environment variable settings.KEY and SECRET must not be the same string. They serve different cryptographic purposes.openssl rand -hex 32 (or equivalent) to produce each value.KEY=a1b2c3d4e5f6... # openssl rand -hex 32
SECRET=f6e5d4c3b2a1... # openssl rand -hex 32 (different value)services:
d9:
image: d9:latest
environment:
KEY: "${D9_KEY}"
SECRET: "${D9_SECRET}"
DB_CLIENT: pg
DB_HOST: db
DB_DATABASE: d9# Linux / macOS / Git Bash on Windows
echo "KEY=$(openssl rand -hex 32)"
echo "SECRET=$(openssl rand -hex 32)"
# Node.js alternative
node -e "const c=require('crypto'); console.log('KEY='+c.randomBytes(32).toString('hex')); console.log('SECRET='+c.randomBytes(32).toString('hex'))"INVALID_TOKEN, TOKEN_EXPIRED immediately after issuance).KEY and SECRET. They are used for different cryptographic operations and reusing values weakens security.KEY or SECRET values to version control. Use .env files (excluded via .gitignore), secrets managers, or platform-level environment variable injection.KEY=123, SECRET=secret). Always use cryptographically random strings of at least 32 characters.openssl rand -hex 32 for generation; it produces 64-character hex strings with 256 bits of entropy..env (e.g., ${D9_KEY}) rather than hardcoding values in the YAML file.KEY and SECRET simultaneously to avoid partial invalidation of existing sessions.KEY and SECRET are defined in the environment configuration.A developer sets up d9 with Docker Compose and only defines SECRET (following upstream Directus documentation).
Before (auth fails):
services:
d9:
image: d9:latest
environment:
SECRET: "my-super-secret-value"
DB_CLIENT: pg
DB_HOST: db
DB_PORT: 5432
DB_DATABASE: d9
DB_USER: d9
DB_PASSWORD: d9passSymptom: Server starts. Admin user can be created via bootstrap. Login POST to /auth/login returns a token, but subsequent authenticated requests fail with INVALID_TOKEN.
After (works):
services:
d9:
image: d9:latest
environment:
KEY: "4f8a1c3e7b9d2f0a5c6e8d1b3a7f9e2c4d6a8b0e1f3c5a7d9b2e4f6a8c0d2e"
SECRET: "9b2e4f6a8c0d2e4f8a1c3e7b9d2f0a5c6e8d1b3a7f9e2c4d6a8b0e1f3c5a7d"
DB_CLIENT: pg
DB_HOST: db
DB_PORT: 5432
DB_DATABASE: d9
DB_USER: d9
DB_PASSWORD: d9passA developer migrates from upstream Directus 9 to d9. Their existing .env has SECRET but not KEY. The migration completes, d9 starts, but existing user sessions break.
Before (.env):
# Carried over from Directus 9
SECRET=original-directus-secret
DB_CLIENT=sqlite3
DB_FILENAME=./data/database.sqliteSymptom: d9 starts without errors. Existing sessions from Directus 9 are all invalid (expected after migration). New login attempts succeed intermittently or fail with "errors":[{"message":"Invalid user credentials."}] even though credentials are correct.
Diagnosis: Run node -e "console.log(process.env.KEY)" inside the d9 process context (or check the startup logs in debug mode). KEY is undefined.
After (.env):
KEY=b7c4e9a1f2d8365e0c7a4b1d9f6e3c8a5d2b7f0e4a1c6d9b3f8e5a2c7d0b4f
SECRET=original-directus-secret
DB_CLIENT=sqlite3
DB_FILENAME=./data/database.sqliteIn a Kubernetes deployment, environment variables come from a Secret resource. A team member creates the secret with only one key, or both keys reference the same secret data field.
Before (both reference the same value):
apiVersion: v1
kind: Secret
metadata:
name: d9-secrets
type: Opaque
data:
token-secret: NGY4YTFjM2U3YjlkMmYwYTVjNmU4ZDFiM2E3ZjllMmM=
---
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- name: d9
env:
- name: KEY
valueFrom:
secretKeyRef:
name: d9-secrets
key: token-secret # Same source as SECRET
- name: SECRET
valueFrom:
secretKeyRef:
name: d9-secrets
key: token-secret # Same source as KEYAfter (distinct values):
apiVersion: v1
kind: Secret
metadata:
name: d9-secrets
type: Opaque
data:
app-key: NGY4YTFjM2U3YjlkMmYwYTVjNmU4ZDFiM2E3ZjllMmM=
app-secret: OWIyZTRmNmE4YzBkMmU0Zjh...
---
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- name: d9
env:
- name: KEY
valueFrom:
secretKeyRef:
name: d9-secrets
key: app-key
- name: SECRET
valueFrom:
secretKeyRef:
name: d9-secrets
key: app-secret~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.