Skip to content

Rotate Pinpoint keys ​

How to rotate the Pinpoint API key and the webhook signing secret that Luna uses to receive and act on hires from Pinpoint, our applicant tracking system.

Neither value expires, so rotate them when someone with access leaves, when a value may have leaked, or on whatever schedule security policy sets.

Requirements ​

  • Pinpoint admin access for the account you are rotating (the sandbox for lower environments and staging, production for production).
  • AWS access to the matching account (luna-non-prod or luna-production) with permission to write SSM parameters.

Where the values live ​

ValueSSM parameterRead by
API key/luna/<env>/pinpoint/api-key (SecureString)The onboarding subscriber, through @bhag-business-platform/luna-connectors (hired flow, ANDi id write-back, rejection and the start-date poll). The employee-gateway scheduler (<env>-employee-gateway-scheduler-function) for the 02:00 UTC daily poll and the 05:30 UTC reference-data sync
Subdomain/luna/<env>/pinpoint/subdomainThe same callers, to build https://<subdomain>.pinpointhq.com/api/v1
Webhook signing secret/luna/<env>/pinpoint/webhook-signing-secret (SecureString)The employee-gateway subscriber, to verify the pinpoint-hmac-sha256 header on POST /webhooks/pinpoint

The values are read from SSM on every call, except in the reference-data sync, which reads them once at the start of each run. Nothing is cached between runs, so a new value takes effect on the next request or run and no redeploy is needed.

Pinpoint screens not verified

The Pinpoint UI steps below follow Pinpoint's documentation and haven't been checked step by step. If a screen differs, follow Pinpoint's current UI and update this page.

Rotate the API key ​

  1. In Pinpoint, create a new API key. Don't delete the old one yet.

  2. Check the new key works:

    bash
    curl -s -o /dev/null -w "%{http_code}\n" \
      -H "X-API-KEY: <new-key>" \
      "https://<subdomain>.pinpointhq.com/api/v1/applications?page%5Bnumber%5D=1"

    Expect 200.

  3. Switch Luna to the new key:

    bash
    aws ssm put-parameter \
      --name "/luna/<env>/pinpoint/api-key" \
      --type SecureString \
      --value "<new-key>" \
      --overwrite
  4. Check the new key works in Luna. The quickest check is the next daily poll: the employee-gateway scheduler logs (<env>-employee-gateway-scheduler-function) show Queued <n> hired Pinpoint applications updated in the last 7 days after 02:00 UTC. Then check the onboarding subscriber logs (<env>-onboarding-subscriber-function) for errors from Pinpoint calls.

  5. Delete the old key in Pinpoint.

Rotate the webhook signing secret ​

Expect a short gap during the swap. While Pinpoint and SSM disagree, webhook deliveries fail signature verification and return 401, and the signature-failure alarm posts to #<env>-error-alerts. Pinpoint's documentation says it retries failed deliveries, which hasn't been tested, so keep the gap to seconds and let the channel know beforehand.

  1. Open the Luna webhook in Pinpoint's webhook settings and regenerate or set its signing secret. Copy the new value.

  2. Straight away, overwrite the SSM parameter:

    bash
    aws ssm put-parameter \
      --name "/luna/<env>/pinpoint/webhook-signing-secret" \
      --type SecureString \
      --value "<new-secret>" \
      --overwrite
  3. Confirm the signature-failure alarm goes back to OK and the employee-gateway subscriber logs show Received Pinpoint webhook event again.

If Pinpoint retries give up before the swap completes, Pinpoint may disable the endpoint. Follow Re-enable a disabled endpoint.

Made with ❤️ by the Luna team