Skip to content

fix: Replace plain SHA-256 with HMAC-SHA256 for remote function artifact integrity#5602

Open
mollyheamazon wants to merge 11 commits intoaws:masterfrom
mollyheamazon:hmac-key-new
Open

fix: Replace plain SHA-256 with HMAC-SHA256 for remote function artifact integrity#5602
mollyheamazon wants to merge 11 commits intoaws:masterfrom
mollyheamazon:hmac-key-new

Conversation

@mollyheamazon
Copy link
Contributor

@mollyheamazon mollyheamazon commented Mar 5, 2026

Ticket: https://tiny.amazon.com/umah6gic/tcorpamazD403over

Issue

PR #5379 updated the integrity verification for remote function serialized artifacts by switching from HMAC to SHA-256 hashing. However, this approach has a gap
where the hash can be recomputed if the artifact is replaced, making the integrity check ineffective.

Solution

Re-introduce HMAC-SHA256 signing with the key stored in AWS Secrets Manager instead of environment variables (the original approach in pre-#5379). A trust anchor in SSM Parameter Store ensures the key reference cannot be tampered with.

Breaking change

This changes the serialization/deserialization format for remote function artifacts. Existing in-flight jobs will need to be re-run after upgrade.

New IAM permissions required

Execution roles used with @Remote / RemoteExecutor need:

Permission Resource
secretsmanager:CreateSecret arn:aws:secretsmanager:*:*:secret:sagemaker/remote-function/*
secretsmanager:GetSecretValue same
ssm:PutParameter arn:aws:ssm:::parameter/sagemaker/remote-function/*
ssm:GetParameter same
sts:GetCallerIdentity *

Testing

Validated end-to-end via notebook: https://tiny.amazon.com/kyowq0p4/drivcorpamazdocumollremoipyn

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@mollyheamazon mollyheamazon marked this pull request as ready for review March 7, 2026 00:16
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.

1 participant