Skip to content

CCM-12615: APIM Authentication#116

Merged
simonlabarere merged 5 commits intomainfrom
feature/CCM-12615_APIM_key_rotation
Nov 24, 2025
Merged

CCM-12615: APIM Authentication#116
simonlabarere merged 5 commits intomainfrom
feature/CCM-12615_APIM_key_rotation

Conversation

@simonlabarere
Copy link
Copy Markdown
Contributor

@simonlabarere simonlabarere commented Nov 18, 2025

Description

APIM Key generation / rotation + token generation.

Context

  • Lambda to generate a public/private key pair if required. Scheduled to run once a day.
  • S3 Bucket to store the public key.
  • Cloudfront to expose public key to APIM
  • Private key stored in SSM.
  • Lambda to generate an auth token using the API key and Private key in SSM. Scheduled to run every 9 minutes.

Testing

Developer portal updated to make the APIM application point at the the public key of this PR

image

Private and Public keys generated by the key-generation lambda

image image

Public key exposed using Cloudfront

image image

Auth token generated by the refresh-apim-access-token lambda

image

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@simonlabarere simonlabarere requested review from a team as code owners November 18, 2025 11:57
@simonlabarere simonlabarere force-pushed the feature/CCM-12615_APIM_key_rotation branch from 5830910 to 39af95d Compare November 21, 2025 15:12
Comment thread infrastructure/terraform/components/dl/variables.tf
Copy link
Copy Markdown
Contributor

@gareth-allan gareth-allan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments from a look through the TF changes. I still need to look over the actual lambda code.

Comment thread infrastructure/terraform/components/dl/module_lambda_apim_key_generation.tf Outdated
Comment thread infrastructure/terraform/components/dl/module_s3_bucket_cf_logs.tf
Comment thread infrastructure/terraform/components/dl/ssm_parameter_api_key.tf Outdated
Comment thread lambdas/refresh-apim-access-token/jest.config.ts
Copy link
Copy Markdown
Contributor

@gareth-allan gareth-allan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@simonlabarere simonlabarere merged commit d1c0a37 into main Nov 24, 2025
36 checks passed
@simonlabarere simonlabarere deleted the feature/CCM-12615_APIM_key_rotation branch November 24, 2025 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants