|
| 1 | +# Kong Gateway Akeyless Vault Backend |
| 2 | + |
| 3 | +Native [Kong Gateway](https://konghq.com) Secrets Management integration for [Akeyless](https://www.akeyless.io). Resolve `{vault://...}` references in `kong.conf`, declarative config, plugin fields, and certificates — without storing plaintext secrets in Kong. |
| 4 | + |
| 5 | +**Target listing:** [Kong Supported Vault backends](https://developer.konghq.com/gateway/entities/vault/#supported-vault-backends) (same category as HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, GCP Secret Manager, and CyberArk Conjur). |
| 6 | + |
| 7 | +> **Ready for Kong partner review.** See **[docs/YOUR-ACTION-CHECKLIST.md](docs/YOUR-ACTION-CHECKLIST.md)** for what to do next (publish repo, validate, contact Kong). |
| 8 | +
|
| 9 | +## What this provides |
| 10 | + |
| 11 | +| Component | Description | |
| 12 | +|-----------|-------------| |
| 13 | +| **Vault strategy** | Lua module (`kong.vaults.akeyless`) implementing Kong's vault `get(conf, resource, version)` contract | |
| 14 | +| **LuaRocks package** | Install into Kong Gateway Enterprise for joint QA before native bundling | |
| 15 | +| **decK examples** | Declarative Vault entity + plugin secret references | |
| 16 | +| **Docker Compose demo** | Kong Gateway + PostgreSQL with mounted vault strategy | |
| 17 | +| **Kong-format docs** | Draft how-to for developer.konghq.com | |
| 18 | +| **Partner playbook** | Steps to land on Kong's official vault backends page | |
| 19 | + |
| 20 | +## How it works |
| 21 | + |
| 22 | +``` |
| 23 | +┌─────────────────┐ {vault://akeyless-vault/demo/api-key} ┌──────────────┐ |
| 24 | +│ Kong Gateway │ ──────────────────────────────────────────────► │ Akeyless │ |
| 25 | +│ (Enterprise) │ POST /auth → POST /get-secret-value │ SaaS / GW │ |
| 26 | +└─────────────────┘ └──────────────┘ |
| 27 | +``` |
| 28 | + |
| 29 | +1. Create a **Vault entity** with `name: akeyless` and your gateway credentials. |
| 30 | +2. Store secrets in Akeyless under a path prefix (e.g. `/kong/...`). |
| 31 | +3. Reference secrets anywhere Kong supports vault references. |
| 32 | + |
| 33 | +### Example references |
| 34 | + |
| 35 | +| Akeyless path | `path_prefix` | Kong reference | |
| 36 | +|---------------|---------------|----------------| |
| 37 | +| `/kong/demo/api-key` | `/kong` | `{vault://akeyless-vault/demo/api-key}` | |
| 38 | +| `/kong/pg` (JSON `username`/`password`) | `/kong` | `{vault://akeyless-vault/pg/username}` | |
| 39 | + |
| 40 | +## Quick start |
| 41 | + |
| 42 | +### 1. Prerequisites |
| 43 | + |
| 44 | +- Kong Gateway **Enterprise** license |
| 45 | +- Akeyless Access ID + Access Key (or Kubernetes / cloud IAM auth) |
| 46 | +- [decK](https://developer.konghq.com/deck/) (optional) |
| 47 | +- Docker (for local demo) |
| 48 | + |
| 49 | +### 2. Create a demo secret in Akeyless |
| 50 | + |
| 51 | +```bash |
| 52 | +cp examples/.env.example examples/.env |
| 53 | +# Edit examples/.env with your credentials |
| 54 | + |
| 55 | +./scripts/setup-demo-secrets.sh # requires Akeyless CLI |
| 56 | +``` |
| 57 | + |
| 58 | +Or create `/kong/demo/api-key` manually in the Akeyless console. |
| 59 | + |
| 60 | +### 3. Test Akeyless API (no Kong) |
| 61 | + |
| 62 | +```bash |
| 63 | +./scripts/test-akeyless-api.sh |
| 64 | +``` |
| 65 | + |
| 66 | +### 4. Run Kong demo stack |
| 67 | + |
| 68 | +```bash |
| 69 | +export KONG_LICENSE_DATA='...' # or add to examples/.env |
| 70 | +docker compose -f examples/docker-compose.yml up -d |
| 71 | +``` |
| 72 | + |
| 73 | +### 5. Apply Vault entity and validate |
| 74 | + |
| 75 | +```bash |
| 76 | +export DECK_AKEYLESS_GATEWAY_URL=https://api.akeyless.io |
| 77 | +export DECK_AKEYLESS_ACCESS_ID=p-xxxxx |
| 78 | +export DECK_AKEYLESS_ACCESS_KEY=... |
| 79 | + |
| 80 | +deck gateway apply examples/kong.yaml |
| 81 | + |
| 82 | +docker compose -f examples/docker-compose.yml exec kong-gateway \ |
| 83 | + kong vault get '{vault://akeyless-vault/demo/api-key}' |
| 84 | +``` |
| 85 | + |
| 86 | +Or run the full validation script: |
| 87 | + |
| 88 | +```bash |
| 89 | +./scripts/validate-vault.sh |
| 90 | +``` |
| 91 | + |
| 92 | +## Install vault strategy |
| 93 | + |
| 94 | +Until Kong bundles Akeyless natively: |
| 95 | + |
| 96 | +**Option A — mount files (demo)** |
| 97 | + |
| 98 | +```yaml |
| 99 | +volumes: |
| 100 | + - ./vault-strategy/kong/vaults/akeyless:/usr/local/share/lua/5.1/kong/vaults/akeyless:ro |
| 101 | +``` |
| 102 | +
|
| 103 | +**Option B — LuaRocks** |
| 104 | +
|
| 105 | +```bash |
| 106 | +luarocks make kong-vault-akeyless-0.1.0-1.rockspec |
| 107 | +``` |
| 108 | + |
| 109 | +## Configuration |
| 110 | + |
| 111 | +### Vault entity (decK / Admin API) |
| 112 | + |
| 113 | +```yaml |
| 114 | +vaults: |
| 115 | + - name: akeyless |
| 116 | + prefix: akeyless-vault |
| 117 | + config: |
| 118 | + gateway_url: "https://api.akeyless.io" |
| 119 | + auth_method: api_key |
| 120 | + access_id: "p-xxxxxxxx" |
| 121 | + access_key: "your-access-key" |
| 122 | + path_prefix: "/kong" |
| 123 | + ttl: 60 |
| 124 | +``` |
| 125 | +
|
| 126 | +### Authentication methods |
| 127 | +
|
| 128 | +| Method | Fields | Notes | |
| 129 | +|--------|--------|-------| |
| 130 | +| `api_key` | `access_id`, `access_key` | Default | |
| 131 | +| `token` | `token` | Skip `/auth` | |
| 132 | +| `kubernetes` | `access_id`, `k8s_auth_config_name` | Reads SA token from file | |
| 133 | +| `aws_iam` | `access_id` | EC2/EKS instance metadata | |
| 134 | +| `azure_ad` | `access_id` | Azure IMDS | |
| 135 | +| `gcp` | `access_id`, `gcp_audience` | GCE/GKE metadata | |
| 136 | +| `universal_identity` | `uid_token` | Universal Identity | |
| 137 | + |
| 138 | +See [docs/configure-akeyless-as-vault-backend.md](docs/configure-akeyless-as-vault-backend.md) for the full parameter table. |
| 139 | + |
| 140 | +## Appearing on developer.konghq.com |
| 141 | + |
| 142 | +Native listing requires Kong to **bundle** the vault strategy in Gateway Enterprise (not a community plugin). |
| 143 | + |
| 144 | +| Doc | Purpose | |
| 145 | +|-----|---------| |
| 146 | +| [YOUR-ACTION-CHECKLIST.md](docs/YOUR-ACTION-CHECKLIST.md) | **Start here** — your to-do list | |
| 147 | +| [publish-to-github.md](docs/publish-to-github.md) | Push to `akeyless-community` | |
| 148 | +| [partner-outreach-email.md](docs/partner-outreach-email.md) | Copy/paste Kong email | |
| 149 | +| [kong-engineering-handoff.md](docs/kong-engineering-handoff.md) | One-pager for Kong engineers | |
| 150 | +| [kong-partner-submission.md](docs/kong-partner-submission.md) | Full partner playbook | |
| 151 | + |
| 152 | +## Repository layout |
| 153 | + |
| 154 | +``` |
| 155 | +kong-akeyless-integration/ |
| 156 | +├── vault-strategy/kong/vaults/akeyless/ # Lua vault backend |
| 157 | +├── kong-vault-akeyless-0.1.0-1.rockspec # LuaRocks (repo root) |
| 158 | +├── examples/ # docker-compose, kong.yaml, .env |
| 159 | +├── scripts/ # validate, setup, API smoke test |
| 160 | +├── .github/workflows/ci.yml # lint + preflight |
| 161 | +└── docs/ # how-to, partner email, your checklist |
| 162 | +``` |
| 163 | +
|
| 164 | +## Security notes |
| 165 | +
|
| 166 | +- Scope Akeyless auth to `/kong/*` (or your prefix) with read-only access. |
| 167 | +- Use Kubernetes or cloud IAM auth on Kong data planes when possible instead of long-lived access keys. |
| 168 | +- Kong never logs resolved secret values when vault references are used correctly. |
| 169 | +
|
| 170 | +## Related projects |
| 171 | +
|
| 172 | +- [Jenkins Akeyless Credentials Provider](../JenkinsSecretsManagerProvider) |
| 173 | +- [Buildkite Akeyless Plugin](../buildkite-akeyless-plugin) |
| 174 | +- [Octopus Deploy Akeyless Step Templates](../octopus-akeyless-plugin) |
| 175 | +
|
| 176 | +## License |
| 177 | +
|
| 178 | +Apache-2.0 |
0 commit comments