The Update Framework - Everythings

Discover serverless TUF implementation on AWS for secure, scalable IoT software updates and learn key takeaways from challenges faced.

The Update Framework - Everythings
Photo by Jorge Ramirez / Unsplash

The project I worked on was for a company called Everythings. Everythings is a spin-off of Cloudway and they focus on providing Internet of Things (IoT) solutions. The specific task I was given was to implement The Update Framework (TUF) in a serverless way on Amazon Web Services (AWS). TUF is an open-source security framework that provides a secure way to update software on connected devices in an IoT ecosystem. Implementing TUF in a serverless way on AWS involved using AWS services such as Lambda functions, API Gateway, and Key Management Service (KMS) to securely manage and distribute software updates to connected devices. The goal of the project was to ensure the security and integrity of software updates while also providing a scalable and cost-effective solution for the company's clients.

Background

The Update Framework (TUF) is an open-source security framework that provides a secure way to update software on connected devices in an Internet of Things (IoT) ecosystem. TUF is designed to address the unique security challenges associated with software updates in IoT systems, such as the need to protect against compromised or malicious software repositories and the need to ensure the authenticity and integrity of software updates.

TUF is based on a set of roles and file formats that provide a flexible and extensible way to manage software updates. The framework consists of several components, including:

  • Root keys: These are the top-level keys that are used to sign all other keys in the TUF system. They are typically kept offline and only used to sign the keys of other roles.
  • Targets: These are the files that are being updated, such as firmware images or software packages.
  • Timestamp: This is a role that signs the metadata of the latest version of the targets.
  • Snapshot: This is a role that signs the metadata of all the targets.
  • Delegations: This is a role that allows for the transfer of signing responsibilities to other parties.

Typically TUF is implemented by creating a TUF repository, which is a collection of metadata files and target files. The metadata files include the keys and signatures that are used to verify the authenticity and integrity of the target files, while the target files are the files that are being updated. The TUF client, which is a software running on the IoT device, is responsible for checking the metadata files to ensure that the target files are authentic and have not been tampered with, before downloading and installing the updates.

It is important for IoT systems as it provides a secure way to update software on connected devices, by ensuring the authenticity and integrity of software updates and protecting against compromised or malicious software repositories. The TUF framework also provides a scalable and extensible way to manage software updates, which is important for the complex and dynamic nature of IoT systems.

Technical details

The specific architecture I used to implement TUF in a serverless way on AWS includes the use of the following AWS services:

  1. Lambda functions: I used Lambda functions to handle the TUF client requests and handle the TUF repository metadata. Lambda functions is a stateless, event-driven compute service that allows for the execution of code without the need to provision or manage servers.
  2. API Gateway: I used API Gateway to expose the TUF repository metadata to the TUF clients in a secure manner. API Gateway is a fully managed service that makes it easy to create, publish, maintain, monitor, and secure APIs at any scale.
  3. KMS: I used KMS keys to sign the TUF repository metadata. KMS is a fully managed service that makes it easy to create and control the encryption keys used to encrypt your data, and uses Hardware Security Modules (HSMs) to protect the security of your keys.

Challenges and Solutions

During the implementation process, I faced several challenges:

  1. Security: One of the main challenges I faced was ensuring the security of the TUF repository metadata and the target files. I had to ensure that the target files were authentic and had not been tampered with. To overcome this challenge, I used KMS keys to sign the TUF repository metadata and used API Gateway to control access to the TUF repository.
  2. Scalability: Another challenge I faced was ensuring that the TUF system could handle a large number of updates and TUF clients. I had to ensure that the system could handle a high volume of requests and that the TUF repository could scale to accommodate a large number of target files. To overcome this challenge, I used Lambda functions, which are highly scalable and can automatically handle a high volume of requests.
  3. Network Latency: Since the TUF clients are IoT devices, they are connected over the internet, this led to the challenge of dealing with network latency and the potential for lost packets. To overcome this, I had to optimize the TUF repository's metadata for the size and network conditions of IoT devices.
  4. Key Management: Key management is a critical aspect of TUF. I had to ensure that the keys used to sign the TUF repository metadata were properly protected and rotated regularly. To overcome this challenge, I used KMS to manage the keys used to sign the TUF repository metadata and had a robust key management strategy in place.
  5. Testing: Testing the implementation in a real-world scenario was a challenge, but I overcame it by using a combination of automated testing and manual testing. I also used testing tools to ensure that the system was robust and reliable.
  6. Monitoring: Monitoring the system and identifying potential issues was also a challenge. To overcome this I used AWS CloudWatch, this service allows me to monitor the system's performance, identify potential issues, and troubleshoot problems.

By addressing these challenges, I was able to successfully implement TUF in a serverless way on AWS, providing a secure and scalable solution for the company's clients.

Conclusion

The key takeaways from this project are:

  1. TUF provides a secure way to update software on connected devices in an IoT ecosystem, by ensuring the authenticity and integrity of software updates and protecting against compromised or malicious software repositories.
  2. Implementing TUF in a serverless way on AWS provides a scalable and cost-effective solution for managing software updates in IoT systems. The use of Lambda functions, API Gateway, and KMS keys allows for the creation of a secure and highly available system.
  3. Key management is a critical aspect of TUF, using KMS for key management allows for the protection and rotation of keys used to sign the TUF repository metadata.
  4. Monitoring and testing are important to ensure the robustness and reliability of the system, AWS CloudWatch and testing tools can help with that.
  5. There are challenges when implementing TUF in a real-world scenario, such as network latency, and key management, which can be overcome by optimizing the TUF repository's metadata for the size and network conditions of IoT devices and by having a robust key management strategy in place.

For future work, it is important to continuously monitor the system and adapt it as necessary to ensure that it stays secure and reliable. Also, it is important to keep up with TUF updates and advancements, and to consider integrating TUF with other security protocols and standards for IoT systems.

Up till now some of the basics have been implemented, but as it was an R&D project to prove it could be done, no further work will be done on this implementation. Cloudway / Everythings will take over development from the documentation I wrote whilst researching.