Safeguard
Developer Tools•

Which fastlane CI environment variables are secrets?

Several variables fastlane reads on CI hold passwords or session tokens. Here is which to store as secrets, which are just settings, and how to limit them.

Safeguard Security Team
3 min read

Treat FASTLANE_PASSWORD, MATCH_PASSWORD, FASTLANE_SESSION and FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD as secrets. FASTLANE_USER is an account identifier, not a secret but still sensitive. The locale variables and the interactive 2FA flag are plain settings. Store the secrets in a secret manager and scope them to the jobs that need them.

What the CI page lists

The fastlane continuous integration guide names the variables most setups need:

VariableWhat it isTreat as
FASTLANE_USERStore account userSensitive identifier
FASTLANE_PASSWORDAccount password, used with the userSecret
MATCH_PASSWORDPassword of the match encryptionSecret
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORDApp-specific password for uploading when 2FA is onSecret
FASTLANE_SESSIONA pregenerated session from the spaceauth command when 2FA is onSecret, regenerate when needed
LANG and LC_ALLUTF-8 locale for the shellSetting
SPACESHIP_ONLY_ALLOW_INTERACTIVE_2FAStops 2FA prompts in non-interactive modeSetting

The page says FASTLANE_PASSWORD is usually only needed if you also set the user variable. It also says many CI systems come with an unset or ASCII locale, which is why the locale variables matter.

Reduce how many you need

Each password variable is a reason for a credential to exist. The fastlane docs describe the App Store Connect API key path as avoiding 2FA, with better reliability. If your lanes support it, an API key replaces the user, password, session and app-specific password variables with a key file, key ID and issuer ID, and the key can be role-scoped. Our post on API key versus Apple ID compares them.

Scope them

  1. Define secrets at the narrowest level your CI allows, a single environment or job, not the whole organization.
  2. Do not export them in a step that also runs third-party code or scripts you did not write.
  3. Give the beta lane and the release lane different credentials where the platform allows.
  4. Keep MATCH_PASSWORD apart from the signing storage, since together they open the certificates.
  5. Never echo variables or print the environment for debugging.

Watch the logs

CI platforms redact exact matches of known secrets, but not transformed values. A hosted CI service's guidance says automatic redaction is not guaranteed because a secret can be transformed in several ways, and tells you to register generated sensitive values as secrets too. If a secret reaches a log, delete the log and rotate the secret. See our post on log masking limits.

Rotation checklist

EventRotate
Someone with access leavesAll store credentials they could read
Suspected log leakThe leaked value, then delete the log
Quarterly reviewMATCH_PASSWORD and keys, on your schedule
CI compromiseEverything the environment could reach

Where Safeguard fits

Safeguard does not store these variables. It scans the dependencies of the code that uses them and enforces release policies. Try a free scan.

Quick check

Is FASTLANE_SESSION safe to keep for months?

No. It is a pregenerated session token, so regenerate it when it is exposed or stops working, and treat it like a password.

Can I put all of these in a plain config file?

No. Keep secrets in a secret manager and inject them at run time.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.