What to know
App Store Connect API keys are credentials. Apple says private keys can be downloaded only once and should be stored securely. Treat the file like a password with the ability to change app data.
Use the smallest role that supports the workflow. Keep the key in a secret store or protected environment, not in source control, screenshots, chat, or a client-side bundle.
Choose the key type and role for one job. A reporting check should not receive publishing access. Record the key ID, issuer ID, owner, environment, and creation date, but never record the private-key value. If a private key is available only once, confirm the secure backup before leaving the setup screen.
Start with read-only checks. Confirm the key ID, issuer ID, and private key match. If a key is lost or exposed, revoke it and create a replacement.
The API uses a signed JWT, so protect the inputs that create it as carefully as the key file. Keep signing inside a trusted server or CI environment. Never place the private key, JWT, or issuer secret in browser code, a mobile build, a public issue, or a diagnostic log.
Separate credentials by purpose and environment. A reporting job should not share a key with a publishing job, and a local developer key should not be copied into a CI log or a browser bundle.
Test the failure path too. Confirm the job stops when a secret is missing, never prints private-key material, and records only safe identifiers such as the key ID and request result.
Use a small setup sequence: name the job, choose the minimum role, create the key in the correct team account, download the private key once, store it in the approved secret manager, and run a read-only request. Keep the key ID and issuer ID in configuration metadata, but keep the private-key content out of tickets and release notes.
Give the job an explicit expiration and rotation owner. Before rotation, create the replacement, test it with the same read-only request, switch the secret reference, and revoke the old key only after the new path is confirmed. If the test fails, stop rather than falling back to a broader credential.
Log safe outcomes instead of sensitive inputs: request type, app or resource identifier, timestamp, status, and key ID. A failure should say which check stopped the run without printing the JWT, private-key path, issuer secret, or full request headers.
Practice rotation before it is urgent. Write down who creates the replacement, who verifies the read-only request, who changes the secret reference, and who revokes the old key. Test the failure branch where the replacement is invalid, and keep the old credential available only until the new path is confirmed.
Treat a suspected exposure as an incident, not a debugging task. Stop jobs that use the key, preserve safe timestamps and key IDs, revoke or replace the credential through the approved process, and check logs, source control, tickets, and build artifacts for copies. Never paste the private key into an incident report.
Keep the rotation record free of secret material: key ID, role, environment, owner, dates, validation result, and revocation status are enough for an audit. A person should approve the final switch and confirm that no job has silently fallen back to a broader or older credential.
Add a pre-rotation inventory of every job, environment, secret reference, and role that uses the key. After the switch, run the same safe read-only check in each environment and confirm that failures stop closed instead of retrying with an untracked credential.
Define an exposure boundary before an incident occurs. Decide who can revoke the key, where safe evidence is recorded, which jobs are paused, and how the team checks source control, logs, tickets, artifacts, and local copies. Do not wait for certainty before stopping a suspected leaked credential.
Revisit access when ownership, team membership, app scope, CI provider, or automation purpose changes. A key can remain technically valid while its role is no longer appropriate. Keep the old approval, new owner, and revocation result in the same credential record.
ASOgenic can help review the credential-safe automation plan and show which fields need approval without exposing secrets. The final key creation, storage, rotation, and revocation decisions stay with your team.