{"record":{"id":"8ee5d5200d86f373","repo":"kubernetes/kops","slug":"attested-document-createdon-s-is-too-far-in-the-f","errorCode":null,"errorMessage":"attested document createdOn %s is too far in the future","messagePattern":"attested document createdOn (.+?) is too far in the future","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/attest.go","lineNumber":306,"sourceCode":"\t\treturn nil, fmt.Errorf(\"attested document subscriptionId is required\")\n\t}\n\n\t// Verify the nonce matches the request body hash (replay protection).\n\texpectedNonce := nonceForBody(body)\n\tif data.Nonce != expectedNonce {\n\t\treturn nil, fmt.Errorf(\"attested document nonce mismatch: got=%q expected=%q\", data.Nonce, expectedNonce)\n\t}\n\n\tnow := time.Now().UTC()\n\tif data.TimeStamp.CreatedOn == \"\" {\n\t\treturn nil, fmt.Errorf(\"attested document createdOn is required\")\n\t}\n\tcreatedOn, err := time.Parse(attestedDocumentTimeFormat, data.TimeStamp.CreatedOn)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"parsing attested document creation: %w\", err)\n\t}\n\tif createdOn.After(now.Add(attestedDocumentMaxClockSkew)) {\n\t\treturn nil, fmt.Errorf(\"attested document createdOn %s is too far in the future\", data.TimeStamp.CreatedOn)\n\t}\n\toldestAllowedCreatedOn := now.Add(-(attestedDocumentMaxAge + attestedDocumentMaxClockSkew))\n\tif createdOn.Before(oldestAllowedCreatedOn) {\n\t\treturn nil, fmt.Errorf(\"attested document createdOn %s is older than allowed freshness window of %s plus %s clock skew\", data.TimeStamp.CreatedOn, attestedDocumentMaxAge, attestedDocumentMaxClockSkew)\n\t}\n\tklog.V(4).Infof(\"Attested document createdOn is fresh (createdOn=%s now=%s)\", createdOn.Format(time.RFC3339), now.Format(time.RFC3339))\n\n\t// Verify the attested document has not expired and has a coherent lifetime.\n\tif data.TimeStamp.ExpiresOn != \"\" {\n\t\texpiresOn, err := time.Parse(attestedDocumentTimeFormat, data.TimeStamp.ExpiresOn)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"parsing attested document expiration: %w\", err)\n\t\t}\n\t\tif expiresOn.Before(createdOn) {\n\t\t\treturn nil, fmt.Errorf(\"attested document expiresOn %s is before createdOn %s\", data.TimeStamp.ExpiresOn, data.TimeStamp.CreatedOn)\n\t\t}\n\t\tif expiresOn.Before(now.Add(-attestedDocumentMaxClockSkew)) {\n\t\t\treturn nil, fmt.Errorf(\"attested document expired at %s\", data.TimeStamp.ExpiresOn)","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/attest.go#L288-L324","documentation":"Freshness check: the attested document's createdOn is further in the future than the allowed clock skew, indicating a fabricated timestamp or badly skewed clocks; the document is rejected to prevent future-dated attestations.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/azure/attest.go:306 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reject the attestation token","Verify NTP/time synchronization on both the node and the verifier host"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}