Why
bunny.net has one API key for each account, and the key gives full control of the account. bunny.net does not supply OIDC login or keys with limited access.
If you put the key in a CI secret, each workflow has full control of your account. Each person who can change a workflow also has full control. With White Rabbit, a deploy job gets mc.read and mc.deploy for five minutes, and nothing more.
How it works
White Rabbit is a layer between your CI jobs and bunny.net. The rabbit command-line tool runs the official BunnyCLI through White Rabbit. BunnyCLI never sees the real key.
rabbit -- <bunny arguments>.You sign in one time
rabbit auth loginsends a one-time code of six digits to your email address.rabbit admin key setstores your bunny.net API key on the server, encrypted.You add a workload binding
rabbit admin bindings addgives one workflow in one repository a set of capabilities. Only a person who is signed in can add a binding. CI jobs and repository content cannot.The CI job exchanges its token
In CI,
rabbitsends the OIDC token of the job to White Rabbit. Only a job that agrees exactly with a binding gets a session. A CI session is valid for 60 minutes or less.White Rabbit does a check of each request
Each BunnyCLI call uses a virtual credential that is valid for five minutes. If an operation is not in the registry, the response is
404. If the capability is not in the binding, the response is403.White Rabbit sends the request to bunny.net
White Rabbit adds your bunny.net API key on the server and sends the request to
api.bunny.net. The audit log records each decision.
In your workflow
There is no bunny.net secret and no White Rabbit secret in the repository. The job needs permission to get an OIDC token.
permissions:
id-token: write # Forgejo: enable-openid-connect: true
steps:
- run: npm install -g @bunny.net/cli
- run: curl -fsSL https://raw.githubusercontent.com/activout/nordray-whiterabbit/main/scripts/install-rabbit.sh | sh
- run: rabbit -- apps deploy
The same rabbit -- … command operates at your own terminal. Thus an AI agent can use BunnyCLI and not see the key. rabbit --capabilities a,b -- … limits what the agent can do.
Security model
White Rabbit refuses each request that it does not know.
Deny by default
Each operation must be in a registry in the source code. A new endpoint needs a code review before it becomes available.
Exact workload bindings
A binding agrees with the issuer, the repository, the ref and the workflow exactly. Pull request events are never permitted.
Short-lived credentials
A virtual credential is valid for five minutes. White Rabbit stores only a SHA-256 hash of each session and each credential. You can revoke them at any time.
The key stays on the server
White Rabbit keeps the bunny.net API key encrypted in its database and adds it to outgoing requests. CI jobs and the CLI do not see the key.
Secrets in responses are removed
White Rabbit replaces container environment values and registry passwords with a placeholder before the caller sees them.
Sign-in allow-list
Only the email addresses and domains on the list can sign in. An empty list means that nobody can sign in.
Supported bunny.net APIs
Each area has its own capabilities. A workload binding gets only the capabilities that it needs.
| Area | Capabilities |
|---|---|
| Magic Containers | mc.read, mc.deploy, mc.env, mc.manage |
| Bunny Database | db.read, db.manage, db.token |
| Pull Zones | pullzone.read, pullzone.write |
| DNS Zones | dns.read, dns.write |
| Shield | shield.read, shield.write |
| Account and statistics | account.read, statistics.read |
Run it
White Rabbit uses ASP.NET Core on .NET 11, YARP and libSQL. It operates as one container, for example on bunny.net Magic Containers with Bunny Database. The rabbit CLI is written in Go. The instructions are in the repository.
Also from Nordray: Access
Nordray Access puts a login in front of your web application at the Bunny CDN edge. You do not change your application code.