Deflect Documentation Релiз 1.4.0

лип. 02, 2019

What is Deflect

1 Про Deflect 1 1.1 Контекст...... 1 1.2 Обґрунтування...... 1 1.3 Для кого призначено Deflect?...... 2 1.4 З чого почати...... 2 1.5 Налаштування...... 2 1.6 Наш пiдхiд...... 3 1.6.1 Дизайн...... 3 1.6.2 Який захист ми пропонуємо...... 4 1.6.3 Як працює Deflect...... 4 1.7 Деталi та обмеження...... 6 1.7.1 Закешованi компоненти...... 6 1.7.2 Cookies...... 6 1.7.3 Чи Deflect працює?...... 6 1.7.4 SSL...... 6 1.7.5 DNS...... 6 1.7.6 Налаштування Deflect...... 6

2 Deflect features 9 2.1 eQpress hosting...... 9 2.1.1 eQPress FAQ...... 9 2.1.2 Що таке eQpress...... 11 2.2 Control panel...... 11 2.2.1 Бiчна панель...... 12 2.2.2 Налаштування вебсайту...... 15 2.2.3 Повiдомити про DDoS атаку...... 23 2.2.4 Challenging requests...... 24 2.3 HTTPS/TLS support...... 25 2.3.1 TLS/HTTPS: protect your website’s visitors“ privacy...... 25 2.4 Deflect Mitigation Tech...... 30 2.4.1 Banjax authentication...... 30 2.4.2 Cookies...... 30 2.4.3 BotnetDBP...... 33 2.4.4 Challenger...... 41 2.5 Deflect Labs...... 44 2.5.1 Technical Details...... 44

i 2.5.2 Reports...... 49 2.6 Пiдтримка...... 52

3 Deflect in the media 55 3.1 Recent Media Coverage...... 55

4 Вiдгуки 57

5 Критерiї участi 61 5.1 Вiдповiднiсть критерiям участi...... 61

6 Посiбник по Панелi керування 63 6.1 Крок 0 - Реєстрацiя...... 63 6.2 Крок 1 - Налаштування IP та DNS...... 65 6.2.1 Важливо...... 66 6.3 Крок 2 - Облiковi данi адмiнiстратора...... 67 6.4 Крок 3 - HTTPS/TLS...... 67 6.4.1 Налаштування HTTPS/TLS...... 67 6.4.2 Публiчнi TLS Сертифiкати...... 68 6.4.3 Опцiї HTTPS...... 68 6.4.4 Сертифiкати вихiдного сервера...... 68 6.5 Крок 4 - Завершення...... 69

7 Deflect FAQ 71 7.1 Хто ви такi?...... 71 7.2 Що ще робить eQualit.ie?...... 71 7.3 Навiщо було створено Deflect?...... 71 7.4 Якi вебсайти використовують Deflect?...... 72 7.5 Чи можете Ви захистити мiй вебсайт?...... 72 7.6 Чи моєму вебсайту потрiбен Deflect?...... 72 7.7 Чи можу я використовувати Deflect якщо мiй вебсайт знаходиться у станi розробки?.. 73 7.8 Скiльки це коштує?...... 73 7.9 Я вже плачу за хостинг. Чи менi це справдi потрiбно?...... 73 7.10 Чи потрiбно менi переносити мiй вебсайт на Вашi сервери?...... 73 7.11 Чи можуть нападники обiйти захист Deflect, щоб атакувати через DDoS мiй вебсайт?.. 73 7.12 Якщо я матиму проблему або запитання, як швидко я отримаю вiдповiдь?...... 74 7.13 Хто контролює мiй вебсайт?...... 74 7.14 Чи має мiй вебсайт право на захист?...... 74 7.15 Чи є контракт?...... 74 7.16 Чи вплине це не мої доходи вiд реклами?...... 75 7.17 Що таке Deflect?...... 75 7.18 Чи можу я перейти пiд захист Deflect пiд час DDoS атаки?...... 75 7.19 Чи це сповiльнює роботу мого вебсайту?...... 75 7.20 Як я можу отримати захист Deflect?...... 75 7.21 Чи можу я розгорнути власну мережу Deflect?...... 76 7.22 Чи Ви пiдтримуєте SSL?...... 76 7.23 Let’s Encrypt...... 76 7.24 Чи люди знатимуть, що мiй сайт знаходиться пiд захистом?...... 76 7.25 Чому Deflect це вiдкрите програмне забезпечення?...... 77 7.26 Де розташовано Вашi сервери?...... 77 7.27 Я можу тримати код?...... 77

8 Terms of service 79 8.1 1. Про нас...... 79 8.2 2. Що таке Deflect?...... 79 ii 8.3 3. Хто може скористатись Deflect?...... 79 8.4 4. Використання Deflect...... 80 8.5 5. Представник Вашого Вебсайту...... 80 8.6 6. Вашi Зобов’язання...... 80 8.6.1 6.1 Вашi Зобов’язання...... 80 8.6.2 6.2 Забороненi види дiяльностi...... 81 8.7 7. Зобов’язання eQualit.ie...... 81 8.7.1 7.1 Нашi обов’язки...... 81 8.8 8. Порушення авторських прав...... 81 8.9 9. Припинення надання Послуги...... 82 8.10 10. Гарантiї та межi вiдповiдальностi...... 82 8.11 11. Вашi Вiдшкодування...... 82 8.12 12. Загальне...... 82

9 Privacy notice 83 9.1 Наша Обiцянка Щодо Безпеки та Цiлiсностi Даних...... 83 9.2 1. Effective Date and Scope...... 83 9.3 2. What Type of Data Do We Collect?...... 83 9.4 3. How Do We Use Data We Collect?...... 84 9.5 4. Do We Disclose Your Personal Information to Others?...... 85 9.6 5. Law Enforcement Requests...... 85 9.7 6. Storage of Data Outside Canada...... 85 9.8 7. How Do We Protect Data?...... 85 9.9 8. How Can You Access and Modify Your Personal Information or Make a Complaint?... 86 9.10 9. Notice to Persons Outside of Canada...... 86 9.11 10. Changes to Our Privacy Notice...... 86

10 Technology and tools 87 10.1 Debian...... 87 10.2 Apache Traffic Server (ATS)...... 87 10.3 ...... 88 10.4 ElasticSearch...... 88 10.5 Search Guard by Floragunn...... 89 10.6 Nagios Core...... 89 10.7 Ansible...... 89 10.8 GitHub...... 90 10.9 CircleCI...... 90 10.10 Read the Docs...... 91 10.11 Sphinx...... 91

11 Deflect DIY 93 11.1 What is Deflect...... 93 11.1.1 How Deflect fits together...... 93 11.1.2 Component...... 94 11.2 Technical Overview...... 94 11.2.1 How Deflect fits together...... 94 11.2.2 How to build Deflect from nothing...... 95 11.2.3 Notes on the sysadmin choices...... 96 11.3 Installing Deflect...... 98 11.3.1 Operating System...... 98 11.3.2 Deflect Controller...... 99 11.3.3 Deflect Edge...... 103 11.3.4 Configuration...... 104 11.3.5 Further Security...... 104

iii 11.4 Additional Components...... 105 11.4.1 Banjax...... 105 11.4.2 Swabber...... 105 11.4.3 ENCfs...... 106 11.4.4 Logging...... 107 11.5 Daily Tasks...... 109 11.5.1 Edge management...... 110 11.5.2 Check edges are serving traffic...... 112 11.5.3 Managing DNS...... 112 11.5.4 Managing partners...... 113 11.5.5 Apache Traffic Server configuration...... 114 11.5.6 Fail2ban rules...... 114 11.5.7 Revert a config change...... 115 11.5.8 Monitoring tasks...... 115 11.6 IP blacklisting and Firewall...... 116 11.6.1 IP tables...... 116 11.6.2 SYN flooding...... 116 11.7 BotNetBDP...... 116 11.7.1 Banjax and Swabber...... 116 11.7.2 IP blacklisting with Fail2ban...... 116 11.8 Origin security...... 117 11.8.1 General origin security...... 117 11.9 Monitoring...... 118 11.9.1 Nagios and Nagiosgrapher...... 118 11.9.2 awstats...... 119 11.9.3 logstash and kibana...... 119 11.9.4 Incident reporting...... 119 11.10 Deflect Apache Traffic Server...... 119 11.10.1 ATS Build Notes...... 119 11.10.2 ATS SSL...... 121 11.10.3 ATS SNI...... 122 11.11 Deflect and Apache Traffic Server...... 122 11.11.1 Design...... 122 11.11.2 Update an Apache Traffic Server plugin...... 122 11.11.3 Build new Apache Traffic Server (ATS) version...... 123

12 Localization 127 12.1 How to translate Deflect documentation...... 127

13 Contribute 129 13.1 How to contribute...... 129 13.2 Add or edit files...... 130 13.2.1 Add a new file or directory...... 130 13.2.2 Edit files...... 130 13.2.3 Add or edit files by command line...... 130 13.2.4 Contribute directly to the documentation...... 130 13.3 Important notes...... 130 13.3.1 reStructuredText...... 130

14 Support us 131

15 Як ми Вас захищаємо 133

iv Роздiл 1

Про Deflect

Deflect - це сервiс для захисту вiд DDoS-атак , призначений для неурядових органiзацiй, iнiцiативних груп громадянського суспiльства, блогерiв-активiстiв та незалежних ЗМI. Створений неприбутковою органiзацiєю у сферi цифрової безпеки eQualit.ie, цей сервiс має вiдкритий код, i є безкоштовним та ефективним рiшенням для боротьби з DDoS-атаками.

1.1 Контекст

У багатьох правозахисних органiзацiй та незалежних ЗМI немає достатьно фiнансових або технiчних ресурсiв для захисту вiд DDoS. Саме тому Deflect створений аби надати такий захист безкоштовно. Адже атаки, що здiйснюються зараженими „ботами“, здатнi зупинити роботу веб-сайту, обмежити до- ступ до нього для пересiчних користувачiв. Також цi атаки можуть ставити за цiль залякати власникiв вебсайтiв чи обмежити свободу слова в Iнтернетi. Комерцiйнi сервiси iз захисту проти DDoS атак зазвичай є дорогими чи здатнi змiнити умови користу- вання, якщо вирiшать, що певний вебсайт генерує значний трафiк. Багато наших партнерiв звернулись до нас саме в таких ситуацiях, розчарувавшись у спiвпрацi з вiдомими комерцiйними сервiсами.

1.2 Обґрунтування

Deflect - це надiйний та iнновацiйний сервiс захисту веб-сайтi, розроблений аби протидiяти “розпо- дiленим атакам на вiдмову в обслуговуваннi” - distributed denial-of-service attacks (DDoS). Цi атаки здiйснюються зараженими пристроями-«ботами» й здатнi зупинити або уповiльнити роботу веб-сайту, що став їхньою цiллю, позбавивши користувачiв доступу до сайту. Цiль подiбних атак – це також й залякати власникiв сайту. Значна кiлькiсть невеликих правозахисних та незалежних медiа-органiзацiй не здатнi самостiйно захистити себе вiд таких атак – адже це дорого й складно. Бiльше того, небагато системних адмiнiстраторiв є фахiвцями у захистi вiд DDoS. З кожним роком запобiгти DDoS-атакам стає все важче. Однак ще складнiше вiдновити роботу сайту пiсля атаки. Оскiльки запобiгання атакам є бiльш вдалим рiшенням анiж вiдновлення пiсля них, Deflect дiє проактивно: замiсть того, щоб реагувати на атаку пiсля її проведення, наш сервiс постiйно захищає

1 Deflect Documentation, Релiз 1.4.0

веб-сайти ще до виникнення будь-яких загроз безпеки. Ми не хостимо вебсайти, ми лише кешуємо їх, i потiм доставляємо до користувача контент у незмiнному виглядi через хмарну iнфраструктуру eQualit.ie. Ця iнфраструктура складається з широкої мережi надiйних серверiв, розташованих у всьому свiтi, i побудована для «поглинання» значної кiлькостi зловмисних запитiв вiд „ботiв“. Ми зробили «Deflect» безкоштовним, оскiльки ми вiримо у те, що важливiсть роботи наших клiєнтiв переважує будь-якi комерцiйнi мiркування. Насправдi, поки вебсайт не перебуває пiд атакою, робота сервiсу Deflect знижує навантаження на сервер клiєнта та зменшує обсяги роботи його системного адмiнiстратора, у пiдсумку заощаджуючи їм кошти. Увесь програмний код i документацiя розмiщенi у вiльному доступi згiдно з лiцензiєю Creative Commons, дозволяючи будь-кому створювати власнi мережi Deflect та протистояти DDoS-атакам.

1.3 Для кого призначено Deflect?

Для Вас. Розгляньте можливiсть його пiдключення! Надто часто нашi заходи щодо убезпечення вiд атак потрапляють у папку “Зробити пiзнiше”, i, коли стається екстренна ситуацiя, вона призводить до хаосу. Хоча ми надаємо захист вебсайтам саме пiд час здiйснення DDoS-атаки, набагато простiше i зручнiше зробити це заздалегiдь. Коли Ваш вебсайт починають атакувати, провайдер нерiдко здатен просто вимкнути його, й тодi захищатися вiд атаки буде запiзно. Тому плануйте захист заздалегiдь. Крiм того, Deflect - це ще й сервiс з кешування. А це означає, що ми будемо показувати користувачам Вашi веб-сторiнки без необхiдностi постiйно надсилати запити на Ваш сервер. Це знижує навантаження на Ваше обладнання та фактично пришвидшує отримання контенту Вашими користувачами.

1.4 З чого почати

1. У нас є певнi критерiї, аби ви отримали наш захист 2. Ви повиннi контролювати доменне iм’я Вашого вебсайту/вебсайтiв. 3. Ви повиннi володiти певними навичками, що дозволяють керувати Вашим вебсайтом. 4. You can provide us with all the technical information. 5. Ви повиннi усвiдомлювати, що це безкоштовна послуга, що надається eQualit.ie без контрактних зобов’язань з боку жодної зi сторiн. Детальнiше читайте у наших положеннях. 6. Ви повиннi розумiти, що команда Deflect матиме доступ до даних трафiку Вашого вебсайту.

1.5 Налаштування

Ось кiлька простих крокiв, якi потрiбно виконати, щоб долучитись до Deflect: 1. Зареєструватись на https://dashboard.deflect.ca/signup 2. Ми надiшлемо Вам електронний лист з iнформацiєю для тимчасової реєстрацiї. 3. Увiйдiть у систему та дотримуйтесь вказiвок аби налаштувати DNS, параметри безпеки та, за потреби, SSL/TLS сертифiкати Вашого веб-сайту. Детальнiше дивiться у Процедурi реєстрацiї 4. Ми отримуємо Вашу заявку, затверджуємо її вiдповiдно до наших правил та налаштовуємо Ваш вебсайт у Deflect.

2 Роздiл 1. Про Deflect Deflect Documentation, Релiз 1.4.0

5. Ви отримуєте сповiщення, що потрiбно спрямувати вашi name servers - сервера iмен (NS) на Deflect 6. Спрямуйте Вашi NS на Deflect. Ось i все!

Потенцiйним партнерам проекту необхiдно врахувати такi технiчнi деталi: • Захист Deflect за своїм задумом є проактивним та має бути iмплементованим ще до DDoS-атаки. Ви можете увiмкнути його пiд час DDoS-атаки, але нам потрiбно буде бiльше часу, щоб усе налаштувати. Щойно Ви приєднаєтесь до Deflect, Ваш веб-сайт буде закешовано у нашiй iнфра- структурi, а Iнтернет-трафiк буде проходити через нашi сервери. • Потрiбно прописати вашi DNS-записи таким чином, щоб вони вказували на хостинг Deflect. У будь-який момент Ви можете вiдмовитися вiд послуг Deflect, змiнивши записи DNS так, щоб вони вказували на оригiнальнi name servers. • Адреса Вашої веб-сторiнки залишиться незмiнною у мережi Iнтернет. Вашим редакторам потрi- бно буде зареєструватись за допомогою паролю, який Ви визначите у панелi керування Deflect. • Рекомендовано змiнити IP-адресу Вашого сервера пiсля приєднання до Deflect. • Deflect пiдтримує SSL/TLS сертифiкати для Вашого веб-сайту. Ви можете попросити нас зге- нерувати Вам сертифiкати TLS або Ви можете завантажити свiй власний у Панель керування Deflect. • Вам може бути потрiбно встановити певнi оновлення на Вашому вебсайтi, перш нiж вiн буде прийнятий проектом Deflect. Це забезпечить захист вiд вiдомих вразливостей програмного забез- печення, i Ваш вебсайт буще краще захищеним вiд зловмисних хакерських атак та DDoS. • Оскiльки Deflect - це безкоштовна послуга, ми не гарантуємо цiлодобову пiдтримку. Проте, члени нашої команди базуються на 3 континентах та працюють за монiторинговим графiком, тому зазвичай має бути хтось, хто зможе дати раду з будь-якими питаннями, що можуть виникнути.

1.6 Наш пiдхiд

Ми розгорнули розподiленi зворотнi проксi-кешi у багатьох географiчно розподiлених, недорогих хостинг-провайдерiв. Кожен хост функцiонально еквiвалентний, хоча ми перевiряємо, якi з постачаль- никiв надають сервiс найкращої якостi. Використання короткострокових time-to-live DNS, розподi- леного кешування, блек-лiстiнгу IP-адрес та iнших стандартних практик дає Deflect має можливiсть одночасно обслуговувати значну кiлькiсть клiєнтiв утримуючи низьку цiну для нас та нульову вартiсть послуг для них.

1.6.1 Дизайн

Deflect спроектовано як надiйну, недорогу, непропрiєтарну та легко вiдтворювану систему, що захищає значну кiлькiсть веб-сайтiв, якi ми називаємо «Джерелами». Система була створена таким чином, щоб працювати однаково з рiзними веб-серверами, враховую- чи деякi наведенi нижче обмеження. Вона побудована з використанням шести Debian VPS, якi ми називаємо «Вузлами», а також керуючого сервера, який ми називаємо «Контроллером». Кешування обробляється Apache Traffic Server.

1.6. Наш пiдхiд 3 Deflect Documentation, Релiз 1.4.0

1.6.2 Який захист ми пропонуємо

• Поглинаємо 99% трафiку, призначеного для Вашого вебсайту. Перегляньте нашу статистику. • Приховуємо мiсцезнаходження Вашого сервера (IP адресу). • Запобiгаємо вiдкритому доступу до редакторських панелей (тобто /admin, /login тощо). • Filtering out malicious requests using Fail2ban, Learn2ban and iptables rulesets.

1.6.3 Як працює Deflect

Для доступу до захищеного Deflect вебсайту: 1. Введiть адресу вебсайту у браузерi. 2. DNS отримає псевдонiм-alias, що вказує на наш пул вузлових серверiв. Один з цих серверiв ви- бирається за допомогою методу round robin DNS. 3. Якщо запитувана адреса дозволена i «вузол» має контент сторiнки у кешi, то вiн одразу вiдповiсть браузеру. Якщо контент не було закешовано на серверi-«вузлi», то вiн запитає його на серверi - джерелi - «Origin» - i вже потiм перешле у браузер. 4. Якщо адреса заборонена для перегляду, то браузер отримає сторiнку з вiдповiдним повiдомлен- ням. Iнфографiка нижче дає просте пояснення:

4 Роздiл 1. Про Deflect Deflect Documentation, Релiз 1.4.0

1.6. Наш пiдхiд 5 Deflect Documentation, Релiз 1.4.0

1.7 Деталi та обмеження

1.7.1 Закешованi компоненти

Deflect кешує веб-сторiнки з багатьма компонентами, включно з CSS, Javascript, мультимедiа тавели- кими бiнарними файлами. Складовi веб-сторiнки, що розмiщенi на iнших доменах («вiджети», модулi для вiдстеження трафiку тощо) обробляються у звичайний спосiб. Зараз Deflect кешує вiдповiдi по 10 хвилин. Цi налаштування можна змiнити залежно вiд iндивiду- альних потреб (наприклад, довше для бiнарних файлiв, що рiдко змiнюються, швидше для онлайн- форумiв).

1.7.2 Cookies

Хоча зараз Deflect iгнорує файли-cookies, повертаючи об’єкт з кешу незалежно вiд присутностi будь- яких cookies у запитi клiєнта, це може бути налаштовано для окремого домену та окремого шляху. Ми можемо налаштувати роботу з рiзними cookies для сайту чи його частини, утiм, цим ми фактично зупиняємо кешування цього сайту чи вiдповiдної його частини. Утiм, сайт все одно залишатиметься пiд захистом нашого фаєрволу. Запити обробляються як частина URL - окремi запити завжди будуть iнтерпретуватись як унiкальнi об’єкти та вiдповiдно кешуватись. Вiдповiдi на POST запити нiколи не потрапляють у кеш.

1.7.3 Чи Deflect працює?

Ви можете зрозумiти, чи сторiнка обслуговується Deflect, перевiривши HTTP-заголовки (використову- ючи функцiю „Inspect Element“ у браузерах Chrome чи Firefox); ви побачите рядок Via:, що повертає iндивiдуальний вузловий сервер, який обслуговує запитувану вебсторiнку.

Via:http/1.1 prometeus1.deflect.ca (ApacheTrafficServer/3.2.4 [uIcMsSfWpNeN:t cCMi p sS])

Закешована вiдповiдь, у прикладi вище [uIcMsSfWpNeN:t cCMi p sS] може бути iнтерпретована тут.

1.7.4 SSL

Deflect також пiдтримує SSL. Щоб дiзнатись бiльше, див. Пiдтримка TLS.

1.7.5 DNS

DNS сконфiгуровано для коротких TTL («time to live»), щоб уможливити швидке додаван- ня/прибирання нових елементiв до серверного пулу серверiв-вузлiв. Якщо у Вас лишились якiсь ще питання, перевiрте FAQ або напишiть нам на email i ми спробуємо вiдповiсти на Вашi питання.

1.7.6 Налаштування Deflect

Ми поступово розробляємо профiлi для рiзних веб-серверiв. Тим часом, ми можемо запропонувати окремi налаштування для: 1. Домени та їх псевдонiми (www.yoursite.org, yoursite.org)

6 Роздiл 1. Про Deflect Deflect Documentation, Релiз 1.4.0

2. Час кешування 3. Захищенi сторiнки (/admin)

1.7. Деталi та обмеження 7 Deflect Documentation, Релiз 1.4.0

8 Роздiл 1. Про Deflect Роздiл 2

Deflect features

2.1 eQpress hosting

2.1.1 eQPress FAQ

Що таке eQpress eQPress is a secure, stable and user-friendly hosting infrastructure based on the Wordpress blogging platform and protected by Deflect.

Who can have their website hosted on eQPress? eQPress offers website hosting to anyone who already uses or wants to use Wordpress for their website and qualifies for protection under the terms of Deflect’s eligibility criteria.

How can I create my site on eQPress?

If your existing website or the new website you want to create is eligible under Deflect, you can ask Deflect’s team for an eQPress account. To do so, you first need to register a domain (if you don’t have one already) andthen sign up with Deflect. When the registration is completed, you can ask Deflect’s team to create a new site for you or to migrate your site to eQPress.

How can I migrate my Wordpress-based website to eQPress?

After you have signed up with Deflect, you can migrate your site to eQPress by following these instructions, or we can do it for you. We will just need a MySQL database dump and the complete backup of your Wordpress site. This will allow us to do any tuning of the site that may be needed from the beginning.

9 Deflect Documentation, Релiз 1.4.0

Can I get my own IP?

No. To mitigate the risk of DDoS attacks, eQPress has been created ad hoc to protect your Wordpress-based website under the Deflect network, so you cannot get your own IP.

Is multisite supported?

Yes it is. eQPress supports both subdomains (sub.example.com) and subdirectories (example.com/sub).

What do you mean by secure?

Websites hosted by eQPress are secure because they are protected against DDoS by Deflect, which also protects any possible backdoors from attacks. Furthermore, the websites are hosted in hardened servers that are run by an experienced team.

Will my site be accessible on HTTPS?

HTTPS certificates can be added via the Deflect Dashboard. By following the procedure to install your TLS certificate, your website will be accessible on HTTPS.

Will my site be protected from DDoS attacks?

Yes, definitely! eQPress has been developed as a hosting platform protected by Deflect, a distributed denial-of- service (DDoS) mitigation service created to neutralize cyberattacks against independent media and human rights defenders.

What about other attacks?

Deflect doesn’t only mitigate the risk of DDoS, but also protects any backdoors from possible attacks because attackers cannot reach your actual website and will only have access to Deflect’s caching servers.

How often is my site backed up?

Websites hosted on eQPress are backed up every day, and the backup is encrypted and stored on Deflect’s servers. The system also has a mirror backup for failover. This gives our team the ability to switch to this mirror server if we have problems with the master eQPress server in the cluster.

What version of WordPress will my website run on? eQPress is based on the latest version of WordPress and updates are carried out regularly.

When will my WordPress core get updated?

WordPress periodically releases maintenance updates. These are typically for significant bug fixes or security issues. Since these upgrades might have security implications, and because WordPress’ popularity makes it susceptible to an exploit being quickly released, we attempt to apply these upgrades as quickly as possible.

10 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

Our goal is to upgrade all websites within 6 hours from the release of a version addressing security issues. All sites will be upgraded no later than 24 hours from the time when the official announcement is made on the WordPress Project’s News blog. Major releases provided by WordPress can significantly affect its compatibility with plugins and themes. Typically there are no security patches applied, therefore the urgency to upgrade is lower. We will provide guidance via our announce mailing list on how the upgrades will eventually be applied to all websites hosted on the platform.

Can I install any theme I like?

Yes, but if we find the theme to have a security vulnerability, we may decide toblockit.

Can I install any plugin I like?

Yes, but if we find the plugin to have a security vulnerability or large performance flaw, we maydecideto block it.

How do I get support?

The best way to submit a support issue is through the Deflect Dashboard.

2.1.2 Що таке eQpress

Пiсля кiлькох рокiв захисту вебсайтiв вiд DDoS-атак, ми виявили, що найслабшою ланкою у загальному захистi вебсайтiв є хостинг-провайдери (та сервери) наших клiєнтiв - у них не вистачає ресурсiв, вони не здатнi захиститись вiд базових атак та вразливi до соцiальної iнженерiї. Використовуючи досвiд нашої команди з посилення iнфраструктури та надання послуг безпеки, ми вирiшили закрити потен- цiйнi слабкi мiсця, пропонуючи безпечний хостинг разом iз захистом вiд DDoS. Ось що таке eQPress - безпечний та стабiльних хостинг зi зручним користувацьким iнтерфейсом на основi WordPress пiд захистом Deflect. eQPress пропонує хостинг окремим вебсайтам, сайтам з субдоменами (http://sub.example.com) та пiд- директорiями (http://example.com/sub) для будь-кого, хто вiдповiдає умовам надання сервiсу Deflect. Користувачi можуть створити свiй вебсайт з чистого листа або перенести свiй вебсайт на платформi Wordpress до eQPress. Щоб створити або перенести вебсайт на eQPress, Вам потрiбно спочатку зареєструватись у Deflect. Пi- сля завершення процесу реєстрацiї, Ви можете попросити команду Deflect створити Вам новий вебсайт чи перенести Ваш сайт на eQPress.

2.2 Control panel

Пiсля приєднання до Deflect, Ви зможете використовувати Панель керування, у якiй можна будеке- рувати DNS записами, додавати новi вебсайти, змiнювати налаштування Вашого облiкового запису чи мову панелi керування, повiдомляти про iнциденти, зв’язуватись з технiчною пiдтримкою, керувати налаштуваннями Ваших вебсайтiв та повiдомляти про атаки.

2.2. Control panel 11 Deflect Documentation, Релiз 1.4.0

• Бiчна панель – Сайти, захищенi Deflect-ом – Мiй облiковий запис – Двохфакторна авторизацiя – Допомога • Налаштування вебсайту – Вкладка Статистики – Вкладка записiв DNS – Вкладка «користувачi» – Вкладка «безпека» – Вкладка «налаштування» – Вкладка «HTTPS/TLS» ∗ Сертифiкати вихiдного сервера • Повiдомити про DDoS атаку • Challenging requests

2.2.1 Бiчна панель

Сайти, захищенi Deflect-ом

У роздiлi Сайти, захищенi Deflect-ом бiчної панелi Ви знайдете список вебсайтiв, якi Ви захищаєте за допомогою Deflect. Якщо Ви очiкуєте на вiдповiдь по вашому запиту, натиснувши на адресу вебсайту на бiчнiй панелi, Ви отримаєте доступ до сторiнки , на якiй можна буде перевiрити статус Вашого запиту. У цьому ж роздiлi ви зможете додати новi вебсайти, натиснувши на «Додати новий сайт». • Щоб додати новий вебсайт, який ви хочете захистити, введiть його URL у вiдповiдну форму, нати- снiсть «Додати сайт», та дотримуйтесь покрокових iнструкцiй, починаючи з Крок 1 . Зауважте, що якщо Ви хочете зареєструвати пiдсайт (наприклад, sub.domain.org), потрiбно буде додати його як новий вебсайт, натиснувши цю кнопку. Щойно Ваш вебсайт буде у системi Deflect, натиснувши на його адресу на боковiй панелi, Вам будена- дано доступ до контрольної панелi, де Ви зможете перевiрити статистику Вашого вебсайту, керувати DNS записами, додавати нових користувачвi, керувати налаштуваннями безпеки and адмiнiструва- ння.

Мiй облiковий запис

У секцiї Мiй облiковий запис, Ви можете керувати налаштуваннями облiкового запису, натиснувши на Налаштування. Так Ви отримаєте доступ до сторiнки , на якiй Ви зможете оновити Вашу email- адресу та пароль.

12 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

Fig. 1: Додати новий сайт

Двохфакторна авторизацiя

Двохфакторна авторизацiя (також вiдома як 2FA) - це механiзм безпеки, у якому користувач надає два фактори авторизацiї, щоб пiдтвердити що вони тi, за кого себе видають. 2FA можна протиста- вити однофакторнiй авторизацiї (SFA) - механiзму безпеки, де користувач надає лише один фактор - зазвичай пароль. Ви можете не вмикати двохфакторну авторизацiю, але вона додасть додатковий рiвень захисту Вашого облiкового запису. Щоб зайти у Ваш облiковий запис з увiмкненою двохфакторною авторизацiєю, Вам потрiбно буде ввести код разом з логiном та паролем. Це пiдтвердить нам, що Ви - це справдi Ви.

Fig. 2: Двохфакторна авторизацiя

На наступному кроцi Ви побачите QR код, який можна вiдсканути мобiльним телефоном та який автоматично сконфiгурує додаток для двохфакторної перевiрки, наприклад, Google Authenticator. Тут також показано резервний код, що дозволить Вам знову налаштувати генератор кодiв у разi, якщо Ви втратите доступ до пристрою. Будь ласка, запишiть його та зберiгайте у надiйному мiсцi! Пiсля того, як Ви вiдскануєте QR код, 6-значний цифровий код з’явиться на екранi Вашого телефону. Вам потрiбно буде ввести його у форму токена на екранi та натиснути «Enable two-factor authenticati- on». Тепер усе налаштовано. Якщо на якомусь етапi Ви вирiшите вимкнути двохфакторну авторизацiю, вам буде потрiбен iнший TOTP-код (time-based one-time Password), який можна згенерувати у додатку, який Ви використали для того, щоб увiмкнути 2FA. Введiть код на Вашому екранi у поле «disable two-factor authenitcation». Двохфакторну авторизацiю тепер вимкнено.

2.2. Control panel 13 Deflect Documentation, Релiз 1.4.0

Fig. 3: QR код

Fig. 4: Форма для вимкнення 2FA

14 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

Користувачiв з увiмкненою двохфакторною авторизацiєю буде автоматично перенаправлено на сторiн- ку, де їм потрiбно буде ввести їх другий фактор перед наданням доступу до облiкового запису.

Fig. 5: Форма введення другого фактору

Допомога

У цьому роздiлi Ви можете повiдомити про iнцидент або звернутись за технiчною пiдтримкою. Якщо з вебсайтом, що знаходиться пiд захистом Deflect, щось не так, або Ви вважаєте, що цi про- блеми спричиняє Deflect, будь ласка, натиснiсть «Повiдомити про iнцидент» та заповнiть форму, вказавши вiдповiдний вебсайт та надавши якомога бiльше деталей. У разi, якщо Вам потрiбна наша допомога у налаштуваннi вебсайту, клiкнiть на «Пiдтримка» та заповнiсть форму, обравши тип потрiбної Вам пiдтримки, вказавши вiдповiдний вебсайт та додавши максимум iнформацiї, що може знадобитись, у коментарях.

2.2.2 Налаштування вебсайту

Щоб керувати Вашим вебсайтом, натиснiть на його адресу на Панелi керування: Ви отримаєте доступ до контрольної панелi, де Ви зможете перевiрити статистику вашого вебсайту, керувати DNS записами, додавати нових користувачiв, та змiнювати налаштування безпеки and адмiнiстрування.

Вкладка Статистики

Вкладка статистики - це перше, що Ви побачите, зайшовши на Панель керування. Тут Ви знайдете графiки зi статистикою трафiку, що надходив на Ваш вебсайт, включно з користувачами та заблоко- ваними ботами.

2.2. Control panel 15 Deflect Documentation, Релiз 1.4.0

Fig. 6: Повiдомити про проблему

Fig. 7: Пiдтримка

16 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

Натиснувши на сiрий верх кожного графiку, Ви можете рухати графiки по екрану, i пересувати вище статистику, яку Ви вважаєте найбiльш корисною для керування Вашим вебсайтом. Якщо Ви хочете повернутись до початкового вигляду, просто натиснiсть на кнопку «Reset layout» у верхньому лiвому кутку вкладки. Коли Ви заходите у Панель керування, за замовчуванням графiки показують статистику за останнi 30 днiв, але Ви можете змiнити це значення, щоб подивитись данi за останню годину або за останнi 12 мiсяцiв, натиснувши на випадне меню часового iнтервалу у верхньому правому кутку вкладки. Якщо Ви оберете «Custom range», з’явиться меню, де Ви зможете обрати початкову дату та побачити статистику за тиждень, мiсяць або рiк, починаючи з обраної дати. Будь ласка, майте на увазi, що у зв’язку з величезним обсягом даних, як ми обробляємо, цифри у деяких випадках можуть бути приблизними (Детальнiше пояснення читайте на цiй сторiнцi). Точнiсть зазвичай варiюється у межах 90-100%, при цьому таблицi, що показують топ країн, user agents та користувачiв є найбiльш приблизними. Normally we expect logs to arrive into Dashboard within a few seconds, but sometimes there are issues with log delivery, like maintenance work or the occasional unplanned outage somewhere in the system. Data from more than a couple of days ago should always be reliable. Very recent data like «Last hour» is not guaranteed to be accurate. Iнформацiя, показана на графiках, включає: • Статистика за перiод - загальна сума: – Запитiв, отриманих Вашим вебсайтом (Усього попадань), – унiкальних вiдвiдувачiв (Унiкальнi IP-шки), – обсяг даних, що передаються з Вашого вебсайту на комп’ютери користувачiв (Передача даних)

2.2. Control panel 17 Deflect Documentation, Релiз 1.4.0

18 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

– IP-адреси, iдентифiкованi як зловмиснi та заблокованi Deflect (Забаненi боти) • Bandwidth: обсяг даних, переданих з Вашого вебсайту на комп’ютери Ваших вiдвiдувачiв про- тягом певного обраного перiоду • Requests: запити, отриманi Вашим вебсайтом • Унiкальнi IP-адреси (всього): кiлькiсть унiкальних вiдвiдувачiв, що надсилали запити на Ваш вебсайт • Забаненi Боти (всього): IP-адреси, iдентифiкованi як зловмиснi та заблокованi Deflect • Hits by country (топ 10): топ десять країн, з яких надходять запити до Вашого вебсайту, протягом певного перiоду • Banned Bots by country (топ 10): топ десять країн, з яких боти атакували Ваш вебсайт, протягом певного перiоду • Топ User Agents: браузери, якi використовуються Вашою аудиторiєю для вiдвiдування Вашого вебсайту, а також веб-роботи та краулери, що заходили на ваш сайт. Шкiдливi боти у бiльшостi випадкiв пiдробляють записи своїх User agents, маскуючись, наприклад, пiд Wordpress чи Opera - https://en.wikipedia.org/wiki/User_agent • Top Viewed Pages: найбiльш вiдвiдуванi сторiнки на Вашому вебсайтi, без врахування , тощо • Топ URL: найбiльш запитуванi об’єкти на Вашому вебсайтi, включно з усiма елементами javascri- pt, css тощо • HTTP status codes: код статусу, що входить до вiдповiдей, надiсланих Вашим вебсайтом до вiдвiдувачiв, для означення причин доступностi чи недоступностi запитуваних ресурсiв - https: //en.wikipedia.org/wiki/List_of_HTTP_status_codes • Cache Hit/Miss: Вiдсоток ресурсiв, якi були доступними в кеш-пам’ятi Вашого вебсайту, що зберiгалась на вузлових серверах Deflect («Обслуговуються з кеш-пам’ятi») та ресурсiв, якiне зберiгались у кешi та їх треба було запитувати з Вашого веб-серверу («Обслуговується з сервера- джерела») (Див. цю сторiнку, щоб дiзнатись бiльше про те, як працюють вузловi сервери Deflect • Top Countries: Рейтинг країн, звiдки надходили запити до Вашого вебсайту • Top Bot Countries: Рейтинг країн, звiдки надходили запити вiд зловмисних ботiв • Top Traffic Sources: Мапа кiлькостi запитiв, отриманих Вашим вебсайтом з кожної країни

Вкладка записiв DNS

Коли Ви реєструєте вебсайт у мережi Deflect, система Deflect автоматично визначає вашi налаштування DNS, i Ви можете просто прийняти їх або внести потрiбнi змiни, видаляючи чи додаючи записи. Якщо Вам потрiбно змiнити DNS записи, коли Ваш сайт вже захищено Deflect, Ви можете натиснути на вкладку «записи DNS» у Панелi керування. Кожна змiна, яку Ви вносите до Ваших DNS записiв проходить через процес валiдацiї, що перевiряє, чи внесенi змiни правильнi та чи записи DNS достовiрнi. Якщо змiни коректнi, їх буде застосовано автоматично. Як можна буде побачити, Контрольна панель також проiнформує Вас, якщо Вашi змiни очiкують розгляду чи їх було застосовано - щоб дати Вам максимальний контроль за кожною опера- цiєю. Ось коротке пояснення DNS записiв та їх значення: • A website.com 129.128.127.210 -> це головний (адресний) запис домену, також вiн називається джерелом IP чи кореневим записом.

2.2. Control panel 19 Deflect Documentation, Релiз 1.4.0

Fig. 8: Вкладка записiв DNS

Fig. 9: змiни очiкують розгляду

20 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

• CNAME www website.com -> зазвичай це псевдонiм (СNAME), який дозволяє людям вводити www.website.com та переходити на Ваш вебсайт • MX website.com mail.website.com -> цей запис для електронної пошти (MX), наприклад [email protected] • A mail.website.com 129.128.127.210 -> цей запис дозволяє надсилання електронної пошти на Ваш сервер. Вiн пов’язаний з вищезгаданим записом MX • NS ns1.website.com -> адреса сервера, що вiдповiдає за Ваш домен. Ви можете залишити цей запис незмiнним • TXT website.com „This is a test“ -> iнодi до домену додається текстовий запис (TXT). Ви можете залишити цей запис незмiнним

Вкладка «користувачi»

Щоб керувати користувачами Вашого вебсайту, натиснiть на «користувачi» у панелi iнструментiв. З’явиться вiкно з перелiком iснуючих користувачiв та формою для додавання до Панелi керування Deflect нових користувачiв. Якщо Ви хочете дозволити новим користувачам мати доступ до обраного вебсайту, просто введiть електронну адресу нового користувача у форму та натиснiсть на кнопку «Додати користувача». Нового користувача буде додано до списку «Current users».

Fig. 10: Вкладка «користувачi»

Вкладка «безпека»

Натиснiть на вкладку «безпека» у панелi iнструментiв для отримання доступу до налаштувань без- пеки Вашого вебсайту. Тут Ви зможете змiнити Облiковi данi адмiнiстратора для отримання доступу до роздiлу редагування Вашого вебсайту (наприклад, до адмiнiстраторського iнтерфейсу Wordpress чи Joomla), також Ви можете додати чи змiнити Вашi SSL/TLS сертифiкати.

Вкладка «налаштування»

Вкладка «HTTPS/TLS»

Deflect може автоматично обслуговувати Ваш вебсайт через зашифрований HTTPS канал. Щобдiзна- тися бiльше, див. документ Налаштування HTTPS / TLS.

2.2. Control panel 21 Deflect Documentation, Релiз 1.4.0

Fig. 11: Вкладка «безпека»

Fig. 12: Вкладка «налаштування»

22 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

Якщо Ваш вебсайт вже пiдтримує HTTPS зв’язок, Вам потрiбно буде додатково налаштувати TLS. Ви можете використати Вашi iснуючi сертифiкати чи згенерувати новi сертифiкати вiд Let’s Encrypt, щоб використовувати їх на серверах Deflect.

Fig. 13: Налаштування HTTPS/TLS

Fig. 14: Публiчнi TLS Сертифiкати

Fig. 15: Опцiї HTTPS

Сертифiкати вихiдного сервера

• Для того, щоб Deflect згенерував Вам свiй кореневий сертифiкат, натиснiсть на кнопку «Let Deflect generate a certificate and key bundle». • Щоб згенерувати сертифiкат самостiйно та завантажити Certificate Signing Request у Deflect, оберiть опцiю «Завантажити запит на пiдпис сертифiкату» та вставте ваш СSR з кодуванням .pem у форму, що вiдкриється автоматично. Пiсля натискання на кнпоку «Generate Origin certificate bundle» сертифiкат буде згенеровано автомати- чно та з’явиться у списку згенерованих кореневих сертифiкатiв. Натиснiть кнопку «Download bundle», щоб завантажити .zip файл iз файлами, якi Вам треба буде iнсталювати на Вашому веб-серверi для встановлення TLS зв’язку з Deflect.

2.2.3 Повiдомити про DDoS атаку

Якщо у Вас є переконливi причини вважати, що один з Ваших вебсайтiв знаходиться пiд атакою, Ви отримаєте доступ панелi керування вiдповiдним вебсайтом натиснувши на його назву у боковiй

2.2. Control panel 23 Deflect Documentation, Релiз 1.4.0

панелi Deflect websites. Одразу бiля назви вебсайту, у верхнiй частинi екрану, натиснiть на «My site is under attack», i потiм натиснiть на «One of the above applies, my site is under attack» на наступному екранi. Команду Deflect буде негайно повiдомлено, що Ваш вебсайт знаходиться пiд атакою та збiльшить рiвень захисту для нього.

Fig. 16: Мiй сайт знаходиться пiд атакою

2.2.4 Challenging requests

When a DDoS attack is not automatically mitigated by Deflect rules and begins to have a negative impact on your server, you can enable the Challenger filter. It will help Deflect distinguish between real website readers (who are using a web browser) from automated bots. Challenger does this by serving everyone who requests access to the website a mathematical challenge in JavaScript: the SHA-inverse challenge and Captcha challenge. The browser solves the challenge and sends back their reply. The bot cannot do this. When a challenge has been solved, Deflect returns a cookie to the reader’s browser. No further challenges are required from this reader for the next 24 hours. For the challenger to work JavaScript needs to be enabled. BotnetDBP can be configured to serve challenges to each computer requesting content, allowing only those which solve the challenge successfully to proceed. General information about the challenger and the white listing process can be found on this page.

24 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

2.3 HTTPS/TLS support

2.3.1 TLS/HTTPS: protect your website’s visitors“ privacy

When someone visits your website by entering a common URL starting with http:// their logins and passwords and other confidential data can be intercepted by undesired third parties. Strongly motivated attackers can even alter visited pages to try injecting malware into your users“ browsers. Threats like these can be prevented by allowing your readers to access your website through a so-called encrypted tunnel TLS encryption, by using a URL starting with https:// instead of http:// (in many browsers you will see a green padlock next to the address bar when https:// is used). This option must be made available by the administrator of the visited website, and this page explains what you can do. It’s free and easy to enable TLS on your website with Deflect, as users“ safety is our first concern. Read **this guide** to learn how to set up your website to make TLS encryption available to your visitors.

How TLS/HTTPS works on Deflect

Normally when two computers communicate securely, without a caching proxy service like Deflect, the client (for example a browser) requests the server’s TLS certificate, checks that it trusts the certificate, then encrypts the connection using it. ISPs, businesses and governments - those who own the networks, or any other actor sitting in the middle between the client and the server - cannot look at what’s inside the communication. This is a good solution to prevent ill-intentioned intrusions between your readers and your website, but it clearly defeats the purpose of the distributed caching. This is because the caching proxy server, like other middle parties, does not have access to the encrypted data and is therefore unable to cache it. To overcome this problem, Deflect has developed a system that creates two encrypted tunnels instead of justone- for the connection between the public and the Deflect edges where your website is cached, the other forthe connection between the Deflect network and your actual website (origin). Deflect offers several options to encrypt connections to your website, and can generate TLS certificates both for encrypting connections between your readers and the Deflect edges (public-facing certificates) and between the edges and your website (origin certificates). Deflect generates public-facing TLS certificates through Let’s Encrypt, a certification authority (CA) launched in 2015 and co-founded by the Electronic Frontier Foundation that issues free and easy-to-install SSL certificates with the explicit aim of facilitating and spreading the use of web cryptography. SinceLet’s Encrypt certificates need to be renewed frequently, to encrypt connections between edges and yourweb server Deflect uses longer-lasting origin certificates signed by itsown certification authority. Of course, if you already have a TLS certificate, you can use it to encrypt connections between Deflect and your website (origin certificate) as well as between the public and the edges (public-facing certificate), but inthelatter case you will need to share your private TLS key with us. If you would rather not share it with anybody, we can generate a Let’s Encrypt certificate to encrypt connections that reach any of the Deflect edges while connections between Deflect edges and your web server will be encrypted by your own certificate. If you are not familiar with TLS but think that encrypting connections to your website is a good idea, we are willing to help! Contact us through the dashboard panel and we will look for a solution that can work for you.

2.3. HTTPS/TLS support 25 Deflect Documentation, Релiз 1.4.0

Fig. 17: Deflect TLS scheme

26 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

Enable HTTPS connections to your website under Deflect

If you are enabling HTTPS connections for the first time on your website and you don’t have a TLS certificate yet, you have 3 options:

Ask Deflect to do everything for you

Fig. 18: TLS option1

You can ask Deflect to do everything for you: we will generate a public-facing Let’s Encrypt certificate to encrypt connections between your readers and Deflect edges, and an origin certificate to secure connections

2.3. HTTPS/TLS support 27 Deflect Documentation, Релiз 1.4.0 between Deflect and your website (see option 1in the public-facing certificate setup guide and option 1 in the guide to the Deflect Dashboard Control Panel). This option is recommended if you are not familiar with OpenSSL. Both public-edge and edge-origin communi- cations will be encrypted and the edge can validate that it is talking to your server rather than some other server impersonating yours.

Generate your origin certificate and have it signed by Deflect

Fig. 19: TLS option2

If you feel comfortable using OpenSSL, Deflect will only generate a public-facing Let’s Encrypt certificate,

28 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0 while you generate your origin certificate and have it signed by Deflect so that connections between edges and origin can be validated and Deflect can be sure that it is talking to your server (see option1in the public-facing certificate setup guide and option 2 in the guide to the Deflect Dashboard Control Panel. This is an advanced option, recommended if you are comfortable using OpenSSL and creating a certificate signing request. You won’t need to share your private key with Deflect, and the edge will still be able to validate your origin certificate.

Generate a self-signed origin certificate

Fig. 20: TLS option3

2.3. HTTPS/TLS support 29 Deflect Documentation, Релiз 1.4.0

You can also generate a self-signed origin certificate without having it signed by Deflect. Deflect will only generate a public-facing Let’s Encrypt certificate, while connections between Deflect and your website will be encrypted through your own self-signed certificate (see option 1in the public-facing certificate setup guide. You can choose this option if you would rather not share your private key with anyone but have no experience with certificate signing requests. All connections will be encrypted, but Deflect will not be able to confirmthat the certificate really belongs to you. If your website already accepts HTTPS connections and you have a TLS certificate that you would like to keep using, you have two options:

Upload a custom TLS certificate bundle

Upload a custom TLS certificate bundle - in this case, both connections to Deflect and connections between Deflect and your website will be encrypted through your TLS certificate (see option2in the public- facing certificate setup guide. This option allows you to keep using the certificate you have already generated, but requires you to share your private key with Deflect.

Use a third-party certificate on your origin server

Ask Deflect to generate a public-facing Let’s Encrypt certificate while you useyour third-party certificate as an origin certificate (see option 1 in the public-facing certificate setup guide. This option allows you to keep using the certificate you have already generated without having to share your private key with anyone.

2.4 Deflect Mitigation Tech

2.4.1 Banjax authentication

When your website is behind Deflect, requests for a new page will come from our caching servers. Thismeans that they may be several minutes old and may not have the very latest updates. This is not ideal for when you are editing the website and need to see updates immediately. Deflect provides a special way to authenticate yourself to the system and access your website without caching. We call this Banjax authentication. After you have created the password in the Dashboard, the login page to your website (e.g. /wp-admin, /login, /administrator, etc.) will appear like this: Only those in possession of the authentication password will be able to proceed. This has an extra side effect of protecting your website editorial from password brute-force attacks.

2.4.2 Cookies

Cookies in Deflect

Deflect widely supports cookies, although they are sometimes controversial: for example, cookies aresubject to legal regulation in certain countries. In the interests of privacy, they may be disabled by users or system administrators.

30 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

Fig. 21: TLS option4

2.4. Deflect Mitigation Tech 31 Deflect Documentation, Релiз 1.4.0

Fig. 22: TLS option5

32 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

Fig. 23: Banjax Authentication

The Cookie request header and Set-Cookie response header are end-to-end HTTP headers, and therefore normally propagated intact by HTTP proxies. However, the propagation of Set-Cookie headers as-is may be insufficient in a reverse proxy. The Set-Cookie header may contain Path and Domain information thatare valid for the origin server, but are incorrect or meaningless when a reverse proxy has remapped the URL space. Cookies may also affect cacheability, and hence performance. The issue of rewriting URLs in a reverse proxy is discussed at http://www.apachetutor.org/admin/ reverseproxies. Cookie path and domain information are one element of that rewriting. It is implemented in Apache HTTPD’s mod_proxy through the ProxyPassReverseCookiePath and ProxyPassReverseCooki- eDomain directives.

2.4.3 BotnetDBP

Deflect’s extensive network of caching servers is built to absorb and mitigate traffic inflicted bysustained DDoS attacks. There are, however, many scenarios in which it is more efficient to actively and accurately differentiate between legitimate and malicious requests in order to further reduce the load on the network. Previously, Deflect had been using Fail2ban to perform detection and prevention duties. As a simple brute force prevention tool, Fail2ban cannot offer all the complex preventative tasks required by Deflect. Wehad planned to extend the tool’s capabilities but as the attacks grew in strength and complexity, the fundamental shortcomings of Fail2Ban became apparent so we decided to develop our own high-performance, integrated prevention system called Botnet Detection Banning and Prevention, or BotnetDBP for short. BotnetDBP is comprised of the following core components:

2.4. Deflect Mitigation Tech 33 Deflect Documentation, Релiз 1.4.0

Banjax

Banjax is responsible for early stage filtering, challenging and banning of bots, identified via regular expression (regex) matching, in conjunction with the Swabber module. Banjax allows for per site configuration of either SHA-inverse proof-of-work or Captcha challenges. These challenges are served as a simple method to detect bot requests that have not been intercepted by one of the system configured regexes. The Banjax module is integrated into the ATS proxy server working as a filter which intercepts and analyses HTTP requests before any content is served. This tool has a number of functional operations. It allows for the use of regular expression (regex) banning, SHA-inverse challenging and generation of Captchas. Additionally, it provides whitelisting capabilities to prevent banning of allowed bots as well as legitimate automated requests. The three Banjax functionalities are enabled as filters in banjax.conf. Additionally Banjax can gather and submit the detailed information on each request to Botbanger for further analysis of the requester behavior.

Regex detection

In the majority of large-scale attacks, clear and distinct patterns can be found in each attacker’s requests, allowing BotnetDBP to be fed with regular expressions to find these patterns and ban any bot whose requests show up with them at a given rate. The regex filter is basically imitating Fail2ban’s capabilities but witha greater level of efficiency needed for DDoS defence. This is done before serving any such requests andhas proven crucial when particularly weak origins are under attack by a significantly large network of bots. The regex filters are defined as a series of rules indicating the circumstance within which a givenrequest should be banned. The parameters supported are: • Rule - is the human readable name for a given regex to be banned. • Regex - contains the regular expression string that a request will be tested against. • Interval - is the window of time between requests that Banjax should consider. • Hits_per_interval - is the number of hits for a given time window that Banjax should consider before banning a given IP address. The actual banning is calculated as 1/1000 x hits_per_interval. This means that for a given interval, Banjax considers the number of requests per millisecond and when it crosses the allowed threshold, a ban is implemented.

Challenging the request

The caching proxy does not offer an effective measure to prevent cache-busting attacks. In this typeof attack, each bot requests a new, unique resource from the network. Because each request is different from the previous one, there is no copy of such a resource in the caching proxy so all the requests reach the origin,

34 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0 effectively amplifying the DDoS attack by the number of proxy servers. This strategy essentially turnsthe Deflect network against the very people we are trying to help. To prevent this, BotnetDBP can be configured to serve challenges to each computer requesting the content, allowing only those which solve the challenge successfully to proceed (automatic detection of cache-busting has been implemented and will be deployed shortly). The Challenger filter supports two methods for HTTP requests: SHA-inverse challenge and Captcha challenge. These functions are primarily intended to mitigate cache-busting attacks but also serve to ensure the legitimacy of the request and to provide a mechanism to slow traffic during a heavy load. • The SHA-inverse challenge asks the user browser for an inverse image of partial SHA256 value via Javascript. This ensures that traffic is originating from a legitimate browser rather than from apre- programmed Bot. This challenge is seamless for the user as it occurs as part of the interaction between their browser and the server. • By contrast, the Captcha is presented directly to the user, who must correctly solve the visual challenge and submit their answer before gaining access to the site’s content. Banjax users can configure Challenger by the following parameters: • the number of times a requester can fail a challenge before they are banned • the difficulty level (the time taken for the browser to solve the SHA256 inverse problem) • the length of time that a solved challenge can grant access to the requester Additionally, there is a key which ensures that the cookies passed to and from the user have not been tampered with or manipulated and the tool can also be configured for multiple hostnames, allowing for different challenges to be set per host.

Automatic detection of bot behaviours

Banjax gathers details of each request and submits them to Botbanger. Botbanger then computes statistical features from the browsing behaviour of each client and compares the clients“ behaviours against known botnet behaviour patterns. Depending on the results of this comparison, either the client is immediately banned or a challenge is presented to test their authenticity.

White Listing

The Banjax tool can also be configured to allow HTTP requests for specific IP addresses via the WhiteLister in order to interact with the server without interference.

Swabber

2.4. Deflect Mitigation Tech 35 Deflect Documentation, Релiз 1.4.0

Swabber is responsible for managing the actual banning of IP addresses identified by either Banjax or Learn2ban. It uses a ZMQ-based pub-sub mechanism for communication and bans the given IP addresses via IPTables to block identified malicious IP addresses at the TCP level. Swabber has been implemented with several configurable parameters for greater flexibility: • bantime - describes the amount of time that malicious IP addresses should be banned from further HTTP requests. • bindstrings - provides the list of addresses on which to listen for bans. • interface - legitimate ban source to interact with • backend - Swabber supports the following methods of banning: – raw ∗ IPTables commands – python-iptables library – host.deny

Learn2ban

Огляд

Learn2Ban is an open source module designed to introduce intelligent, adaptive features to botnet detection and banning by using a machine-learning approach. While regular expressions work to frustrate most brute force attacks, they are still vulnerable to even minor changes in the pattern or content of requests sent during a Denial of Service attack. By simply rotating the User Agent field or tuning the timeframe of attacks, assailants are able to work around a traditional Fail2Ban-style system. This failing in regex-only banning occurs because each request is considered on its own rather than in the context of all the requests made by a particular IP. Thus each time the IP makes a request, its past behaviour is essentially wiped clean, akin to changing its fingerprints every time. Learn2ban, by contrast, works as an adjunct to the Banjax module by taking an abstract viewpoint of HTTP requests and differentiates legitimate users from attacking botnets. In so doing, it blocks only those requests which meet the criteria for being considered a bot. Using machine-learning techniques, the system can make decisions about whether or not a given request is spurious. This decision-making capability is contingent upon a range of available information, thereby increasing the number of attack dimensions that can be considered at once. In order to detect botnet behaviour, it is not enough simply to match a recurring pattern; rather, based on a broad range of example data, Learn2Ban is capable of highlighting and capturing significant patterns of behaviour. These patterns act

36 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0 as the fingerprints which identify a DDoS attack. Learn2Ban is an open source module designed to introduce intelligent, adaptive features to botnet detection and banning by using a machine-learning approach.

Machine-learning in brief

In the case of Learn2Ban, our use of the term machine-learning refers to a process of classification. For any given set of data, we want to determine algorithmically which pieces of information represent genuine requests to our servers and which are malicious attempts to damage the system. Machine- learning works by training the system to correctly classify requests, based on presenting it with the sample data of past DDoS attacks. The greater the number and variety of sample data presented, the broader the capability of the model will be. In other words, the more types of DDoS attacks the system sees, the more accurately it will be able to deflect them. To this end, eQualit.ie has collected a wide range of example logs that detail the many different narratives of DDoS attacks. These logs are annotated, initially using Banjax filters such as Javascript and Captcha Challenges, in order to distinguish between genuine and malicious requests. The annotated logs are then presented to the Learn2Ban system and a model is constructed and tested against attacks it has never seen before. The model is measured for initial accuracy and then multiple experiments are run to refine it until the model is regarded as no longer improvable. The goal is to create a model that is very good at catching specific attacks and still able to recognise new patterns when they first arise. The determination as to whether a given IP address is malicious is done based on comparisons with pre- computed Support Vector Machine (SVM) models. These models are learned from existing attack examples chosen to allow the greatest coverage of potential attack types.

Learn2Ban concept

Learn2Ban has been designed to work as an additional filter for the Fail2Ban system, building on the existing protocols for blacklisting, banning and blocking attacks. This new extension of its capabilities does not affect the standard operability for Systems Administrators and Operations Systems. Once a suspect IP address has been identified, the predefined rules for (temporarily or permanently) banning the IP are enforced through the Fail2Ban system. Learn2Ban has the added advantage of reducing administration overheads, since it is no longer necessary for Admins to notice attacks - either through system alerts or, in a worst-case scenario, through systems going offline. In its place, Learn2ban proactively detects attacks and responds accordingly to the utilised patterns.

Implementation

As with all BotnetDBP components, Learn2ban works as a standalone module. It can integrate seamlessly with the other moving parts of the Deflect system but can also be easily adapted by others for theirown projects. It takes into account several features of an HTTP request in making its determination. These range from frequency of request to rotation of User Agent for the same IP address, as well as browsing behaviour. Rather than dealing with a single dimension of information, as in the case of a regex filter, Learn2ban is able to consider a requesting IP address’s behaviour as a whole over a given period of time. The primary algorithm used is an SVM as a binary classifier due to its efficiency in the detection phase.A number of features were implemented to model user browsing behaviour as a vector; features 1 through 7 were implemented in the primary phase and features 8 through 10 were added in the optimization phase. The following is a list of the features considered: 1. Average request interval - this feature essentially captures the rate of request. An abnormally high rate would be a strong indication that the associated IP is performing an attack.

2.4. Deflect Mitigation Tech 37 Deflect Documentation, Релiз 1.4.0

2. User Agent cycling - in order to frustrate attempts by a traditional regex or pattern-based system, such as Fail2Ban, attackers will generally rotate the User Agent they make per each request. This has the effect of limiting the efficacy of a hard-coded regex. By considering this behaviour in thecontext of the associated IP’s overall behaviour, Learn2Ban aims to see through this obfuscation. 3. Page depth request - human users will generally browse through a site in ways which lead to a deeper link exploration than an automated bot is inclined to do. Thus if an IP is generally only requesting certain front-end pages rather than digging into the site, this feature will highlight that behaviour. 4. Request Depth Standard Deviation - As an adjunct to the depth of a request, this feature considers the standard deviation of a bot’s request. 5. HTML to Image/CSS ratio - again, unlike a human user, bots will not usually cause requests to load additional content such as images or CSS, since the request is neither focused widely nor browser-based in general. 6. Variance of request interval - in this case, bots are again unmasked by their fundamental behaviour. Unless the attacker has the foresight to build in an algorithmic random-wait interval between requests, the request interval variance will once again expose the attack. It is quite difficult to model the stochastic behaviour of a human user, so given a large enough sample set, a pattern will generally emerge in the behaviour of a bot. 7. Payload size - if an IP is consistently requesting large files - such as PDFs - this is a good indication that it is an intentional attack to waste server resources. 8. HTTP Response Code Rate - this feature considers the type of request that a requester is causing. In many cases, a bot will deliberately cause an error request or make requests for non-existent pages. The latter is a deliberate attempt at a cache-busting attack. In this scenario, the botnet attempts to turn the caching servers against the origin site forcing them to attempt to update their caches for non- existent pages. In this circumstance, the proxy servers essentially switch sides and become an extension of the attacking force, bombarding the protected host with requests. 9. Session Length - this feature also elucidates general behaviour considering the requester’s interaction with a given site in terms of session time. 10. Percentage Consecutive Requests - to further elucidate the requester’s interaction with a given site, we additionally consider how many of the requests made were consecutive as another window onto frequency. Supervised learning was employed during the training phase. We distinguished between bots and human users by recognizing attacking users in attack logs and identifying them using regular expressions. Later classification was based on this initial training. Minimum Redundancy Maximum Relevance (mRMR) and a second method based on Principal Component Analysis (PCA) were used to rank the effectiveness of the features in detecting bots from human users. mRMR indicates that, overall, features 1, 9, 4 and 3 were of most importance respectively, with feature 1 appearing significantly more important than any other feature. PCA results are mostly consistent with mRMR measures, indicating features 8, 4, 3 and 1 as the most important features. In a recent attack on the Deflect network, feature 2 was by itself able to detect all bots with 100% accuracy. The addition offeatures 8 and 9 in the optimization phase did much to improve the accuracy of some models, in some cases raising efficacy of detection from 70% to 90%. Through experimentation, the accuracy of the Learn2ban tool has been determined to be at 90% and above (i.e. both false positives and true negatives amounted to less than 10%). In several cases, accuracy of 99% was achieved.

38 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

2.4. Deflect Mitigation Tech 39 Deflect Documentation, Релiз 1.4.0

Learn2ban is fully configurable by end users. For example in the event of a high rate of attack itmay be preferable to ban all IP addresses with greater than 75% certainty of being a bot whereas in low load situations a threshold of 95% would be the optimal setting. The tool, as well as a variety of use cases and configurations, are all fully available and fully open sourced on Github.

40 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

Botbanger

Botbanger is the component responsible for using the SVM model constructed by Learn2Ban to test HTTP traffic and determine the legitimacy of the requester in realtime. The core functions of the tool are as follows: 1. gathering of log data 2. building a feature set of requesting IP addresses 3. calculating the probability of each requester being a bot. Data aggregation and retrieval is done by the Botsniffer tool which passes the log data to Botbanger for parsing. The log line is converted into a vector matching the feature set considered by the Learn2ban SVM model. After this feature set has been derived, the model prediction functionality is called and the result is recorded. The decision to ban is based on statistical evidence and thus requires multiple examples to have accuracy, so for each interaction with the Deflect network, information about a given IP is logged. If the IP continues to make requests, Botbanger will build a narrative of its behaviour and recalculate the likelihood of its legitimacy for every new request received. By analysing the determined features for a given IP address, paired against the pre-defined models and based on its threshold certainty, the address is then identifiedas either legitimate or malicious. In the event that an IP is determined to be malicious, it is marked and sent to the Swabber module for banning at the IP Tables level. The tools are easily configurable by system administrators and provide extensive tuning capabilities for specific scenarios. As the project has been built entirely modularly, it is also possible for the componentsto be used independently or integrate into new systems. Because our approach is to share information, knowledge and skills as much as possible, we have documented a number of our attack experiences over time. You can read about them here. BotnetDBP is currently deployed in the live Deflect network and has performed extremely well under heavy DDOS load. Code and READMEs for the various tools listed within are available on Github.

2.4.4 Challenger

When a DDoS attack is not automatically mitigated by Deflect rules and begins to have a negative impact on your server, you can enable the Challenger filter. It will help Deflect distinguish between real website readers (who are using a web browser) from automated bots. Challenger does this by serving everyone who requests access to the website a mathematical challenge in JavaScript. The browser solves the challenge and sends back their reply. The bot cannot do this. When a challenge has been solved, Deflect returns a cookie to the reader’s browser. No further challenges are required from this reader for the next 24 hours.

2.4. Deflect Mitigation Tech 41 Deflect Documentation, Релiз 1.4.0

Fig. 24: BotnetDBP scheme

42 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

Information for website readers In order to successfully receive and process a challenge, your browser will need to have JavaScript enabled. If you are using a JavaScript blocker like e.g. «NoScript», it will result in an error message telling you that JavaScript is blocked and should be enabled:

Fig. 25: NoScript blocking JavaScript on the Black Lives Matter website

Information for Deflect clients Challenger is a strong measure of defense. It will not only block all malicious traffic, but also legitimate traffic. This may result in website crawlers not being able to access your website. Use Challenger asalast resort. We have white listed the following crawlers and IPv4 address ranges to make sure websites behind the challenger can still be indexed: # Google crawler # PayPal IPN servers # Facebook # Testing Website or crawler banned? If the challenger filter blocks your website or crawler we can white list your IP address. Please submit a ticket to the Deflect team and provide the following information: • Name of your organization and a brief description of work • Link or IP address / ranges If your request is legit we will add your website or crawler to the white list. Banjax Challenger Code

2.4. Deflect Mitigation Tech 43 Deflect Documentation, Релiз 1.4.0

Here’s a link to the code served by Challenger. It should only take a second or two for your computer or smartphone to solve the challenge. For more information about BotnetDBP, Banjax, early stage filtering and challenging and banning of bots, you can navigate to this page

2.5 Deflect Labs

2.5.1 Technical Details

Deflect Labs tests and defines the limits of attribution in the current and evolving landscape of DDoS attacks. At the core, the Deflect network is capable of logging information about any and all aspects of theweb traffic sent to origin web servers (this includes traffic over SSL). This means that (unless the clientrunning a Deflected website requests us not to keep logs) for each visitor accessing the Deflect network it ispossible to record or otherwise ascertain: • Site accessed • Browser user agent • Deflect server queried • Time of request • Response code to the request • Cache status of the request The key elements of Deflect Labs are:

BotHound

BotHound is an automatic attack detector and botnet classifier. Its purpose is to create a historical classifi- cation of the attacks with detailed information regarding the attackers (country-based, time-based, etc.). In brief, what BotHound does is: • detecting anomalies in traffic • clustering the IPs into groups of botnet or non-botnet IPs, and • classifying the attacks. More in detail, BotHound detects and classifies the attacks using the anomaly-detection and machine-learning tool GreyMemory. When GreyMemory detects an anomaly, the BotHound attack classifier reacts to the detection and starts gathering live information from the Deflect network in order to compute a behaviour vector for all visitors of the network. BotHound groups the clients’ IPs in different clusters in order to profile the group of malicious visitors and then feeds all the behaviour vectors of bot IPs into a classifier to detect if the botnet has a history of attacking the Deflect network in the past. Finally, BotHound generates a report based on the conclusions, sends it to Deflect’s sysops and gets feedback to improve its classification performance.

Визначення

• Session - an IP and a vector of features values recorded and calculated during a period of the IP’s activity

44 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

• Feature - an individual measurable property of a session • Incident - a set of sessions recorded during a time interval • Attack - a subset of sessions in an incident which was labeled as an attack • Botnet - a list of IPs that participated in similar attacks

Modules

Fig. 26: BotHound scheme

• Anomaly Detector - monitors anomalies in traffic and triggers incident recording in case of anomalies. Incident recording (gathering live information from the Deflect network) in BotHound is triggered by anomaly detector tool Grey Memory. Currently, Grey Memory is monitoring only one channel: the percentage of failed HTTP requests. • Session Computer - requests detailed logs from Elasticsearch and Sniffles for each incident, creates sessions and calculates session features (inherited from Learn2ban.) Feature selection is extremely important and has a huge impact on clustering. Currently feature selection is not automated and is performed manually as a part of the clustering process. • Clustering & Attack Detection - semi-supervised tool for labeling a subset of incident sessions as an attack. Currently clustering involves human interaction. The user visually examines a 10-dimensional feature space for every incident and selects features for clustering. Then, using different clustering

2.5. Deflect Labs 45 Deflect Documentation, Релiз 1.4.0

methods (DBSCAN and K-means), the user visually chooses and labels the group of sessions (clusters) with a manually chosen attack ID. We use an approach which we call “double clustering”: we use DBSCAN in a first iteration and then, in a second iteration, we use K-means for dealing with suspected clusters from the first iteration. • Botnet Database - a database for all the confirmed attacks and botnets with all the correspondent metrics (IPs, features, history, analytics, comments).

GreyMemory

GreyMemory is the part of the Deflect Labs system that spots changes in the patterns of traffic arriving from website visitors and decides whether they are significant. It can either observe live data or workon historical logs. The module carves up time into fixed-length segments and then, based on the traffic ithas seen in previous segments, tries to predict what the data in the next segment should look like. If the data is significantly different from its prediction, GreyMemory notes this as an anomaly, and when therateof anomalies exceeds a certain threshold, it flags the event for analysis by BotHound.

Sniffles

Traditionally, Deflect edges are low-cost Linux VPSs or dedicated servers existing in heavily filtered colocation facilities. Sniffles is a pair of Linux systems with a dedicated unfiltered Internet uplink and alargepoolof IP addresses available. One machine is in practical terms a typical Deflect edge. The other is a Linux router sitting between the edge and the unfiltered Internet connection, able to capture all traffic (including UDP- or ICMP-based attack traffic, which is typically heavily filtered before itreaches traditional edges) and then forward legitimate traffic to the edge server, where it is handled as normal. Each Deflect-protected site is assigned a dedicated unique IP address by Edgemanage from the pool available to the router, giving a reliable indication of which site is under attack at any given time (frequently missing from attack traffic against a shared IP address with name-based virtual hosting). Sniffles primary outputs are: • reliable identification of attack target; and • raw pcap or flow data regarding an attack. Each of these outputs can be considered an input into both Opsdash and BotHound.

Learn2ban

Огляд

The goal of this project is to introduce intelligent, adaptive features to the Fail2Ban system. While regular expressions work to frustrate most brute force attacks, they are still vulnearable to even minor changes in the pattern or content of requests sent during a Denial of Service attack. By simply rotating the User Agent field or tuning the timeframe of attacks, assailants are able to work around the traditional Fail2Ban system. Using Machine Learning techniques, the system can make decisions about whether or not a given request is spurious. This is contingent upon a range of given information and increases the number of dimensions that can be considered at once. It is not necessary to simply match a recurring pattern; rather, based on a broad range of example data, Learn2Ban is capable of highlighting and capturing significant patterns of behaviour. These patterns act as finger prints which identify a DDoS attack.

46 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

Machine Learning in brief

In the case of Learn2Ban, our use of the term Machine Learning refers to a process of Classification. For any given set of data, we want to determine algorithmically which pieces of information represent genuine requests to our servers and which are malicious attempts to damage the system. Machine Learning works by training the system to correctly Classify requests, based on presenting it with the sample data of past DDoS attacks. The greater the number and variety of sample data presented, the broader the capability of the model will be. In other words, the more types of DDoS attacks the system sees, the more accurately it will be able to deflect them. To this end, eQualit.ie has collected a wide range of example logs that detail the many different narratives of DDoS attacks. These logs are annotated, initially using Fail2Ban filters, to distinguish between GENUINE and MALICIOUS requests. The annotated logs are then presented to the Learn2Ban system and a model is constructed and tested against attacks it has never seen before. The model is measured for initial accuracy and then multiple experiments are run to refine it until the model is regarded as no longer improvable. The goal is to create a model that is very good at catching specific attacks and still be able to recognise new patterns when they first arise.

Learn2Ban

Learn2Ban has been designed to work as an additional filter for the Fail2Ban system, building on the existing protocols for blacklisting, banning and blocking attacks. This new extension of its capabilities does not affect the standard operability for Systems Administrators and Operations Systems. Once a suspect IP address has been identified, the predefined rules for (temporarily or permanently) banning the IP are enforced through the Fail2Ban system. Learn2Ban has the added advantage of reducing administration overheads, since it is no longer necessary for Admins to notice attacks - either through system alerts or, in a worst-case scenario, through systems going offline. In its place, Learn2ban proactively detects attacks and responds accordingly to the utilised patterns.

Implementation Details

At present, Learn2Ban is using the Support Vector Machine classification algorithm; however, we have designed the system so that it is completely agnostic of what classifier it uses. It can use any classifier supported by the Sklearn Python ML toolkit. This would include Neural Networks, Naive Bayes classifiers, Decision Tree learning and more. To ensure that the Learn2Ban tool searches for the most relevant patterns, we have drawn from several academic and industry papers in order to identify the key features which are generally applied by a Distri- buted Denial of Service attack, specifically at the HTTP level. The Learn2Ban tool collects these features from all available log files and from these features we can construct a model which represents thegeneral characteristics of a DDoS attack at the HTTP layer. The primary features which Learn2Ban examines are, at present: • Average request interval - this feature essentially captures the rate of request. An abnormally high rate would be a strong indication that the associated IP is performing an attack. • User Agent cycling - in order to frustrate attempts by traditional regex or pattern-based system, such as Fail2Ban, attackers will generally rotate the User Agent they make per each request. This has the effect of limiting the efficacy of a hard-coded regex. By considering this behaviour in the contextof associated IP’s overall behaviour, Learn2Ban aims to see through this obfuscation. • Page depth request - human users will generally browse through a site in ways which lead to a deeper link exploration than an automated bot is inclined to do. Thus if an IP is generally only requesting certain front-end pages rather than digging into the site, this feature will highlight that behaviour.

2.5. Deflect Labs 47 Deflect Documentation, Релiз 1.4.0

• HTML to Image/CSS ratio - again, unlike a human user, bots will not usually cause requests to load additional content such as images or CSS, since the request is neither focused widely nor browser-based in general. • Variance of request interval - in this case, bots are again unmasked by their fundamental behaviour. Unless the attacker has the foresight to build in an algorithmic random-wait interval between requests, the request interval variance will once again expose the attack. It is quite difficult to model the stochastic behaviour over a human user, so given a large enough sample set. a pattern will generally emerge in the behaviour of a bot. • Payload size - if an IP is consistently requesting large files - such as PDFs - this is a good indication that it is an intentional attack to waste server resources. These features work together to build up a pattern of behaviour that attempts to delineate between legitimate website users and algorithmic bots designed to bring down a site or a server. To a certain degree, this acts like a reverse Turing test. DDoS attacks cannot generally hide their fundamental behaviour, relying instead on sheer volume of requests to achieve their goals. Thus by utilising the pattern recognition and Machine Learning capabilities of Learn2Ban, it is possible to further weaken the efficacy of most DDoS attacks. This method of handling DDoS attacks is also evolutionary, in so far as whenever the attacks adapt to a new degree of sophistication, so too does the model to frustrate them.

Future Work

Some of the next steps for this project we would like to develop • new models based on more diverse examples of DDoS attacks • an extension to the set of features we have developed to cover more variations in attack • a test for new classifiers • a way to facilitate communication between instances of Learn2Ban, allowing data on current attacks to spread to other vulnerable nodes

Edgemanage

Edgemanage is a tool used to ensure maximum availability of Deflect edges. It observes the health of edges in the Deflect edge pool and selects the best ones to be active (i.e. in DNS) at any given time. See the Edgemanage documentation on GitHub.

Opsdash

Opsdash provides near realtime storage and querying of the large volume of traffic reaching the Deflect edge (many millions of events per day). It is composed of: • an Elasticsearch cluster for data storage and querying; • a Kibana interface to quickly and easily create visualisations of complex data; • Logstash to enrich and insert logs into Elasticsearch; • Log-courier to ship logs securely and rapidly from the edge to Logstash; • nginx to restrict access to the powerful Elasticsearch API. • Deflect itself, by its nature a rich target for DDoS attacks.

48 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

• BotnetDBP - a set of tools to actively and accurately differentiate between legitimate and malicious requests in order to further reduce the load on the Deflect network. • BotHound and Grey Memory - Bothound detects and classifies the attacks using the anomaly-detection and machine-learning tool Grey Memory. • Sniffles and Edgemanage provide an unfiltered view of inbound traffic, and give an unmistakable indicator of which site is targeted. • Opsdash - ElasticSearch cluster where the majority of collected data is stored and queried. We use these tools to gather, store and analyze information for attack diagnostics and user-facing statistics, as well as to study series of attacks and historical behaviours. What we can observe when analyzing bots through Deflect Labs“ components and open third-party resources includes: • The geographic location of the bot (GeoIP databases lookups): This information can be used to inform decisions as to whether the bot is part of a malware-based botnet or a voluntary botnet using tools such as LOIC or other packaged denial of service tools that are used in participatory DDoS attacks. Bots proximity will be noted and can be used to indicate whether a high number of attackers are clustered geographically. • Whether the visitor has used the site regularly: Hits on the aggregation system will be used to indicate whether the IP address has been seen before • How much traffic a particular user has incurred • Whether the user’s profile has changed drastically since last visit: learn2ban profiles visitor activity and uses machine-learning techniques to determine whether a user is behaving in a malicious non-human manner. • Whether the user’s profile matches that of a known bot type or bot cluster (Ban filter rules):Some malware toolkits use very obvious patterns of attack or identify themselves in an obvious manner. This information makes classification of attackers easy. • Whether the host has been seen as part of a botnet in the past Deflect Labs is Deflect’s project that leverages and enriches the large amount of data available totheDeflect DDoS mitigation system to: • provide sophisticated intelligence about the nature of DDoS attacks; • profile attacks and create a taxonomy of attacks; • inform efforts to mitigate, prevent and discuss attacks; • develop visualization tools for data analytics to profile botnet activity history, DDoS attack metrics and forensics.

2.5.2 Reports

Deflect Labs publishes regular reports on the most interesting cases we observe:

2017

• Deflect Labs Report #3 - On DDoS attacks launched against Black Lives Matter’s official website, blacklivesmatter.com, between April 29th and October 15th.

2.5. Deflect Labs 49 Deflect Documentation, Релiз 1.4.0

Fig. 27: Deflect Labs Components

50 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0

Fig. 28: Deflect Labs - Canaries

2016

• Deflect Labs Report #2 - On DDoS attacks launched against the BDS Movement’s website between February 1st and March 31st, 2016. • Deflect Labs Report #1 - On DDoS attacks launched against Ukrainian media website Kotsubynske in February 2016. Deflect Labs“ goal is to raise the costs for launching DDoS attacks by keeping the Internet Freedom communi- ty informed about new and incoming cyber-threats and by exposing adversary methods and identities, thus discouraging future attacks. Deflect provides an excellent resource to study the characteristics and nature of DDoS and other attacks on civil society websites. The network can be seen a honeypot of sorts for collecting attack data, since a large number of Deflect-protected sites are subject to frequent DDoS attack. The Deflect Labs project aims to use this information to strip away some of the impunity currently enjoyed by botnet operators and their benefactors, so as to raise the costs for launching attacks against our clients and civil society in general. While complete revelation of the identity of attackers is an impossible technical challenge for us to undertake, Deflect Labs allows for better attribution of attacks to specific hosts, botnets and causes. Webelievethis research may help attack victims or third parties form opinions about the provenance, or perhaps even the objectives, of attacks. If your site is protected by Deflect and you would like to work with us on researching attacks youhave experienced, please contact us via the support form in Deflect Dashboard.

2.5. Deflect Labs 51 Deflect Documentation, Релiз 1.4.0

2.6 Пiдтримка

The Deflect network is managed by a committed team of human beings scattered all around the globe. This means that we can reply to support requests within 3 hours between Monday and Friday, and within 6 hours on the weekend. We also speak several languages, including English, French, Russian, and Spanish. Deflect clients can contact the support team through the Deflect Dashboard or by writing to the support email address you will receive after subscribing to Deflect. Please, treat the Deflect support team with courtesy and respect, remembering that this is a free besteffort service run by some very dedicated and overworked people. Deflect is not the only DDoS-mitigation service available for human rights defenders, civil society groups, independent media and freedom of speech activists. At the time of writing, here are two other (well-known) initiatives which offer DDoS mitigation services free of charge. • Project Galileo • Project Shield Each offers a robust, capable service, so you will likely be protected whichever one you choose. However, there are key differences with each provider that we believe are crucial to consider before making your choice. You can also read an excellent overview of the field with extensive advice on how to protect your sitefrom an attack here. Features Deflect Project Galileo Project Shield Open Source Так Some Components Optimization libraries SSL Так Так Так Headquarters Канада США США Loyal to Users - non commercial Stakeholders - commercial Shareholders Sign-Up

52 Роздiл 2. Deflect features Deflect Documentation, Релiз 1.4.0 https://dashboard.deflect.ca/signup By referral or online By referral or online Умови участi Deflect’s eligibility criteria NGOs and civil society groups Media, elections and human rights orgs Disk Encryption Так Нi Нi Data Logging Opt-out Так Так Infrastructure https://docs.deflect.ca/en/latest/about_deflect.html Data Centers Data Centers Having said all that, Deflect is the only service which: • Operates on a non-profit basis and exists specifically to protect human rights groups and independent media websites • Does not accept groups which promote hate speech, incite violence, advocate censorship, use our network for criminal activities or wilfully disseminate propaganda • Never changes or denies service due to very large attack size • Encrypt our partners“ data at rest: on each caching server • Does not give away or sell any data to a third party • Is trying to solve the problem, not just react to it • Is a dedicated service run by dedicated people with backgrounds in human rights, journalism, digital security and tech-activism. We do this because we believe in it and we want to support the activists and journalists who risk so much to do their work.

2.6. Пiдтримка 53 Deflect Documentation, Релiз 1.4.0

54 Роздiл 2. Deflect features Роздiл 3

Deflect in the media

3.1 Recent Media Coverage

Deflect Labs“ 3rd report – Black Lives Matter English • Matthew Braga, «How Canadians are keeping Black Lives Matter website online» CBC News, Dec 19, 2016 • Colin Daileda, «Black Lives Matter website hit with more than 100 DDoS attacks this year» Mashable, Dec 16, 2016 • Cory Doctorow, «How hackers tried to knock blacklivesmatter.com offline» Boing Boing, Dec 14, 2016 • Corin Faife, «The DDoS vigilantes trying to silence Black Lives Matter» Ars Technica, Dec 14, 2016 • Justin Ling, «Black Lives Matter Website Saw Over 100 DDoS Attacks in Seven Months» Motherboard, Dec 14, 2016 • Russell Brandom, «Anonymous groups attacked Black Lives Matter website for six months» The Verge, Dec 14, 2016 • Monique Judge, «Report: Black Lives Matter Website the Target of More Than 100 DDoS Attacks» The Root, Dec 15, 2016 Deflect Labs“ 2nd report – BDS Movement English • Ali Abunimah, «Attacks on BDS websites linked to Israel» The Electronic Intifada, June 6, 2016 • Jack Moore, «BDS Movement Accuses Israel of Series of Cyber Attacks» Newsweek, June 3, 2016 • Sarah Lazare, «Tech Report Says Palestinian Rights Orgs Are Under Sophisticated Cyber Attack» Alternet, June 3, 2016 • Justin Ling, «Someone Is Launching Cyber Attacks on Websites Critical of Israel» Vice News, June 2, 2016

55 Deflect Documentation, Релiз 1.4.0

• «Attacks on BDS websites smack of Israel’s despair at its growing isolation» BDSMovement.net, June 2, 2016 Hebrew • : -BDS « Haaretz, June 2, 2016 Deflect Labs“ 1st report – Kotsubynske English • Justin Ling, «The Activists on the Forefront of Ukraine’s Cyberwar» Vice News, March 29, 2016 Ukrainian • Konstantin Oleinik, «Як IТ-технологiї покращують безпеку України» Global Ukraine News, May 23, 2016 On Deflect English • Jillian C. York, «A guide to online security for activists» The Electronic Intifada“, Aug 2, 2016 Czech • «Kyberv´alka na Ukrajinˇem´akanadskou stopu. Ottawa poslala miliony» iDNES, April 1, 2016 German • Andrea Jonjic, «Weitere Dimension in der DDoS-Debatte: Angriffe gegen unabh¨angigekritische Medi- en, die sich kaum wehren k¨onnen» Netzpolitik, Jan 29, 2013

56 Роздiл 3. Deflect in the media Роздiл 4

Вiдгуки

За останнi роки ми допомогли мiльйонам людей отримати доступ до вебсайтiв, якi знаходяться пiд захистом Deflect. Деякi з них вiдповiли зiбраними тут персональними свiдченнями.

Fig. 1: мапа вебсайтiв, захищених Deflect Deflect.ca вiдмiнно попрацював над тим, щоб захистити вебсайт вiдомої правозахисної НГО вiддов- готривалої DDoS атаки. Вебсайт не працював майже тиждень. Ми спочатку спробували Cloudflare, але все вказувало на те, що DDoS все одно проходив крiзь захист. Поясню: це вiдбувалось з усi- ма налаштуваннями «на максимум» на бiзнес-планi цiною у 200$/мiсяць. Щойно ми перейшли до Deflect, ми почали отримувати нормальний трафiк, а активна технiчна пiдтримка через чат,що була надана Deflect, справдi допомогла нам утримати ситуацiю в безпецi та пiд контролем.

Каспер Сурен IPOS отримав пряму вигоду вiд експертизи та професiоналiзму Deflect, коли наш сайт став цiллю безпрецедентної атаки. На той час послуги аналогiчних компанiй, включно з CloudFlare та Google PageSpeed не зумiли захистити електоральне опитування IPOS вiд серйозної DDoS атаки пiд час президентських виборiв у Iранi у 2013 роцi. Утiм, Deflect

57 Deflect Documentation, Релiз 1.4.0

спромiгся швидко налаштувати CDN, прийнти трафiк з основного домену IPOS та проти- стояти атацi. Дякуємо вам, Deflect. Алi Реза, IPOS solution Deflect надав нашому вебсайту захист, який ми б не змогли собi дозволити. Це даломожли- вiсть функцiонувати нашiй органiзацiї з пiдтримкою необхiдного для невеличкої правозахи- сної органiзацiї рiвня безпеки. Без Deflect, наш основний канал комунiкацiї - вебсайт -був би пiд значно вищим ризиком стати об’єктом нападу. Можливо, навiть бiльш важливим є те, що долучення CTC до сiм’ї eQualit.ie надало нам доступ до спiльноти з надзвичайно цiнним експертним знанням. Кароль Семдап, Виконавчий директор, Канадський комiтет Тибету (СTC) Наша органiзацiя використовувала безпечнi хостинги для наших партнерiв, якi нацiленi на роботу у закритих суспiльствах та репресивних країназ. Ми вирiшили скористатись послу- гами Deflect i лишились дуже задоволеними. Команда дiяла швидко, професiйно та активно вiдповiдала на запити. Нам було надано усю потрiбну iнформацiю та технiчну пiдтримку пiд час усього процесу активацiї та монiторингу. Дякуємо вам, Deflect. Команда Deflect були першопрохiдцями у реалiзацiї унiкальної та блискучої iдеї захища- ти загроженi сайти вiд DDoS та iнших типiв атак. Вони неодноразово й дуже ефективно захищали вебсайти наших клiєнтiв, даючи журналiстам свободу слова - одну з головних сутностей Iнтернету. Що я також помiтив та чим я захоплююсь у командi Deflect - це їхня швидка технiчна пiдтримка, дружнiй пiдхiд та ставлення до клiєнтiв як частини команди, що створює взаємини приязнi та поваги. Дякуємо вам, Deflect. Махмуд Джiсрi. Операцiйний менеджер у CyberiaHosting.ca Окрiм того, що Deflect допомiг нашiй фундацiї запобiгти DoS атакам, уся команда була дуже приязною до нас i допомогала навiть тодi, коли нам потрiбна була лише якась порада щодо безпеки. Роберто Паломiно. ElCultivo.mx Було чудово отримати технiчну пiдтримку вiд Deflect для того, щоб утримати наш сайт онлайн та зупинити подальшi атаки. Команда швидко вiдповiдала на нашi питання та вирi- шувала проблеми. Нашому бажанню вести журналiстську роботу з вигнання було б завдано удару, якби не допомога, яку нам надав Deflect. Дякуємо вам, Deflect. Mesfin Deflect врятував мою журналiстську роботу та можливiсть незалежно публiкувати резуль- тати моїх розслiдувань. Моя спецiалiзацiя - корупцiя та вплив глобалiзацiї та органiзованої злочинностi на такi спортивнi федерацiї як FIFA та IOC. Спортивнi фанати по усьому свiту люблять мiй блог, тому що я розкриваю корупцiйнi скандали, яких не хочуть торкатись багато хто з «поважних» спортивних кореспондентiв. Минулої осенi мiй вебсайт було ата- ковано бот-мережами. Протягом довгого часу вiн залишався офлайн, i навiть мiй етичний Iнтернет-провайдер на деякий час перестав працювати. Дуже скоро стало очевидно, що одне з викриттiв розiзлило певних багатих та сильних керiвникiв свiтового спорту. Вони не мо- гли подати в суд, тому що iсторiя була добре задокументованою. Тому вони звернулись до брудних трюкiв. Deflect поспiшив менi на допомогу i зробив багато такого, чого менi, зви- чайному журналiсту-розслiдувачу, нiколи не зрозумiти. Роботу мого сайту було вiдновлено i вiн продовжує працювати. Моя подяка - а також усiєї свiтової спiльноти, що прагне до чесностi у своїх репортажах. Ендрю Дженнiгс Вiд iменi Osservatorio Balcani e Caucaso (OBC), iталiйської неприбуткової медiа органiзацiї, якою я керую, хотiв би висловити нашу вдячнiсть за послуги цифрового захисту, якi ви нам

58 Роздiл 4. Вiдгуки Deflect Documentation, Релiз 1.4.0

надаєте. Протягом останнiх кiлькох мiсяцiв, OBC (www.balcanicaucaso.org) була цiллю три- валої та iнтенсивної DDoS-атаки, яку, найiмовiрнiше, було розпочато з-за кордону, та яка мала на метi залякати нас. Зрозумiло, це дуже нас стривожило та поставило пiд загрозу роботу, яку ми ведемо вже бiльш нiж 13 рокiв. Утiм, ми не могли собi дозволити поставити пiд загрозу якiсть та надiйнiсть новин, якi мої публiкуємо, i зробили усе вiд нас залежне, щоб себе захистити. У якостi короткострокового надзвичайного заходу, ми звернулись до системи захисту премiум-класу, що в жодному разi не було економiчно виправданим рiше- нням у середньо- та довгостроковiй перспективi для такої маленької органiзацiї, як наша. Дуже скоро пiсля цього, ми були радi отримати вашу пропозицiю та цiнну солiдарнiсть, яка дозволила нам знову зосередитись на нашiй мiсiї - тобто на новинах, дослiдженнях, тре- нiнгах та iнших активностях, спрямованих на демократизацiю процесiв, якi вiдбуваються у Пiвденно-Схiднiй Європi та на Кавказi. Ваша допомога дала нам вiдчути себе менш вра- зливими, а також частиною ширшого спектру НУО, вiдданих захисту прав, справедливостi та миру в усьому свiтi. Ще раз дякуємо вам за вашу солiдарнiсть та дружбу. I, звiсно - за захист, який ви гарантуєте. Луiза Чiодi, РHD Ми дiзнались про Deflect у червнi 2012, коли насильство охопило штат Ракхайн уМ’янмi (Бiрма). Як наслiдок, сьогоднi у рiзних таборах перебувають бiльш нiж 150 000 внутрiшньо перемiщених осiб. У цей перiод наш вебсайт, перша агенцiя новин Рохiнджа, перебував пiд постiйними атаками i вiдключався. З повною вiддачею, переконанням, пiдтримкою та екс- пертизою, команда Deflect повернула його в онлайн i захищає його i сьогоднi. Ми -найбiльш переслiдуваний народ, Рохiнджа - бажаємо вам усього найкращого та дякуємо донорам, якi допомагають їм продовжувати їхню справу. Дуже вам дякуємо. Роннi

59 Deflect Documentation, Релiз 1.4.0

60 Роздiл 4. Вiдгуки Роздiл 5

Критерiї участi

5.1 Вiдповiднiсть критерiям участi

Iндивiди та групи, якi потребують захисту Deflect повиннi вiдповiдати наступним критерiям: • Ви захищаєте права людини; керуєте органiзацiєю громадянського суспiльства; працюєте як не- залежне медiа; або спiвпрацюєте з людьми, якi роблять щось з перелiченого. • Ваша робота не повинна суперечити принципам, перелiченим у Загальнiй Декларацiї Прав лю- дини. • Ваша робота не пропагує мову ненавистi та не заохочує дискримiнацiю. • Ви погодились з нашими Умовами обслуговування.

61 Deflect Documentation, Релiз 1.4.0

62 Роздiл 5. Критерiї участi Роздiл 6

Посiбник по Панелi керування

6.1 Крок 0 - Реєстрацiя

Панель керування дозволяє вам зареєструвати Вашi вебсайти, щоб отримати захист Deflect. Також це контрольна панель, де, пiсля переходу за Deflect, Ви можете керувати своїми DNS записами, налашту- ваннями безпеки та статистикою трафiку. Якщо Ви вiдповiдаєте критерiям вiдповiдностi Deflect та зможете надати нам необхiдну технiчну iнформацiю, Ви можете розпочати без зволiкань. Необхiдно зробити лише кiлька крокiв для створення облiкового запису. • Перейдiть на https://dashboard.deflect.ca/signup • Вкажiть назву вебсайту, який Ви хочете захистити • Введiть IP-адресу сервера, на якому розмiщено вебсайт (якщо Ви її не знаєте, перейдiть на сторiн- ку http://ip-lookup.net/domain.php та введiть назву Вашого веб-сайту, щоб отримати IP-адресу. Вона буде складатись з чотирьох чисел, роздiлених крапками, наприклад, 173.254.238.77) • Введiть Вашу email адресу • Додайте Ваш PGP ключ (необов’язково) - якщо Ви хочете надсилати нам зашифованi електроннi листи. Будь ласка, звернiть увагу! Автоматизованi повiдомлення, якi надсилатимуться з контрольної панелi Deflect, не будуть зашифрованими Щойно Ви заповните цю форму, Ви отримаєте email з посиланням. Перейшовши за цим лiнком, Ви отримаєте доступ до сторiнки активацiї, де Ви зможете ввести свiй новий пароль. Оберiть хороший пароль, двiчi введiть його та натиснiть на кнопку «Задати пароль». Ви отримаєте пiдтвердження, що Ваш пароль було збережено з посиланням на форму реєстрацiї.

63 Deflect Documentation, Релiз 1.4.0

Fig. 1: Форма реєстрацiї

Fig. 2: Активуйте Ваш облiковий запис

64 Роздiл 6. Посiбник по Панелi керування Deflect Documentation, Релiз 1.4.0

Авторизуйтесь через форму реєстрацiї та перейдiть до наступного кроку.

6.2 Крок 1 - Налаштування IP та DNS

На першому екранi Ви побачите прохання пiдвердити (якщо це перший вебсайт, який Ви реєструєте) або ввести IP-адресу Вашого вебсайту. Якщо Ви її не знаєте, перейдiть на http://ip-lookup.net/domain. php та введiть назву Вашого веб-сайту, для отримання IP-адреси. Вона буде складатись з чотирьох чисел, роздiлених крапками, наприклад, як ось ця: 173.254.238.77 Коли Ви введете чи перевiрите IP-адресу Вашого вебсайту, натиснiсть «Зберегти IP».

Fig. 3: Форма IP адреси

На цьому етапi система Deflect знайшла налаштування DNS Вашого вебсайту. Вони будуть показа- нi на цьому екранi, де Ви зможете їх вiдредагувати та пiдтвердити. Будь ласка, переконайтесь, що

6.2. Крок 1 - Налаштування IP та DNS 65 Deflect Documentation, Релiз 1.4.0

вiдображено усi релевантнi DNS записи. Хоча кожен домен матиме свої власнi записи, ось коротке пояснення • A website.com 129.128.127.210 -> це головний (адресний) запис домену, також вiн називається джерелом IP чи кореневим записом. • CNAME www website.com -> зазвичай це псевдонiм (СNAME), який дозволяє людям вводити www.website.com та переходити на Ваш вебсайт • MX website.com mail.website.com -> цей запис використовується для електронної пошти (MX), наприклад [email protected] • A mail.website.com 129.128.127.210 -> цей запис дозволяє надсилання електронної пошти на Ваш сервер. Вiн пов’язаний з вищезгаданим записом MX • NS ns1.website.com -> адреса сервера, що вiдповiдає за Ваш домен. Ви можете залишити цей запис незмiнним • TXT website.com „This is a test“ -> iнодi до домену додається текстовий запис (TXT). Ви можете залишити цей запис незмiнним

Fig. 4: Налаштування DNS

Наша система достатньо добре iдентификує DNS записи. Перевiрте схему Вашої DNS зони, щоб по- дивитись, чи щось вiдрiзняється, та додати або змiнити будь-якi налаштування якi вiдрiзняються чи помилковi. Коли Ви впевнтитесь, що все вiрно, натиснiсть кнопку Зберегти, мої записи правильнi, щоб перейти до наступного кроку.

6.2.1 Важливо

• Кожен субдомен, який Ви хочете захистити за допомогою Deflect, i який вказує на вiдмiнну IP-адресу, потрiбно зареєструвати як окремий вебсайт, використавши кнопку „Додати новий веб- сайт“.

66 Роздiл 6. Посiбник по Панелi керування Deflect Documentation, Релiз 1.4.0

6.3 Крок 2 - Облiковi данi адмiнiстратора

На цiй сторiнцi Ви виберете новий пароль, щоб захистити доступ до сторiнки адмiнiстрування Вашого вебсайту. Щоб отримати детальнiше пояснення дивiться сторiнку про Banjax-аутентикацiю. Вкажiть адресу сторiнки, через яку Ви заходите у адмiнiстраторський облiковий запис Вашого вебсайту. Напри- клад, за замовчуванням адреси адмiнiстраторських сторiнок для популярних редакторських платформ є наступними: • Wordpress: /wp-admin • Drupal: /admin • Joomla: /administrator Скопiюйте та вставте вiдповiдну адресу адмiнiстраторської сторiнки (потрiбно вставити лише адресу, що знаходиться пiсля назви домену).

Fig. 5: Безпека

Тут Ви зможете створити новий пароль, якщо забудете або захочете змiнити попереднiй.

6.4 Крок 3 - HTTPS/TLS

6.4.1 Налаштування HTTPS/TLS

Deflect може автоматично обслуговувати Ваш вебсайт по зашифрованоому HTTPS каналу. Щобдiзна- тися бiльше, прочитайце цей довiдник. Якщо Ваш вебсайт вже пiдтримує зв’язок через HTTPS, Вам все одно знадобиться налаштувати TLS. Для використання на серверах Deflect ви можете використати Вашi iснуючi сертифiкати або згене- рувати новi сертифiкати вiд Let’s Encrypt. Будь ласка, зауважте, що для того, щоб TLS/HTTPS працював, Ваш веб-сервер має пiдтримувати TLS шифрування. Ви отримаєте попередження, якщо Ваш сервер не пiдтримує TLS. Вам буде потрiбно увiмкнути TLS на Вашому серверi-джерелi до того, як Ви зможете увiмкнути TLS на Deflect.

6.3. Крок 2 - Облiковi данi адмiнiстратора 67 Deflect Documentation, Релiз 1.4.0

Fig. 6: TLS працює за замовчуванням, коли можливо встановити TLS з’єднання з Вашим сервером- джерелом

Fig. 7: ТLS працює за замовчуванням пiд час реєстрацiї, коли на Вашому серверi-джерелi не виявлено TLS.

6.4.2 Публiчнi TLS Сертифiкати

Deflect може автоматично створити та пiдтримувати для Вашого сайту безкоштовний TLS сертифiкат вiд Let’s Encrypt. Це рекомендована опцiя, за винятком, якщо Ви хочете використовувати саме Ваш нинiшнiй TLS сертифiкат.

6.4.3 Опцiї HTTPS

6.4.4 Сертифiкати вихiдного сервера

Користувачi зможуть встановлювати безпечне HTTPS/TLS з’єднання до Вашого вебсайту лише у тому випадку, якщо Ви встановили TLS сертифiкат на Вашому серверi-джерелi. Важливо, щоб заши- фрований трафiк вiд Ваших користувачiв до мережi Deflect також був також зашифрованим пiд час з’єднання мiж мережею Deflect та Вашим веб-сервером. На Вашому серверi, ви можете використовувати дiючi сертифiкати третiх сторiн або згенерувати без- коштовний пакет сертифiкатiв для сервера-джерела вiд Deflect.

68 Роздiл 6. Посiбник по Панелi керування Deflect Documentation, Релiз 1.4.0

6.5 Крок 4 - Завершення

Це останнiй екран для реєстрацiї Вашого вебсайту у Deflect. Коли Ви потрапите на цю сторiнку, на- ша команда отримає данi Вашого вебсайту та почне його розмiщення у нашiй iнфраструктурi. Коли налаштування буде закiнчено, Ви побачите тут повiдомлення про потребу змiнити NS Records - NS записи - для цього домену та спрямувати їх на Deflect. Коли ми завершемо налаштування, це зображення змiниться на наступне: Тепер вам потрiбно спрямувати сервери iмен вашого домену (NS) на Deflect. Зазвичай це можна зробити у Вашого DNS провайдера. Зайдiть у облiковий запис вашого DNS про- вайдера та подивiться на налаштування Nameservers. Два чи бiльше таких записи будуть там за за- мовчуванням. Щойно це буде зроблено, натиснiсть Done. NS settings saved. На цьому Вашу реєстрацiю буде завершено. Ваш вебсайт почне з’являтись на Deflect по мiрi того, як змiни поширяться Iнтернетом. Це зазвичай займає вiд 1 до 48 годин. Перейдiть до **Контрольна панель** , щоб дiзнатись, як користуватись панеллю керування.

6.5. Крок 4 - Завершення 69 Deflect Documentation, Релiз 1.4.0

Fig. 8: Завершення налаштування 1

Fig. 9: Завершення налаштування 2

70 Роздiл 6. Посiбник по Панелi керування Роздiл 7

Deflect FAQ

7.1 Хто ви такi?

• Deflect створено та пiдримується канадських неприбутковим техколективом eQualit.ie. Ми ма- ленька вiддана група техноактивiстiв, зосереджена на захистi правозахисникiв та незалежних журналiстiв. eQualit.ie базується у Монреалi, хоча iндивiдуально ми розташованi у рiзних мiсцях планети. • Команда Deflect складається з професiйних розробникiв, криптографiв, системних адмiнiстра- торiв, системних iнженерiв та техконсультантiв. Разом ми володiємо десятками рокiв досвiду у широкому дiапазонi дисциплiн та мов програмування та працювали у публiчних, приватних, комерцiйних та академiчних проектах. Нашi бiографiї можна знайти тут.

7.2 Що ще робить eQualit.ie?

Досить багато! Перевiрте наш вебсайт. Ми розробляємо iнструменти з цифрової безпеки, проводимо тренiнги та технiчнi аудити.

7.3 Навiщо було створено Deflect?

• Основна причина створення Deflect виникла через наступну необхiднiсть: iснує нагальна потреба у цiй послузi для iндивiдiв та груп, якi знаходяться пiд загрозою кiбератак, але не здатнi дозволити собi комерцiйний захист. • Бiльшiсть DDoS атак є рудиментарними та можуть бути пом’якшеними за допомогою хорошої технологiї. Бiльшiсть веб-адмiнiстраторiв, що роблять добру справу у потенцiйно небезпечних умовах, просто не мають часу або ресурсiв для спецiалiзованої технiчної команди.

71 Deflect Documentation, Релiз 1.4.0

7.4 Якi вебсайти використовують Deflect?

Ми не розкриваємо iдентичнiсть наших партнерiв (як i не розкиємо Вашу) публiцi, iншим партнерам чи донорам проекту. Усi вебсайти, що перебувають пiд захистом Deflect розробленi або пiдтримуються неприбутковими правозахисними органiзацiями або незалежними медiа, що працюють заради та за принципами, закрiпленими у Загальнiй декларацiї прав людини. Ось тут географiчний зрiз розмiщення вебсайтiв наших нинiшнiх партнерiв.

Fig. 1: Карта партнерiв

7.5 Чи можете Ви захистити мiй вебсайт?

• Так. Ми можемо захистити Ваш вебсайт вiд перевантаження надмiрною кiлькiстю трафiку, не- залежно вiд того, чи цей трафiк є результатом зловмисної активностi чи високої популярностi Вашого вебсайту. • Ми також приховуємо справжню адресу сервера Вашого вебсайту, що допомагає захистити його вiд iнших типiв атак, як наприклад зламу пароля. Якщо нападники не зможуть знайти хост, вони не зможуть його атакувати. • Deflect розроблено спецiально для боротьби з DDoS-атаками. Це анi «срiбна куля», щовирiшить усi проблеми веб-безпеки, анi провайдер веб-хостингу.

7.6 Чи моєму вебсайту потрiбен Deflect?

• Ймовiрно так. Deflect потрiбен не лише тодi, коли ви знаходитесь пiд постiйними DDoS атаками, достатньо лише мати обґрунтовану пiдозру, що Ваш вебсайт може бути атаковано хакерами та DDoS-атаками. • Деякi вебсайти пiд нашим захистом знаходяться пiд майже невпинними DDoS-атаками, в той час якi iншi можуть працювати мiсяцями без жодного пiдозрiлого трафiку. • Ви можете дочекатись атаки i перейти на Deflect пiсля її початку (див. Чи можу я отримати захист Deflect пiд час DDoS-атаки?), але набагато ефективнiше зробити це заздалегiдь.

72 Роздiл 7. Deflect FAQ Deflect Documentation, Релiз 1.4.0

7.7 Чи можу я використовувати Deflect якщо мiй вебсайт знахо- диться у станi розробки?

Так, насправдi ми це рекомендуємо. Чим ранiше ви заховаєте свiй вебсайт за захист Deflect, тим менше людей будуть знати його IP-адресу, i це зменшить шанси, що атака досягне Вашого сервера. Реєструйте Ваш вебсайт у Deflect якомога ранiше. Ви так само зможете мати доступ до будь-якої панелi веб-адмiнiстрування крiзь Deflect, або напряму з’єднатись з IP-адресою вашого серверу, якщо уцьому виникне така потреба.

7.8 Скiльки це коштує?

• Deflect є безкоштовним для будь-якого вебсайту чи мережi вебсайтiв, що представляють органiза- цiї захисникiв прав людини, активiстiв, блогерiв-дисидентiв та незалежнi медiа. Вiдсутнi будь-якi контрактнi зобов’язання i ви можете скористатись цим сервiсом коли Ви вважатимете за потрiбне. • На щастя, пiдтримка нашої мережi вузлових серверiв коштує нам небагато.

7.9 Я вже плачу за хостинг. Чи менi це справдi потрiбно?

• Дуже ймовiрно, що так. Ми надаємо наш сервiс безкоштовно на додачу до Вашого хостингу. Це може скоротити цiну вашого хостингу суттєво зменшивши кiлькiсть трафiку, з яким доводиться оперувати вашому серверу. • Є окремi спецiалiзованi хостинги, що рекламують свою готовнiсть до DDoS-атак, але це може бути дорогим рiшенням з багатьма обмеженнями. • Якщо Ваш вебсайт використовує платформу WordPress, ми також можемо запропонувати Вам безкоштовний та безпечний хостинг на eQPress. Тут можна дiзнатися бiльше про цю опцiю.

7.10 Чи потрiбно менi переносити мiй вебсайт на Вашi сервери?

• Нi. Deflect це iнфраструктура захисту вiд DDoS-атак, не хостинг вебсайтiв. Щоб приєднатись до Deflect Вам просто потрiбно змiнити Вашi DNS-записи. Ваш вебсайт залишиться у Вашого попе- реднього хостинг-провайдера. Ми можемо порадити Вам дешевших та надiйнiших провайдерiв, якщо Ви не задоволенi сервiсом Вашого нинiшнього хостера. • Якщо Вам потрiбен безкштовний безпечний хостинг та Ваш вебсайт розроблено на платформi WordPress, ми можемо запропонувати сервiс eQPress.

7.11 Чи можуть нападники обiйти захист Deflect, щоб атакувати через DDoS мiй вебсайт?

Можуть, якщо Вашi нападники знають IP-адресу Вашого вебсайту. Deflect захищає Вас вiд цього, ховаючи IP-адресу сервера, на якому розмiщено Ваш вебсайт. ЩойноВи будете пiд захистом Deflect, DNS-записи Вашого вебсайту будуть спрямовувати на IP-адресу Deflect.

7.7. Чи можу я використовувати Deflect якщо мiй вебсайт знаходиться у станi розробки? 73 Deflect Documentation, Релiз 1.4.0

Тiльки Deflect знатиме справжню IP-адресу сервера Вашого вебсайту, натомiсть вiдвiдувачi Вашого вебсайту будуть бачити лише пов’язанi з Вашим вебсайтом IP-адреси Deflect. Пiсля того, як Ви будете пiд захистом Deflect, у нападникiв є два шляхи дiзнатись, де розмiщено ваш веб-сервер: • Через iншi сервiси, що не захищенi Deflect - наприклад, email-сервер. Важливо переконатись, що iншi сервiси мають свої власнi IP-адреси. • Iсторичнi записи DNS. Ми можемо пiдказати Вам, чи можна знайти в Iнтернетi IP-адресу Вашого веб-сервера, та як отримати нову - якщо вона Вам знадобиться.

7.12 Якщо я матиму проблему або запитання, як швидко я отри- маю вiдповiдь?

• Ми розглядаємо запити до техпiдтримки та повiдомлення про iнциденти як найбiльш прiоритетнi у нашiй щоденнiй роботi. Iнодi, серйознi iнциденти чи потiк iнших запитiв можуть ускладнити негайну обробку запиту. Наша мета - вiдповiсти на запит не пiзнiше нiж за три години пiсля його отримання. • Ми неприбуткова група вiдданих своїй справi техно-активiстiв, що живуть у рiзних часових зонах, тому є високий шанс, що хтось з нас буде онлай аби обробити ваш запит ще швидше. • Це у наших iнтересах надавати швидкий та ефективний сервiс, тому що якщо один з наших клiєнтiв знаходиться пiд DDoS-атакою, це впливає на усю нашу iнфраструктуру.

7.13 Хто контролює мiй вебсайт?

Ви. Ми просто допомагаємо надавати контент, але ми його нiяк не змiнюємо. Можна сказати, що ми контролюємо резервну копiю, оскiльки переведення DNS на нашi сервери означає, що резервне копiювання Вашого вебсайту вiдбувається щоразу, як на нього хтось заходить.

7.14 Чи має мiй вебсайт право на захист?

Ми оцiнюємо вебсайти за двома ключовими критерiями: • Чи Ваша робота є неприбутковою та пов’язана з незалежними медiа та/або захистом прав люди- ни? • Чи є у Вас пiдстави вважати, що Ваш вебсайт може бути цiллю DDoS-атаки через вашу роботу? Чи були Ви ранiше цiллю атаки? Див. бiльше на сторiнцi Умови вступу.

7.15 Чи є контракт?

• Нi. Ви можете долучитись та покинути мережу Deflect у будь-який момент. • Пiд час реєстрацiї, ми просимо Вас погодитись з нашими Загальними положеннями та умовами та Повiдомленням про конфiденцiйнiсть.

74 Роздiл 7. Deflect FAQ Deflect Documentation, Релiз 1.4.0

7.16 Чи вплине це не мої доходи вiд реклами?

Deflect не вплине на вашi доходи вiд реклами чи на статистику трафiку, що використовують зовнiшнiй контент - те, як працюють бiльшiсть систем на зразок Google Ads та Google Analytics. Веб-сторiнки можуть мiстити додатковий контент з Вашого вебсайту (джерела) або iз зовнiшнiх сайтiв. Ми кешуємо лише контент, що хоститься на сайтi-джерелi. Якщо Ви розмiщуєте рекламу вiд Google або бiльшостi iнших рекламних сервiсiв, або використовувати аналiтичний трекер, браузери зможуть отримувати рекламу, посилання для аналiтики та iнший контент iз зовнiшнiх вебсайтiв.

7.17 Що таке Deflect?

• Deflect це сервiс зворотнього кешування для вебсайтiв, що вразливi до DDoS атак. Хоча вебсайти й не змiнюють своїх IP-адрес, Deflect гарантує, що їхнiм серверам не потрiбно буде мати справуз раптовим напливом несправжнiх вiдвiдувачiв або «ботiв», що намагаються «покласти» вебсайти. Натомiсть, цi запити перенаправляються до Deflect, мережi серверiв, спецiально налаштованих для боротьби з ними. • Тимчасом, легiтимний трафiк має повний доступ до усього опублiкованого контенту вебсайту. На вiдмiну вiд комерцiйних сервiсiв, ми не беремо оплату за нашi послуги i не змiнюватимемо Умови обслуговування. Ми не маємо контракту чи мiнiмального перiоду перебування у мережi.

7.18 Чи можу я перейти пiд захист Deflect пiд час DDoS атаки?

Ви можете пiдключитись до мережi Deflect в будь-який момент, але правильнiше це зробити щедо початку атаки. Якщо Ви дочекаєтесь моменту, коли Ваш сайт опиниться пiд атакою, ми все ще можемо допомогти, але повна змiна DNS записiв може зайняти до 24 годин. За цей час, боти, що знають Вашу IP-адресу зможуть атакувати Ваш вебсайт, тому наше кешування не одразу дасть потрiбний ефект. Як-то кажуть, профiлактика краще за лiкування, тому вчасний перехiд пiд наш захист може вберегти Вас вiд головного болю та вiдмов у роботi вебсайту у майбутньому. Зазвичай, нам потрiбно зробити оцiнку Вашого вебсайту перед переходом, i це може забрати час, але якщо це надзвичайна ситуацiя, тодi звiсно, звертайтесь до нас i ми спробуємо зробити усе, що зможемо.

7.19 Чи це сповiльнює роботу мого вебсайту?

Нi, насправдi це допоможе швидше показувати сторiнки Вашим читачам. У цьому перевага сервiсiв для кешування - вони швидко вiддають змiст сторiнки. Приймаючи бiльшiсть трафiку, призначеного для Вашого вебсайту, ми зменшуємо навантаження на Ваш сервер. Це працює постiйно, не лише пiд час DDoS атак.

7.20 Як я можу отримати захист Deflect?

1. Перевiрте, чи ви маєте право на захист вiдповiдно критерiїв вiдповiдностi. 2. Перейдiть до форми реєстрацiї та дотримуйтесь цих iнструкцiй. 3. Змiнiть свої DNS-записи, щоб вони вказували на Deflect.

7.16. Чи вплине це не мої доходи вiд реклами? 75 Deflect Documentation, Релiз 1.4.0

За iнших рiвних умов, це все, що потрiбно зробити. Ми також рекомендуємо змiнити IP-адресу Вашого вебсайту пiсля переходу пiд захист Deflect. Якщо не буде жодних DNS-записiв, що вказують напряму на Ваш сервер, Вашу нову IP-адресу буде приховано та справжнє розмiщення сервера, на якому розмiщено Ваш вебсайт буде приховано вiд Iнтернету та вiд потенцiйних нападникiв.

7.21 Чи можу я розгорнути власну мережу Deflect?

Детальнi iнструкцiї по тому, як розгорнути мережу Deflect можна знайти на у роздiлi Deflect DIY .

7.22 Чи Ви пiдтримуєте SSL?

Так, пiдтримуємо! У Вас є кiлька варiантiв: Ви дозволити нам все налаштувати для Вас чи використати Вашi власнi сертифiкати. Щоб дiзнатися бiльше, див. сторiнку Пiдтримка TLS/HTTPS шифрування.

7.23 Let’s Encrypt

Let’s Encrypt це безкоштовний центр сертифiкацiї (CA). Вiн дозвляє користувачам безкоштовно ав- томатично генерувати сертифiкати для своїх веб-доменiв, для того, щоб обiйти картелi, що досi кон- тролювали видачу SSL сертифiкатiв. Метою є спрощення процесу налаштування безпечного вебсайту настiльки, щоб безпечнi вебсайти стали повсюдними. З тих пiр як процес створення SSL сертифiкатiв з Let’s Encrypt є достатньо простим для будь-кого, хто вмiє користуватись термiналом, багато користувачiв Deflect можуть зацiкавитись у самостiйному гене- руваннi SSL сертифiкатiв. Якщо Ви плануєте приєднатись до Deflect та хочете перед тим згенерувати SSL сертифiкати через Let’s Encrypt, дотримуйтесь цих iнструкцiй на вебсайтi Let’s Encrypt. Якщо, з iншого боку, Ваш вебсайт вже знаходиться за мережею Deflect, i Ви хочете згенерувати новi SSL сертифiкати з Let’s Encrypt, є певнi деталi, якi вам потрiбно знати, щоб забезпечити коректну роботу сертифiкатiв. Let’s Encrypt намагається зробити налаштування якомога простим для користувачiв зi своїм iнстру- ментом letsencrypt-auto, але це, на жаль, не спрацює для Deflect, i вебсайти пiд захистом Deflect не зможуть верифiкувати iмена сертифiкатiв по запиту. Щоб запобiгти цьому, а також забезпечити без- перебiйну роботу ви можете скористатись опцiєю webroot, щоб прописати потрiбнi данi напряму у кореневу папку сервера. Прикладом такої команди для equalit.ie буде: ./letsencrypt-auto certonly -d equalit.ie,www.equalit.ie –webroot-path /var/www/equalit.ie/ Залежно вiд налаштувань Вашого веб-сервера, шлях /var/www/example.com/ слiд замiнити на коре- ктний шлях. Якщо, наприклад, Ваша CMS та контент зберiгаються у папцi /wordpress, ваш шлях буде: /var/www/example.com/wordpress* Цi сертифiкати потiм потрiбно завантажити у Панель керування у звичайний спосiб.

7.24 Чи люди знатимуть, що мiй сайт знаходиться пiд захистом?

• Захист Deflect не одразу помiтний для нетренованого ока.

76 Роздiл 7. Deflect FAQ Deflect Documentation, Релiз 1.4.0

• Досвiдчений веб-користувач (чи нападник) може це з’ясувати, уважно поглянувши на код, який видає веб-сторiнка. • Окрiм того, якщо хтось спробує залогiнитись на редакторську сторiнку Вашого вебсайту, вони побачать сторiнку Deflect.

7.25 Чому Deflect це вiдкрите програмне забезпечення?

Deflect було створено з використанням одних з найкращих open source програм та принципiв. Михотiли б пiдтримати та зробити свiй внесок у open source спiльноту - зробивши вихiдний код та документацiю публiчною та безкоштовною. Ми вiримо, що Iнтернет має лишатись майданчиком для свободи слова, незалежної думки та соцiальних перетворень. Поширюючи наше знання, ми хочемо, щоб люди навча- лись на ньому, вiдтворювали його для себе, та, з часом, ми навчимося у них. Ми також вiримо у те, що iнфраструктура безпеки має бути побудована на хороших принципах, а не секретах. Якщо нам немає чого приховувати, ми не вразливi до викриття цих секретiв. Це робить справу нападника ще складнiшою.

7.26 Де розташовано Вашi сервери?

Нашi VPS розташованi на трьох континентах у безпечних мiсцях.

7.27 Я можу тримати код?

Ви можете отримати код Deflect ось тут.

7.25. Чому Deflect це вiдкрите програмне забезпечення? 77 Deflect Documentation, Релiз 1.4.0

78 Роздiл 7. Deflect FAQ Роздiл 8

Terms of service

8.1 1. Про нас eQualit.ie Inc. - це канадська органiзацiя (eQualit.ie, Ми або Нас), що надає послугу iз захисту вiд розподiлених атак на вiдмову у обслуговуваннi (DDoS), пiд назвою Deflect (Deflect або Послуга) для осiб, органiзацiй та бiзнесiв, що займаються пiдтримкою громадянського суспiльства та захищають права та свободи людини (Ви). Ми керуємо вебсайтом Deflect.ca та його субдоменами. Ми базуємось у Монреалi, Канада, але наша команда розташована по усьому свiту. Щоб дiзнатися бiльше, див. наш Манiфест eQualit.ie. Реєстрацiєю на сервiсi Deflect Ви погоджуєтесь дотримуватись цих Умов обслуговування та Полiтику приватностi (разом, Умови).

8.2 2. Що таке Deflect?

Deflect - це послуга iз захисту вiд DDoS-атак. Нашою метою є створення керованої спiльнотою таopen source технiчної протидiї DDoS-атакам, що цензурують онлайн-голоси, якi просувають чи захищають громадянськi свободи та права людини. Deflect складається з наступних Послуг: • Розподiлена мережа зворотнiх кешуючих проксi-серверiв (мережа Deflect) • Контрольна панель для керування захистом вашого вебсайту (Панель керування Deflect) • Додаткова послуга з хостингу вебсайтiв (EQpress)

8.3 3. Хто може скористатись Deflect?

Захист Deflect пропонується групам та окремим представникам громадянського суспiльства, якiзахи- щають права людини та створюють незалежнi медiа. Нашi послуги також надаються тим, хто захищає

79 Deflect Documentation, Релiз 1.4.0

демократiю, екологiю, права жiнок та принципи, закрiпленi у Мiжнародному бiллi прав людини.

8.4 4. Використання Deflect

Deflect - це безкоштовний сервiс. Вiдсутня будь-яка плата за його використання. Щоб скористатись Послугами, Вам потрiбно буде створити облiковий запис користувача та надати деяку базову iнформацiю про Ваш вебсайт, включно з його доменним iм’ям та IP-адресою сервера. Щойно Ви зареєструєтесь, Ви зможете налаштувати кожен вебсайт, який Ви хочете захистити, через Панель керування Deflect.

8.5 5. Представник Вашого Вебсайту

Кожна органiзацiя, що використовує Послуги, має призначити представника, який має право дiяти вiд її iменi, який (i) матиме доступ до профiлю Панелi керування Deflect, налаштованого для Вашого вебсайту (або вебсайтiв), та який (ii) має доступ та контролює основну електронну адресу, на яку було зареєстровано цей вебсайт (Представник Вебсайту). Ми прийматимо iнструкцiї та комунiкуватимемо лише з Представником Вебсайту або iншими особами, авторизованими Представником Вебсайту. Перевага надаватиметься повiдомленням, що будуть надi- сланi через Панель керування або з основної електронної адреси, на яку було зареєстровано вебсайт. Якщо, з будь-якої причини, Представник Вебсайту буде не здатен продовжувати свою роботу, новий Представник Вебсайту повинен бути автентифiкований eQualit.ie. Ви можете зв’язатись з нами через форму Contact Us на вебсайтi eQualit.ie.

8.6 6. Вашi Зобов’язання

Ви надаєте Нам безоплатне, невиключне, непередаване право та лiцензiю на використання, копiювання, зберiгання та вiдображення даних, якi Ви нам надаєте, виключно з метою надання нам можливостi надавати Послуги.

8.6.1 6.1 Вашi Зобов’язання

На додачу до iнших зобов’язань, що мiстяться у цих Умовах, Ви повиннi: • Заявити i гарантувати, що у Вас є повна влада i повноваження для реєстрацiї веб-сайту Вашої органiзацiї на Deflect. • Призначати, зареєструвати та контролювати уповноваження Вашого Представника Вебсайту. • Нести вiдповiдальнiсть за точнiсть, повноту та адекватнiсть Ваших даних. • Нести вiдповiдальнiсть за те, щоб контент вебсайтiв, що використовують Послуги, вiдповiдав цим Умовам та нашому Манiфесту. • Нести вiдповiдальнiсть за те, що будь-який матерiал, захищений авторським правом, буде вико- ристано з дозволу правовласника або що Вам у iнший спосiб дозволено публiкувати цей матерiал. • Зберiгати у таємницi пароль та данi Вашого облiкового запису. • Ставитись з ввiчливiстю та повагою до eQualit.ie та її партнерiв, пам’ятаючи, що це безкоштовний сервiс, який пiдтримують дуже самовiдданi та перевантаженi роботою люди.

80 Роздiл 8. Terms of service Deflect Documentation, Релiз 1.4.0

8.6.2 6.2 Забороненi види дiяльностi

We lean on the International Bill of Human Rights when required to define content that is discriminatory, threatening, or liable to incite violence, or racial hatred. We lean on the Canadian Privacy Act and PIPEDA when defining personal privacy violations. However, in all cases, we reserve the right to interpret abuse complaints and the content we host or carry for our clients to the best of our abilities, without limitation. Вам заборонено: • Додавати, або дозволяти iншим додавати будь-який Неприйнятний Контент. • Розповсюджувати зловмисне програмне забезпечення або вiруси через нашi Послуги. Неприйнятний Контент - це контент, що порушує права iнших, зокрема права людини та право на приватнiсть, та/або контент, що є дискримiнацiйним, мiстить погрози або пiдбурює до насильства чи расової ненавистi. Якщо Ми вважаємо, що Ваш контент або данi мiстять шкiдливе програмне забезпечення, вiруси або Неприйнятний Контент, ми можемо усунути Вашi данi та вебсайт з Deflect. Якщо Ми отримаємо скаргу щодо змiсту Вашого вебсайту, Ми можемо зв’язатися з Вами для отримання додаткової iнформацiї та надання Вам можливостi пояснити цей контент. Пiсля розгляду скарги Ми можемо вирiшити видалити Ваш облiковий запис та зупинити використання Вами наших Послуг. Будь ласка, повiдомте про будь- який образливий контент, використовуючи форму Contact Us на вебсайтi eQualit.ie.

8.7 7. Зобов’язання eQualit.ie

8.7.1 7.1 Нашi обов’язки

Ми повиннi • Operate according to our DDoS principles and place the utmost importance on data security, your privacy, and respecting your technical and service demands. • Докладати максимум зусиль з метою (i) утримати Ваш вебсайт онлайн пiд час DDoS атаки та (ii) продовжувати надання Вам Послуг незалежно вiд атак на Ваш вебсайт чи тиску на нашу органiзацiю. • Provide our Service in accordance with our Privacy Notice. • Iнформувати Вас електронною поштою, чи, у вiдповiдних випадках, телефоном або iншими спосо- бами, якi Ви нам надали до початку застосування посилених заходiв захисту. • Намагатись пiдтримувати у робочому станi нашу мережу та усi вiдповiднi сервiси, а також вста- новлювати останнi оновлення програмного забезпечення, щойно вони будуть доступними. • Надавати послуги нашої служби пiдтримки Deflect та намагтись вiдповiдати на запити протягом 6 годин з понедiлка по п’ятницю (в усiх часових зонах). • За можливостi, повiдомляти Вас електронною поштою про усi збої у роботi Послуг та намагатись звести такi збої до мiнiмумуму.

8.8 8. Порушення авторських прав

Легiтимнi повiдомлення про порушення авторського права, якi ми отримаємо, буде переслано Пред- ставнику Вебсайта. Ми можемо призупинити Послугу для Вашого вебсайту для виконання вiдповiдного законодавства про захист авторського права.

8.7. 7. Зобов’язання eQualit.ie 81 Deflect Documentation, Релiз 1.4.0

8.9 9. Припинення надання Послуги.

Цi Умови набирають чинностi щойно Ви зареєструєтесь у Deflect. Ви можете у будь-який момент зупинити використання Deflect, змiнивши вашi DNS записи таким чином, щоб вони бiльше не вказували на нашу мережу. Якщо ми вважаємо, що ви не дотримуєтесь наших Умов, ми можемо зупинити Ваше використання Deflect та видалити Ваш облiковий запис. На наш розсуд, але дiючи обґрунтовано та з найкращими намiрами, ми можемо зупинити надання Вам Послуг, наприклад, у випадку, якщо вичерпаються нашi джерела фiнансування. Якщо це станеться, Вас буде повiдомлено щонайменше за мiсяць, якщо це буде можливо, та надати допомогу у переходi з Deflect. Якщо Ви порушите цi Умови, ми залишаємо за собою право вчиняти заходи для виправлення ситуацiї, аж до зупинки вашого облiкового запису та надання Послуги. Ми прагнемо бути справедливими та пропорцiйними у своїх дiяк. Якщо ми не вживаємо заходiв негайно, то це не означає, що ми вiдмовля- ємось вiд нашого права вжити їх пiзнiше.

8.10 10. Гарантiї та межi вiдповiдальностi

Ми надаємо послуги Deflect на комерцiйно обґрунтованому рiвнi послуг та вмiнь, але Ми неможемо надати жодних гарантiй щодо специфiчних функцiй Послуги, його надiйностi, досутпностi чи його здатностi вiдповiдати Вашим конкретним потребам. Ми не можемо обiцяти, що Ваш вебсайт завжди буде захищений вiд атак. Ми надаємо нашi Послуги «як є» та виключаємо будь-якi гарантiї в дозво- лених законом межах, включно з передумовленими гарантiями, умовами товарної якостi, придатностi для певної мети, вiдсутностi порушень, того, що послуги вiдповiдатимуть Вашим потребам, будуть доступними для використання у будь-який конкретний момент, або що вони не мiститимуть помилок. За жодних обставин Ми не несемо вiдповiдальнiсть за будь-якi прямi, побiчнi, випадковi, типовi або штрафнi збитки, навiть якщо Нас попередили про можливiсть таких збиткiв. Так само Ми не несе- мо вiдповiдальностi за жоднi втраченi доходи, втраченi прибутки чи втраченi заощадження, або за наслiдки Вашого використання чи неправильного використання наших Послуг, включно з будь-яким використанням, що суперечить закону.

8.11 11. Вашi Вiдшкодування

Ви, та, у вiдповiдних випадках, Ваша органiзацiя вiдмовляєтесь вiд претензiй та звiльняєте вiд вiдпо- вiдальностi Нас та афiлiйованих з нами осiб, службовцiв, агентiв та працiвникiв вiд будь-яких вимог, позовiв та дiй, що можуть постати в наслiдок або бути пов’язаними з використання Послуг або через порушення цих Умов, включно з будь-якою вiдповiдальнiстю чи витратами, пов’язаними з претензiями, позовами, втратами, збитками, судовими рiшеннями, судовими витратами та юридичними виплатами.

8.12 12. Загальне

Час вiд часу ми можемо змiнити цi Умови i повiдомимо Вас коли це станеться. Якщо Ви будете незгоднi з нашими змiненими Умовами, Вам слiд припинити використання Deflect. Законодавство Канади буде застосовано до будь-яких диспутiв, що можуть постати чи бути пов’язаними з цими Умовами, та будь-якi диспути будуть розглядатись у провiнцiї Квебек, Канада. У випадку, якщо будь-яка частина з цих Умов не може бути виконана, решта Умов залишається в силi, так наче частини, що не бути виконаною, не iснувало.

82 Роздiл 8. Terms of service Роздiл 9

Privacy notice

9.1 Наша Обiцянка Щодо Безпеки та Цiлiсностi Даних

Нашим головним принципом завжди буде захист Вашої приватностi та безпека Вашої iнформацiї. Якщо Ви використовуєте нашi Послуги, ми знаємо, що приватнiсть та безпека є для Вас надзвичайно важли- вими. Ми докладаємо усiх зусиль та використовуємо найкращi безкоштовнi та open source iнструменти, якi є у нашому розпорядженнi, щоб захистити Вашi данi вiд втрати, несанкцiонованого використання та доступу, розкриття, змiни та знищення. Ми застосували вiдповiднi фiзичнi, електроннi та операцiйнi процедури, щоб убезпечити та захистити вашi Данi. Ми обробляємо Вашi Данi у спосiб, що вiдповiдає цiлi, для якої цi данi було зiбрано чи авторизовано. Ми весь час намагаємось дотримуватись нашої Декларацiї розподiлених онлайн сервiсiв. Ми призначили Privacy Officer - особу, що вiдповiдальна за захист приватностi, яка займається оцiнкою наших методiв обробки даних. Якщо у Вас є питання або скарги щодо наших методiв обробки даних, будь ласка, зв’яжiться з нами за адресою [email protected].

9.2 1. Effective Date and Scope

Ця Полiтика Приватностi набуває чинностi з 1 жовтня 2016 року i є невiд’ємною частиною наших Умов обслуговування. У цiй полiтицi приватностi (Полiтика Приватностi), термiни «ми», «наш» та «нас» означають eQualit.ie. Ця Полiтика Приватностi регулює нашi практики по вiдношенню до Даних, якi ми збираємо за допомо- гою Послуги Deflect про вебсайти Вашої органiзацiї, що зареєстрованi у Deflect («Ви») та вiдвiдувачiв Ваших вебсайтiв, якi знаходяться пiд захистом Deflect.

9.3 2. What Type of Data Do We Collect?

Пiд Даними ми розумiємо будь-яку iнформацiю, зiбрану через Послуги, включно з вашої Персональною iнформацiєю та метаданими, пов’язаними з Вашим користуванням Послугою та вiдвiдувачами Ваших

83 Deflect Documentation, Релiз 1.4.0

вебсайтiв. Персонально iдентифiкована iнформацiя - це iнформацiя, що може iдентифiкувати Вас або, може бу- ти об’єднана з iншою iнформацiєю, щоб iдентифiкувати Вас. Персональною iнформацiєю також може бути iнформацiя, що мiстить данi про те, чи вiдвiдували Ви вебсайт або Вашу IР-адресу, якщо ця персо- нальна iнформацiя може бути асоцiйована з Вами. Єдина Персональна iнформацiя, яку Ми збираємо, це Ваша електронна адреса та назва вебсайту, який Ви реєструєте. Ми також можемо попросити Вас вказати назву органiзацiї, яку представляє цей вебсайт, який Ви реєструєте та iншi пов’язанi деталi, що можуть допомогти Нам перевiрити, чи Ви маєте право скористатись послугами Deflect. Iнша iн- формацiя може включати будь-яку Персональну iнформацiю, яку Ви можете добровiльно надати Нам через наш вебсайт, електронну пошту чи запити на технiчну пiдтримку з Вашого облiкового запису. Ми зберiгаємо Вашу Персональну iнформацiю упродовж усього часу, поки Ви зареєстрованi у Нас або поки Ви не видалите Ваш облiковий запис. Ось деякi приклади Даних, якi ми збираємо: • Дата реєстрацiї у наших сервiсах • Ваше доменне iм’я • Файл Вашої DNS зони • Ваша IP-адреса • IP-адреси вiдвiдувачiв вашого вебсайту, захищеного Deflect. Метаданi, пов’язанi з активнiстю вiдвiдувачiв на Вашому вебсайтi. • Iдентифiкатори сесiї. Поки ви знаходитесь у Вашому облiковому записф, ми тримаємо на Вашому комп’ютерi тимчасовий iдентифiкатор сесiї, який Ваше програмне забезпечення використовує для пiдтвердження стану авторизацiї. Вони видаляються пiсля того, як Ви вийдете з вашого облiкового запису або чи пiсля завершення сесiї. • Коли ви редагуєте Ваш вебсайт, захищений Deflect, Ви маєте авторизуватись як власник облiково- го запису. Це створить на Вашому комп’ютерi файл-cookie тривалiстю у 24 години, що пiдтвердить Вашi облiковi данi у системi Deflect та дозволить Вам отримати доступ до бекенду. • Електроннi листи, запити до техпiдтримки та пов’язанi метаданi.

9.4 3. How Do We Use Data We Collect?

Ми використовуємо зiбранi нами Данi (включно з Вашою Персональною Iнформацiєю) для надання наших Послуг, а саме послуг Deflect для Вашого вебсайту, адмiнiстрування Вашого облiкового запису та керування нашими вiдносинами. Деякi приклади того, як використовуються Вашi Персональнi Данi, включають (i) реєстрацiю облiко- вих записiв та авторизацiю Вашого доступу до Панелi керування Deflect та (ii) комунiкацiю з Вами щодо Deflect. Як щодо метаданих? За замовчуванням, ми збираємо метаданi про вiдвiдувачiв Вашого вебсайту. Iна- кша назва для цього - ведення журналу логiв, i вiн використовується для надання Вам статистики. Нам також потрiбнi цi данi для того, щоб захищати Вас вiд зловмисної активностi та для застосування пе- редових аналiтичних iнструментiв до метаданих, пов’язаних з вiдвiдувачами Вашого вебсайту. Якщо Ви вiдмовитесь вiд збереження метаданих (логування) у Панелi керування Deflect, метаданi будуть зберiгатись лише на час, необхiдний для надання Послуги. Будь-якi метаданi, пов’язанi зi зловмисною активнiстю у Нашiй мережi чи на Вашому вебсайтi будуть зберiгатись безстроково. Ми не використовуємо жодних cookies вiд третiх сторiн та стеження будь-якого виду.

84 Роздiл 9. Privacy notice Deflect Documentation, Релiз 1.4.0

9.5 4. Do We Disclose Your Personal Information to Others?

Нi, за винятком отримання на це Вашої попередньої згоди, або якщо це є вимогою законодавства.

9.6 5. Law Enforcement Requests

Ми можемо бути змушенi розкрити Вашi Данi, включно з Вашою Персональною Iнформацiєю, без Вашого вiдома чи згоди, у випадку отримання ордеру, судового рiшення, розпорядження чи iншої ле- гальної вимоги, виданої судом, трибуналом, вiдповiдним регуляторним органом чи iншою особою, що має юрисдикцiю вимагати розкриття Вашої iнформацiї, включно з Вашою Персональною Iнформа- цiєю. Якщо ми отримаємо запит на отримання доступу до Даних вiд правоохоронних органiв в ходi вiдкритого чи потенцiйного розслiдування, нашою полiтикою є вимагати вiд правоохоронного органу отримати ордер чи судове рiшення. Також нашою полiтикою є оскаржувати такий ордер чи рiшення, якщо ми вважаємо його невиправданим. Ми якнайшвидше повiдомимо Вас про наявнiсть будь-якого ордера, рiшення чи розпорядження про надання iнформацiї про Вас та вiдвiдувачiв Вашого вебсайту, включно Персональною iнформацiєю, за винятком випадкiв, коли нам буде юридично заборонено це робити.

9.7 6. Storage of Data Outside Canada

Данi можуть обробляється або зберiгатись Нами, Нашими партнерами та сервiс-провайдерами поза межами Канади. Якщо Ваша Персональна Iнформацiя зберiгається та обробляється поза межами Ка- нади, до неї також буде застосовуватись законодавство країни, у якiй вона обробляється та зберiгається. В усiх випадках, Данi, якi ми збираємо, будуть захищенi з використанням усiх адекватних технiчних та юридичних заходiв для запобiгання доступу з боку третiх сторiн.

9.8 7. How Do We Protect Data?

Ми вживаємо адмiнiстративних, технiчних та фiзичних заходiв для захисту Даних, включно з Вашою Персональною Iнформацiєю, вiд втрати, зловмисного використання чи несанкцiонованого доступу, роз- криття, змiни чи знищення. Ми запровадили фiзичнi, електроннi та управлiнськi полiтики по управ- лiнню та захисту Даних. Усюди, де це можливо, ми шифруємо данi пiд час передачi та зберiгання. Ми зберiгаємо доступ до зашифрованих даних лише в межах, потрiбних для надання Послуг, включно з їх адмiнiструванням. Deflect використовує послуги третiх сторiн для забезпечення iнфраструктури кешування таведення логiв. Ми уважно обираємо наших партнерiв та провайдерiв стороннiх сервiсiв для здiйснення спiвмiр- них крокiв по захисту будь-яких наданих їм Даних, але Ми не можемо взяти на себе вiдповiдальнiсть за їх поводження з Вашими персональними Даними. Це одна з причин, чому Ми ретельно усе шифруємо пiд час зберiгання. Хоча Ми вживаємо запобiжних заходiв щодо можливих зламiв наших систем безпеки, жодна компанiя не здатна повнiстю лiквiдувати ризики неавторизованого доступу до Даних. Ми не можемо гаранту- вати, що неавторизованого доступу, хакерської атаки, втрати даних чи зламу наших систем безпеки нiколи не станеться. Будьте свiдомими цих ризикикiв та подумайте, чи варто передавати нам дуже чутливу Персональну Iнформацiю.

9.5. 4. Do We Disclose Your Personal Information to Others? 85 Deflect Documentation, Релiз 1.4.0

9.9 8. How Can You Access and Modify Your Personal Information or Make a Complaint?

Якщо у Вас є облiковий запис, авторизуйтесь у ньому та змiнiть Персональну Iнформацiю, яка зберi- гається у Вашому облiковому записi. Якщо у Вас є питання чи застереження щодо iншої Персональної Iнформацiї, яку Ми збираємо та Ви б хотiли отримати допомогу у отриманнi доступу до цiєї iнфор- мацiї, будь ласка, звернiться до Особи, вiдповiдальної за захист приватностi за електронню адресою [email protected]. Ви також можете вирiшити видалити Ваш акаунт через Панель керування Deflect.

9.10 9. Notice to Persons Outside of Canada

Ця Полiтика Приватностi регулюється законодавством Канади та вiдповiдним провiнцiйним законодав- ством. Надаючи Нам Персональну Iнформацiю, Ви усвiдомлюєте, що Ваша Персональна Iнформацiя буде суб’єктом регулювання законiв Канади та вiдповiдних провiнцiй.

9.11 10. Changes to Our Privacy Notice

Час вiд часу нам може знадобитися змiнювати певнi аспекти Полiтики Приватностi. Ми повiдомио електронним листом та публiкацiєю на нашому вебсайтi про будь-якi суттєвi змiни цiєї полiтики разом з датою вступу цих змiн у дiю.

86 Роздiл 9. Privacy notice Роздiл 10

Technology and tools

Deflect is our DDoS-mitigation service for NGOs, civil society groups, activist bloggers and independent media. Our service is a free, open source and an effective solution to mitigate DDoS attacks. Deflect could not exist without the continued support from the open source community. We would like to take this opportunity to thank our service providers and partners.

10.1 Debian

Debian is a Unix-like computer operating system that is composed entirely of free software, most of which is under the GNU General Public License and packaged by a group of individuals participating in the Debian Project. Our edge servers work like a charm on Debian.

https://www.debian.org/

10.2 Apache Traffic Server (ATS)

Apache Traffic Server™ software is a fast, scalable and extensible HTTP/1.1 and HTTP/2.0 compliant caching proxy server. We use ATS to cache and proxy Deflect edge servers.

87 Deflect Documentation, Релiз 1.4.0

http://trafficserver.apache.org/

10.3 NGINX

NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. It is also known for its, stability, rich feature set, simple configuration, and low resource consumption. We use NGINX for our managed WordPress framework eQPress.

https://www.nginx.com/

10.4 ElasticSearch

Elasticsearch is a search engine based on Lucene. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents. Elasticsearch is developed in Java and is released as open source under the terms of the . Elasticsearch is developed alongside a data-collection and log-parsing engine called Logstash, and an analytics and visualisation platform called Kibana. The three products are designed for use as an integrated solution, referred to as the «Elastic Stack» (formerly the «ELK stack»). We use the stack for Deflect and Deflect Labs.

https://www.elastic.co/

88 Роздiл 10. Technology and tools Deflect Documentation, Релiз 1.4.0

10.5 Search Guard by Floragunn

Search Guard® is an Open Source security suite for Elasticsearch and the entire Elastic Stack that offers encryption, authentication, authorization, audit logging and multi tenancy. Whether you just want to encrypt data in transit, authenticate users against Active Directory, use Kerberos or JSON web tokens for Single Sign On or need to monitor and log malicious access attempts, Search Guard is your one-stop solution. The Community edition comes for free!

https://floragunn.com/

10.6 Nagios Core

Nagios, now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios Core offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved.

https://www.nagios.org/

10.7 Ansible

Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs. Designed for multi-tier deployments since day one, Ansible models your IT infrastructure by describing how all of your systems inter-relate, rather than just managing one system at a time. It uses no agents and no additional custom security infrastructure, so it’s easy to deploy - and most importantly, it uses a very simple language (YAML, in the form of Ansible Playbooks) that allow you to describe your automation jobs in a way that approaches plain English.

10.5. Search Guard by Floragunn 89 Deflect Documentation, Релiз 1.4.0

https://www.ansible.com/

10.8 GitHub

GitHub is a Web-based version control repository hosting service. It is mostly used for computer code. It offers all of the distributed version control and source code management (SCM) functionality ofGitaswell as adding its own features. It provides access control and several collaboration features such as bug tracking, feature requests, task management, and wikis for every project. We use GitHub on a daily basis to maintain our Deflect Documentation and code repositories for our other projects.

https://www.github.com/

10.9 CircleCI

CircleCI is used to automate our software development processes, using continuous integration and continuous delivery so we can focus on what matters: building great things, not waiting for great things to build. We use it for Deflect Documentation and our other projects.

https://circleci.com/

90 Роздiл 10. Technology and tools Deflect Documentation, Релiз 1.4.0

10.10 Read the Docs

Read the Docs hosts documentation for the open source community. They support Sphinx docs written with reStructuredText and CommonMark. The code is pulled from your Subversion, Bazaar, Git, and Mercurial repositories. It then builds documentation and hosts it for you. Think of it as Continuous Documentation. We use Read the Docs to add and push new Deflect Documentation language versions live.

https://docs.readthedocs.io/en/latest/

10.11 Sphinx

Sphinx is a tool that makes it easy to create intelligent and beautiful documentation, written by Georg Brandl and licensed under the BSD license. It was originally created for the Python documentation, and it has excellent facilities for the documentation of software projects in a range of languages. Sphi- nx uses reStructuredText as its markup language, and many of its strengths come from the power and straightforwardness of reStructuredText and its parsing and translating suite, the Docutils. We use reStructuredText in GitHub for our Deflect Documentation.

http://www.sphinx-doc.org/

10.10. Read the Docs 91 Deflect Documentation, Релiз 1.4.0

92 Роздiл 10. Technology and tools Роздiл 11

Deflect DIY

11.1 What is Deflect

11.1.1 How Deflect fits together

1. A user enters http://www.somesite.com/page into a web browser or a web viewing software (UA) of somekind. 2. The UA then does a name to IP lookup which returns one of many Deflect edges 3. A request is directed to this edge with your request of www.somesite.com/page with GET /page HTTP/1.1 Host: www.somesite.com 4. edge then checks for local copy (cache). If found and fresh, returns to client, end. If no local cache is found, edge requests from origin

GET/page HTTP/1.1 Host: www.somesite.com

If found in cache but not fresh, client attempts to revalidate with an IMS request to origin:

GET/page HTTP/1.0 Host: www.somesite.com If-Modified-Since: Sat,6 Oct 19851:24:00 GMT

5. origin webserver gets request, and builds page if dynamic. If we requested If-Modified-Since, and the page has not been modified since the moment Marty arrived back in 1985, then the server might return «304 Not Modified» - in that case the edge updates time oncached object and serves from cache. Otherwise, whether IMS or not, the server will respond with the appropriate HTTP code and data: probably 200 OK (though it could be any code). If the edge cannot be reached in without origin-timeout, we choose to serve from cache no matter how old. 6. edge returns response to the UA 7. UA optionally caches response locally

93 Deflect Documentation, Релiз 1.4.0

11.1.2 Component

1. Operating System Linux - Debian 7.x 2. Proxy Apache Traffic Server 3. Monitoring (а) nagios nagiosgrapher ii. logstash kibana 4. Log Analysis AWStats 5. Domain Name Server bind 6. Firewall Tools (а) iptables (б) banjax swabber 7. File Sync rsync 8. File System Encryption Fuse encFS

11.2 Technical Overview

11.2.1 How Deflect fits together

NB: this flow should not be a list. . . watch this space for nice process diagramtbd 1. user enters http://www.somesite.com/page into user agent 2. UA (or proxy server) asks DNS 3. DNS returns an edge server IP 4. UA requests www.somesite.com/page from edge GET /page HTTP/1.1 www.somesite.com 5. edge checks for local copy. If found and fresh, returns to client, end. if no local copy found, edge requests from origin GET /page HTTP/1.1 Host: www.somesite.com if found in cache but not fresh, client attempts to revalidate with an IMS request to origin: GET /page HTTP/1.0 Host: www.somesite.com If-Modified-Since: Sat, 6 Oct 1985 1:24:00 GMT 6. origin webserver gets request, and builds page if dynamic If we requested If-Modified-Since, and the page has not been modified since the moment Marty arrived back in 1985, then the server might return «304 Not Modified» - in that case the edge updates time on cached object and serves fromcache. Otherwise, whether IMS or not, the server will respond with the appropriate HTTP code and data: probably 200 OK (though it could be any code). If the edge cannot be reached in without origin-timeout, we choose to serve from cache no matter how old. 7. edge returns response to UA 8. UA optionally caches reponse locally fin.

94 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0

11.2.2 How to build Deflect from nothing

Preconfigure DNS host names for edges (optional) edge pool- edge.deflect.ca (multiple A records) origin.site.com note: do not reconfigure www.site.com at this point

Configure a master and secondary master node debian ver apt-get install prereqs download trafficserver source unpack in usr/local/src/

./configure --layout=apache make && make install mkdir /usr/local/deflect cp -rp /usr/local/trafficserver /usr/local/deflect/trafficserver-app cd /usr/local/deflect cp -rp trafficserver-app/conf trafficserver-conf mkdir trafficserver-confstg install packages copy custom scripts build ats and place in repository configure nagios server 2ndary master instructs tbd

Configure some edge nodes automated node build - Daily tasks - create an edge node add to monitoring - Daily tasks - Add a host to monitoring

Configure ATS

Follow the instructions for editing a config fileDaily in[ tasks - Apache Traffic Server configuration - it’s not necessary to push each file separately. It’s a trade-off between validating the configuration as yougoalong, and the reality that some changes cannot be test piece-meal. At the time of writing (15 Feb 2011) there are five files we run that are different from stock. Look at the files on disk,under /usr/local/deflect/ trafficserver-conf/ for specifics, but here’s an overview: • remap.config

11.2. Technical Overview 95 Deflect Documentation, Релiз 1.4.0

This is the file that controls what HTTP Host header maps to what origin server. • records.config This file is the main configuration of the ATS application behaviour - for example, this filedetermines whether to check remap.config at all! Some caching behaviour is configured here- for example, whetherto over-ride the Cache-control: headers we receive from origin servers. • cache.config A lot less config here than you might expect- mostly just the TTL in cache per domain, and the catch-all default TTL. • plugins.config We use the conf_remap and the stats_over_http plugins. • logs_xml.config Our custom log format is defined here. It is basically netscape «common» format, with some addition caching information - it logs one code like TCP_HIT, TCP_MISS, TCP_IMS_HIT (that last mean ats sent an If-Modified-Since request and received a 306 Not Modified response)

Test

See Testing • Most important is functional testing.

Operational acceptance master is backed up dns is accurate and complete logs are being collected from all edges monitoring is active and alerting for all nodes (master and edges) functional testing passed for all edges performance has been tested and is adequate

Go-live point the public URLs (eg site.com, www.site.com) at the pool of edge servers fin

11.2.3 Notes on the sysadmin choices

Good Practices

• make it easy for yourself and others Sometimes you’re not the one fixing a problem- if standards are adhered to it’s a lot easier to troubleshoot. Other times, you might not remember what you did last time. Therefore: standardise, document, take copious but orderly backups, and broadcast the work you’re doing for the informational and peer review purposes. this means less headaches for everyone. Consider documenting work before you start, or work from existing

96 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0 documentation- and be very wary of any deviation from the document. If you have to deviate, then capture it! • infrastructure grade Deflect is an infrastructure service- downtime = bad. • that’s all

Local Practices

Here’s some of the ways we try to implement the principles of stress free administration. . . .

The bvi wrapper

Take a look at: :/usr/local/deflect/scripts/bvi it’s a simple script, for now, that creates a temporary copy of the file you want to edit and opens that for editing. After your editor (vi) quits, it compares the new files to the old one. If there’s a difference, it copies the old one to a dated backup of itself in the old/ subdirectory of the current directory, moves the new one into place, and emails a diff to sysadmin@ in the future i hope to smarten it up a bit. it’s not meant to provide security or strictly enforce policy - it’s just there to make good practices easy for the well-intentioned sysadmin. near future improvements include editor choices and alerting the watch list to files that have been edited without backups being taken.

Capturing your session with screen

A simple .screenrc file exists at ~root/.screenrc - if you run screen as root, screen will do two important things: 1. keep a log of your session so to aid review, documentation, troubleshooting and collaboration later 2. allow you to reconnect to a session if your login session is interrupted for any reason. Even better practice is to copy .screenrc to your own homedir, create the directory $HOME/screenlogs and run screen as yourself, before you su to an administrative user account - this makes it even easier to enjoy the benefits of a logged session after the fact.

/usr/local/deflect/Makefile

This is a cludge, but it’s doing its job pretty well at the moment. Have a look inside the file - or run make in that directory with no arguments for useful help text. This is the main interface for controlling the edges, and any work that needs to be done on edges (plural) should be captured in the makefile. In time this may be rolled into a shell or perl script, or the makefile cleaned up. It currently calls some of the scripts in /usr/local/deflect/scripts/ - not a bad place to have a poke around to see what does what.

11.2. Technical Overview 97 Deflect Documentation, Релiз 1.4.0

/usr/local/

I like to keep everything where I can see it- so I build to /usr/local/. I think it makes upgrades easier, to name but one advantage.

SSH and passwords

As described in https://xkcd.com/936/ - the «search space» for two different passwords - that is how many you might have to try before you’d be certain of brute forcing this password. gJ823$%aK\ = 6.05 x 10e19 or 5,748,511,570,879,116,626,495 vs ifyou'rehappyandyouknowitclapyourhands = 1.99 x 10e67 or 19,943,457,888,530,122,458,259,355,763,514,562,458,206,830,362,647,183, 073,840,370,234,460

That’s six sextillion for a bitch-to-remember password that you have to write down or store (bad) vs twenty unvigintillion (I looked it up :) for a really easy to remember password - that’s a factor of over 100 tredecillion! SSH keys are like the PGP of login security. The properly guarded private key is never ever exposed- the public key is used to generate a challenge that can only be met by the private key. The response is then verified using the public key, and if it’s a match, and the target host’s sshd is configured to allowtheowner of the private partner of the public key it has to log on as the requested user, access is granted. The future is ssh keys encrypted with strong passphrases- much better. I will make this section better in future, maybe using the number unvigintillion again.

Naming conventions and its online backup backup are named for their roles. the edge hosts are named by the VPS provider for each, in the form providerN.deflect.ca, where N indicates whether this is the first, second, Nth VPSatthat provider, eg edge1.deflect.ca edge2.deflect.ca edge3.deflect.ca edge4.deflect.ca

11.3 Installing Deflect

11.3.1 Operating System

• Deflect tarball has been compiled with Debian 7.x amd64 – Install Debian with ssh access – Upgrade the server. In most cases this can be done like:

98 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0

sudo -i apt-get update ; apt-get dist-upgrade ; reboot

11.3.2 Deflect Controller

Download the Deflect Tarball wget http://users.deflect.ca/deflect-v3.0.tar.bz2 md5sum deflect-v3.0.tar.bz2 394af03511919e15aab40f2fa5a38165 deflect-v3.0.tar.bz2

Install Some Prerequisites

Note: Some Debian installs do not install a few things by default and you will get some errors without these. Please check. apt-get install bzip2 rsync time bind9 nagios3 nagiosgrapher

Setup DNS System

FIXME: bind software setup link. • Add your controller and any edges you intend to install to your DNS name server.

Install Deflect

• Change to install directory location and extract the file. cd /usr/local tar jxvf /path/to/deflect-v3.0.tar.bz2 • Move /usr/local/deflect-v3.0 to /usr/local/deflect. Note: If you have a old version of deflect installed here, this will need to be moved before moving thisto deflect directory. mv/usr/local/deflect-v3.0/usr/local/deflect

Create SSL Keys

• Create your private/public keys for the Edges Example: First one is for root on the edges and second is for the trafficserver user. ssh-keygen-b4096-t rsa-f/usr/local/deflect/etc/edge_id

If you do not need a passphrase for the key ROOTPRIVKEY in etc/deflect.config, press Enter twice to create a key without pass phrase. ssh-keygen-b4096-t rsa-f/usr/local/deflect/etc/id_rsa

If you do not need a passphrase for the key TSPRIVKEY in etc/deflect.config, press Enter twice to create a key without passphrase.

11.3. Installing Deflect 99 Deflect Documentation, Релiз 1.4.0

Configure Deflect

This is an example etc/deflect.config file.

[default] # Must use -A. This is a good idea. If you only want to setup one config and ALWAYS use default␣ ˓→you can # comment FORCE_ALT out or set to anything other than 1. Do not confuse yourself, only use in␣ ˓→default. FORCE_ALT=1 # This file is read in from top to bottom. Leave [default] at top so any variable over writting␣ ˓→can happen ### local things # Deflect root DBASE=/usr/local/deflect # Edge root for pushing files EDGEBASE=${DBASE}/edges/default # File list of ALL edges (live and non-live) EDGES=${DBASE}/etc/edges/edges.default # File list of ALL LIVE edges EDGES_LIVE=${DBASE}/etc/edges/edges.default.live # Private key for user root (used on edges) ROOTPRIVKEY=${DBASE}/etc/edge_id # Public key for user root (used on edges) ROOTPUBKEY=${DBASE}/etc/edge_id.pub # Private key for user of traffic server TSPRIVKEY=${DBASE}/etc/id_rsa # Public key for traffic server TSPUBKEY=${DBASE}/etc/id_rsa.pub # The program name that called this MYNAME=`basename $0` # Deploy log file DPLOGFILE=/var/log/deploy.log # Bind zone file template location ZTEMPLATE_DIR=${DBASE}/etc/zones/default # Current UNIX time. (Seconds elapsed since January 1, 1970 00:00:00 GMT) Used # to plot serial numbers in bind zones TIME_S="`date +%s`" # Default proxied domain to test DHOST=www.equalit.ie # Bind (Main Zone Template File) BIND_MZTFILE=${ZTEMPLATE_DIR}/deflect.ca.zone # Bind live directory BIND_LDIR=/var/named # Bind (Main Zone File) BIND_MZTFILE=${ZTEMPLATE_DIR}/deflect.ca.zone # Bind live directory BIND_LDIR=/var/named # Bind (Main Zone File) BIND_MZFILE=${BIND_LDIR}/deflect.ca.zone #Bind SOA record BIND_SOA="@ 300 IN SOA dns0.easydns.com. zone.easydns.com. $TIME_S 43200 10800␣ ˓→1209600 300" #Bind NS definitions. If need more edit zonegen.sh and all more here #BIND_NS_1="@ IN NS dns1.easydns.com." #BIND_NS_2="@ IN NS dns2.easydns.net." #BIND_NS_3="@ IN NS dns3.easydns.ca." BIND_NS_1="@ IN NS adns1.easydns.com." (continues on next page)

100 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0

(continued from previous page) BIND_NS_2="@ IN NS adns2.easydns.com." BIND_NS_3=";;;" BIND_NS_4=";;;" BIND_NS_5=";;;" BIND_NS_6=";;;" # Location of ATS remap.config file in controller push directory ATS_RMAP=${EDGESBASE}/usr/local/trafficserver/config/remap.config #Nagios Host Template File NAG_HTEMPLATE=${DBASE}/etc/nagios/host.template.cfg # Nagios Serviceext Template File NAG_STEMPLATE=${DBASE}/etc/nagios/serviceext.template.cfg # Nagios Host Group Template NAG_HGTEMPLATE=${DBASE}/etc/nagios/hostgroups_template.cfg # File to be read in for nagios monitoring NAG_EDGES=${DBASE}/etc/hosts.monitor

# remote things # ATS UID TSUSER=trafserv TSUID=99 # ATS GID TSGROUP=trafserv TSGID=99 # Location of ATS installed director on edge TSPATH=/usr/local/trafficserver # Our network domain of edges DEFLECT_DOM=deflect.ca # edge CNAME definition to include all our live edges in DNS DEFLECT_EDGE=edge # various prereqs for ATS TSPREREQS="autoconf automake libtool g++ libssl-dev tcl-dev expat libexpat1-dev libpcre3-dev␣ ˓→libcap-dev libhwloc-dev libncurses5-dev libcurl4-openssl-dev libre2-dev libzmq1 libconfig9␣ ˓→libconfig++9 python-swabber" # various prereqs for nagios NAGIOS="nagios-plugins nagios-nrpe-server libnagios-plugin-perl libreadonly-perl" # various prereqs for fail2ban FAIL2BAN="fail2ban" # various prereqs for misc. Add anythis extra we want installed here MISC="sudo rsync ntp iftop tcpdump node virt-what" REPOSTRING="deb http://users.deflect.ca/repo/ wheezy main" # Location on misc in push directory MISC_PATHS="etc/cron.d etc/sudoers" # Use ENCfs for the trafficserver directory? ENCFS=0

[your_DNET] # Location for your_DNET EDGEBASE=${DBASE}/edges/your_DNET EDGES=${DBASE}/etc/edges/edges.your_DNET EDGES_LIVE=${DBASE}/etc/edges/edges.your_DNET.live ATS_RMAP=${EDGESBASE}/usr/local/trafficserver/config/remap.config ZTEMPLATE_DIR=${DBASE}/etc/zones/your_DNET BIND_MZTFILE=${ZTEMPLATE_DIR}/your_DNET.deflect.ca.zone BIND_MZFILE=${BIND_LDIR}/your_DNET.deflect.ca.zone DEFLECT_DOM=your_DNET.deflect.ca ENCFS=0

11.3. Installing Deflect 101 Deflect Documentation, Релiз 1.4.0

PATH for Scripts

• Add PATH to scripts: echo «export PATH=$PATH:/usr/local/deflect/scripts» >> ~/.bashrc Then source the profile so your change takes effect. source/etc/profile

Sometime this does not work depending on you environment. If the deflect PATH does not get added try this. source~/.bashrc

DNET Push Directory

Deflect has the ability to have many DNETs (Deflect Networks) controlled by one controller. Itis recommended that you download the template and save to deflect/edges/default and then copy that di- rectory to your dnetname. So we want to start out configuring the basics here. cd/usr/local/deflect/edges/ wget http://users.deflect.ca/default_push-v3.0.tar.bz2 md5sum default_push-v3.0.tar.bz2 c6364b50e290aa3b5d746921d83291cb default_push-v3.0.tar.bz2 tar jxvf default_push-v3.0.tar.bz2 mv default_push_v3 default cd/usr/local/deflect/edges/default

• Basic push configuration – edit a few files. This will be your default setup that you use for all DNET setups edit the following files to work with your setup. What counts most is to read the comments andchange items, the controller IP address, etc. • etc/iptables.deflect • etc/nagios/nrpe_local.cfg • usr/local/trafficserver/modules/banjax/banjax.conf • copy in right etc/localtime for the timezone you want to run in Dig through all the files and get comfortable where everything is located. When you are happy withyour basic setup copy to you live dnet so you can start to add the websites the this dnet will protect. • Copy the default push directory to your DNET name cd /usr/local/deflect/edges/ cp -a default your_DNET

Nagios Monitor

You will be able to access the nagios monitor web interface from the controller at http(s)://CONTROLLER_DOMAIN_OR_IP/nagios3. If you configured nagios with an administrative password, you should see an apache auth request when visiting the above location.

102 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0

Configuring Edge Monitoring

In order to register your edge with nagios, add the edges to the file /usr/local/deflect/etc/hosts.monitor, in the format. edge1.deflect.ca IP_ADDRESS edge2.deflect.ca IP_ADDRESS

Where IP_ADDRESS is the actual ip address of the edge. Then run: nagios_conf.sh-A your_DNET

It is possible that the script does not fully configure nagios and you may need to modify some configurations by tracing down any errors when nagios attempts to start. Add more documentation for edge monitoring configuration.

11.3.3 Deflect Edge

• Log into your edge (If you have ssh access you can ssh into your edge for example) . • Install Debian Wheezy with ssh access • Upgrade the server. In most cases this can be done like: sudo -i apt-get update ; apt-get dist-upgrade ; reboot Note: The deploy.sh script does this for us but have found it is safer to manually do it unless you know it will work with your VPS provider. • Go back to your controller. • Add your edge to /usr/local/deflect/etc/edges/edges.your_DNET file on controller. This is alistof all your edges controlled by your controller server. Later we will setup edgemanage to do this. On controller: cd/usr/local/deflect/etc/edges bvi edges.your_DNET add the full host name and save file Example: edge1.testnet.deflect.ca edge2.testnet.deflect.ca

• Deploy. Example: cd /usr/local/deflect/scripts/ deploy.sh -A your_DNET -b -v -H edge2 Notes: (This installs and sets up, approx time is 15 to 30 minutes) Note: nagios installs samba and the install sometimes asks for a DOMAIN: Not important unless you are using samba. Adding DEFLECT will work • Add edge to live edges cd /usr/local/deflect/etc/edges bvi edges.your_DNET.live

11.3. Installing Deflect 103 Deflect Documentation, Релiз 1.4.0 add the full host name and save file like we did in the edges file.

11.3.4 Configuration

Note: all configuration is done on the controller and pushed to theedges

ATS remap.config

This file is the heart of the Apache Traffic Server configuration. It is used to map URLs tooriginserver.You can find ours here cd/usr/local/deflect/edges/your_DNET/usr/local/trafficserver/conf bvi remap.config

Add your map to this file, specifying the site that will be served, and where the content will comefrom. Example: regex_map http://^(www\.)?equalit.ie$/ http://example.xxx.deflect.ca/ regex_map https://^(www\.)?equalit.ie$/ https://example.xxx.deflect.ca/

ATS https (SSL/SNI) ssl_multicert.config ssl_multicert.config file is the file to do changes to point to the key/cert files for out httpswithSNI enabled. We put our key/certs in the ATS config directory under a directory called ssl. The directory canbe adjusted in records.conf. Below is a example of ssl_multicert.config

# Equalit.ie ssl_cert_name=equalitie.crt ssl_key_name=equalitie.key # Deflect.ca ssl_cert_name=deflectca.crt ssl_key_name=deflectca.key # This is how we add the default in case the browser or OS is not able to use SNI or a https map␣ ˓→was defined in remap.config but does not have a key/cert dest_ip=* ssl_cert_name=deflectca.crt ssl_key_name=deflectca.key

Push Configuration

Here we use our deploy.sh script again located under /usr/local/deflect/scripts. The command should bein your PATH.

# view what your options are deploy.sh-A your_DNET-h # deploy our ATS change to ALL our edges. deploy.sh-A your_DNET-p ats-H ALL

11.3.5 Further Security

• Edge firewall (iptable rules) – This can be found in /usr/local/deflect/edges/your_DNET/etc/iptables.deflect

104 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0

cd /usr/local/deflect/edges/your_DNET/etc/ bvi iptables.deflect uncomment lines 38 - 42edit safesrc= and at minimum add your controllers FQDN then comment out lines 45 and 46 deploy.sh -A your_DNET -p firewall -v -H ALL This will push the change to all edges • Fail2ban – This can be found /usr/local/deflect/edges/your_DNET/etc/fail2ban – Add your jail in jail.local – Add your filter in filter.d/jail_name.conf cd /usr/local/deflect/edges/your_DNET/etc/fail2ban bvi jail.local add your jail information. Examples are in this file. Save cd filter.d bvi jail_name.conf add and save deploy.sh -A your_DNET -p fail2ban -v -H ALL this will push to all edges it is good practice to reload the firewall any time you do changes to fail2ban deploy.sh -A your_DNET -p firewall -v -H ALL

11.4 Additional Components

11.4.1 Banjax

Banjax is an ATS Banning filter. It was designed as a replacement for fail2ban in processing logs based on regular expressions. Banjax identifies attackers based on regular expressions and then passes the IPaddress of the client matching the rule to Swabber. It was designed because: • It is fast: it reads the request on the fly before it is being written in a file hence file I/O operation does not slow it down. • It can prevent a botnet before even serving it once. The Banjax source is available on Github. The name is based upon Dublin slang terminology for «to ruin». To download the code and learn how to install and configure, Banjax, go to the project on Github.

Configuration

Banjax.conf is usually located in /usr/local/trafficserver/conf/banjax/banjax.conf. This configuration is per- Dnet.

Push changes to banjax.conf deploy.sh-A network-p ats-H ALL

11.4.2 Swabber

Swabber is a daemon for banning and unbanning IP addresses. As simple as that.

Documentation

The vast majority of documentation and detail is available on Github. Swabber can be installed by running pip install swabber

11.4. Additional Components 105 Deflect Documentation, Релiз 1.4.0

Requirements

Swabber requirements can be installed via pip. The minimum supported version of python is 2.6. The code uses the «as» keyword and other conventions that are only present in 2.6 and onwards.

Operation

Swabber uses a pub/sub based system via ZMQ, whereby Swabber itself will try to connect to (ie subscribe to) a port (usually on localhost) where something will publish a ban by starting to listen (publishing) on the same port. Swabber takes a ban as an IP address. If the IP address hasn’t been banned, it will be banned. If it is currently banned, the ban will be extended for the predefined ban time. This is defined in the configuration file swabber.yaml, this time defaults to two minutes.

Manual Execution

You can use the init script to run swabber as a daemon as normal:

/etc/init.d/swabberd start

Or if you want to observe more debug info: swabberd-v

11.4.3 ENCfs

Deflect uses the ENCfs FUSE filesystem for encryption of local file storage. Currently due to thelackof observed overhead, we encrypt the whole Traffic Server directory on install. Deflect edges should, wherever possible, store their ATS tree within an ENCfs mount (unless proper LUKS encryption is available). This allows us to secure logs and SSL keys in cases of theft of hardware or low level compromises.

Implementation

Edge

The edge simply needs to have ENCfs installed (via the encfs package) and the ENCfs directory mounted. Generally the source for the mount is /usr/local/.trafficserver and the mountpoint is /usr/local/trafficserver.

Controller

The controller supports automated creation and mounting of ENCfs filesystems. The Expect script named initENCfs.e in the scripts directory is used to both create a new, blank ENCfs device if not already present, and also to mount an existing one. This script is called by deploy.sh when ENCfs is required to be set up on an edge- ie if the DNET has ENCFS=1.

106 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0

Commands migrate_to_encfs.sh

This script is used to migrate a whole network to ENCfs in bulk. The NETWORK variable must be defined if you wish to deploy to a new network. mountats

This command simply mounts the ATS ENCfs tree and restarts ATS. This is the command to use to remount ENCfs when a host comes up after boot. initENCfs.e

This is an Expect script that remotely mounts the ENCfs directory. It generally doesn’t need to be called directly but it can be called as follows: initENCfs.e $host $ENCFS_PASS /usr/local/.trafficserver/ /usr/local/trafficserver/.

11.4.4 Logging

Deflect „Cruncher“ Awstats Log Analysis

This is the method Deflect does its Awstats setup for all edges running Apache Traffic Server.

Directory Structure and Files

• Installed in /var/deflect/ – etc/ ∗ edges ∗ id_rsa – bin/ ∗ 0_backup_awdata.sh ∗ 1_log_collection.sh ∗ 2_uz2live.sh ∗ 3_resolve_logs.sh ∗ 4_crunch_configs.sh ∗ add_aw.sh ∗ cron_crunch.sh – archives/ ∗ edge1.domain.com/ ∗ .../ ∗ edge24.domain.com/ – tlive/ ∗ 201306/

11.4. Additional Components 107 Deflect Documentation, Релiз 1.4.0

∗ 201307/ ∗ .../ ∗ 201401/ – backup/ ∗ var_lib_awstats-20140103010001-341825787/ ∗ etc_awstats-20131201000138-262232287/ – lock/

The Scripts ( bin/ )

• 0_backup_awdata.sh – This script just does a copy of the config and awstats data files before running anything. For easier recovery if anything goes wrong. • 1_log_collection.sh – This script reads a list of edges and rsync the ATS log files „-.gz“ to a archive • 2_uz2live.sh – Gets date and looks for zipped file in archive that match the right date. Unzips to a temp location in a separated YYYYMM directory If file was already unzipped in this directory before it doesa „cat /dev/null > old_file“ • 3_resolve_logs.sh – Uses some of awstats tools to merge the unzipped log files together into one file YYYMM/current.log • 4_crunch_configs.sh – Read all the Awstats configs setup and forks the to all crunch using YYYYMM/current.log • cron_crunch.sh – Runs all the files above • add_aw.sh – A simple config creator script to add a client to Awstats – you need (domain, config name, password) – Also gives a option to manually add REGEX for advanced REGEX

Configuration ( etc/ )

• edges – List of all edges we are collecting log files from. • id_rsa – Private ssl key so scripts can access (rsync) logs

108 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0

Locking ( lock/ )

Scripts write files in here to make sure things finish. If a problem occurs, like a edges could not getcollected from, you can later just delete the file inside this directory and do a manual run.

11.5 Daily Tasks

=This is a paste still need updating= These are typical operational tasks of Deflect. See the Introduction to get started.

• Edge management – Add a new edge – Enable an edge – Disable an edge – Decommission an edge – Update an ATS plugin – Move a site from one network to another – Move an edge from one DNET to another – ENCfs management ∗ Mount ENCfs partition after a reboot ∗ Migrate a network to use ENCfs for ATS • Check edges are serving traffic – Check an individual edge • Managing DNS – Add a new DNS domain to controller and DNS – Edit templated DNS entry – Generate templated zone files and push to DNS • Managing partners – Test with a partner – Test an edge with pac – Add a partner • Apache Traffic Server configuration • Fail2ban rules • Revert a config change • Monitoring tasks – Access Nagios – Acknowledge an alarm

11.5. Daily Tasks 109 Deflect Documentation, Релiз 1.4.0

– Change monitoring configuration – Add a host to monitoring

11.5.1 Edge management

Add a new edge

1. Purchase a raw Debian amd64 7 image with ssh virtual private server ($vpsname), set root password 2. Upgrade host

root login; apt-get update ; apt-get dist-upgrade ; reboot

• Assign a unique hostname „“„datacentreN.your.dom“„“ and Edit templated DNS entry 3. Deploy Apache Traffic Server (ATS) and other prerequisites: controller# deploy.sh -A dnetname -b -H datacentreN Note: deploy.sh uses a failsafe mechanism to minimize the risk of remote lock-out. Before applying firewall rules, the script creates a flag file on disk on the target node. After the remote script runs, itwaits30 seconds then checks for the file. If the file still exists, all rules are flushed. During those 30seconds, {{DEFLECT_CONTROLLER}} waits a few seconds (for rules to be applied) then spawns a new ssh connection which deletes the flag. Therefore, if the rules are good, {{DEFLECT_CONTROLLER}} will have removed the flag by the time the edge looks for it, thus the edge should not ever lockusout. 1. Nagios host configuration • scripts/nagios_config.sh updates Nagios configuration. 2. Log collection • Add hostname to /usr/local/deflect/etc/edges.dnet • Generate templated zone files and push to DNS 3. Check ATS function 4. Enable VPS • controller# edgemanage -A $dnetname --add $vpsname • Generate templated zone files and push to DNS

Enable an edge

1. Pre checks Confirm edge is being monitored. Confirm edge is serving good content.

controller# edge_check.sh -qc 10

2. controller# edgemanage -A $dnetname --enable $vpsname 3. Generate templated zone files and push to DNS

110 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0

Disable an edge

1. Remove from live edge list controller# edgemanage -A $dnetname –disable $vpsname 2. Generate templated zone files and push to DNS 3. Optionally silence alerts in nagios

Decommission an edge

1. controller# edgemanage -A $dnetname --remove $vpsname 2. Run log_collect.sh, or wait for nightly log collection 3. Remove from monitoring 4. Power down, burn, terminate, etc 5. Remove $vpsname name from the $dnetname zone file 6. Generate templated zone files and push to DNS

Update an ATS plugin

1. build the plugin using axps 2. copy into /usr/local/deflect/trafficserver/modules controller# deploy.sh -p ats -H $vpsname

Move a site from one network to another

1. Move the zone file from /usr/local/deflect/etc/zones/$sourcezone/ to /usr/local/deflect/etc/zones/$destzone/ • Optionally copy the zone file in $sourcezone to $sourcezone/holding 2. Add the host origin to /usr/local/deflect/etc/zones/$destzone/$destzone.domain.zone 3. Copy both deny and remap lines in remap.config from /usr/local/deflect/edges/$sourcezone/usr/local/trafficserver/conf/remap.conf to /usr/local/deflect/edges/$destzone/usr/local/trafficserver/conf/remap.conf and redeploy your ATS configuration. 4. Run controller# zonegen.sh -A $destzone 5. Check controller# rndc reload & tail -f0 /var/log/daemon.log for the new zone being loaded

Move an edge from one DNET to another

1. Take the edge out of rotation • For edgemanage, use edgemanage -A dnet --remove $vpsname 2. Remove the edge from the edge configs at /usr/local/deflect/etc/edges/edges.$dnetname 3. Remove the edge from the originaldnet zone file - „“„unless“„“ the original dnet is in a primary configured primary dnet (all edges are kept in this dnet to support Nagios) 4. Add the edge to the newdnet zone file and regenerate zones.

11.5. Daily Tasks 111 Deflect Documentation, Релiз 1.4.0

5. Run controller# deploy.sh -A newdnet -b -H edge 6. If needed (unlikely) reconfigure Nagios for this edge. 7. Add the machine to rotation: controller# edgemanage -A newdnet --add edge -c "Moving edge from originaldnet to newdnet

ENCfs management

Mount ENCfs partition after a reboot

• mountats host.deflect.ca - wait a few seconds, any prompts displayed will be answered automati- cally and require no input on your part.

Migrate a network to use ENCfs for ATS

• Use migrate_to_encfs.sh, making sure to set the NETWORK variable.

11.5.2 Check edges are serving traffic

controller# /usr/local/deflect/scripts/edge_check.sh -h <-- script is well documented,␣ ˓→check the inline help or run without args

• Verify the output page is as expected, and examine the Via: header, which describes the object served, as explained here: How do I interpret the Via: header code

Check an individual edge

controller# /usr/local/deflect/scripts/edge_check.sh -H $vpsname

• Examine the Via: header, which describes the object served, as explained here: How do I interpret the Via: header code

11.5.3 Managing DNS

Add a new DNS domain to controller and DNS

1. cd /etc/bind/ && bvi named.conf.local 2. Copy an existing block 3. Put the appropriately named file into /usr/local/deflect/etc/zones if it’s to be autogenerated, or directly into /var/named/ if it’s to be static - the «notify» line tells bind to inform DNS of changes. For static files in /var/named, remember to increment the SOA serial - use unix epoch time („date +%s“) 4. Restart bind 5. Check /var/log/daemon.log for domain 6. Test locally using „host“, „dig“, or „nslookup“ 7. Purchase domain on DNS

112 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0

8. Set DEFLECT_CONTROLLER to primary 9. Generate templated zone files and push to DNS

Edit templated DNS entry

Template files are found in /usr/local/deflect/etc/zones/*.zone 1. Edit the zonefile controller# cd /usr/local/deflect/etc/zones/ controller# bvi domain.com.zone 2. Generate templated zone files and push to DNS

Generate templated zone files and push to DNS

1. Generate zonefiles. zonegen.sh will add SOA and apex records in /var/named — read the script source for full details. controller# zonegen.sh 2. Push changes to upstream DNS provider, and view logs controller# rndc reload & tail -0f /var/log/daemon.log 3. Confirm all authoritative nameservers for the changed domain are now reporting the updated answers.

11.5.4 Managing partners

Test with a partner

1. Configure remap.conf for partner site 2. Add origin to zone file, regenerate zones 3. Push configuration to a sample edge 4. Test an edge with pac

Test an edge with pac function FindProxyForURL(url, host) { if (shExpMatch(url,"http://samplesite.com*")|| (shExpMatch(url,"http://www.samplesite.com*"))) { return"PROXY sampleedge.deflect.ca" } else{ return"DIRECT" } }

1. Create a pac file pointing to the sample edge. 2. Configure a test browser with pac file; eg proxy settings | automatic proxy configuration url 3. Set up the browser or extension (eg. Live HTTP Headers for Firefox 4. Load site and verify it is «via» the sample edge

11.5. Daily Tasks 113 Deflect Documentation, Релiз 1.4.0

Add a partner

1. Add new DNS domain to DEFLECT_CONTROLLER and DNS using existing records - put the zonefile directly into /var/named 2. Delegate to DNS. NB: this step should ; meanwhile. . . . 3. Add a record to source.network.tld - something like partner.com.source.network.tld 4. Push DNS; confirm partner.com.source.network.tld resolves 5. Editing remap.config, add the record to ATS config - use another partner as an example 6. Confirm all well and good with old records on new DNShost 7. Add partner to stats host 8. Engage partner for testing by setting their browser proxy to edge.your.dom (or create a .pac file 9. Strip out SOA and apex records (both A and NS, but not MX) to create zone template in /usr/local/deflect/etc/zones/holding. Replace non-apex A records with CNAME -> edge.your.dom where appropriate 10. Confirm time with partner for go-live 11. At agreed time, move zone template from zones/holding/ into zones/, Generate templated zone files and push to DNS(#Generate_templated_zone_files_and_push_to_DNS]

11.5.5 Apache Traffic Server configuration

Generally, you’ll only need to change remap.conf. records.conf is used for site specific configuration. Examine the files to see how they are configured, and consult Apache Traffic Server documentation. • Edit ATS config: controller# cd /usr/local/deflect/edges/your_DNET/usr/local/trafficserver/config bvi fi- le_to_edit.config • This will keep a dated backup of your edit, and mails a diff to sysadmin for monitoring. • Push the file to a staging host- in this example your_edge.your.dom cd .. deploy.sh -A your_DNET -p ats -H your_edge • Configure your browser to use your_edge.your.dom as a proxy for sites, conduct manual testing; – The things you have changed – A few things you haven’t changed too, just in case • Deploy new configuration controller# deploy.sh -A your_DNET -p ats -H ALL • Disable proxies and test again, results should be same.

11.5.6 Fail2ban rules

• Files are in /usr/local/deflect/etc/fail2ban/ • Edit with bvi.

114 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0

• They are deployed using: controller# deploy.sh -A your_DNET -p fail2ban -H your_edge (or ALL)

11.5.7 Revert a config change controller# ls -ltr old/borked_file.config*

• check for the last revision before the bad edit, then controller# bvi borked_file.conf • Use the editor to read in the old file. For example, in vim: dG:r old/borked_file.conf-date-name ddZZ

11.5.8 Monitoring tasks

Access Nagios https://deflect_controller/nagios3/index.php

Acknowledge an alarm

• Log into the Nagios web interface • Select the status detail of the test which is alarmed • Select «acknowledge»

Change monitoring configuration

1. Consult the nagios documentation e.g. Nagios Docs 2. Make a change to the nagios config controller# cd /etc/nagios3/conf.d bvi file_to_edit.cfg 3. Test the config controller# /usr/sbin/nagios3 -v /etc/nagios3/nagios.cfg 4. Fix any problems encountered, and once tests pass, have nagios re-read its config controller# /etc/init.d/nagios3 reload

Add a host to monitoring

If you’ve built a host from one of the scripts, it will be ready and waiting to be monitored- the nrpe agent will be running, accepting connections from DEFLECT_CONTROLLER and any backup hosts. 1. Go to nagios host dir controller# cd /etc/nagios3/conf.d/hosts 2. Copy an existing host- for example another edge controller# cp host.rackspace1.cfg host.datacentreN.cfg

11.5. Daily Tasks 115 Deflect Documentation, Релiз 1.4.0

3. Edit new file controller# bvi host.datacentreN.cfg update hostname references 4. Test and reload as above.

11.6 IP blacklisting and Firewall

11.6.1 IP tables

11.6.2 SYN flooding

To ensure the system is protected against SYN flooding, add these lines to /etc/sysctl.conf:

11.7 BotNetBDP

For an overview, see the BotnetDBP page.

11.7.1 Banjax and Swabber

For setup instructions see the Banjax and Swabber pages.

11.7.2 IP blacklisting with Fail2ban we still use fail2ban but main for non apache traffic server log parsing. It has been updated to banjax/swabber Deflect is primarily designed to resist distributed denial of service attack. This requires that Deflectbeable to resist simple denial of service attack in the first place. Deflect uses Fail2ban to deal with this kind of attack. Fail2ban is an intrusion detection and prevention tool which works based on analyzing the log files generated by different servers and daemons running on a system. In the case of Deflect, Fail2ban checksthe log file, generated by ATS and look for different kind of anomalies which suggest that a client reachingthe edge with a malicious intention. After finding an intruder, Fail2ban uses iptables to blacklist its ip. In this section, the basic configuration of Fail2ban for Deflect is explained.

Configuring Fail2ban

Config files live in

/usr/local/deflect/edge/etc/fail2ban for initial push and/or config update: deploy.sh-H edgename-p fail2ban

All the required packages are available in the distribution. apt-get-y install fail2ban

116 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0

The default rules are acceptable. Add the following to /etc/fail2ban files. It will block hosts for 300 seconds that make more than 100 requests in 10 seconds. jail.local: [ats-ddos] enabled = true port = http,https filter = ats-ddos logpath = /usr/local/trafficserver/logs/deflect.log maxretry = 100 findtime = 10 bantime = 300action= iptables[name=HTTP, port=http, protocol=tcp] filter.d/ats-ddos.conf: [Definition] failregex = ^ .* ignoreregex =

11.8 Origin security

11.8.1 General origin security

While your origin is behind Deflect, you will not be immune to all attacks - either targeted attacks oras part of the day-to-day attacks that any and all webservers are subject to. The topic of improving webserver security is a very broad one, and it would not be useful to comprehensively cover this on this page. There are a few simple things that can be done as a matter of course, however.

SYN cookies

SYN cookies are a safeguard against SYN flood attacks. To temporarily enable them in Linux, simply issue the following command echo1>/proc/sys/net/ipv4/tcp_syncookies

To permanently enable them, add the following to /etc/sysctl.conf net.ipv4.tcp_syncookies=1 iptables rules

If you don’t have any existing iptables rules set (check with iptables -L, you should set some basic rules. Your mileage may vary, so make sure that the rules you apply are sane. Misconfiguring your firewall will at best lock you out of your system. You should only change rules if you know what you’re doing! Amongst other things, rules are set to disallow access to all services running on the system other than those that are vital for normal operation of the site and for maintenance (ie web access and SSH). For a system running only ssh and a webserver running HTTP and HTTPs, the following rules will block off the use of all other TCP ports on the system. iptables -F #delete all rules iptables -A INPUT -i eth0 -p tcp –dport 22 -j ACCEPT iptables -A INPUT -i eth0 -p tcp –dport 80 -j ACCEPT iptables -A INPUT -i eth0 -p tcp –dport 443 -j ACCEPT iptables -A INPUT -j DROP

11.8. Origin security 117 Deflect Documentation, Релiз 1.4.0

Whenever changing firewall rules, make sure that your system is accessible and operates normally afterthe rules have been applied. Some web applications may malfunction if they cannot access specific ports. The above rules will not break any local access to ports, so database connections etc will function as normal.

11.9 Monitoring

11.9.1 Nagios and Nagiosgrapher

• See Daily Tasks http://DEFLECT\_CONTROLLER/nagios3/index.php - System monitoring and trends Nagios runs as a daemon in two places, and nagios agents run on every other host (ie the edges). The first nagios instance is on DEFLECT CONTROLLER, collecting data about all services, alerting us when things go down or cross configured thresholds. The second nagios server instance is tbd on backup, first tomonitor DEFLECT CONTROLLER’s nagios, eventually to become a live standby. The most important thing for us to monitor is availability of content, over HTTP, on a per-edge basis.

Nagios grapher

Nagios Grapher collections data using RRD, and presents it in graph format.

Nagios future monitor an object on the origin too both direct and via each edge parent test either HTTP object or availability of the nrpe agent should be configured as parent for each host. A parent test has this function: if „children“ fail which a parent is down, they do not issue alerts - though they will show as RED on the nagios web interface. This is to streamline diagnosis when a lot of ests fail at once. DNS DNS check against the nameservers, possibly integrated dns-then-http check other basics disk space, log size, log currency, cache size, traffic-to-origin (per origin?), traffic-to-edge, variation intraffic levels to different edges ATS stats already being recorded per minute, but not yet fed into monitoring. Secondary nagios The second instance runs (will run!) on backup, and its job is just to check that the first instance of nagios is functioning.configuration of the the two nagios instances will be such that if the primary goesdown, the secondary will continue monitoring in the interim. For the time being, the secondary just monitors the primary and alerts if that goes down.

118 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0

11.9.2 awstats

HTTP request volumes

11.9.3 logstash and kibana

11.9.4 Incident reporting

Under development. We use a wiki based incident system and email reporting of other events.

11.10 Deflect Apache Traffic Server

11.10.1 ATS Build Notes

Version 6.0.x

Prerequisites

• Install Debian-7.x (Wheezy) amd64 and upgrade it • Reboot • Create user and group (trafserv with UID and GID of 99) – If not already created from a old version (uid:gid 99:99)

groupadd -g 99 trafserv

useradd -g trafserv -u 99 -d /usr/local/trafficserver -m trafserv

• Prepare server for deveploment

apt-get install build-essential automake autoconf libtool flex bison

Compile from Source

Find the version you will use here. Add equalitie repo for apt-get:

# echo "deb http://users.deflect.ca/repo/ wheezy main" > /etc/apt/source.list.d/deflect.list # apt-get update # apt-get install libssl-dev libhwloc-dev libcap-dev tcl-dev libpcre3-dev libncurses5-dev libcurl4- ˓→openssl-dev libspdylay-dev # cd /usr/local/src # wget http://archive.apache.org/dist/trafficserver/trafficserver-6.0.x.tar.bz2 # wget http://archive.apache.org/dist/trafficserver/trafficserver-6.0.x.tar.bz2.md5 Pick the latest and replace the 6.0.x # md5sum trafficserver-6.0.x.tar.bz2 Make sure matches the trafficserver-6.0.x.tar.bz2.md5 # tar jxvf trafficserver-6.0.x.tar.bz2 # cd trafficserver-6.0.x (continues on next page)

11.10. Deflect Apache Traffic Server 119 Deflect Documentation, Релiз 1.4.0

(continued from previous page) # ./configure --prefix=/usr/local/trafficserver --enable-layout=Apache --with-user=trafserv --with- ˓→group=trafserv --enable-experimental-plugins \ # --enable-reclaimable-freelist --enable-cppapi --with-ncurses --enable-wccp --with-xml=libxml2 -- ˓→enable-spdy --with-build-number= # make # make install # cd /usr/local/trafficserver # mkdir .ssh ; chown trafserv:trafserv .ssh ; chmod 700 .ssh # mv conf/ dist-conf

Banjax

# apt-get install git-core libyaml-cpp-dev libyaml-cpp0.5 libre2-dev libzmq-dev libboost-dev # git clone https://github.com/equalitie/banjax.git # cd banjax # ./autogen.sh # ./configure --libdir=/usr/local/trafficserver/modules # make # make install

The banjax.so is in src/.libs/banjax.so • mv conf/ dist-conf

Additional

• Use diff to fix your „conf“ directory to your preference.

diff -rupN orig new > patch_orig-new.patch

• Files to pay attention to when configuring DNET. – cache.config – records.config – remap.config – ssl_multicert.config When happy with your migrated conf directory, launch this command:

# cp -a new-conf /usr/local/trafficserver/conf

Make sure the permissions and ownership are correct. Do not start the traffic server if you plan on using for the controller. It will write a lot of files that are not needed. We recommend to tar and bzip2 it up:

# cd /usr/local # tar jcvf trafficserver-6.0.x-deflect.tar.bz2 trafficserver/

120 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0

Conf Directory Recursive Patch Files

I created these diffs with method below cp-R orig new vi new/* ''This is just my way of saying, edit the files.'' diff-rupN orig new> patch_orig-new.patch

Apply patch with example above. Patch orig cd orig patch-p1<../patch_orig-new.patch *remember you can use--dry-run*

11.10.2 ATS SSL

Mostly lifed from here. This is still not tested. My notes only. I will remove this when thoroughly tested and I know it works

SSL Termination

All private keys must be hosted on the Edge unless browser will give a warning. Magic is now done in ssl_multicert.conf. Good information here dest_ip=xx.xx.xx.xx ssl_cert_name=cert.pem ssl_key_name=key.pem ssl_ca_name=ca.ca_bundle

Note: If the private key is located in the certificate file, then you do not need to specify the name of the private key ssl_ca_name= can be used to specify the location of a Certification Authorithy change in case that differs from what is specified under records.config’s proxy.config.ssl.CA.cert.filename

Client and ATS Only

Note: This would not be the type of setup we use unless we wanted to do a encrypted tunnel to origin. This setup would mainly be used if your origin was behind your firewall on a private network. This must be setup first, before we go on to Client, ATS and Origin

Client —–>—– HTTPS —>—— Edge <<——- HTTP ——->> Origin —-<—— HTTPS —<—— records.conf. All ssl files are going to be in conf/ssl

#CONFIG proxy.config.ssl.enabled INT 1(deprecated) #CONFIG proxy.config.ssl.server_port INT 443 (deprecated) CONFIG proxy.config.ssl.client.certification_level INT1 CONFIG proxy.config.ssl.server.cert.filename STRING NULL CONFIG proxy.config.ssl.server.cert.path STRING conf/ssl CONFIG proxy.config.ssl.server.private_key.filename STRING NULL CONFIG proxy.config.ssl.server.private_key.path STRING conf/ssl (continues on next page)

11.10. Deflect Apache Traffic Server 121 Deflect Documentation, Релiз 1.4.0

(continued from previous page) CONFIG proxy.config.ssl.CA.cert.filename STRING NULL CONFIG proxy.config.ssl.CA.cert.path STRING conf/ssl

See ssl_multicert.conf See proxy.config.http.server_ports

Client, ATS and Origin

This is the setup we will concentrate on.

Client —–>—– HTTPS —>—— Edge <<——- HTTPS ——->> Origin —-<—— HTTPS —<—— records.conf

#CONFIG proxy.config.ssl.auth.enabled ????? I can't find info on this #CONFIG proxy.config.ssl.server_port (deprecated) CONFIG proxy.config.ssl.client.verify.server INT CONFIG proxy.config.ssl.client.cert.filename STRING NULL CONFIG proxy.config.ssl.client.cert.path STRING conf/ssl CONFIG proxy.config.ssl.client.private_key.filename STRING NULL CONFIG proxy.config.ssl.client.private_key.path conf/ssl CONFIG proxy.config.ssl.client.CA.cert.filename STRING NULL CONFIG proxy.config.ssl.client.CA.cert.path conf/ssl

11.10.3 ATS SNI

11.11 Deflect and Apache Traffic Server

11.11.1 Design

Apache Traffic Server (ATS)

For manageability, trafficserver config (like all our configs) is edited centrally and deployed to edge nodesvia a script. We use several deviation from stock config, among which are • reverse proxy mode • pristine host headers For more information on the meaning of these terms, consult the trafficserver documentation. For more accurate and up-to-date information on all our deviations from stock configuration, simply diff a given file against the original (which can be found in /usr/local/trafficserver/config/.config

11.11.2 Update an Apache Traffic Server plugin

• build the plugin using plugin build method ; e.g. axps, gcc, cc • copy into /usr/local/deflect/trafficserver/modules deploy.sh -p ats -H edgeN

122 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0

11.11.3 Build new Apache Traffic Server (ATS) version

Version 3.2.0

Prerequisites: Debian-Squeeze, Deflect, user trafserv:trafserv already created (UID:99, GID:99). Download source to /usr/local/src/

$ cd /usr/local/src ... find your mirror at http://www.apache.org/dyn/closer.cgi/trafficserver/trafficserver-3.2.0.tar. ˓→bz2 $ wget http://download.nextag.com/apache/trafficserver/trafficserver-3.2.0.tar.bz2 Note: Debian does not come with bzip2 by default :/ $ apt-get install bzip2 $ tar jxvf trafficserver-3.2.0.tar.bz2 .... trafficserver-3.2.0/ $ cd trafficserver-3.2.0/ Note: Box probably does not have development tools installed. Below install should get you by on a␣ ˓→deflect box. $ apt-get install build-essential $ ./configure --with-user=trafserv --with-group=trafserv --enable-layout=Apache --prefix=/usr/ ˓→local/trafficserver Note: I add the --prefix= just in case the default changes. Also note the uppercase Apache. It␣ ˓→matters. Changed the default user and group for Apache layout since we already have them created for the␣ ˓→old 3.1.3 install. $ make ... wait approximately 10 minutes $ service trafficserver stop ; mv /usr/local/trafficserver /usr/local/deflect/archive/ ˓→trafficserver-3.1.3 ; make install

Config File Changes

Not going to do a step-by-step here. Explain differences below. Config changes a pretty manual process. Diff the stock config from previous trafficserver version: diff-uwr/usr/local/deflect/archive/trafficserver-previous/conf/usr/local/trafficserver/conf

If there are no differences between config files, then we can carry on using the same ones. Ifthereare differences, you’ll need to be careful to see whether we need new options, and you’ll need to do thefollowing: list all our variation from stock config for the previous version, then merge into the new config: diff-uwr/usr/local/deflect/archive/trafficserver-previous/conf//usr/local/deflect/tsconf

Put the new config files into place Apply all the differences from stock (as listed from the previous version) to the new config files Nominate a test edge, then: deploy.sh-p ats-H testedgeN

Test with edge_check.sh if all is well, then: deploy.sh-p ats-H ALL

11.11. Deflect and Apache Traffic Server 123 Deflect Documentation, Релiз 1.4.0

What has Changed 3.2.x

• Upgrade conf to 3.2.x. most lifted from [ https://cwiki.apache.org/confluence/display/TS/Upgrading+ to+v3.2 ATS Upgrade to 3.2] – Removed the use of records.config to define SSL certificates. Certificate file names mustnowbe in ssl_multicert.config. ∗ The proxy.config.ssl.server.cert.filename and proxy.config.ssl.server.private_key.filename configuration parameters have been removed. The ssl_multicert.config has examples ofa typical configuration,eg: dest_ip=192.168.9.9 ssl_cert_name=cert.pem ssl_key_name=key.pem

• Removed proxy.config.http.quick_filter.mask from records.config. This functionality has been moved to ip_allow.config. See the example that comes with your source. • Changed the way ports are configured for HTTP. The following configuration values are now deprecated proxy.config.http.server_port proxy.config.http.server_port_attr proxy.config.http.server_other_ports proxy.config.http.ssl_ports

All of these are replaced by a single new configuration value. The value is a STRING consisting of a sequence of port specificiations separated by spaces or commas. Each specification configures a listening port forATS. Each specification is a set of keywords separated by colons. Some keywords can also have values which may be separated from the keyword by an optional „=“ character. The case of keywords is ignored. The keyword order is irrelevant unless keywords conflict (eg tr-full and ssl) in which case the right most keyword dominates..: proxy.config.http.server_ports

Eg: Note: ipv4 is default so the 2 examples below are the same:

80 80:ipv6 443:ssl 80:ipv4 80:ipv6 443:ipv4:ssl

124 Роздiл 11. Deflect DIY Deflect Documentation, Релiз 1.4.0

Stri- Description ng numberIP port, required. ipv6 Use IPv6 ipv4 Use IPv4. Default tr- Use inbound transparency (to client) in tr- Use outbound transparency (to server) out tr- Full transparency , both inbound and outbound full ssl Use SSL termination. Note: For SSL you must still configure the certificates , this option handles only the port configuratio n bli- Use as a blind tunnel (for CONNECT) nd ip- Use the keyword value as the local inbound (listening) address. This will also set the address family in if not explicitly specified. If the IP address family is specified by ipv4 or ipv6 it mustagreewith this address ip- Use the value as the local address when connecting to a server. This may be specified twice, once out for IPv4 and once for IPv6. The actual address used will be determined by the family of the origin server address

See also

• Logging

11.11. Deflect and Apache Traffic Server 125 Deflect Documentation, Релiз 1.4.0

126 Роздiл 11. Deflect DIY Роздiл 12

Localization

We welcome anybody with the time and talent to lend a hand translating this documentation into other languages. If you wish to contribute to this website by editing or adding to its resources, please read the Contributer instructions.

12.1 How to translate Deflect documentation

The Deflect documentation is translated using the Transifex platform. To get started you will needto create a Transifex account and join the Deflect documentation project. For more detailed information check out the helpful Getting Started guide on Transifex. New translations will be deployed to the website at regularly intervals as they are completed.

127 Deflect Documentation, Релiз 1.4.0

128 Роздiл 12. Localization Роздiл 13

Contribute

• How to contribute • Add or edit files – Add a new file or directory – Edit files – Add or edit files by command line – Contribute directly to the documentation • Important notes – reStructuredText

This website aims to share collected experience and provide directions to Deflect users and to sys admins who wish to install their own Deflect instances on their server. It is a work in progress and we welcome contributions. Please, read this guide to learn how to contribute to this website. If you wish to translate this website into a different language, read these instructions.

13.1 How to contribute

The Deflect documentation website is generated automatically from a repository hostedon GitHub. The Sphinx documentation tool is used to convert the text files to HTML. All text files are formatted in reStructuredText, a lightweight markup language that you can use to format the text. The syntax of reStructuredText is easy to use and you can find the references you need here. To contribute to Deflect documentation, the first thing you need to doisto create a GitHub account. Once you have created an account, you can:

129 Deflect Documentation, Релiз 1.4.0

• Edit the repository in your own branch and submit a pull request. • Become a member of the project and edit the master repository directly. In this case all your edits will be deployed to the website within few minutes.

13.2 Add or edit files

13.2.1 Add a new file or directory

To add a new file or directory to the project, go tothe master repository and select one of the following option from the top bar: • Create new file - By selecting this option, you will be able to add a new file by editing it in the web interface. It should be saved with the .rst extension. • Upload files - This option allows you to upload a file that you have already created in your local computer. This is the option you need to select, for example, if you want to add images or PDF files. Images should be uploaded to the img/ directory.

13.2.2 Edit files

To edit an existing file, just select it in the file list to view the text and then click on the «Edit» peniconin the right-top corner. An editing interface will open where you can change both the title of the file and the text. When you’re done, click on the «Commit changes» button in the bottom left corner of the window.

13.2.3 Add or edit files by command line

If you know how to use git from a command line, you can just clone the repository to your local computer and then commit your changes by submitting a pull request or by pushing directly your changes to the master repository if you’re a member of the project.

13.2.4 Contribute directly to the documentation

If you are sure of what you are doing and wish to contribute directly to the documentation, you can ask us to become a member of the documentation project. Please write to us at deflect @ equalit . ie to explain who you are and what you would like to contribute with. Once we have accepted your access request, you will be able to edit the repository directly, and all your changes will be deployed to the Deflect documentation website within a few minutes.

13.3 Important notes

13.3.1 reStructuredText

All text files of Deflect’s documentation are written in reStructuredText. Please read thebasicsof reStructuredText before you start contributing to this project.

130 Роздiл 13. Contribute Роздiл 14

Support us

All support for our project is very welcome. Please contact us.

131 Deflect Documentation, Релiз 1.4.0

132 Роздiл 14. Support us Роздiл 15

Як ми Вас захищаємо

1. Зареєструватись 2. Налаштування 3. Змiнiть DNS та вперед!

133