{"record":{"id":"8dbe50b428743775","repo":"kubernetes/kops","slug":"attested-document-createdon-is-required","errorCode":null,"errorMessage":"attested document createdOn is required","messagePattern":"attested document createdOn is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/attest.go","lineNumber":299,"sourceCode":"\t}\n\tklog.V(4).Infof(\"Attested document content: vmId=%q subscriptionId=%q createdOn=%q expiresOn=%q\", data.VMId, data.SubscriptionId, data.TimeStamp.CreatedOn, data.TimeStamp.ExpiresOn)\n\n\tif data.VMId == \"\" {\n\t\treturn nil, fmt.Errorf(\"attested document vmId is required\")\n\t}\n\tif data.SubscriptionId == \"\" {\n\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 {","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/attest.go#L281-L317","documentation":"Guard on the attested document freshness fields: createdOn is empty, so the document's age cannot be established and replay of arbitrarily old attestations would be possible.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/azure/attest.go:299 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reject the attestation token","Regenerate the token on the node","Update kOps if the document timestamp schema changed"],"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"}