Skip to main content
Servers Are Up
Virtual Datacenter
PricingFree Tools
Sign inBrowse catalog
Servers Are Up
Virtual Datacenter
PricingFree Tools
Sign inBrowse catalog

Loading…

Servers Are Up

Your apps, automation and data on hardware we own. Build a private stack with predictable capacity and access through your dashboard, API or SSH.

SLA with service creditsOwned hardwareUS-based

Make room for your next idea

Explore the capacity, apps and access options that fit your workload. Check current availability and your total before you buy.

Sign up freeView Pricing

Products

  • Linux VPS
  • Windows VPS
  • Cloud & SaaS Services
  • Cloud Storage (Azure)
  • Virtual Datacenter
  • AI & Agent Hosting
  • Containers
  • Instant Apps
  • Software Platforms
  • Network builder
  • Game Servers
  • Pricing

Resources

  • Free Network Tools
  • 2026 Pricing Benchmark
  • Live SVG Badges
  • Latency & Speed Test
  • Guides & Tutorials
  • Documentation
  • API Reference
  • MCP Server
  • CLI & SDKs
  • OpenAPI & llms.txt
  • Use Cases
  • Free Migration
  • Uptime & Reliability
  • Datacenter
  • System Status
  • Network
  • Provider Comparisons Hub
  • Compare Providers

Company

  • About Us
  • Enterprise
  • Security Architecture
  • Trust Center
  • Blog
  • FAQ
  • Compliance
  • Startup Program
  • Open-Source Sponsorship
  • Press & Media Kit
  • Referral Program
  • Help Center
  • Contact Us
© Servers Are Up
TermsPrivacySLARefund PolicyDPAAcceptable Use
Service information
Docs
  • Documentation Hub
  • Choose a Product
    VMs, Containers & Cloud
  • First Linux Server
    SSH, Firewall & Apps
  • Windows Server 2025
    BYOL & Remote Desktop
  • Remote Access
  • Troubleshooting
  • FAQ
  • All Product Guides
    29 Step-by-Step Guides
  • Cloud & SaaS Catalog
    112 Cloud & SaaS Offerings
  • Azure Cloud Storage
    Hot/Cool/Archive & WORM
  • Resource Manager & RBAC
    Groups, Tags & Locks
  • Multi-Model Cloud DB
    JSONB, SQL & pgvector
  • Cloud Identity & ZTNA
    OIDC, SCIM & PIM
  • Key Vault & KMS
    Secrets & Envelope Keys
  • Cloud SIEM, SOAR & DLP
    Posture & Threat Response
  • API Gateway & Cloud DNS
    Edge WAF & DNS Zones
  • Serverless, Workflows & IoT
    Functions, Queues & DAGs
  • SaaS, Governance & Vault
    Budgets & Off-Host GRS
  • Build Web Apps with AI
  • Next.js and React
  • TypeScript and Node.js
  • npm and Tooling
  • Data and APIs
  • Deploy and Operate
  • Tutorials
  • Infrastructure
  • Automation & Regions
  • API Overview
  • API v1 Reference
    Endpoints & 23 Scopes
  • MCP Server
    129 AI Agent Tools
  • Swagger / OpenAPI 3.1
  • API Playground
  • Versioning & Sunset
  • API Token Security
    Authentication & Tokens
  • Instances API
    Compute Resources
  • Networking API
    Networks & Ports
  • Storage API Availability
    Volumes & Backups
  • Webhooks & Events
    Event Notifications
  • Rate Limits & Best Practices
    Throttling & Retries
  • sau CLI Reference
    34 Commands (v0.2)
  • Browser Web CLI
  • SDKs
  • Infrastructure as Code
    Terraform & Ansible
  • Code Examples
  • CLI & SDK Guides
  • Security Guides
  • Security at a Glance
  • Zero Trust Architecture
  • Live Trust Center
  • Compliance
Need help?

Loading documentation...

Documentation/products

Store AES-256-GCM secrets and rotate keys in Key Vault

Encrypt application secrets with AES-256-GCM envelope KMS, perform transit signing, rotate versions and recover soft-deleted secrets.

Intermediate
15 min
Updated 2026-11-12

Deploy Ready-to-Run Infrastructure in Seconds

Linux VMs from $6/mo · Pooled Virtual Datacenters from $12/mo · Use code WELCOME20 for 20% off your first order.

Browse ServersView Pricing

Commands checked on 2026-11-12 with SAU Key Vault & KMS v1.7 (AES-256-GCM, P-256/RSA), sau CLI 0.2.0.

What you will have at the end

Your database passwords, third-party webhook keys, TLS certificates, and JWT signing keys will live inside Access > Key vault & KMS (/dashboard/key-vault), protected by per-secret AES-256-GCM authenticated envelope encryption (where a unique Data Encryption Key encrypts each secret version and is itself wrapped by a Key Encryption Key), automatic version history, transit cryptographic operations (sign, verify, encrypt, decrypt), and soft-delete purge protection.

Before you start

  • A Servers Are Up account signed in at Access > Key vault & KMS (/dashboard/key-vault).
  • A Personal Access Token with cloud:read and cloud:write scopes (Account settings > API keys at /account/api-keys), or RBAC role Key Vault Secrets Officer assigned in Operations > Resource manager & settings (/dashboard/resource-manager).
  • Note on metering: 10,000 Key Vault & KMS operations per month are included free on every account ($0.03 per 10,000 operations thereafter).

Steps

1. Store versioned secrets in Key Vault via CLI, Console, or API

Never commit .env secrets to Git or bake them into Docker images. Store them in a named vault (default-vault or environment-specific vaults such as prod-payments-vault):

# Store secrets via sau CLI
sau keyvault secret-set STRIPE_WEBHOOK_SECRET "whsec_example_rotated_value" \
  --vault prod-payments-vault \
  --content-type "text/plain"

sau keyvault secret-set DATABASE_URL "postgresql://app_writer:strong_pass@172.30.1.27:5432/app_prod" \
  --vault prod-payments-vault

# List secret metadata (values are never returned in list calls!)
sau keyvault list --vault prod-payments-vault -o table

Notice that sau keyvault list (GET /api/v1/vault/secrets?vault=prod-payments-vault) returns only secret names, version numbers, content types, and timestamps—never plaintext values—so operators can audit inventory safely without exposing credentials.

2. Fetch secrets at service startup (never on every HTTP request)

Read and unwrap a specific secret at process startup or during deployment rendering:

# Retrieve and decrypt a single secret via CLI
sau keyvault secret-get DATABASE_URL --vault prod-payments-vault -o json

In a Node.js or TypeScript service, fetch required secrets once during boot, validate them, and hold them in memory (which also keeps your KMS call volume well inside the free 10,000 ops/mo tier):

export async function loadVaultSecret(vault: string, name: string): Promise<string> {
  const url = new URL('https://serversareup.com/api/v1/vault/secrets');
  url.searchParams.set('vault', vault);
  url.searchParams.set('name', name);

  const res = await fetch(url, {
    headers: { Authorization: `Bearer ${process.env.SAU_API_TOKEN}` },
    cache: 'no-store',
  });
  if (!res.ok) {
    throw new Error(`Key Vault fetch failed for ${vault}/${name}: HTTP ${res.status}`);
  }
  const data = (await res.json()) as { secret?: { value?: string } };
  if (!data.secret?.value) throw new Error(`Empty secret returned for ${name}`);
  return data.secret.value;
}

3. Use KMS transit signing and encryption without exporting private keys

When signing release artifacts, webhook payloads, or custom JWTs, use KMS Transit Keys on /dashboard/key-vault (/api/v1/vault/keys) so the raw private key material never leaves the KMS boundary:

# Create an asymmetric ES256 signing key or AES-256 transit key and sign a digest
curl -fsSL -X POST "https://serversareup.com/api/v1/vault/keys" \
  -H "Authorization: Bearer sau_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "create-key",
    "vaultName": "prod-payments-vault",
    "keyName": "release-artifact-signer",
    "algorithm": "EC_P256"
  }' | jq .

4. Rotate secret versions and enable soft-delete protection

Calling sau keyvault secret-set on an existing secret name automatically increments its version (v1 -> v2) while preserving prior versions for instant rollback if a downstream service has not reloaded yet.

If someone accidentally deletes a secret, Soft-Delete Retention holds it in a recoverable state on Access > Key vault & KMS (/dashboard/key-vault) so an administrator can click Recover before the retention window expires; enabling Purge Protection blocks permanent erasure even by admins during the retention period.

Check that it works

Verify round-trip encryption, version incrementation, and audit logging:

sau keyvault secret-set ROTATION_TEST "version-one" --vault prod-payments-vault
sau keyvault secret-set ROTATION_TEST "version-two" --vault prod-payments-vault
sau keyvault secret-get ROTATION_TEST --vault prod-payments-vault
sau monitor activity-log --limit 5 -o table

secret-get returns "version-two" with version: 2, and activity-log records both write operations and the read access event without logging the secret plaintext.

What can go wrong

  • Calling secret-get inside a hot per-request HTTP handler. Network latency and rate limits will slow down user traffic. Load secrets once at startup and refresh them on a 5–15 minute background timer or SIGHUP signal.
  • Accidentally printing decrypted output in CI logs. Never run set -x (bash -x) around sau keyvault secret-get; pipe directly into a 0600 tmpfs file (/run/secrets/...) or process environment.
  • Deleting a production vault fails with 409 RESOURCE_LOCKED. A CanNotDelete lock is protecting the vault in /dashboard/resource-manager—keep that lock enabled permanently on production vaults!

Good practice

  • Separate vaults by environment and blast radius (prod-payments-vault, prod-web-vault, staging-vault) and scope Key Vault Secrets Officer RBAC roles per vault.
  • Pair static secrets in Key vault & KMS (/dashboard/key-vault) with dynamic non-secret feature flags in Automation > App config & messaging (/dashboard/app-config).
  • Alert on unexpected spikes in secret-get calls inside Operations > Cloud SIEM & SOAR (/dashboard/sentinel) to catch compromised runner tokens immediately.

Where to go next

  • Hunt threats with KQL, automate SOAR and enforce DLP
  • Organize resources with groups, tags, locks and RBAC
  • Run serverless functions, workflows, queues and OCI registries

Related Articles

Create a scoped API key and send your first v1 request

Read more

Route APIs with Edge WAF, rate limits and Cloud DNS

Read more

Purchase Azure-backed cloud storage with WORM locks and SAS

Read more

Frequently Asked Questions

What does the Store AES-256-GCM secrets and rotate keys in Key Vault documentation guide cover?
Encrypt application secrets with AES-256-GCM envelope KMS, perform transit signing, rotate versions and recover soft-deleted secrets. It is rated intermediate difficulty (15 min) and applies to Servers Are Up infrastructure and workflows.
Can I manage or automate these steps through the Servers Are Up dashboard, REST API v1, or MCP server?
Yes. Every Servers Are Up server includes browser-based SSH, WebRDP, and VNC console access in the dashboard, plus programmatic control via the REST API v1 (/api/v1) and hosted Model Context Protocol server (/api/mcp/v1) using a scoped Personal Access Token.

Need hands-on help with Store AES-256-GCM secrets and rotate keys in Key Vault?

Every Servers Are Up virtual machine and container includes an integrated HTML5 browser-based SSH, RDP, and VNC console in your dashboard, default-off inbound firewall rules with per-IP allow-lists, and full programmatic control via REST API v1 and Model Context Protocol (MCP). Explore our Virtual Datacenter Plans or reach out to Servers Are Up Support.

Was this article helpful?

On this page

What you will have at the endBefore you startSteps1. Store versioned secrets in Key Vault via CLI, Console, or API2. Fetch secrets at service startup (never on every HTTP request)3. Use KMS transit signing and encryption without exporting private keys4. Rotate secret versions and enable soft-delete protectionCheck that it worksWhat can go wrongGood practiceWhere to go next