æè¡ã®è©³çŽ°ïŒACME DNSãã£ã¬ã³ãžæ€èšŒã®èªååã®ç¢ºä¿ ã
ãªãªãžãã«èšäºã®èè ïŒJoona Hoikkalaã
åççºè¡æ¥ïŒ2018幎2æ23æ¥
ä»æåãã Let's Encrypt ïŒ2幎åã«EFFãç«ã¡äžããæ¯æŽããç¡æã®èªååããããªãŒãã³èªèšŒæ©é¢ïŒã¯ã 5000äžãè¶ ããã¢ã¯ãã£ããªèšŒææžãçºè¡ãããšããéèŠãªãã€ã«ã¹ããŒã³ãè¶ ããŸããã ãŸããLet's Encryptã¯æ°é±é以å ã«ãå€ãã®ã·ã¹ãã 管çè ãèŠæ±ããã¯ã€ã«ãã«ãŒã蚌ææžã®çºè¡ãéå§ããããããã®æ°ã¯å¢ãç¶ããŸãã
ã¯ã€ã«ãã«ãŒã蚌ææžãšã¯äœã§ããïŒ
HTTPS蚌ææžã確èªããããã«ããŠãŒã¶ãŒã®ãã©ãŠã¶ã¯ã蚌ææžã«Webãµã€ãã®ãã¡ã€ã³åãå®éã«ç€ºãããŠãããã©ããã確èªããŸãã ããšãã°ã www.eff.orgã®èšŒææžã«ã¯ãå®éã«ã¯www.eff.orgããã®èšŒææžã®æå¹ãªãã¡ã€ã³ãšããŠå«ããå¿ èŠããããŸãã ææè ããã¹ãŠã®ãã¡ã€ã³ã«å¯ŸããŠ1ã€ã®èšŒææžã䜿çšããå Žåã蚌ææžã«ã¯è€æ°ã®ãã¡ã€ã³ïŒ www.eff.org ãssd.eff.orgãsec.eff.orgãªã©ïŒãå«ããããšãã§ããŸãã
ã¯ã€ã«ãã«ãŒã蚌ææžã¯ããã¹ãŠãæ瀺çã«ãªã¹ãããã®ã§ã¯ãªããããã®ãã¡ã€ã³å ã®ãã¹ãŠã®ãµããã¡ã€ã³ã«å¯ŸããŠæå¹ã§ãããšèšèŒããã蚌ææžã§ãã ïŒããã¯ãã¢ã¹ã¿ãªã¹ã¯ã§ç€ºãããã¯ã€ã«ãã«ãŒãæåã䜿çšããŠèšŒææžã«ç€ºãããŸãããããã£ãŠãçŸåšeff.orgã®èšŒææžã確èªãããšã* .eff.orgã«å¯ŸããŠæå¹ã§ãããšè¡šç€ºãããŸããïŒãããã£ãŠãã·ã¹ãã 管çè ã¯ãã¹ãŠã®èšŒææžãååŸã§ããŸããã¡ã€ã³ãäœæãã蚌ææžãåãåã£ããšãã«èããããªãã£ãæ°ãããµããã¡ã€ã³ã§äœ¿çšããŸãã
ã¯ã€ã«ãã«ãŒã蚌ææžãçºè¡ããã«ã¯ãLet's Encryptã¯ã www.eff.orgãªã©ã®ãã¡ã€ã³åãIPã¢ãã¬ã¹ã«å€æãããã¡ã€ã³ããŒã ã·ã¹ãã ã§ããDNSã«åºã¥ããã£ã¬ã³ãžã䜿çšããŠããã¡ã€ã³å¶åŸ¡ã確èªãããããŠãŒã¶ãŒã«èŠæ±ããŸã69.50.232.54ã Let's Encryptãªã©ã®èšŒææ©é¢ã®èŠ³ç¹ããã¯ããã¡ã€ã³ã®ç®¡çã¯DNSã®åºç€ã®1ã€ã§ãããããDNSã¬ã³ãŒããå€æŽãããããããã¡ã€ã³ã管çããããšã蚌æããããè¯ãæ¹æ³ã¯ãããŸããã
ãã ããLet's Encryptã®éèŠãªã¢ã€ãã¢ã®1ã€ã¯ã蚌ææžã®ååŸã¯èªåããã»ã¹ã§ãããšããããšã§ãã ãããããããèªååããã«ã¯ã蚌ææžãèŠæ±ãããœãããŠã§ã¢ããã®ãã¡ã€ã³ã®DNSã¬ã³ãŒããå€æŽã§ããå¿ èŠããããŸãã ãã®æ©èœãå®çŸããããã«ããœãããŠã§ã¢ã¯DNSãµãŒãã¹ã®è³æ Œæ å ±ïŒãã°ã€ã³ããã¹ã¯ãŒããæå·åããŒã¯ã³ãªã©ïŒã«ãã¢ã¯ã»ã¹ã§ããå¿ èŠãããããããã®è³æ Œæ å ±ã¯èšŒææžãèªåçã«ååŸãããå Žæã«ä¿åããå¿ èŠããããŸãã
å€ãã®å Žåãããã¯åä¿¡ããã»ã¹ãåŠçãããã·ã³ãå±éºã«ãããããå ŽåãDNSã¯ã¬ãã³ã·ã£ã«ã§ãåãããšãèµ·ããããšãæå³ãããããæ¬åœã®å±éºã§ãã ãã®æçš¿ã®æ®ãã®éšåã§ã¯ããã®ããã»ã¹ã«é¢ä¿ããã³ã³ããŒãã³ããããã³ã©ã®ãªãã·ã§ã³ããããããå®å šã«ãããã«ã€ããŠè©³ãã説æããŸãã
ãã¡ã€ã³æææš©ã®æ€èšŒã¯ã©ã®ããã«æ©èœããŸããïŒ
é«ã¬ãã«ã§ã¯ããã¡ã€ã³æææš©ãã§ãã¯ã¯ãACMEãããã³ã«ã®äžéšã§ããä»ã®ãã¹ãŠã®èªåãã§ãã¯ãšåæ§ã«æ©èœããŸããLet's Encryptãªã©ã®èªèšŒæ©é¢ïŒCAïŒãCertbotãªã©ã®ã¯ã©ã€ã¢ã³ããœãããŠã§ã¢ãæ å ±ã®äº€æã«äœ¿çšã§ãããããã³ã«ãµãŒããŒãèŠæ±ããŠãã蚌ææžãããã³ãµãŒããŒã察å¿ãããã¡ã€ã³åã®æææš©ã確èªããæ¹æ³ã
ãã¡ã€ã³æææš©ã®æ€èšŒäžããŠãŒã¶ãŒã¯ããã®ã¿ã€ãã®æ€èšŒããµããŒãããCertbotãªã©ã®ACMEã¯ã©ã€ã¢ã³ããœãããŠã§ã¢ã䜿çšããŠãCAã«èšŒææžãèŠæ±ããŸãã ã¯ã©ã€ã¢ã³ãã蚌ææžãèŠæ±ãããšãCAã¯ç¹å®ã®TXTã¬ã³ãŒããDNSãŸãŒã³ã«è¿œå ããããšã«ããããã¡ã€ã³ã®æææš©ã®èšŒæãã¯ã©ã€ã¢ã³ãã«èŠæ±ããŸãã 詳现ïŒCAã¯äžæã®ã©ã³ãã ããŒã¯ã³ãACMEã¯ã©ã€ã¢ã³ãã«éä¿¡ãããã¡ã€ã³ãå¶åŸ¡ãããŠãŒã¶ãŒã¯ããã®ããŒã¯ã³ããã®ãã¡ã€ã³ã®ã_acme-challengeããšããååã®å®çŸ©æžã¿ãµããã¡ã€ã³ã®DNSãŸãŒã³ã«TXTã¬ã³ãŒããšããŠé 眮ããå¿ èŠããããŸãããŠãŒã¶ãŒã蚌æããããšããŠããŸãã
ããšãã°ã* .eff.orgã®ãã¡ã€ã³ãæ€èšŒããããšããŠããå Žåãæ€èšŒãµããã¡ã€ã³ã¯ã_acme-challenge.eff.orgãã«ãªããŸãã ããŒã¯ã³å€ãDNSãŸãŒã³ã«è¿œå ããããšãã¯ã©ã€ã¢ã³ãã¯æææš©ãã§ãã¯ãç¶è¡ããããã«CAã«æ瀺ããŸãããã®åŸãCAã¯ãã¡ã€ã³ã®æš©éã®ãããµãŒããŒã§DNSã¯ãšãªãå®è¡ããŸãã æš©éã®ããDNSãµãŒããŒãæ£ããæææš©æ€èšŒããŒã¯ã³ãå«ãDNSã¬ã³ãŒãã§å¿çããå Žåããã¡ã€ã³ã®æææš©ã蚌æããã蚌ææžã®çºè¡ããã»ã¹ãç¶è¡ã§ããŸãã
DNSãµãŒãã¹ã¯ããžã¿ã«IDãå¶åŸ¡ããŸã
DNSãŸãŒã³ã«é¢é£ããè åšã¯éåžžã«å±éºãªããããŠãŒã¶ãŒã®ãã©ãŠã¶ã¯ããã¡ã€ã³ã«ã¢ã¯ã»ã¹ããããšãããšãã«é£çµ¡ããIPã¢ãã¬ã¹ãç¥ãããã«DNSãä¿¡é ŒããŠããŸãã ããã¯ãé»åã¡ãŒã«ããWebãµãŒãã¹ãŸã§ããã¡ã€ã³ã®äžã§è§£æ±ºå¯èœãªååã䜿çšãããã¹ãŠã®ãµãŒãã¹ã«é©çšãããŸãã
DNSã䟵害ããããšãæ»æè ã¯é»åã¡ãŒã«ãŸãã¯ãã®ä»ã®å®å šãªãµãŒãã¹ã«åãããããã¹ãŠã®æ¥ç¶ãç°¡åã«ååããTLSã®æå·åãåæ¢ãïŒãã¡ã€ã³ã®æææš©ã確èªãããããã®æå¹ãªèšŒææžãååŸã§ããããïŒãããŒã¿ã解èªããŠããããèªã¿åãããšãã§ããŸãããã®åŸãããŒã¿ãåæå·åãããµãŒããŒã«è»¢éããŸãã ã»ãšãã©ã®äººã«ãšã£ãŠãæ€åºã¯éåžžã«å°é£ã§ãã
åå¥ã®éå®çãªç¹æš©
å³å¯ã«èšãã°ãACMEã¯ã©ã€ã¢ã³ããèªåã¢ãŒãã§æŽæ°ãè¡ãããã«ã¯ããã®ã¯ã©ã€ã¢ã³ãã¯_acme-challengeãµããã¡ã€ã³ã®TXTã¬ã³ãŒããæŽæ°ã§ããè³æ Œæ å ±ã®ã¿ã«ã¢ã¯ã»ã¹ã§ããå¿ èŠããããŸãã æ®å¿µãªãããã»ãšãã©ã®DNSãœãããŠã§ã¢è£œåããã³DNSãµãŒãã¹ãããã€ããŒã¯ããããã®ç¹æš©ãå¶éãã詳现ãªã¢ã¯ã»ã¹å¶åŸ¡ãæäŸããŠããªãããäž»èŠãªDNSãŸãŒã³ã®æŽæ°ãŸãã¯ãã©ã³ã¶ã¯ã·ã§ã³ä»¥å€ã§ãããèªååããAPIãæäŸããŠããŸããã ããã«ãããå¯èœãªèªååæ¹æ³ãäžé©åãŸãã¯å®å šã«ãªããŸããã
ãã®ãããªå¶éãä¹ãè¶ããã®ã«åœ¹ç«ã€ç°¡åãªæ¹æ³ããããŸãïŒ CNAMEã¬ã³ãŒãã䜿çšããŸãã CNAMEã¬ã³ãŒãã¯ãæ¬è³ªçã«å¥ã®DNSã¬ã³ãŒããžã®ãªã³ã¯ãšããŠæ©èœããŸãã Let's Encryptã¯CNAMEã¬ã³ãŒããã§ãŒã³ã«åŸãããã§ãŒã³ã®æåŸã®ã¬ã³ãŒãã®æææš©æ€èšŒããŒã¯ã³ãæå¹ã«ããŸãã
åé¡ã軜æžããæ¹æ³
CNAMEã¬ã³ãŒãã䜿çšããŠããäž»ãªåé¡ã¯ãACMEã¯ã©ã€ã¢ã³ããDNSã¬ã³ãŒãã®å€æŽãèš±å¯ããè³æ Œæ å ±ã«ã¢ã¯ã»ã¹ããå¿ èŠãããããšã§ãã ãã®æ ¹æ¬çãªåé¡ã軜æžããããŸããŸãªæ¹æ³ããããããŸããŸãªã¬ãã«ã®é£æ床ãšãã»ãã¥ãªãã£äŸµå®³ãçºçããå Žåã®ã»ãã¥ãªãã£ãžã®åœ±é¿ããããŸãã
次ã®ã»ã¯ã·ã§ã³ã§ã¯ããã®æçš¿ã§ã¯ããããã®æ¹æ³ã®äžéšã玹ä»ããè³æ Œæ å ±ã䟵害ãããå Žåã«èããããçµæã説æããŸãã 1ã€ã®äŸå€ãé€ãããã¹ãŠCNAMEã¬ã³ãŒãã䜿çšããŸãã
TXTã¬ã³ãŒãã®æŽæ°ã®ã¿ãèš±å¯ãã
æåã®æ¹æ³ã¯ãTXTã¬ã³ãŒããæŽæ°ã§ããç¹æš©ãæã€è³æ Œæ å ±ã»ãããäœæããããšã§ãã
䟵害ãããå Žåããã®æ¹æ³ã¯ãDNSè³æ Œæ å ±ã䜿çšããŠç¬èªã®èšŒææžãååŸã§ãããããæ»æè ãDNSãŸãŒã³å ã®ãã¹ãŠã®ãã¡ã€ã³ã«å¯ŸããŠèšŒææžãçºè¡ã§ããã¡ãŒã«é ä¿¡ãäžæã§ãããšããçµæã«å¶éãããŸãã ã¡ãŒã«é ä¿¡ãžã®åœ±é¿ã¯ãã¡ãŒã«åºæã®TXTã¬ã³ãŒããã€ãŸãSPF ã DKIMãããã³ãã®æ¡åŒµæ©èœADSPããã³DMARCããçããŸãã ãããã®äŸµå®³ã¯ã䟵害ããããã¡ã€ã³ããã®éä¿¡è ãè£ ã£ããã£ãã·ã³ã°ã¡ãŒã«ã®é ä¿¡ãä¿é²ããŸãã
ãã¹ããŒã¢ãŠã§ã€ã確èªãã¡ã€ã³ã䜿çšãã
2çªç®ã®æ¹æ³ã¯ã_acme-challengeãµããã¡ã€ã³ã®CNAMEã¬ã³ãŒããæåã§äœæããå¥ã®è³æ Œæ å ±ã»ããã«ãã£ãŠå¶åŸ¡ããããŸãŒã³ã«ããæ€èšŒãã¡ã€ã³ãæãããšã§ãã
ããšãã°ããyourdomain.tldããšã www.yourdomain.tld ããã«ããŒãã蚌ææžãååŸããå Žåã¯ãã_ acme-challenge.yourdomain.tldããšã_acme-challenge.www.yourdomainããšãã2ã€ã®CNAMEã¬ã³ãŒããäœæããå¿ èŠããããŸãã .tld "-ãŸããæ€èšŒã®ããã«å€éšãã¡ã€ã³ããã€ã³ãããŸãã æææš©ã確èªããããã«äœ¿çšããããã¡ã€ã³ã¯ãå€éšDNSãŸãŒã³ãŸãã¯ãµããã³ãDNSãŸãŒã³ã«ååšããå¿ èŠããããŸãããµããŸãŒã³DNSãŸãŒã³ã«ã¯ã管ççšã®ç¬èªã®è³æ Œæ å ±ã»ããããããŸãã ïŒãµãããªã²ãŒãã®DNSãŸãŒã³ã¯NSã¬ã³ãŒãã䜿çšããŠå®çŸ©ããããŸãŒã³ã®äžéšã«å¯Ÿããå®å šãªå¶åŸ¡ãå€éšãœãŒã¹ã«å¹æçã«å§ä»»ããŸããïŒ
ãã®æ¹æ³ã®åŠ¥åå¹æã¯éåžžã«éãããŠããŸãã å®éã«ä¿åãããè³æ Œæ å ±ã¯å€éšDNSãŸãŒã³ã®ãã®ã§ãããããè³æ Œæ å ±ãåãåã£ãæ»æè ã¯ããã®ãŸãŒã³ã®ã¬ã³ãŒããæããã¹ãŠã®ãã¡ã€ã³ã«å¯ŸããŠã®ã¿èšŒææžãçºè¡ã§ããŸãã ãã ããå®éã«ã©ã®ãã¡ã€ã³ãæããŠããããææ¡ããã®ã¯ç°¡åã§ããæ»æè ã¯èšŒææžã®ééæ§ãã°ãèªã¿åãããããã®èšŒææžã®ãã¡ã€ã³ã«è匱ãªDNSãŸãŒã³ãæãããžãã¯ãµããã¡ã€ã³ããããã©ããã確èªããã ãã§ãã
DNSãŸãŒã³ãžã®å¶éãããã¢ã¯ã»ã¹
ãœãããŠã§ã¢ãŸãã¯DNSãããã€ããŒã§ãµããã¡ã€ã³ã«é¢é£ä»ããããã¢ã¯ã»ã¹èš±å¯ïŒç²åºŠã®é«ãç¹æš©ïŒãäœæã§ããå Žåãããã¯åé¡å šäœã軜æžããã®ã«åœ¹ç«ã¡ãŸãã
æ®å¿µãªãããå ¬éæç¹ã§ããããã®ç¹æš©ãæäŸããå¯äžã®ãããã€ããŒãèŠã€ãããŸãã-ããã¯Microsoft Azure DNSã§ãã Dynã«ã¯ãã现ããªç¹æš©ããããšæãããŸããããã¬ã³ãŒãã®æŽæ°ã以å€ã«ãµãŒãã¹ã§äœãç¹æš©ã¬ãã«ãèŠã€ããããšãã§ããªãã£ãããããŸãŒã³ã¯å®å šã«è匱ãªãŸãŸã§ãã
Route53ãªã©ã®ãŠãŒã¶ãŒã¯ããŠãŒã¶ãŒããµãããªã²ãŒããŸãŒã³ãæ°ãããŠãŒã¶ãŒè³æ Œæ å ±ãäœæããæ°ãããŸãŒã³ã®NSã¬ã³ãŒãã瀺ããCNAMEã¬ã³ãŒãã䜿çšããŠ_acme-challengeæ€èšŒãµããã¡ã€ã³ãæå®ã§ããããã«ããŸãã æææš©ãã§ãã¯ã䜿çšããå¿ èŠã®ãããã¡ã€ã³ããšã«ããããã¹ãŠã®æé ãå®è¡ããå¿ èŠãããããããã®æ¹æ³ã䜿çšããŠæš©éãæ£ããé åžããã«ã¯å€ãã®äœæ¥ãå¿ èŠã§ãã
ACME-DNSã䜿çšãã
å 責äºé ïŒä»¥äžã§èª¬æãããœãããŠã§ã¢ã¯èè ã«ãã£ãŠäœæããããã®ã§ïŒå ã®èšäº-çŽç¿»èš³è ïŒãDNSãä»ãããã¡ã€ã³æææš©ã®æ€èšŒãå®å šãªæ¹æ³ã§èªååããããã«å¿ èŠãªè³æ Œæ å ±ãå¹ççã«ç®¡çããããã«å¿ èŠãªæ©èœã®äŸãšããŠäœ¿çšãããŸãã
æåŸã®æ¹æ³ã¯ãACME-DNSãšåŒã°ãããœãããŠã§ã¢ã§ãè°è«äžã®åé¡ã«ç¹ã«å¯ŸåŠããããã«æžãããŠãããå®å šã«æé€ã§ããŸãã å¯äžã®æ¬ ç¹ã¯ããã®æ¹æ³ã§ã¯ããµããŒããå¿ èŠãªã€ã³ãã©ã¹ãã©ã¯ãã£ã«å¥ã®ã³ã³ããŒãã³ããè¿œå ãããã€ã³ã¿ãŒããããžã®ãããªãã¯ã¢ã¯ã»ã¹ã®ããã«DNSããŒãïŒ53ïŒãéãå¿ èŠãããããšã§ãã
ACME-DNSã¯ãHTTP APIãå¶éãããåçŽãªDNSãµãŒããŒãšããŠæ©èœããŸãã APIèªäœã§ã¯ãèªåçã«çæãããã©ã³ãã ãªãµããã¡ã€ã³ã®TXTã¬ã³ãŒãã®ã¿ãæŽæ°ã§ããŸãã 倱ãããè³æ Œæ å ±ãèŠæ±ããããä»ã®ãšã³ããªãæŽæ°ãŸãã¯è¿œå ãããããæ¹æ³ã¯ãããŸããã 次ã®2ã€ã®ãšã³ããã€ã³ããæäŸããŸãã
- / register-ãã®ãšã³ããã€ã³ãã¯ã䜿çšããæ°ãããµããã¡ã€ã³ãäœæãããã®åŸã«ãŠãŒã¶ãŒåãšãã¹ã¯ãŒããäœæããŸãã ãªãã·ã§ã³ã®ãã©ã¡ãŒã¿ãŒãšããŠãç»é²ãšã³ããã€ã³ãã¯ãã¯ã€ãã¢ããããŒãã®CIDRç¯å²ã®ãªã¹ããåãå ¥ããŸãã
- / update-ãã®ãšã³ããã€ã³ãã¯ããµãŒããŒäžã®çŸåšã®ãã¡ã€ã³æææš©ãã§ãã¯ããŒã¯ã³ãæŽæ°ããããã«äœ¿çšãããŸãã
ACME-DNSã䜿çšããã«ã¯ãæåã«A / AAAAã¬ã³ãŒããäœæãããããNSã¬ã³ãŒãã«ãã€ã³ãããŠå§ä»»ããŒããäœæããå¿ èŠããããŸãã ãã®åŸããšã³ããã€ã³ã/ã¬ãžã¹ã¿ãä»ããŠæ°ããè³æ Œæ å ±ã»ãããäœæãããœãŒã¹ãŸãŒã³ã®ç¢ºèªç¢ºèªã_acme-challengeãã®ãµããã¡ã€ã³ããæ°ããäœæããããµããã¡ã€ã³ãžã®CNAMEã¬ã³ãŒãããã€ã³ãããŸãã
ããŒã«ã«ã«ä¿åãããå¯äžã®è³æ Œæ å ±ã¯ACME-DNSçšã§ããããã£ãŒã«ãå ã®ãã¡ã€ã³ã®æ€èšŒãµããã¡ã€ã³ã®æ£ç¢ºãªTXTã¬ã³ãŒããæŽæ°ããå Žåã«ã®ã¿æå¹ã§ãã ããã«ãããæ»æè ã«å¯ŸããæœåšçãªäŸµå®³ã®åœ±é¿ãããããã®ãã¡ã€ã³ã®èšŒææžãçºè¡ããèœåã«å¹æçã«å¶éããŸãã
ACME-DNSã®è©³çŽ°ã«ã€ããŠã¯ã以äžãåç §ããŠãã ããã
github.com/joohoi/acme-dns
ãããã«
ACME DNSãä»ãããã¡ã€ã³æææš©æ€èšŒã®åé¡ã解決ããããã«ãACME IETFã¯ãŒãã³ã°ã°ã«ãŒãã®Assisted-DNSãªã©ã®ææ¡ãè°è«ãããŸãããããããã®åé¡ã¯ãŸã 解決ãããŠããŸããã 䟵害ã®åœ±é¿ãå¶éããå¯äžã®æ¹æ³ã¯ãç¹å®ã®TXTã¬ã³ãŒããå€æŽããããã«DNSãŸãŒã³ã¢ã«ãŠã³ãã®ã¢ã¯ã»ã¹æš©ãå¶éããããšãªã®ã§ããã¡ã€ã³æææš©æ€èšŒã®èªååã®ä¿¡é Œã§ããå®è£ ã®çŸåšã®å¯èœæ§ã¯ãããã§ãã
å¯äžã®æç¶å¯èœãªãªãã·ã§ã³ã¯ãDNSãœãããŠã§ã¢ãšãµãŒãã¹ãããã€ããŒã«ãããå°ããªãŸãŒã³è³æ Œæ å ±ãäœæããæ¹æ³ãå®è£ ãããããã®ç¹å®ã®ãŠãŒã¹ã±ãŒã¹ã«ãŸã£ããæ°ããã¿ã€ãã®è³æ Œæ å ±ãæäŸããããšã§ãã