Skip to content

Feature/eli 702 code signing#647

Merged
eddalmond1 merged 10 commits intomainfrom
feature/ELI-702-code-signing
Apr 28, 2026
Merged

Feature/eli 702 code signing#647
eddalmond1 merged 10 commits intomainfrom
feature/ELI-702-code-signing

Conversation

@TOEL2
Copy link
Copy Markdown
Contributor

@TOEL2 TOEL2 commented Apr 21, 2026

Description

This pr will enforce code signing on the test environment but no others at the moment.

It will also alter the base deploy script such that for preprod deployments we do the signing but we do not enforce it and we do not do it for prod

Before this workflow change can be tested we need to do a preprod deployment so that the signing resources are available.

Context

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.

@TOEL2 TOEL2 marked this pull request as ready for review April 22, 2026 07:51
@TOEL2 TOEL2 requested a review from a team as a code owner April 22, 2026 07:51
@TOEL2 TOEL2 closed this Apr 22, 2026
@TOEL2 TOEL2 reopened this Apr 22, 2026
eddalmond1
eddalmond1 previously approved these changes Apr 22, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces Lambda code-signing configuration and updates the deployment workflow to support signing during promotions, with the aim of enforcing code signing in lower environments.

Changes:

  • Add conditional attachment of an AWS Lambda Code Signing Config based on environment.
  • Pass an environments_with_signing list from the api-layer stack into the Lambda module.
  • Extend the base deploy GitHub Actions workflow to sign artifacts during preprod deployments and adjust job structure (separate preprod/prod deploy jobs).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
infrastructure/stacks/api-layer/lambda.tf Wires environments_with_signing into the lambda module and exposes signing profile output for workflows.
infrastructure/modules/lambda/variables.tf Adds environments_with_signing module input to control when code signing config is attached.
infrastructure/modules/lambda/lambda.tf Conditionally attaches code_signing_config_arn to the Lambda function.
.github/workflows/base-deploy.yml Adds a preprod signing job and splits deploy into preprod/prod flows; updates dependencies accordingly.

Comment on lines 33 to 37
stack_name = local.stack_name
provisioned_concurrency_count = 5
api_domain_name = local.api_domain_name
environments_with_signing = ["test", "preprod"]
}
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

environments_with_signing includes preprod, which will attach a code signing config to the Lambda in preprod. Given this PR’s description says preprod should sign but not enforce, this appears to enable enforcement in preprod as well (the module’s signing policy is set to Enforce). Consider removing preprod from this list, or introducing a separate flag/setting to sign in preprod without enforcing untrusted artifacts.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I decided to enforce preprod at the same time as this PR, as the pre-requisite step of deploying the signing infrastructure has already been done

Comment on lines 13 to +15

code_signing_config_arn = contains(var.environments_with_signing, var.environment) ? aws_lambda_code_signing_config.signing_config.arn : null

Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

code_signing_config_arn is conditionally set based on environments_with_signing, but the code signing config created by this module uses untrusted_artifact_on_deployment = "Enforce". With the current stack passing preprod into environments_with_signing, this will enforce signing in preprod too, which conflicts with the PR description (“sign but do not enforce”). A common approach is to either (a) only attach the config in enforced environments, or (b) make the signing policy configurable per environment (e.g., Warn vs Enforce).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I decided to enforce preprod at the same time as this PR, as the pre-requisite step of deploying the signing infrastructure has already been done

Comment thread infrastructure/modules/lambda/variables.tf Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@ayeshalshukri1-nhs ayeshalshukri1-nhs left a comment

Choose a reason for hiding this comment

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

This looks good to me.
I just want to check, will this be deployed for prod once preprod is tested/working etc?

@eddalmond1
Copy link
Copy Markdown
Collaborator

eddalmond1 commented Apr 28, 2026 via email

@eddalmond1 eddalmond1 merged commit 78902f1 into main Apr 28, 2026
26 checks passed
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.

4 participants