Other popular TEE platforms (e.g., AMD SEV-SNP, Intel TDX) do not provide a secure wall clock time source. The trusted applications still have to go through the un-trusted OS to access the real time clock. Thus, we have to assume any time read from the system clock is wrong. They do provide secure Time Stamp Counters (TSC), however, which can be used to accurately measure elapsed time. Pairing a secure TSC with a timestamp received via a Network Time Security (NTS) server allows you to calculate a trusted time "window" that you know contains the real wall clock time.
I understand the architecture for Nitro Enclaves is very different from traditional TEE platforms, which is why I cannot tell if Nitro Enclaves have access to a secure system clock. If not, do they at least have access to a secure TSC? I've seen several blogs about how enclave time "drifts" and AWS recommends that you periodically sync via the PTP device. Is the PTP secure?
I'm trying to figure out if I need to build my own secure TSC + NTS clock solution for my app, or if I can simply use the default enclave clock source + PTP sync because it is all protected from host instance interference.
Hey Mike,
Those services are useful if someone could confirm that a Nitro Enclave is capable of connecting directly to them without having to go through an untrusted OS/hypervisor. In Intel TDX and AMD SEV-SNP, the trusted VMs often don't have direct access to system resources, such as the system clock and the network interface. Instead, they go through the untrusted OS/hypervisor just like any normal program would. We can use cryptographic mechanisms (e.g., encryption, MAC) to ensure that the confidentiality and integrity of our data and requests and remains intact outside of our trust boundary, but we cannot guarantee that the OS/hypervisor won't delay or drop our messages.
In the context of time, this means that the OS may modify or delay delivery of any time service messages (e.g., NTP, PTP). The Network Time Security (NTS) protocol can be used with NTP/PTP to protect the integrity of the time service responses and to authenticate that the message originated from said time service. The OS could still delay these authenticated messages, however, which means that the value in the message may be significantly off from the true wall clock time. This is a huge security issue since many authentication mechanisms (e.g., cert validation) assume you have access to the true wall clock time.
Sorry, I ran out of space in the first comment.
Both TDX and SEV-SNP provide VMs with direct access to a secure Time Stamp Counter (TSC). This is a clock that only ever increases in value (i.e., is monotonic) and it increases at a steady rate. Thus, the TSC can be used to accurately measure elapsed time. If we read the TSC right before submitting an NTS request and right after receiving the response R we can calculate the round-trip time T. Since we know the OS cannot affect the TSC, we know that the true wall clock time must lie somewhere between [R, R+T]. If our time window [R, R+T] falls within a certificate's validity range, then the certificate must still be valid.
My problem is that I cannot find any definitive documentation for AWS Nitro Enclaves that states whether they have secure direct access to a real time clock or a TSC. I feel like Nitro Enclaves often depends on "security through obscurity". The docs are lacking and the hardware is not available for purchase like AMD SEV-SNP or Intel TDX, which makes it difficult to determine and verify trust boundaries.