Access credentials
Applications authenticate to NNumbers Messaging with access keys, signing every request with AWS Signature Version 4 (SigV4), exactly as they would on AWS. The SDKs and the AWS CLI sign on their own: you only provide the key ID, the secret key and the br-se-1 region.
Sending over SMTP uses a different credential, the SMTP credential, described in Email.
Access keys
The Access credentials area of the Console lists the organization's keys (without the secret key) with description, status, creation date and restrictions. Creating and revoking keys requires the Admin role.
When you create a key, the Console shows:
| Field | What it is |
|---|---|
| Access key ID | The public identifier of the key; goes in AWS_ACCESS_KEY_ID |
| Secret key | The secret used in the signature; goes in AWS_SECRET_ACCESS_KEY. Shown only once |
| Account | The organization's 12-digit virtual account, used in queue URLs and ARNs |
| Region | br-se-1 |
Copy the secret key straight into a secret manager. It cannot be retrieved again; if you lose it, revoke the key and create another one.
Each organization can have up to 100 access keys. The same key signs requests to Queues, Notifications and the Email API, subject to the restrictions below.
Restrictions
Without restrictions, the key is valid for every action and every queue of the organization. Restrict it whenever you can:
| Restriction | Format | Examples |
|---|---|---|
| Actions | Action name with the service prefix, a per-service wildcard or the full wildcard | sqs:SendMessage, sqs:ReceiveMessage, sns:Publish, ses:SendEmail, sqs:*, ses:*, * |
| Queues | Exact name or a prefix ending in * | orders, orders-* |
- A key with only
sqs:SendMessageand theordersqueue can only send to that queue: ideal for a producer. - The queue restriction also applies when the key creates a Notifications subscription to a queue or points to a dead-letter queue.
- A request outside the restrictions gets
AccessDenied. A valid signature does not mean permission.
Revocation
Revoking a key is immediate and final:
- revocation takes effect at once on the service node that received it and within 60 seconds everywhere else;
- a revoked key stays in the list with the revoked status, for reference;
- requests with a revoked key get
InvalidClientTokenId.
To replace a key without interrupting the application, create the new one, publish it in your secret manager, restart or reload the application and only then revoke the old one.
Key creation and revocation are recorded in the organization's audit trail, with who did it and when. The secret key never appears in the audit trail.
Good practices
- One key per application (or per environment), with a description that identifies the owner. That makes it easy to revoke only what leaked.
- Least privilege: restrict actions and queues to what the application really uses.
- Never in code: read the key from environment variables or from the secret manager, never from a versioned file. The examples in SDK examples follow this rule.
- Periodic rotation: replace keys from time to time, following the steps in the previous section.
- Synchronized clock: the SigV4 signature includes the time. A difference of more than 5 minutes makes the request fail with
SignatureDoesNotMatch. - Leaked? Revoke the key immediately and create another one. Revocation is the only way to invalidate the secret key.
| Error | What it means |
|---|---|
MissingAuthenticationToken | Unsigned request |
InvalidClientTokenId | Unknown or revoked key |
SignatureDoesNotMatch | Wrong secret key, region or service, body changed in transit, or clock out of sync |
AccessDenied | The key does not allow this action or this queue |
Was this page helpful?
Report a problem on this pageDo not send passwords, keys, tokens, or customer data.