Interview Prep/CI/CD/Builds, Artifacts, Nexus, SonarQube and Testing

Tests need secrets (API keys for a sandbox). How do you provide them safely in CI?

IntermediateScenarioBuilds, Artifacts, Nexus, SonarQube and Testing
Answer

Situation read → Test-time secrets.

What I'd do →

  1. Use dedicated sandbox keys with minimal scope and a rotation schedule.
  2. Inject at runtime through the CI secret store/Vault, not committed .env files.
  3. Block secret availability on fork PRs.
  4. Prefer mocks or contract tests where the real service is not needed.

Why → Test credentials are still credentials and still leak.

Interview tip → Contract tests (Pact) reduce reliance on live third parties.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Builds, Artifacts, Nexus, SonarQube and Testing