Varitiã¯ããããããã³DDoSæ»æã«å¯Ÿããä¿è·ãéçºããã¹ãã¬ã¹ããã³è² è·ãã¹ããå®æœããŸãã HighLoad ++ 2018ã«ã³ãã¡ã¬ã³ã¹ã§ãããŸããŸãªçš®é¡ã®æ»æãããªãœãŒã¹ãä¿è·ããæ¹æ³ã«ã€ããŠè©±ããŸããã ã€ãŸããã·ã¹ãã ã®äžéšãåé¢ããã¯ã©ãŠããµãŒãã¹ãšCDNã䜿çšããŠå®æçã«æŽæ°ããŸãã ããããå°éäŒæ¥ããªããã°ãããªãã¯ãŸã ã§ããªãä¿è·:)
ããã¹ããèªãåã«ãäŒè°ã®ãŠã§ããµã€ãã§çãèŠçŽã«æ £ããããšãã§ããŸãã
ãŸããåç»ãèªã¿ãããªãå Žåãåç»ãèŠèŽãããå Žåã¯ãã¬ããŒãã®èšé²ã¯ãã¿ãã¬ã®äžã«ãããŸãã
ãããªãå ±åãã
å€ãã®äŒæ¥ã¯ãã§ã«ã¹ãã¬ã¹ãã¹ããè¡ãæ¹æ³ãç¥ã£ãŠããŸããã誰ããã¹ãã¬ã¹ãã¹ããè¡ãããã§ã¯ãããŸããã äžéšã®ã客æ§ã¯ãé«è² è·ã·ã¹ãã ãåããŠãããæ»æããã·ã¹ãã ãä¿è·ããŠããããããµã€ãã«è匱æ§ããªããšèããŠããŸãã ããã¯å®å šã«çå®ã§ã¯ãªãããšã瀺ããŠããŸãã
ãã¡ããããã¹ããå®æœããåã«ãã客æ§ããèš±å¯ãååŸãã眲åãšã¹ã¿ã³ããæŒããŸãããç§ãã¡ã®å©ããåããŠã ãã«ãDDoSæ»æãä»æããããšã¯ã§ããŸããã ãã¹ãã¯ãã客æ§ãéžæããæéã«å®è¡ãããŸãããã®å ŽåããªãœãŒã¹ãžã®åºåžã¯æå°éã§ãããã¢ã¯ã»ã¹ã®åé¡ã¯ã客æ§ã«åœ±é¿ããŸããã ããã«ããã¹ãããã»ã¹äžã«äœããåžžã«å€±æããå¯èœæ§ããããããã客æ§ãšåžžã«é£çµ¡ãåãåã£ãŠããŸãã ããã«ãããéæãããçµæãã¬ããŒãã§ããã ãã§ãªãããã¹ãäžã«äœããå€æŽããããšãã§ããŸãã ãã¹ãã®æåŸã«ãçºèŠãããæ¬ é¥ãææãããµã€ãã®åŒ±ç¹ãæé€ããããã®æšå¥šäºé ã瀺ãã¬ããŒããåžžã«äœæããŸãã
ã©ããã£ãŠåãã®
ãã¹ãäžã«ãããããããããšãã¥ã¬ãŒãããŸãã ãããã¯ãŒã¯ã«é 眮ãããŠããªãã¯ã©ã€ã¢ã³ããšé£æºããå¶éãŸãã¯ä¿è·ã®ããªã¬ãŒã«ãããã¹ããæåã®1åéã§çµäºããªãããã«ã1ã€ã®IPã§ã¯ãªããç¬èªã®ãµããããããè² è·ãèªã¿èŸŒã¿ãŸãã ããã«ã倧ããªè² è·ããããããã«ãç¬èªã®åŒ·åãªãã¹ããµãŒããŒããããŸãã
ä»®å®
å€ãã¯è¯ããªã
ãªãœãŒã¹ã«é害ãçºçããå¯èœæ§ãããã»ã©ãè² è·ãå°ãªãã»ã©å¹æçã§ãã 1ç§éã«1ã€ã®ãªã¯ãšã¹ãããããŸãã¯1åã«1ã€ã®ãªã¯ãšã¹ãããã§ããµã€ããæ©èœããªããªãããã«ã§ããã°ãããã§åé¡ãããŸããã åå£ãªæ³åã«ãããšããŠãŒã¶ãŒãŸãã¯æ»æè ã誀ã£ãŠãã®è匱æ§ã«é¥ãããã§ãã
éšåçãªé害ã¯å®å šãªé害ãããåªããŠããŸã
ã·ã¹ãã ãç°çš®ã«ããããšãåžžã«ãå§ãããŸãã ããã«ãã³ã³ããåã ãã§ãªããç©çã¬ãã«ã§ããããåé¢ãã䟡å€ããããŸãã ç©ççãªåé¢ã®å Žåããµã€ãã§äœãã倱æããŠããå®å šã«æ©èœããªããªãããšã¯ã»ãšãã©ãªãããŠãŒã¶ãŒã¯æ©èœã®å°ãªããšãäžéšã«ã¢ã¯ã»ã¹ã§ããŸãã
é©åãªã¢ãŒããã¯ãã£ã¯æç¶å¯èœæ§ã®åºç€ã§ã
ãªãœãŒã¹ã®ãã©ãŒã«ããã¬ã©ã³ã¹ãšæ»æãè² è·ã«èããèœåã¯ãèšèšæ®µéãå®éã«ã¯ããŒãããã¯ã«æåã®ãããã¯å³ãæã段éã§èšå®ããå¿ èŠããããŸãã èŽåœçãªãšã©ãŒãå¿ã³èŸŒãã å Žåãå°æ¥ä¿®æ£ããããšãã§ããŸãããããã¯éåžžã«é£ããããã§ãã
ã³ãŒããè¯ãã ãã§ãªããèšå®ãå¿ èŠã§ã
å€ãã®äººã ã¯ãåªããéçºããŒã ããµãŒãã¹ã®èé害æ§ãä¿èšŒãããšèããŠããŸãã åªããéçºããŒã ãæ¬åœã«å¿ èŠã§ãããåªããéçšãåªããDevOpsãå¿ èŠã§ãã ã€ãŸããLinuxãšãããã¯ãŒã¯ãæ£ããæ§æããnginxã§æ§æãæ£ããèšè¿°ããå¶éãæ§æãããªã©ã®å°é家ãå¿ èŠã§ãã ããããªããšããªãœãŒã¹ã¯ãã¹ãã§ã®ã¿æ£åžžã«æ©èœããæ¬çªç°å¢ã§ã¯ããæç¹ã§ãã¹ãŠãæ©èœããªããªããŸãã
ã¹ãã¬ã¹ãã¹ããšã¹ãã¬ã¹ãã¹ãã®éã
è² è·ãã¹ãã«ãããã·ã¹ãã ã®å¶éãç¹å®ã§ããŸãã ã¹ãã¬ã¹ãã¹ãã¯ãã·ã¹ãã ã®åŒ±ç¹ãèŠã€ããããšãç®çãšããŠããããã®ã·ã¹ãã ãç Žå£ããç¹å®ã®éšåã®æ éã®éçšã§ã·ã¹ãã ãã©ã®ããã«åäœãããã確èªããããã«äœ¿çšãããŸãã åæã«ãè² è·ã®æ§è³ªã¯éåžžãã¹ãã¬ã¹ãã¹ããéå§ããããŸã§ã顧客ã«ã¯äžæã®ãŸãŸã§ãã
L7æ»æã®ç¹åŸŽçãªæ©èœ
éåžžãL7ãšL3ïŒ4ã®ã¬ãã«ã®è² è·ã«åå²ããè² è·ã®çš®é¡ã L7ã¯ã¢ããªã±ãŒã·ã§ã³ã¬ãã«ã®è² è·ã§ãããã»ãšãã©ã®å ŽåãHTTPãšããŠã®ã¿ç解ãããŸãããTCPãããã³ã«ã¬ãã«ã®è² è·ãæå³ããŸãã
L7æ»æã«ã¯ç¹å®ã®ç¹åŸŽããããŸãã ãŸããã¢ããªã±ãŒã·ã§ã³ã«çŽæ¥ã¢ã¯ã»ã¹ããŸããã€ãŸãããããã¯ãŒã¯æ段ã«ãã£ãŠåæ ãããå¯èœæ§ã¯äœãã§ãã ãã®ãããªæ»æã¯ããžãã¯ã䜿çšãããããCPUãã¡ã¢ãªããã£ã¹ã¯ãããŒã¿ããŒã¹ããã®ä»ã®ãªãœãŒã¹ãéåžžã«å¹ççã«æ¶è²»ãããã©ãã£ãã¯ã¯ã»ãšãã©ãããŸããã
HTTPãã©ãã
æ»æã®å Žåãè² è·ã¯åŠçãããããäœæã容æã§ãããL7ã®å Žåãåæ§ã§ãã æ»æãã©ãã£ãã¯ãæ£åœãªãã®ãšåºå¥ããããšã¯å¿ ããã容æã§ã¯ãªããã»ãšãã©ã®å Žåãé »åºŠã«ãã£ãŠè¡ãããšãã§ããŸããããã¹ãŠãæ£ããèšç»ãããŠããå Žåãæ»æãã©ãã«ãããæ£åœãªèŠæ±ããã°ã«ãã£ãŠã©ãã«ããããç解ããããšã¯äžå¯èœã§ãã
æåã®äŸãšããŠãHTTP Floodæ»æãæ€èšããŸãã ã°ã©ãã¯ãéåžžããã®ãããªæ»æã¯éåžžã«åŒ·åã§ããã以äžã®äŸã§ã¯ãèŠæ±ã®ããŒã¯æ°ã1åããã60äžãè¶ ããŠããããšã瀺ããŠããŸãã
HTTP Floodã¯ãè² è·ãäœæããæãç°¡åãªæ¹æ³ã§ãã éåžžãApacheBenchãªã©ãäœããã®çš®é¡ã®è² è·ãã¹ãããŒã«ã䜿çšããããªã¯ãšã¹ããšç®çãèšå®ãããŸãã ãã®ãããªåçŽãªã¢ãããŒãã§ã¯ããµãŒããŒãã£ãã·ã³ã°ãçºçããå¯èœæ§ããããŸãããç°¡åã«åé¿ã§ããŸãã ããšãã°ããªã¯ãšã¹ãã«ã©ã³ãã ãªè¡ãè¿œå ãããšããµãŒããŒã¯åžžã«æ°ããããŒãžãåžžã«è¡šç€ºããŸãã
ãŸããè² è·ãäœæããããã»ã¹ã§user-agentãå¿ããªãã§ãã ããã äžè¬çãªãã¹ãããŒã«ã®å€ãã®ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãã·ã¹ãã 管çè ã«ãã£ãŠãã£ã«ã¿ãŒåŠçãããŸãããã®å Žåãè² è·ãåã«ããã¯ãšã³ãã«å°éããªãå¯èœæ§ããããŸãã å€ããå°ãªããæå¹ãªããããŒããã©ãŠã¶ãŒãããªã¯ãšã¹ãã«æ¿å ¥ããããšã§ãçµæãå€§å¹ ã«æ¹åã§ããŸãã
HTTP Floodæ»æã«ã¯ããã®ãã¹ãŠã®åçŽãã«å¯ŸããŠæ¬ ç¹ããããŸãã ãŸããè² è·ãäœæããã«ã¯å€§ããªå®¹éãå¿ èŠã§ãã 第äºã«ããã®ãããªæ»æã¯ãç¹ã«åãã¢ãã¬ã¹ããã®æ»æã®å Žåãéåžžã«ç°¡åã«æ€åºã§ããŸãã ãã®çµæãã·ã¹ãã 管çè ãŸãã¯ãããã€ããŒã¬ãã«ã®ããããã§ããªã¯ãšã¹ãã®ãã£ã«ã¿ãªã³ã°ãããã«éå§ãããŸãã
äœãæ¢ã
1ç§ãããã®ãªã¯ãšã¹ãæ°ãæžãããŠãå¹çãæãªãããªãããã«ããã«ã¯ãå°ãæ³ååãçºæ®ããŠãµã€ããæ¢çŽ¢ããå¿ èŠããããŸãã ãã®ããããã£ãã«ãŸãã¯ãµãŒããŒã ãã§ãªããã¢ããªã±ãŒã·ã§ã³ã®åã ã®éšåïŒããŒã¿ããŒã¹ããã¡ã€ã«ã·ã¹ãã ãªã©ïŒãèªã¿èŸŒãããšãã§ããŸãã èšç®æ©ã補åéžæããŒãžãªã©ããã°ãããèšç®ãè¡ããµã€ãäžã®å Žæãæ€çŽ¢ããããšãã§ããŸãã æåŸã«ããµã€ãã«ã¯ãæ°åäžè¡ã®ããŒãžãçæããç¹å®ã®phpã¹ã¯ãªãããããããšããããããŸãã ãŸãããã®ãããªã¹ã¯ãªããã¯ãµãŒããŒã«å€§ããªè² è·ããããæ»æã®æšçã«ãªãå¯èœæ§ããããŸãã
èŠã©ãã
ãã¹ãããåã«ãªãœãŒã¹ãã¹ãã£ã³ãããšãããã¡ããæåã«ãµã€ãèªäœãèŠãŸãã ããããçš®é¡ã®å ¥åãã£ãŒã«ããéããã¡ã€ã«ãæ¢ããŠããŸããäžè¬ã«ããªãœãŒã¹ã«åé¡ãåŒãèµ·ããããã®åäœãé ãããå¯èœæ§ã®ãããã¹ãŠã®ãã®ãæ¢ããŠããŸãã ããã§ãGoogle Chromeããã³Firefoxã®äžè¬çãªéçºããŒã«ã¯ãããŒãžã®å¿çæéã衚瀺ããã®ã«åœ¹ç«ã¡ãŸãã
ãµããã¡ã€ã³ãã¹ãã£ã³ããŸãã ããšãã°ãç¹å®ã®ãªã³ã©ã€ã³ã¹ãã¢abc.comãããããµããã¡ã€ã³admin.abc.comããããŸãã ã»ãšãã©ã®å Žåãããã¯èªèšŒä»ãã®ç®¡çã€ã³ã¿ãŒãã§ã€ã¹ã§ãããè² è·ãããããšãã¡ã€ã³ãªãœãŒã¹ã«åé¡ãçºçããå¯èœæ§ããããŸãã
ãã®ãµã€ãã«ã¯ããµããã¡ã€ã³api.abc.comããããŸãã ãããããããã¯ã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ã®ãªãœãŒã¹ã§ãã ã¢ããªã±ãŒã·ã§ã³ã¯App StoreãŸãã¯Google Playã«ãããç¹å¥ãªã¢ã¯ã»ã¹ãã€ã³ããé 眮ããAPIãåæãããã¹ãã¢ã«ãŠã³ããç»é²ã§ããŸãã åé¡ã¯ãå€ãã®å Žåãæ¿èªã«ãã£ãŠä¿è·ãããŠãããã¹ãŠã®ãã®ããµãŒãã¹æåŠæ»æã®åœ±é¿ãåããªããšèããŠããããšã§ãã ç³ãç«ãŠã«ãããšãæ¿èªã¯æé«ã®CAPTCHAã§ãããããã§ã¯ãããŸããã 10ã20åã®ãã¹ãã¢ã«ãŠã³ããäœæããã®ã¯ç°¡åã§ãäœæããããšã§ãè€éã§åœè£ ãããŠããªãæ©èœã«ã¢ã¯ã»ã¹ã§ããŸãã
åœç¶ãrobots.txtãšWebArchiveãViewDNSã§å±¥æŽã調ã¹ãå€ãããŒãžã§ã³ã®ãªãœãŒã¹ãæ¢ããŠããŸãã ããšãã°ãmail2.yandex.netãªã©ã®éçºè ãããŒã«ã¢ãŠãããå Žåã§ããå€ãããŒãžã§ã³ã®mail.yandex.netã¯æ®ã£ããŸãŸã«ãªãããšããããŸãã ãã®mail.yandex.netã¯ãµããŒããããªããªããéçºãªãœãŒã¹ã¯å²ãåœãŠãããŸããããããŒã¿ããŒã¹ãæ¶è²»ãç¶ããŸãã ãããã£ãŠãå€ãããŒãžã§ã³ã䜿çšãããšãããã¯ãšã³ãã®ãªãœãŒã¹ãšã¬ã€ã¢ãŠãã®èåŸã«ãããã¹ãŠã®ãã®ãå¹æçã«äœ¿çšã§ããŸãã ãã¡ãããããã¯åžžã«çºçããããã§ã¯ãããŸããããããã§ããã®ãããªããšãé »ç¹ã«çºçããŸãã
åœç¶ããã¹ãŠã®èŠæ±ãã©ã¡ãŒã¿ãŒãCookieæ§é ãåæããŸãã ããšãã°ãJSONé åå ã®Cookieå ã«å€ãå ¥åãã倧ããªãã¹ããäœæããŠããªãœãŒã¹ãäžåœã«é·ãåäœãããããšãã§ããŸãã
æ€çŽ¢è² è·
ã»ãšãã©ãã¹ãŠã®äººãæ€çŽ¢ãè¡ã£ãŠãããæ®å¿µãªããã»ãšãã©ã®äººãæ€çŽ¢ãè¡ã£ãŠããããããµã€ãã調æ»ãããšãã«æåã«é ã«æµ®ãã¶ã®ã¯ããŒã¿ããŒã¹ãããŒãããããšã§ãã äœããã®çç±ã§ãéçºè ã¯æ€çŽ¢ã«ååãªæ³šæãæã£ãŠããŸããã ãã ããæšå¥šäºé ã1ã€ãããŸããHTTPãã©ããã®å Žåã®ããã«ããã£ãã·ã¥ãçºçããå¯èœæ§ããããããåãã¿ã€ãã®èŠæ±ãè¡ããªãã§ãã ããã
ããŒã¿ããŒã¹ã«ã©ã³ãã ãªã¯ãšãªãäœæããããšããåžžã«å¹ççã§ã¯ãããŸããã æ€çŽ¢ã«é¢é£ããããŒã¯ãŒãã®ãªã¹ããäœæããããšããå§ãããŸãã ãªã³ã©ã€ã³ã¹ãã¢ã®äŸã«æ»ããšããµã€ãã§è»ã®ã¿ã€ã€ã販売ããŠãããã¿ã€ã€ã®ååŸãè»ã®ã¿ã€ãããã®ä»ã®ãã©ã¡ãŒã¿ãŒãèšå®ã§ãããšããŸãã ãããã£ãŠãé¢é£ããåèªã®çµã¿åããã«ãããããŒã¿ããŒã¹ã¯ããè€éãªæ¡ä»¶ã§åäœããŸãã
ããã«ãããŒãžããŒã·ã§ã³ã䜿çšãã䟡å€ããããŸããSERPã®æåŸãã2çªç®ã®ããŒãžãæ€çŽ¢ããã®ã¯ãæåã®ããŒãžãããã¯ããã«å°é£ã§ãã ã€ãŸããããŒãžããŒã·ã§ã³ã®å©ããåããŠãè² è·ãå°ãåæ£ãããããšãã§ããŸãã
以äžã®äŸã§ã¯ãæ€çŽ¢ã®è² è·ã瀺ããŠããŸãã 1ç§ããã10ãªã¯ãšã¹ãã®é床ã§ã®ãã¹ãã®æåã®1ç§ããããµã€ããããŠã³ããå¿çããªãã£ãããšãããããŸãã
æ€çŽ¢ããªãå Žå
æ€çŽ¢ããªãå Žåãããã¯ãµã€ãã«ä»ã®è匱ãªå ¥åãã£ãŒã«ããå«ãŸããŠããªãããšãæå³ããŸããã ãã®ãã£ãŒã«ãã¯æ¿èªã®å ŽåããããŸãã çŸåšãéçºè ã¯ãã¬ã€ã³ããŒããŒãã«ã®æ»æãããã°ã€ã³ããŒã¿ããŒã¹ãä¿è·ããããã«ãè€éãªããã·ã¥ãäœæããããšã奜ã¿ãŸãã ããã¯è¯ãããšã§ããããã®ãããªããã·ã¥ã¯å€§ããªCPUãªãœãŒã¹ãæ¶è²»ããŸãã 誀ã£ãæ¿èªã®å€§èŠæš¡ãªã¹ããªãŒã ã¯ãããã»ããµã®é害ã«ã€ãªããããã®çµæããµã€ãã¯åºåã®åŠçãåæ¢ããŸãã
ã³ã¡ã³ãããã£ãŒãããã¯ã®ããã®ããããçš®é¡ã®ãã©ãŒã ããµã€ãã«ååšããããšã¯ãããã«éåžžã«å€§ããªããã¹ããéä¿¡ããããåã«å€§èŠæš¡ãªæŽªæ°ŽãåŒãèµ·ããããããæ©äŒã§ãã ãµã€ãã¯ãgzip圢åŒãªã©ã®æ·»ä»ãã¡ã€ã«ãåãå ¥ããå ŽåããããŸãã ãã®å Žåã1TBã®ãã¡ã€ã«ãååŸããgzipã䜿çšããŠæ°ãã€ããŸãã¯ãããã€ãã«å§çž®ããŠãµã€ãã«éä¿¡ããŸãã ãã®åŸã解åãããéåžžã«èå³æ·±ãå¹æãåŸãããŸãã
REST API
Rest APIãªã©ã®äººæ°ã®ãããµãŒãã¹ã«å°ã泚æãæããããšæããŸãã Rest APIã®ä¿è·ã¯ãéåžžã®ãµã€ããããã¯ããã«å°é£ã§ãã Rest APIã®å Žåããã¹ã¯ãŒãã®ã¯ã©ããã³ã°ããã®ä»ã®éæ³ãªã¢ã¯ãã£ããã£ã«å¯Ÿããããããªä¿è·æ¹æ³ã§ããæ©èœããŸããã
Rest APIã¯ãããŒã¿ããŒã¹ã«çŽæ¥ã¢ã¯ã»ã¹ãããããéåžžã«ç°¡åã«å£ããŸãã åæã«ããã®ãããªãµãŒãã¹ã®å€±æã¯ãããžãã¹ã«ãšã£ãŠéåžžã«æ·±å»ãªçµæããããããŸãã å®éãREST APIã«ã¯éåžžãã¡ã€ã³ãµã€ãã ãã§ãªããã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ãå éšããžãã¹ãªãœãŒã¹ãå«ãŸããŸãã ãããŠãããããã¹ãŠã該åœããå Žåããã®å¹æã¯åçŽãªãµã€ãã®é害ã®å Žåãããã¯ããã«åŒ·åã§ãã
éãã³ã³ãã³ãã®è² è·
è€éãªæ©èœãæããªãéåžžã®1ããŒãžã®ã¢ããªã±ãŒã·ã§ã³ãã©ã³ãã£ã³ã°ããŒãžãååºWebãµã€ãããã¹ãããããã«ææ¡ãããå Žåãéãã³ã³ãã³ããæ¢ããŠããŸãã ããšãã°ããµãŒããŒããæäŸããã倧ããªç»åããã€ããªãã¡ã€ã«ãpdfããã¥ã¡ã³ããªã©ããã¹ãŠãåºåããããšããŠããŸãã ãã®ãããªãã¹ãã¯ããã¡ã€ã«ã·ã¹ãã ãé©åã«ããŒããããã£ãã«ãè©°ãŸããããããå¹æçã§ãã ã€ãŸãããµãŒããŒãåæ¢ããã«ãäœéã§å€§ããªãã¡ã€ã«ãããŠã³ããŒãããå Žåã§ããã¿ãŒã²ãããµãŒããŒã®ãã£ãã«ãè©°ãŸãã ãã§ããµãŒãã¹æåŠãçºçããŸãã
ãã®ãããªãã¹ãã®äŸã¯ã30 RPSã®é床ã§ãµã€ããå¿çãåæ¢ãããã500ãµãŒããŒãšã©ãŒãçæããããšã瀺ããŠããŸãã
ãµãŒããŒã®ã»ããã¢ãããå¿ããªãã§ãã ããã å€ãã®å Žåã人ãä»®æ³ãã·ã³ãè³Œå ¥ããApacheãã€ã³ã¹ããŒã«ããããã©ã«ãã§ãã¹ãŠãæ§æããphpã¢ããªã±ãŒã·ã§ã³ãèŠã€ãããã®äžã«çµæã衚瀺ãããŸãã
ããã§ãè² è·ã¯ã«ãŒãã«è¡ããããã10 RPSã«ãªããŸããã 5ååŸ ã£ãŠãããµãŒããŒãã¯ã©ãã·ã¥ããŸããã ããããçµå±ã®ãšããã圌ããªãèœã¡ãã®ãã¯ããããŸãããã圌ã¯åã«èšæ¶ããã£ã±ãã§ããããã£ãŠå¿çããªããªã£ããšããä»®å®ããããŸãã
ãŠã§ãŒãããŒã¹
éå»1幎ã2幎ã§ããŠã§ãŒãæ»æã¯éåžžã«äžè¬çã«ãªããŸããã ããã¯ãå€ãã®çµç¹ãDDoSããã®ä¿è·ã®ããã«ç¹å®ã®ããŒããŠã§ã¢ãè³Œå ¥ããŠããããããã£ã«ã¿ãªã³ã°æ»æãéå§ããããã«äžå®éã®çµ±èšãå¿ èŠã§ãã ã€ãŸããããŒã¿ãèç©ããŠåŠç¿ãããããæåã®30ã40ç§éã¯æ»æããã£ã«ã¿ãªã³ã°ããŸããã ãããã£ãŠããããã®30ã40ç§ã§ããã¹ãŠã®èŠæ±ãã¬ã€ã¯ããããŸã§ãªãœãŒã¹ãé·æéååšããããã«èµ·åã§ããŸãã
æ»æã®å Žåã10å以äžã®ééãããããã®åŸãæ»æã®æ°ããä¿®æ£ãããéšåãå°çããŸããã
ã€ãŸããé²åŸ¡ã¯èšç·Žããããã£ã«ã¿ãªã³ã°ãéå§ããŸããããæ»æã®ãŸã£ããç°ãªãéšåãæ°ãã«å°çããé²åŸ¡ã¯åã³èšç·Žãéå§ããŸããã å®éããã£ã«ã¿ãªã³ã°ã¯æ©èœããªããªããä¿è·ã¯ç¡å¹ã«ãªãããµã€ãã«ã¢ã¯ã»ã¹ã§ããªããªããŸãã
ãŠã§ãŒãæ»æã¯ãããŒã¯æã«éåžžã«é«ãå€ãç¹åŸŽãšããL7ã®å Žåã1ç§ããã10äžãŸãã¯100äžã®ãªã¯ãšã¹ãã«éããå¯èœæ§ããããŸãã L3ããã³4ã«ã€ããŠè©±ããšããã±ããã§æ°ããå Žåãæ°çŸã®ã¬ãããã®ãã©ãã£ãã¯ããŸãã¯ããã«å¿ããŠæ°çŸmppsã«ãªãå¯èœæ§ããããŸãã
ãã®ãããªæ»æã®åé¡ã¯åæã§ãã ããããããããã®æ»æã§ãããéåžžã«å€§ããª1åéãã®ããŒã¯ãäœæããã«ã¯ãé«åºŠãªåæãå¿ èŠã§ãã ãããŠããã®èª¿æŽã¯åžžã«ããŸããããšã¯éããŸãããåºåã«æŸç©ç·ã®ããŒã¯ãçŸããããšããããŸãããããã¯ããªãåãã«èŠããŸãã
HTTPãŠããã¡ã€ãã§ã¯ãªã
L7ã¬ãã«ã®HTTPã«å ããŠãä»ã®ãããã³ã«ãæªçšããããšã倧奜ãã§ãã ååãšããŠãéåžžã®Webãµã€ããç¹ã«éåžžã®ãã¹ãã£ã³ã°ã§ã¯ãã¡ãŒã«ãããã³ã«ãšMySQLã䜿çšãããŠããŸãã ã¡ãŒã«ãããã³ã«ã¯ããŒã¿ããŒã¹ããã圱é¿ãå°ãªãã§ãããéåžžã«å¹ççã«ããŒãã§ããåºåã§ãµãŒããŒã®CPUãéè² è·ã«ãªãå¯èœæ§ããããŸãã
2016 SSHè匱æ§ã®å©ããåããŠãç§ãã¡ã¯éåžžã«æåããŸããã çŸåšããã®è匱æ§ã¯ã»ãŒå šå¡ã«å¯ŸããŠä¿®æ£ãããŠããŸãããããã¯SSHãããŒãã§ããªããšããæå³ã§ã¯ãããŸããã ã§ããŸãã èšå€§ãªéã®èªèšŒãæäŸãããã ãã§ãSSHã¯ãµãŒããŒäžã®CPUã®ã»ãŒå šäœã䜿ãæãããWebãµã€ãã¯ãã§ã«1ç§ããã1ã€ãŸãã¯2ã€ã®ãªã¯ãšã¹ãã§æ§æãããŠããŸãã
ãããã£ãŠããããã®1ã€ãŸãã¯2ã€ã®ãã°ã¯ãšãªãæ£åœãªè² è·ãšåºå¥ããããšã¯ã§ããŸããã
ãµãŒããŒã§éãå€ãã®æ¥ç¶ã¯åŒãç¶ãé¢é£ããŸãã 以åã¯ãApacheã眪ãç¯ããŸããããnginxã¯å®éã«çœªãç¯ããŸãããå€ãã®å Žåãããã©ã«ãã§æ§æãããŠããŸãã nginxãéãããŸãŸã«ã§ããæ¥ç¶ã®æ°ã¯éãããŠããããããã®æ°ã®æ¥ç¶ãéããšãæ°ããnginxæ¥ç¶ã¯åãå ¥ããããªããªãããµã€ãã¯åºåã§æ©èœããªããªããŸãã
ãã¹ãã¯ã©ã¹ã¿ã«ã¯ãSSLãã³ãã·ã§ã€ã¯ãæ»æããã®ã«ååãªCPUããããŸãã ååãšããŠãå®è·µã瀺ãããã«ããããããããããã奜ãããšããããŸãã äžæ¹ã§ã¯ãGoogleã®çºè¡ãã©ã³ãã³ã°ãããã³ã»ãã¥ãªãã£ã®ãããSSLãªãã§ã¯å®è¡ã§ããªãããšã¯æããã§ãã äžæ¹ãSSLã«ã¯æ®å¿µãªããCPUã®åé¡ããããŸãã
L3ããã³4
L3ããã³4ã¬ãã«ã§ã®æ»æã«ã€ããŠè©±ããšããéåžžã¯ãã£ãã«ã¬ãã«ã§ã®æ»æã«ã€ããŠè©±ããŸãã ãã®ãããªè² è·ã¯ãSYNãã©ããæ»æã§ã¯ãªãå Žåãã»ãšãã©åžžã«æ£åœãªè² è·ãšåºå¥ã§ããŸãã ã»ãã¥ãªãã£ããŒã«ã®SYNãã©ããæ»æã®åé¡ã¯å€§éã«çºçããŸãã L3ïŒ4ã®æ倧å€ã¯1.5-2 Tb / sã§ããã ãã®ãããªãã©ãã£ãã¯ã¯ãOracleãGoogleãªã©ã®å€§äŒæ¥ã§ãåŠçãéåžžã«å°é£ã§ãã
SYNããã³SYN-ACKã¯ãæ¥ç¶ã®ç¢ºç«ã«äœ¿çšãããããã±ãŒãžã§ãã ãããã£ãŠãSYNãã©ãããšæ£åœãªè² è·ãåºå¥ããããšã¯å°é£ã§ãããããSYNã§ããããæ¥ç¶ã確ç«ããããã«ãªã£ãã®ãããã©ããã®äžéšã§ããã®ãã¯æ確ã§ã¯ãããŸããã
UDPãã©ãã
éåžžãæ»æè ã¯ç§ãã¡ãæã£ãŠããèœåãæã£ãŠããªããããå¢å¹ ã䜿çšããŠæ»æãæŽçããããšãã§ããŸãã ã€ãŸããæ»æè ã¯ã€ã³ã¿ãŒããããã¹ãã£ã³ããè匱ãªãµãŒããŒãŸãã¯äžé©åã«æ§æããããµãŒããŒãèŠã€ããŸãããµãŒããŒã¯ãããšãã°ã1ã€ã®SYNãã±ããã«å¿çããŠã3ã€ã®SYN-ACKã§å¿çããŸãã ã¿ãŒã²ãããµãŒããŒã®ã¢ãã¬ã¹ãããœãŒã¹ã¢ãã¬ã¹ãåœé ããããšã«ããã1ã€ã®ããã±ãŒãžã䜿çšããŠå®¹éãããšãã°3åã«å¢ããããã©ãã£ãã¯ã被害è ã«ãªãã€ã¬ã¯ãã§ããŸãã
å¢å¹ ã®åé¡ã¯è€éãªæ€åºã§ãã ææ°ã®äŸãããè匱ãªmemcachedã®ã»ã³ã»ãŒã·ã§ãã«ãªã±ãŒã¹ãåŒçšã§ããŸãã ããã«ãçŸåšå€ãã®IoTããã€ã¹ãIPã«ã¡ã©ããããŸãããããããã»ãšãã©ãããã©ã«ãã§æ§æãããŠãããããã©ã«ãã§ã¯æ£ããæ§æãããŠããªããããæ»æè ã¯ãã®ãããªããã€ã¹ãä»ããŠæ»æãè¡ãããšãã»ãšãã©ã§ãã
é£ããSYNãã©ãã
SYNãã©ããã¯ãããããéçºè ã®èŠ³ç¹ããèŠããšããã¹ãŠã®æ»æã®äžã§æãèå³æ·±ããã¥ãŒã§ãã åé¡ã¯ãå€ãã®å Žåãã·ã¹ãã 管çè ãä¿è·ã®ããã«IPããããã³ã°ã䜿çšããããšã§ãã ããã«ãIPããããã³ã°ã¯ãã¹ã¯ãªããã«åŸã£ãŠåäœããã·ã¹ãã 管çè ã ãã§ãªããæ®å¿µãªãããå€ãã®ãéã§è³Œå ¥ãããã»ãã¥ãªãã£ã·ã¹ãã ã«ã圱é¿ãåãŒããŸãã
æ»æè ãIPã¢ãã¬ã¹ã眮ãæãããšãäŒç€Ÿã¯ç¬èªã®ãµããããããããã¯ããããããã®ãããªæ¹æ³ã¯å€§æšäºã«ãªããŸãã ãã¡ã€ã¢ãŠã©ãŒã«ãç¬èªã®ã¯ã©ã¹ã¿ãŒããããã¯ãããšãå€éšã®çžäºäœçšãåºåã§ã¯ã©ãã·ã¥ãããªãœãŒã¹ãç ŽæããŸãã
ãŸããç¬èªã®ãããã¯ãŒã¯ããããã¯ããããšã¯ç°¡åã§ãã ã¯ã©ã€ã¢ã³ãã®ãªãã£ã¹ã«Wi-Fiãããã¯ãŒã¯ãããå ŽåããŸãã¯ããŸããŸãªç£èŠã䜿çšããŠãªãœãŒã¹ã®ç¶æ ã枬å®ããå Žåããã®ç£èŠã·ã¹ãã ãŸãã¯ãªãã£ã¹ã®Wi-Fiã¯ã©ã€ã¢ã³ãã®IPã¢ãã¬ã¹ãååŸããããããœãŒã¹ãšããŠäœ¿çšããŸãã åºåã§ã¯ããªãœãŒã¹ã¯å©çšå¯èœã§ããããã§ãããã¿ãŒã²ããIPã¢ãã¬ã¹ã¯ãããã¯ãããŠããŸãã ãã®ãããäŒç€Ÿã®æ°è£œåãçºè¡šãããHighLoadäŒè°ã®Wi-Fiãããã¯ãŒã¯ã¯ãããã¯ãããå¯èœæ§ããããããã«ã¯ç¹å®ã®ããžãã¹ããã³çµæžçã³ã¹ãã䌎ããŸãã
ãã¹ãäžãèš±å¯ãããIPã¢ãã¬ã¹ã«ã®ã¿ãã©ãã£ãã¯ãæäŸããå¥çŽããããããäžéšã®å€éšãªãœãŒã¹ã«ããmemcachedãä»ããå¢å¹ ã¯äœ¿çšã§ããŸããã ãããã£ãŠãã·ã¹ãã ã2ã€ãŸãã¯3ã€ã®SYN-ACKã§å¿çããŠ1ã€ã®SYNãéä¿¡ããåºåã2ã3åã«ãªãå ŽåãSYNããã³SYN-ACKãä»ããå¢å¹ ã䜿çšããŸãã
ããŒã«
L7ã¬ãã«ã§ã®èªã¿èŸŒã¿ã«äœ¿çšããäž»ãªããŒã«ã®1ã€ã¯ãYandex-tankã§ãã ç¹ã«ããã¡ã³ãã ã¯éãšããŠäœ¿çšãããããã«ã«ãŒããªããžãçæããçµæãåæããããã®ããã€ãã®ã¹ã¯ãªããããããŸãã
Tcpdumpã¯ãããã¯ãŒã¯ãã©ãã£ãã¯ã®åæã«äœ¿çšãããNmapã¯ãµãŒããŒã®åæã«äœ¿çšãããŸãã L3ïŒ4ã¬ãã«ã§è² è·ãäœæããã«ã¯ãOpenSSLã䜿çšããDPDKã©ã€ãã©ãªã§ç¬èªã®éæ³ãå°ã䜿çšããŸãã DPDKã¯ãLinuxã¹ã¿ãã¯ããã€ãã¹ããŠãããã¯ãŒã¯ã€ã³ã¿ãŒãã§ã€ã¹ãæäœã§ããããã«ããIntelã®ã©ã€ãã©ãªã§ãããããã«ããå¹çãåäžããŸãã åœç¶ãDPDKã¯L3ããã³4ã¬ãã«ã ãã§ãªããL7ã¬ãã«ã§ã䜿çšããŸãã1å°ã®ãã·ã³ããæ¯ç§æ°çŸäžã®ãªã¯ãšã¹ãå ã§éåžžã«é«ãè² è·ãããŒãäœæã§ããããã§ãã
ãŸããç¹å®ã®ãã¹ãçšã«äœæããç¹å®ã®ãã©ãã£ãã¯ãžã§ãã¬ãŒã¿ãŒãšç¹å¥ãªããŒã«ã䜿çšããŸãã SSHã§ãã®è匱æ§ãæãåºããšãäžèšã®èšå®ã§ã¯åé¿ã§ããŸããã ã¡ãŒã«ãããã³ã«ãæ»æããå Žåãã¡ãŒã«ãŠãŒãã£ãªãã£ã䜿çšããããã¹ã¯ãªãããäœæããŸãã
çµè«
ãã®çµæãç§ã¯èšãããã§ãïŒ
- åŸæ¥ã®ã¹ãã¬ã¹ãã¹ãã«å ããŠãã¹ãã¬ã¹ãã¹ããå®è¡ããå¿ èŠããããŸãã ããŒãããŒã®äžè«ãæ¥è ãè² è·ãã¹ãã®ã¿ãå®æœããå®éã®äŸããããŸãã ãªãœãŒã¹ãæšæºè² è·ã«èããããšã瀺ãããŸããã ãããããã®åŸãç°åžžãªè² è·ãçºçãããµã€ã蚪åè ã¯ãªãœãŒã¹ã®äœ¿çšæ¹æ³ãå°ãå€ãå§ããåºåæã«äžè«ãæ¥è ã決ããŸããã ãããã£ãŠããã§ã«DDoSæ»æããä¿è·ãããŠããå Žåã§ããè匱æ§ãæ¢ã䟡å€ããããŸãã
- ã·ã¹ãã ã®äžéšãä»ã®éšåããåé¢ããå¿ èŠããããŸãã æ€çŽ¢ãããå Žåã¯ãå¥ã®ãã·ã³äžã§ãã€ãŸãããã«ãŒå ã§ãªããŠãæ€çŽ¢ããå¿ èŠããããŸãã æ€çŽ¢ãŸãã¯æ¿èªã倱æããå Žåãå°ãªããšãäœããæ©èœãç¶ããããã§ãã ãªã³ã©ã€ã³ã¹ãã¢ã®å ŽåããŠãŒã¶ãŒã¯åŒãç¶ãã«ã¿ãã°ã§è£œåãæ€çŽ¢ããã¢ã°ãªã²ãŒã¿ãŒããåãæ¿ããæ¢ã«æ¿èªãããŠããå Žåã¯è³Œå ¥ããããOAuth2ãä»ããŠãã°ã€ã³ããŸãã
- ããããçš®é¡ã®ã¯ã©ãŠããµãŒãã¹ãç¡èŠããªãã§ãã ããã
- CDNã¯ããããã¯ãŒã¯ã®é 延ãæé©åããããã ãã§ãªãããã£ãã«ã®æ¯æžã«å¯Ÿããæ»æã®ä¿è·æ段ãšããŠã䜿çšããéçã«ããµããŸãã
- ç¹å¥ãªã»ãã¥ãªãã£ãµãŒãã¹ã䜿çšããå¿ èŠããããŸãã ã»ãšãã©ã®å Žåãååãªãã£ãã«ããªãããããã£ãã«ã¬ãã«ã§L3ïŒ4æ»æãã身ãå®ãããšã¯ã§ããŸããã ãŸããL7æ»æã¯éåžžã«å€§ãããããL7æ»æã«æã¡åã€ããšã¯ã§ããŸããã ããã«ãå°ããªæ»æã®æ€çŽ¢ã¯ãäŸç¶ãšããŠç¹å¥ãªãµãŒãã¹ãç¹å¥ãªã¢ã«ãŽãªãºã ã®ç¹æš©ã§ãã
- å®æçã«æŽæ°ããŠãã ããã ããã¯ãã«ãŒãã«ã ãã§ãªããSSHããŒã¢ã³ã«ãé©çšãããŸããç¹ã«ãå€éšã«å¯ŸããŠéãããŠããå Žåã¯ããã§ãã ååãšããŠããã¹ãŠã®è匱æ§ãèªåã§è¿œè·¡ã§ããå¯èœæ§ã¯äœãããããã¹ãŠãæŽæ°ããå¿ èŠããããŸãã