Skip to main content

Security & Permissions

Encryption

LayerMethod
At restAES-256-GCM (random IV per encryption)
In transitTLS 1.3, HSTS

Runtime Security (Zero-Trust)

Keyway promotes a "Zero-Trust" approach where secrets should not persist on disk in unencrypted form.

Runtime Injection

Using keyway run, secrets are:

  1. Fetched from the vault via TLS 1.3
  2. Decrypted in memory (RAM)
  3. Injected directly into the child process environment
  4. Never written to disk (no .env file created)

This mitigates risks associated with:

  • Accidental commits of .env files
  • Backup software archiving unencrypted secrets
  • Malware scanning the filesystem for credential patterns
  • Residual data on disk after deletion
# Example: Inject secrets directly into memory
keyway run -- npm start

Default Permissions

GitHub repo access = Keyway vault access. No separate user management.

Personal Repos

RoleReadWriteAdmin
Owner
Collaborator-

Organization Repos

RoleReadWriteAdmin
Admin
Maintain-
Write-
Triage--
Read--

Environment-Based Defaults

Keyway applies stricter defaults for production environments:

Environment TypeExamplesWrite Access
Protectedproduction, prod, mainadmin only
Standardstaging, test, qawrite+ roles
Developmentlocal, dev, developmentwrite+ roles

Permission Overrides

Organization owners and repo admins can customize permissions per environment.

Why Use Overrides?

  • Restrict production writes to specific users
  • Grant read-only access to certain roles
  • Lock down sensitive environments

Creating an Override

POST /v1/vaults/:owner/:repo/permissions/overrides
{
"environment": "production",
"targetType": "role",
"targetRole": "write",
"canRead": true,
"canWrite": false
}

This prevents users with write role from pushing to production.

Override Types

TypeTargetExample
roleAll users with a specific GitHub roleAll write users
userSpecific Keyway userOne team member

User-Specific Override

POST /v1/vaults/:owner/:repo/permissions/overrides
{
"environment": "production",
"targetType": "user",
"targetUserId": "uuid-of-user",
"canRead": true,
"canWrite": true
}

Listing Overrides

GET /v1/vaults/:owner/:repo/permissions/overrides

Returns:

{
"data": {
"overrides": [
{
"id": "uuid",
"environment": "production",
"targetType": "role",
"targetRole": "write",
"canRead": true,
"canWrite": false,
"createdBy": "user-uuid",
"createdAt": "2025-01-01T00:00:00Z"
}
],
"defaults": {
"read": { "read": true, "write": false },
"write": { "read": true, "write": true }
}
}
}

Checking Effective Permissions

GET /v1/vaults/:owner/:repo/permissions/effective

Returns your actual permissions after overrides are applied:

{
"data": {
"role": "write",
"permissions": {
"local": { "canRead": true, "canWrite": true },
"staging": { "canRead": true, "canWrite": true },
"production": { "canRead": true, "canWrite": false }
}
}
}

Resetting Overrides

Remove all custom permissions:

DELETE /v1/vaults/:owner/:repo/permissions/reset

Activity Logs

Keyway logs all secret access and modifications.

Viewing Your Activity

GET /v1/activity?limit=50&offset=0

Returns:

{
"data": [
{
"id": "uuid",
"action": "secrets_pulled",
"platform": "cli",
"metadata": {
"repoFullName": "owner/repo",
"environment": "local",
"secretCount": 5
},
"ip": "192.168.1.1",
"userAgent": "keyway-cli/1.0.0",
"createdAt": "2025-01-01T12:00:00Z"
}
]
}

Tracked Actions

ActionDescription
loginUser authenticated
secrets_pulledSecrets downloaded
secrets_pushedSecrets uploaded
secret_value_accessedSingle secret viewed
secret_createdNew secret added
secret_updatedSecret modified
secret_deletedSecret removed
vault_createdVault initialized
vault_deletedVault removed
api_key_createdAPI key generated
api_key_revokedAPI key revoked
integration_connectedProvider linked
integration_syncedSecrets synced to provider

Retention

PlanRetention
Free7 days
Team90 days

Security Alerts

Keyway detects suspicious activity and generates alerts.

Viewing Alerts

GET /v1/vaults/:owner/:repo/security/alerts

Alert Types

TypeTrigger
new_deviceFirst pull from unknown device/IP
unusual_locationAccess from unexpected geographic location
high_frequencyUnusual number of pulls in short time
after_hoursAccess outside normal patterns

Alert Response

Alerts include:

  • Device fingerprint
  • IP address
  • User agent
  • Timestamp
  • Severity level
caution

Security alerts are informational. Investigate any unexpected alerts and rotate secrets if necessary.


Authentication

OAuth Device Flow (CLI)

  1. CLI requests device code
  2. User approves in browser
  3. CLI receives token (30 days)

Token stored in ~/.config/keyway-nodejs/config.json (Linux) or ~/Library/Preferences/keyway-nodejs/config.json (macOS), mode 600.

API keys are the recommended authentication method for CI/CD:

POST /v1/api-keys
{
"name": "GitHub Actions Prod",
"environment": "live",
"scopes": ["read:secrets"],
"expiresInDays": 365
}

Benefits over PATs:

  • Scoped permissions (read-only possible)
  • Keyway-specific (doesn't grant GitHub access)
  • Revocable without affecting GitHub tokens
  • Expiration dates
  • IP restrictions (optional)

See API Reference for details.

GitHub PAT (Legacy)

Fine-grained PATs still work but API keys are preferred.

Use fine-grained PATs with Contents: Read.


Team Management

Add access: Add user as GitHub collaborator -> they run keyway pull

Remove access: Remove from GitHub repo -> instant revocation

Check access:

keyway doctor

Best Practices

  1. Use API keys for CI/CD - More secure than PATs
  2. Never commit secrets - .gitignore all .env files
  3. Least privilege - Use read:secrets scope when possible
  4. Rotate regularly - Especially after team changes
  5. Separate environments - Don't use production secrets locally
  6. Set expiration dates - API keys should expire within 1 year
  7. Monitor activity logs - Review access patterns periodically
  8. Use Runtime Injection - Use keyway run to avoid storing secrets on disk

Incident Response

Compromised Secret

  1. Rotate immediately at the source (database, API provider, etc.)
  2. keyway push new values
  3. Deploy changes to all environments
  4. Review activity logs for unauthorized access

Compromised API Key

  1. Revoke the key immediately:
    DELETE /v1/api-keys/:id
  2. Create a new key with appropriate scopes
  3. Update CI/CD secrets
  4. Review activity logs

Compromised CLI Token

  1. keyway logout or revoke from dashboard
  2. Re-authenticate with keyway login
  3. Review recent activity

Reporting Vulnerabilities

Email security@keyway.sh with:

  • Description of the vulnerability
  • Steps to reproduce
  • Potential impact

We respond within 24 hours and follow responsible disclosure practices.