17

I would like to use AWS Lambda to perform a computation on behalf of a 3rd party and then prove to them that I did so as intended. A proof would be a cryptographically signed digest of the function body, the request, and the response. Ideally, Amazon would sign the digest with its own private key and publish their public key to allow verification of the signature. The idea is similar to the "secure enclave" that new Intel chips provide through SGX (Software Guard Extensions).

The existing Lambda service has some of the ingredients needed. For example, the GetFunction response includes a CodeSha256 field that uniquely identifies the function implementation. And the Amazon API Gateway allows you to make HTTPS requests to the Lambda service, which might allow a TLSNotary-style proof of the request-response contents. But to do this right I think AWS Lambda needs to provide the signature directly.

Microsoft Azure is working on trusted software enclaves ("cryptlets") in their Project Bletchley: https://github.com/Azure/azure-blockchain-projects/blob/master/bletchley/bletchley-whitepaper.md https://github.com/Azure/azure-blockchain-projects/blob/master/bletchley/CryptletsDeepDive.md

Is something like this possible with the current AWS Lambda?

3 Answers3

4

Let's make some definitions first, Lambda isn't a server but a service that runs your code. it does not provide any signature directly but rather what you configure for it on AWS.

The Secure Enclave is one implementation or a type of TPM (Trusted Platform Module), this can be done in many ways and the Secure Enclave is one of the best. The short answer to your question is yes it can be done as long as you implement the needed code and add all the required configuration, SSL etc.

I would advide you to read the following:http://ieeexplore.ieee.org/document/5703613/?reload=true

And in case you want to have a TPM out of the box you can use microsoft project: https://github.com/Microsoft/TSS.MSR

Adi
  • 2,074
  • 22
  • 26
3

AWS has different approach according to security. You can set what can use particular resource, and which way.

For sure you can do what was described. You can identify request, response, and exact version of code that was used. Question is if you want to sign code, when processing request. Easier way is to have that calculated on deploy.

For first case - you need language with access to source. Like with Python, you can get it, sign and return that, or store somewhere.

Second case - I would use tagging.

Michał Zaborowski
  • 3,911
  • 2
  • 19
  • 39
  • Your answer doesn't address the key question: I want to prove that a particular computation was performed, using code X on input Y producing output Z. The usual way to do this is with a cryptographic attestation from a trusted party. In the case of Intel SGX, the hardware enclave provides the attestation and the trusted party is Intel. Microsoft is working on a trusted software enclave that runs inside their hypervisor as part of Coco. I hope that Amazon is working on something along these lines. – Michael Maurer Oct 09 '17 at 03:18
  • With AWS you can setup another layer, which will take care about signing, and providing that information in the way is acceptable by all parties. All that "stuff" is just another layer - provided by Intel, Microsoft, or any other company. If you trust PKI - you can sign all including that layer, and provide full info to your customer. – Michał Zaborowski Oct 09 '17 at 13:13
  • Or in the other way. All you can't provide yourself is trusted third side. You can address this problem by sending logs, with all information. That way you can try to trick them, but they can always check what happened. – Michał Zaborowski Oct 09 '17 at 14:04
1

There is also another solution to the problem by using IAM. You can provision an IAM role for your customer that has read-access to the Lambda source code. By using the public lambda endpoint (the one that looks like https://api-id.execute-api.region.amazonaws.com/STAGE) - you can assure the customer that the request is directly hitting this specific lambda function.

The IAM role available to your customer has permissions to do the following:

  • View the lambda code and other details across all revisions
  • Read the API gateway configuration to validate that the request directly hits the lambda, and doesn't go elsewhere.

All your customer needs to do then is setup auditing at their end against lambda by using the given IAM role. They can setup a periodic cron that downloads all versions of your lambda as it is updated. If you have a pre-review process - that can be easily configured against their alerting.

Note that this relies on "AWS" running in good faith and the underlying assumptions being:

  1. AWS Lambda is running the code it is configured against.
  2. AWS management APIs return correct responses.
  3. The time-to-alert is reasonable. This is easier, since you can download previous lambda code versions as well.

All of these are reasonable assumptions.

Nemo
  • 3,104
  • 2
  • 30
  • 46