mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 07:39:24 -05:00
A distribution could name a certificate in ACMCertificateArn and in IAMCertificateId at once, and could name one in either of them without the MinimumProtocolVersion and SSLSupportMethod that go with it. It could also carry a security policy or a viewer support method outside the values those members admit, carry SSLv3 alongside sni-only, and claim CloudFrontDefaultCertificate while naming a certificate of its own. The ViewerCertificate entry states every one of those rules, and nothing here read any of them, so a configuration AWS refuses was taken and the distribution went on to serve it. They are read now on the distribution create and the distribution update, and the shape of the protocol members before any of it, so a request that breaks a rule is refused for the rule and not for a certificate nothing matches. A member carried blank counts as no value, the way a blank location member already names no certificate, and a distribution on the CloudFront domain name needs neither location member. Two of the refusals are published. A MinimumProtocolVersion outside its enumeration is InvalidMinimumProtocolVersion, whose own sentence is that the minimum protocol version specified is not valid. SSLv3 alongside sni-only is InvalidProtocolSettings, whose sentence names that pair and nothing else and which is the same rule as the floor the member states for SNI, "you must specify TLSv1 or higher", SSLv3 being the only value below TLSv1. That code is declared on CreateDistribution, CreateDistributionWithTags and CopyDistribution and has never been declared on UpdateDistribution, which has declared InvalidMinimumProtocolVersion since 2015, so the update answers the pair with the code it declares and keeps the pair's published sentence. The declared code is the one a caller's SDK can map, an undeclared one reaching it as a generic error, and the sentence keeps the two causes the update answers under that one code apart. The others are readings. An SSLSupportMethod outside its enumeration has no code of its own and answers InvalidArgument, what this service already answers a member outside its shape with. The three rules about the certificate itself answer InvalidViewerCertificate 400: InvalidArgument and InvalidMinimumProtocolVersion are modelled on both writes as well and no sentence says which one a caller gets, and the Developer Guide page that enumerates what InvalidViewerCertificate answers reaches none of those cases, naming the certificate's own trust, its chain, its format and the names it covers. That code's own documentation is that a viewer certificate specified is not valid, which is what each of the three carries. One rule in the group replaces a value instead of refusing the request. MinimumProtocolVersion's entry says that when CloudFrontDefaultCertificate is true CloudFront "automatically sets the security policy to TLSv1 regardless of the value that you set here", so the policy such a request asks for is overwritten and the config reads back TLSv1. A distribution created with no ViewerCertificate at all already read as the default certificate and reads TLSv1 with it now, where it had been answering TLSv1.2_2021. Two more readings go with the group. The claim itself is a member declared boolean, so it is held to the four forms XML gives a boolean, true, false, 1 and 0, rather than read for the word true alone: taken for false, a request saying yes would dodge every rule the member governs, the refusal beside a named certificate and the replaced policy alike. Anything else answers the InvalidArgument this service answers a member outside its shape with, CloudFront modelling no error for a malformed document. And the SSLv3 pair is read for a distribution on a certificate of its own alone, since on the CloudFront certificate the policy is replaced and the value that would make the pair is discarded, so refusing the request for it would contradict the override. Both enumerations are read either way. The us-east-1 restriction AWS states for ACM certificates is left unenforced, as is the /cloudfront upload path before it: refusing either here could meet a distribution somebody already built. All of the above, that included, is set out in docs/services/cloudfront.md.