Ruza Drive / Guides
Key security
Where to keep a Ruza'Gency API key, how to restrict it, rotate it without downtime and react to a leak. Never in a URL nor in front-end code.
Where to keep a key
A key opens your files without any other password: treat it as a password. It is shown only once, when created; put it away at once.
- On a server: an environment variable or your host's secret manager.
- In continuous integration: the platform's encrypted secrets, never in clear in the repository.
- On a workstation: the system keychain rather than a text file.
- One key per use and per machine: you can revoke one without stopping the others.
What never to do
- In a URL:
?api_key=or?token=answer 400key_in_url, because an address ends up in logs and histories. Regenerate the key then. - In front-end code (website, published app): any visitor can read it. The API sends no CORS header anyway: no third-party site can call it from a browser.
- In a code repository, even a private one, nor in a ticket, a message or a screenshot.
- In your logs: never write the
Authorizationheader.
Least privilege
- Permissions: tick only what the tool needs; the Backup template is enough for a backup script.
- Folder: restrict the key to the folder the tool uses.
- IP addresses: keep it to your server's addresses.
- Rate: give it a per-minute ceiling lower than the account's.
- Sensitive permissions: Delete permanently and Create and manage share links, only when needed.
Expiry and rotation
A key expires at most one year after its creation or its last extension, and your account warns you 7 days before. "Extend" pushes the date back without changing the secret: the automation keeps running, and each year someone confirms the key is still in use.
To change the secret without downtime, "Regenerate" creates the new one and keeps the old one valid for 1 hour or 24 hours, as you choose: deploy the new key, check, the old one switches off by itself.
If a key leaks
- Revoke the key in your account (API keys): it is refused from the next request.
- Look at its activity: last use, addresses and countries, last requests.
- Create a new key, more restricted if you can, and deploy it.
- If you think your account itself is compromised, change your password; "Forgot password" revokes every key.
Every key creation is notified to you, by the bell and by email: a key you did not create must be revoked at once.
Recognising a key
A key starts with rza_, followed by 40 random characters and 6 check characters, in base62. The check lets a key copied wrong be rejected without a request, and secret scanners recognise a real key. Your account shows it shortened, like rza_7hQe…x9Kd.