ç§ã¯ååã«sabzhã®å éšããè¬çŸ©ãè¡ãããšãææ¡ããŸãã-ã¢ã€ãã¢ãæµ®äžããŸããã 圌ã¯åº§ã蟌ãã§è¬çŸ©èšç»ãæžããããã€ãã®äººã¯ã³ã£ããããŸãã-ãããŠç®ãèŠããå°ããªã¬ã€ããè¿œå ãããŸããã ããã«äœããè¿œå ããŠããæ°ã«å ¥ãã®Habrahabrãå«ãæ å ±ãæ€çŽ¢ããªããèšæ¶ãæŽæ°ããæºåãããŠãããšãã«ãPKIãšã¯äœãããªãPKIãå¿ èŠãªã®ããã©ã®ããã«æ©èœããã®ããããã«ç解ãããšäŸ¿å©ã ãšæããŸãããããã®åœ¢åŒã®èšäºèŠã€ãããŸããã
OpenVPNãµãŒããŒãžã®ãã¹ã¯ãŒããªãã®ã¢ã¯ã»ã¹ãHTTPSã䜿çšãããªãœãŒã¹ãžã®ã¢ã¯ã»ã¹ã®ä¿è·ãªã©ãå€ãã®äººãããç¥ã£ãŠããæ¥åžžã®ã¿ã¹ã¯ã®äŸãæžããŠããŸãã
çè«ãªãã§ã¯ã§ããªã
PKIïŒå ¬éããŒåºç€ïŒã¯ã»ãã¥ãªãã£ã«é¢ãããã®ã§ãã ã€ã³ãã©ã¹ãã©ã¯ãã£å ã®åãšã³ãã£ãã£ã«ã¯ç¬èªã®ããŒããããããã«ãã£ãŠäžæã«èå¥ãããããšãç解ãããŠããŸãã ã€ãŸããããŒãçãŸããå ŽåãçãŸãããšã³ãã£ãã£ã圱é¿ãåãããšã³ãã£ãã£ã®ããã«èŠããå ŽåããããŸãã PKIã¯ããã®ãããªçé£ã®çµæãè¿ éã«æå°éã«æããããã«å¿ èŠã§ãã ããŒã¯ããããªãã¯ãšãã©ã€ããŒãã®2ã€ã®éšåã§è¡šãããŸãã
ã¢ããã°ã¯SSHã®RSAããŒã§ããããããã管çããããã®éäžåãããã¡ã«ããºã ããªããããããããã€ã³ãã©ã¹ãã©ã¯ãã£ãšåŒã¶ããšã¯å°é£ã§ãã ãŸããéãã¯ãSSHã®ããŒãã¢ã®ããŒã®å ¬ééšåã¯å€æŽãããã蚌ææžïŒPKIã¡ã³ããŒããŒã®å ¬ééšåïŒã¯ãã€ã§ãåçºè¡ã§ããããšã§ãã
PKIã«ã¯ã1ã€ïŒå®éã«ã¯å°ãªããšã2ã€å¿ èŠïŒãŸãã¯è€æ°ã®èªèšŒå±ããããŸããèªèšŒå±ïŒèªèšŒå±ïŒã¯ã眲åããã蚌ææžãçºè¡ããã顧客ã«ããŒã®å ¬ééšåãæž¡ããŸãã ãããã£ãŠãã€ã³ãã©ã¹ãã©ã¯ãã£ã®åå è ã¯ã誰ããããã管çããŠããããèªåã«çºè¡ããã蚌ææžãŸãã¯ã仲éããçŸæç¹ã§æå¹ãã©ããããç解ãããŸãïŒèšŒææžã®æãéèŠãªå±æ§ã®1ã€ã¯æå¹æéã§ãïŒã ãŸãã¯ããµãŒããŒãšãã®ã¯ã©ã€ã¢ã³ããåäœããã€ã³ãã©ã¹ãã©ã¯ãã£ã®CAããŒã®å ¬ééšåãæã€ãµãŒããŒã¯ãæå¹ãªèšŒææžãæã€ã¯ã©ã€ã¢ã³ããæ¥ãããšãç解ãããããèš±å¯ããããããã§ãªããã°ãããçŠæ¢ããŸãã
OpenVPNïŒä»çµã¿
å®éãå€ãã®äŒæ¥ã¯ãã§ã«ãã®ã±ãŒã¹ã®ãPKIããææããŠãããåŸæ¥å¡ã®1人ã§ããããååãæã£ãŠããŸãã ãã®ãããªäººãããšãã°Poluektã«ååãä»ããŠããããéåžžã©ã®ããã«æ©èœãããã説æããããããçæ³çãªæ¹æ³ã説æããŸãã
äŒç€Ÿã«æ°ããåŸæ¥å¡ãçŸãããšãPoluektã¯ã¢ãŒã«ã€ããäœæããŠéä¿¡ããŸããã¢ãŒã«ã€ãã«ã¯ãOpenVPNã¯ã©ã€ã¢ã³ãèªäœã®æ§æã«å ããŠããã¡ã€ã«ïŒåŸæ¥å¡A. Ivanovãªã©ïŒããããŸãã
- a.ivanov-officeã key-ãã®ç§å¯éµãç®ã®ããããšããŠä¿åããå¿ èŠãããã誰ã«ãèŠããªããã«ããã®ãã®ïŒSSHã®é¡äŒŒç©ã¯id_rsaãã¡ã€ã«ã§ãïŒã
- a.ivanov-officeã csr-蚌ææžçœ²åèŠæ±ã蚌ææžãçºè¡ããå¿ èŠããã人ã説æãã蚌ææžã«çœ²åããèŠæ±ã¯ãç§å¯éµããçŠããªããããã«ã以åã®ãã¡ã€ã«ã«åºã¥ããŠçæãããŸãïŒOpenVPNèªäœã®æäœã«ã¯å¿ èŠãããŸããïŒã
- a.ivanov-officeã crt-æ¥ç¶ãèš±å¯ããããã«OpenVPNãµãŒããŒã«æ瀺ããåæããã蚌ææžïŒå®éãããã¯ããŒã®å ¬ééšåã§ãïŒã
- çŽ crtã¯CAã®èšŒææžã§ãããããOpenVPNã¯ã©ã€ã¢ã³ãã¯ããããµãŒããŒã«æ瀺ããææããŠãããã©ââã€ããŒãéšåãšäžèŽãããä»äººã§ã¯ãªã蚌ææžã«çœ²åããã®ã圌ã§ããããšã確èªããŸãã OpenVPNã¯ã©ã€ã¢ã³ãA. Ivanovã®æå±ã瀺ãã詳现ã ãµãŒããŒãå®è¡ãããŠããPKIã«ã
ãããã¯ãç¹å¥ãªPEM圢åŒã®åçŽãªããã¹ããã¡ã€ã«ã§ãã ããšãã°ãMicrosoftã®å€§è³JavaããŒã¹ãã¢ãPFXãšã¯ç°ãªãã蚌ææžã¯åçŽãªç«ãš1ã€ã®ãã¡ã€ã«ã«ããŒãžããŠCAãã§ãŒã³ã圢æã§ããŸãïŒãããããã³ãã«ã¯ãnginxã«äŸ¿å©ã§ããããšãã°ã CA蚌ææžã®æ瀺ïŒãäœããã®çç±ã§å¿ èŠãªå Žåã¯ãCA蚌ææžãšç¬èªã®èšŒææžãããã«ã¯ç§å¯éµãçµã¿åãããããšãã§ããŸãã ãã1ã€ã®äŸ¿å©ãªç¹ã¯ãCA蚌ææžãOpenVPNã¯ã©ã€ã¢ã³ãã®æ§æã®<ca> </ ca>ã¿ã°ã®éã«çŽæ¥ç»é²ã§ããããšã§ãã ããããããã®æ¹æ³ã§èšŒææžãç»é²ã§ããã¯ãã§ãã ããããç§ã¯ãã§ã«è©³çŽ°ã«æ°ãåãããŠããŸãã
Acmeã§ã¯ããããã®ãã¡ã€ã«ã¯ãã¹ãŠSemiectã«ãã£ãŠçæãããŸã...
ãããŠä»ãããã¹ã姿
ç§ã®äŸã§ã¯ãåçŽåããïŒ
- ç§ã¯ããŒã«ã«ã«ç§å¯éµãçæããŸãïŒã/ .ssh / id_rsaããæ¢ã«æºåãããŠãããã®ã䜿çšããããšã¯å¯èœã§ãããããããè«ççã«äœ¿çšã§ããŸãïŒïŒ
openssl genrsa -out openvpn.key 2048
- ç§ã¯èšŒææžçœ²åãªã¯ãšã¹ã-CSRãæºåããŠããŸãã
openssl req -new -key openvpn.key -out a.vrublevskiy-office. csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]: RU
State or Province Name (full name) []:.
Locality Name (eg, city) [Default City]: Moscow
Organization Name (eg, company) [Default Company Ltd]: Pixonic
Organizational Unit Name (eg, section) []: Sysadmins Dept
Common Name (eg, your name or your server's hostname) []: Alexander Vrublevskiy
Email Address []: a.vrublevskiy@pixonic.ru
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
ïŒæåŸã«ãã¹ã¯ãŒããæå®ããªãæ¹ãè¯ãã§ããããããªããšãæ¥ç¶ãããã³ã«ãã¹ã¯ãŒããå ¥åããå¿ èŠããããŸãããããé²ãããã«ã蚌ææžã«å¿ãã蚌ææžã®ã¿ããããŸããããã«ãPixonicã®GoogleããOTPããããŸã ïŒã
- çµæã®a.vrublevskiy-officeãã¡ã€ã«ãéä¿¡ããŠããŸãã csr Half Act;
- ç§ã®ãªã¯ãšã¹ããåãåããCAããŒã®äž¡æ¹ã®éšåïŒããã§ã¯ca.keyãšca.crtïŒãæã€ããŒãã¢ã¯ãã¯ãCAããŒã§çœ²åããŠèšŒææžãçºè¡ããŸãïŒãã¡ãã·ã§ããã«ãªãããã¹ã¿ãŒã¯easy-rsaã䜿çšããŸãããç§ãã¡ã¯å³ããã²ããçããã管çè ã§ãïŒïŒ
openssl x509 -req -in a.vrublevskiy-office. csr -CA ca. crt -CAkey ca. key -out a.vrublevskiy-office. crt -days 90
- ããŒãã¢ã¯ãã¯çµæã®ãã¡ã€ã«ãéä¿¡ããŸãã
åççãªçåãçããŸãïŒãªããã®ãããªå°é£ãªã®ã§ããïŒ PKIããªãã¯ãšã¯äœã§ããïŒ çããŸãã äºå®ã¯ããã®ãã§ãŒã³ã«ã¯ãããããªããšããããšã§ãã ãããŠãããã¯CRLïŒèšŒææžå€±å¹ãªã¹ãïŒãšåŒã°ããŸãã ããã¯CAã«ãã£ãŠçºè¡ããã倱å¹ãã蚌ææžã®ãªã¹ãã§ãããããšãã°ãç©è³ªã§éå°ã«äœ¿çšãããŠããŠãç§å¯éµã競åä»ç€Ÿã«æ瀺ããããšãã§ããå Žåã«ãPoluectã以åã«çºè¡ããŠçœ²åãã蚌ææžãå ¥åã§ããŸãïŒãŸãããŸãã¯åœŒãã¯ç§ããçãã ïŒã©ãããããïŒã
ãã®æ©èœãå¿ èŠã§ããïŒè°è«ã®ããã®è³ªåã§ãã ãããã£ãŠããããå®è£ ããæ¹æ³ã¯ããããŸã§ã®ãšããããã®èšäºã®ç¯å²å€ã§ãã
ãŸããã¯ã©ã€ã¢ã³ã蚌ææžã®æå¹æ§ã«ã€ããŠïŒPixonicã§3ãæéã®äžæå¥çŽã®äžã§ä»äºãåŸãŠããããæŽæ°ããªãã£ããšä»®å®ããå ŽåãèšèŒãããç¶æ³ã§ã¯ãVPNãžã®ã¢ã¯ã»ã¹ã¯èšŒææžã®çºè¡æ¥ãã90æ¥åŸã«èªåçã«åæãããŸãã ååãFreeIPAã®ã¢ã«ãŠã³ããåæããããauthorized_keysããè¡ãæåã§åé€ããã®ãå¿ããå ŽåãSSHã¢ã¯ã»ã¹ã§ã¯äœãèµ·ãããŸããã Cã¯sesuriteã§ãã
çŸåšã Borschev HTTPSã«ãããš
蚪åè ããã©ãŠã¶ãçŸããããã¯ã§ããããã«ããµã€ãã§ãSSLãæå¹ã«ããããšä»®å®ããŸãã å®éãããã§ã¯ãã¹ãŠãåãã§ãããããã€ãã®ãã¥ã¢ã³ã¹ããããŸãã
- æããã«ãããªãã®åŽã§ã¯ãç§å¯éµãšèšŒææžçœ²åèŠæ±ã®ã¿ãçæã§ããŸãã
- èŠæ±ãå ±éåãšããŠçæãããšãã¯ãä»®æ³ãã¹ãã®ServerNameãšãWebãµãŒããŒæ§æã§æå®ãããã¹ãŠã®ãšã€ãªã¢ã¹ãæå®ããå¿ èŠããããŸãã äŸãã°ãdomain.tldããã³www.domain.tldã§ããããwwwãCAã¯éåžžã蚌ææžãçºè¡ãããšãã«è¿œå ãããŸãã ã»ãšãã©ã®å Žåã* .domain.tldãæå®ããã ãã§ïŒããããã¯ã€ã«ãã«ãŒã蚌ææžãèŠæ±ããããïŒãç¹å®ã®CAããæ å ±ãååŸãããã®ãããªæ±ºå®ã®çµæãæ確ã«ç解ããå¿ èŠããããŸãã ååãšããŠããããªãã¯CAã§ã¯IPã¢ãã¬ã¹ããšã€ãªã¢ã¹ãšããŠäœ¿çšã§ããŸããã
- èŠæ±ãçââæãããšãããã£ã¬ã³ãžãã¹ã¯ãŒããæå®ããªãã§ãã ãããæå®ããªããšãWebãµãŒããŒãåèµ·åãããã³ã«æåã§å ¥åããå¿ èŠããããŸãã
- éåžžããããªãã¯CAã¯ãComodoã
SymantecãGoDaddyãªã©ã®ç±ç·ãããªãã£ã¹ã§ãã 蚌ææžã®çºè¡ã«ã¯è²»çšãããããŸãããåªãã蚌ææžã«ã¯å€å€§ãªè²»çšãããããŸãã ãã ããããããšã¯å¥ã«ãæ¯èŒçæè¿ã Let's EncryptãååšããŸããããã¯å€ãã®äººãä¿¡é ŒããåŸåãããç¡æã®ãããžã§ã¯ãã§ããã蚌ææžã§ããããä¿è·ããããã«ã©ã®ãªãœãŒã¹ãšã©ã®ãããªç¶æ³ã§èããŸãã - ãããã®äººã¯ãåŸè ããããã®CAã®èšŒææžïŒå ¬éããŒéšåãã€ãŸãåã®äŸã®ca.crtïŒããã©ãŠã¶ã«ãã¬ã€ã³ã¹ããŒã«ãããããªæ¹æ³ã§ä»ã®äººãšåæããŸããã ã€ãŸããPKIèªäœã¯åé¡å€ã§ãã 誰ããç¹å®ã®äŒæ¥ãä¿¡é Œããããšã«åæããã ãã§ãã ãã©ãã£ãã¯ã®æå·åã«ã¯æçµçã«HTTPSãå¿ èŠã§ãããèªå·±çœ²åããŒãã¢ã䜿çšããŠæå·åããããšãã§ãããããããã¯æªããããŸããã ããããããã¯å声ã®åé¡ã§ãããæå¹æéåã/ç¡å¹ãªèšŒææžã«ã€ããŠã®èŠåã§ã€ã³ã¿ãŒãããå šäœãç §ãããªãããã«ããŸãã
- äžéšã®éåžžã«æèœã®ããCAã¯ãç§å¯ããŒãšCSRãçæãã䟿å©ããæäŸããŸãã ããã¯å¿ èŠãããŸããã çç±ãæ確ã§ããããšãé¡ã£ãŠããŸãã
- 蚌ææžã®æå¹æéã«ã€ããŠã ã¿ã€ã ãªãŒãªæŽæ°ã®ããã«ãã·ã¹ãã ã®åã«åžžã«èããå¿ èŠããããŸãã ããã¯ãLet's Encryptããã®èšŒææžã«ç¹ã«åœãŠã¯ãŸããŸããLet's Encryptã®æå¹æéã¯ããã3ãæã§ãïŒå·çæç¹ïŒã
- ãããŠãããããã®äººã ãéã®åæã«ã€ããŠã Googleãšã·ãã³ããã¯ãšã®æè¿ã®é åçãªè©±ã®åŸã«å€æããããã«ãä»ãããªãã¯ãã®ãããªãé¢çœããã±ãŒã¹ã«ã¹ãããŒã眮ãããšãã§ããå¿ èŠããããŸãã
ãã®ãããªããšã èšäºã®åé ã§çŽæããç解ãçŸããããšãé¡ã£ãŠããŸãã
PSãã¡ããããã®ç¬ãé£ã¹ãç±ç·ããããã¬ãŒãã¯ãPKIã®ãããªè€éãªãã®ããã®èšäºã§ã©ã®ããã«èª¬æãããŠããããããæãæ§ãããªå Žæã§é«ªãããåããããããŸããã ãã®å°ããªã¬ã€ãã¯ãè·å Žã§ããã«ééããŠããããã«èŠããŸããããããäœãããªãè¡ã£ãŠããã®ããæ¬åœã«ç解ããŠããªã人ã®ããã«æžããŸããã ãããŠãããªãã®ã€ã³ã¿ãŒãããã«ãããããªããã°ãç§ã«ã¯ååãªçéå ¥ãã®ããã¿ã³ãããããŸãã ããã«ãããããããäœãèšãããããšãããã°ãã³ã¡ã³ããæè¿ããŸãã