Відгук: James Clear – Atomic Habits

Зовсім забув сказати, прочитав книжку Atomic Habits. Твір дуже добре систематизує те, що вам вже може бути відомо з інших матеріалів. Якщо раніше ви вважали Power of Habit кращим твором на цю тему, тепер у вас є новий улюбленичок. Джеймс Клір не спростовує роботу Чарльза Дугіґґа, а радше впорядковує та систематизує її. В «Атомарних звичках» значно менше яскравих прикладів з історії великих корпорацій, зате до біса методичних вказівок, практичних настанов та інших матеріалів.

Якщо не гортати, а вчитуватись, книжка дуже добре перегукується з сучасними популярними філософськими поглядами. Це все класно відбивається на вашому сприйнятті історій успіху, змушує скептичніше ставитись до критеріїв досягнення цілей, та взагалі натякає що варто переглянути життєві орієнтири. І навіть якщо ви не готові позбавитися ілюзії свободи волі та все ще сприймаєте успіх та поразку як результати рішень окремих індивідуумів, ця книжка робить вас на крок ближче до дійсності.

Ви – це історія, досвід, результат мільярдів інтеракцій з іншими об’єктами у всесвіті. І на успішність чи провальність ваших дій впливає занадто багато факторів, щоб ваша «воля» відігравала на їхньому фоні якусь помітну роль. Хіба що, ви будете здійснювати спроби вплинути на всесвіт наполегливо, регулярно, систематично. Хіба що, ви змиритеся, що задля досягнення результату талант менш важливий, ніж системність у докладанні зусиль. Хіба що, ви усвідомите, що ви й є система.

Ну і центрова цитата, звісно ж,

Ви не підіймаєтеся до рівня ваших цілей. Ви падаєте до рівня вашої системи.

Звинувачення щодо зламу Equifax

Сьогодні Мін’юст США нарешті оголосив звинувачення (заочно) китайським державним хакерам, які брали участь у зламі Equifax. Через тиждень після того, як серед усього іншого суд зобов’язав компанію-жертву витратити один мільярд доларів на кібербезпеку. Та це лише початок історії.

Те, що китайці зламали Equifax, в певних колах вже давно публічна інформація. Ми в Berezha Security в програмі нашого тренінгу з безпечної розробки використовуємо злами Equifax, Anthem та Office for Personnel Management (OPM), як стандартний приклад обрання мішеней для операцій міжнародного кібершпіонажу. Звучить пафосно, але насправді все дуже просто, дивіться.
1. Зламавши страхову компанію із монопольним держзамовленням Anthem, китайці отримали список усіх держслужбовців у США.
2. Зламавши глобальний відділ кадрів держагенцій OPM, китайці отримали список усіх держслужбовців США, які не мають доступу до інформації з грифом “SECRET” та “TOP SECRET”. Бо їх, як і скрізь у світі, супроводжують не звичайні кадри, а “режимщики-секретчики”.
3. Зламавши бюро кредитних історій Equifax, китайці отримали дані про те, як люди яких немає в другому списку, але які є в першому, вносять платежі по кредитах. І якщо раптом хтось із них запізнився два-три рази зробити внесок, чуйні китайці готові допомогти їм розв’язати ці матеріальні складності в обмін на шматочок батьківщини.

Ось така елементарна вправа з теорії множин. Тому, офіційна заява, що один із трьох інцидентів виконали китайські хакери в погонах, ставить крапку в обговоренні можливих версій щодо виконавців усіх трьох операцій. У диванних експертів, для яких усе це теорія змови, можуть виникнути сумніви. Розумію, не всі люди однаково обдаровані інтелектом. Але думаю, що посперечатися їм буде краще не зі мною, а з сім’ями страчених американських розвідників, яких китайському уряду вдалося виявити у схожий спосіб серед дипломатів, що знаходилися у Китаї.

Дехто іронізує, що звинувачення американської правоохоронної системи китайцям до одного місця. Це не так. По-перше, це не просто звинувачення, це повна деанонимізація оперативників супротивника та чіткий сигнал усім і всюди: так буде з кожним. По-друге, не треба забувати, що список країн, що мають зі Штатами угоду про екстрадицію, дуже довгий. І по-третє, в американської правоохоронної системи дуже довга пам’ять.

https://www.justice.gov/opa/pr/chinese-military-personnel-charged-computer-fraud-economic-espionage-and-wire-fraud-hacking

Принцип незалежності перевірки

Натрапив на ситуацію, коли в досить принциповій суперечці був змушений пояснювати колезі, що таке принцип незалежності перевірки, чому він важливий, як він захищає від конфлікту інтересів, і навіщо це все взагалі. Звісно, що це мене здивувало, адже в нашій уяві усі люди, яких ми поважаємо як професіоналів, знають принаймні стільки само, як і ми. Насправді ж це омана, і людей зі справжнім аудиторським досвідом в кібербезпеці, а тим більше у сфері захисту програмного забезпечення, не дуже багато. Я знаю двох, зі мною включно. Тому, робити про це доповідь напевно то занадто, а от написати невеличкого поста я себе змусив.

Отже, давайте по черзі. Що таке конфлікт інтересів? Це така ситуація, коли наше особисте заважає професійному, або коли наші професійні пріоритети конфліктують між собою. Крайній випадок: ваша друга половина пише код, а ви його перевіряєте. Ви можете мені зараз мамою поклястися, що будете об’єктивні та неупереджені у своїх діях та висновках, але ми обоє знаємо, що це не так. Щось в цій ситуації буде не так як зазвичай. Уважність, прискіпливість, суворість формулювань. І щось піде не так. Бо це нормально. Це людська природа і з цим нічого не зробиш. Ви свідомо чи несвідомо будете намагатися збалансувати в собі дві ролі й в результаті принаймні одну з них, а скоріш за все обидві, провалите. Ви або погано перевірятиме, або погано сформулюєте наслідки, або будете після цього поганим партнером бо підставили. Тому якщо ви обоє не є клінічними соціопатами в такі ситуації краще не потрапляти.

Тепер менш мелодраматичний приклад: ваші колеги девелопери писали код, а вам його перевіряти. Тут все залежить від ставок. Якщо мова про внутрішні процеси, в яких всі знахідки пофіксять та процес піде далі, то тут ризику замало, щоб його обговорювати. Якщо ж ситуація публічна та має широкий розголос, як наприклад дискусія про перевірку безпеки додатку Дія, яка завела нас в ці рядки, то все різко змінюється. Є зовнішні загрози для компанії, тому в усіх задіяних осіб виникає потенційна корпоративна або персональна відповідальність за якість виконаної роботи. Девелопери можуть вигрісти за те, що погано розробили, безпечники за те, що погано перевірили девелоперів, а менеджмент за те, що погано це все організував. Зокрема, не попіклувався про усунення конфлікту інтересів. Адже якої б ми високої не були думки про професійний рівень наших колег, «ми не беремо на роботу мудаків» — це не найкраща корпоративна стратегія. Ми не хочемо, щоб між колегами в одному колективі виникали робочі конфлікти через те, що ми змушуємо друзів перевіряти роботу одне одного. І тим більше ми не хочемо, щоб занадто амбіційні та корпоративно-відповідальні менеджери мали змогу все «розрулити» в ручному режимі. Тому ми наймаємо зовнішній аудит для перевірки фінансової звітності та робимо пентести за допомогою незалежних компаній.

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

Отже, підсумуємо. Не варто сприймати принцип незалежності перевірки у вузькому контексті перевірки власної роботи або роботи колег. Звісно, я не хочу, щоб мій звіт про пентест додатку, який писали мої друзі, побачили треті особи. Це було б щонайменше якось дивно. Принцип незалежності ширший і він існує не для того, щоб ним нехтувати з огляду на конкретні обставини. Конфлікт інтересів настільки складна ситуація, що буде простіше просто не дати їй виникнути.

Бережіться.

Algo VPN: Personal DIY VPN. For normals.

In this post, I walk you through the process of creating your own self-managed do-it-yourself VPN server running Algo VPN.

I have spent some time teaching normal non-tech people how to use Algo VPN and other Do-It-Yourself VPN solutions, and there are several issues that we encountered each time. So I wanted to put up a manual that everyone could use and that helps remove those issues. If you still find problems along the way, please let me know.

First, a few words about the solution: Algo is not the easiest way to set up a personal VPN, but I think it is the best. Using Algo VPN alternatives, such as Outline or OpenVPN AS, might be simpler but far from better. I will not discuss the drawbacks here; I will say that I tried them and used them and many more for a while. After that, I have found Algo the best possible solution for my overall setup, which ensures a) top speed, b) native OS support on all clients, c) open design, and d) minimal overall potential for user tracking.


Read this manual carefully before you start. It will save you a lot of pain.

There is one thing you will need before we start. It is an active Amazon account with a payment method linked to it, as we will use Amazon LightSail as a cloud engine for the virtual hosts we create. LightSail provides the first month of free usage, but you will still need a credit card to activate the service.

Step 0. Create a deployment user account in IAM

First, let’s create a user account that we will need during the installation. We will create it in Amazon IAM, assign a policy to it, and then input its access keys to Algo when asked.

Go to IAM users configuration console to create a new user: https://console.aws.amazon.com/iam/home#/users$new?step=details. Give the user a unique name and mark its access type as programmatic.

Create Algo user in AWS IAM

Next step, select “Attach existing policies directly” and then press the “Create policy” button.

Create AWS ISM policy for Algo user

A new browser tab will open for policy creation. Edit the policy using JSON mode.

Create AWS IAM policy as JSON

Copy and paste the JSON content below to the policy editor. You can find the original policy in Algo documentation: https://github.com/trailofbits/algo/blob/master/docs/deploy-from-ansible.md#lightsail.

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "LightsailDeployment",
"Effect": "Allow",
"Action": [
"lightsail:GetRegions",
"lightsail:GetInstance",
"lightsail:CreateInstances",
"lightsail:OpenInstancePublicPorts"
],
"Resource": [
"*"
]
}
]
}

When the JSON content is there, preview the policy.

Edit AWS IAM policy as JSON

Give it a name and then hit “Create”.

Save AWS IAM policy

Go back to the IAM session and hit the refresh button to see your newly created policy in the list.

Refresh AWS IAM policy

Select the new policy by checking the box next to it and proceed.

Attach AWS IAM policy to Algo user

Skip the next step — don’t assign any tags — and go straight to Review your new user. After reviewing, hit “Create user.”

Review and create AWS IAM policy

If everything went well, you would see your new user and its access key parameters.

Review Algo IAM user

Copy these parameters somewhere safe and keep them until Algo asks you for them.

Step 1. Create a jump host

Now, let’s create a temporary jump host that we will use to run Algo. Running Algo could be hard if you are not running Linux or macOS on your desktop, so I found it more convenient to create a jump host for that. If you already have a Linux machine, you can skip this step.

Login to Amazon and go to https://lightsail.aws.amazon.com/ls/webapp/home/instances. There, manually create a new Ubuntu virtual host in any region.

Create Amazon LightSail instance

Make sure you create an “OS only” Linux host running Ubuntu 18.04 LTS.

Select Ubuntu Linus as instance OS

The most economical plan should be fine. Give the instance a unique name.

Select instance size and name

After the instance has been deployed, hit the terminal button. It will open an SSH session window.

Open instance virtual console
Review instance virtual console

Step 2. Install and configure Algo VPN

In the console window, run the following commands. You can copy and paste them to the terminal. When asked, “Restart services during package upgrades without asking?” answer “Yes.”

git clone https://github.com/trailofbits/algo
sudo apt update
sudo apt install -y python3-virtualenv
cd algo
python3 -m virtualenv — python=”$(command -v python3)” .env &&
  source .env/bin/activate &&
  python3 -m pip install -U pip virtualenv &&
  python3 -m pip install -r requirements.txt

If you did everything correctly, you will see something like this in the end.

Clone Algo and install Python virtual environment

Next, you will need to edit the config file with nano or any other console-based text editor. If you are new to nano and the Linux command line, make a copy of the config file before editing it.

cp config.cfg config.bak
nano config.cfg

Once the editor is open, go to the “users” section and change it to reflect your user plan. Make sure there is a line for every device you are planning to put through the VPN server. It is important to note that adding as many users as there will be people using VPN is not enough. In this case, they might experience networking problems while simultaneously using VPN on different devices.

Edit Algo setup configuration

After you have finished editing the file, exit and save by pressing Ctrl+X, choosing “Yes,” and pressing Enter.

Step 3. Run Algo to deploy your VPN server

Now, run the Algo script and follow the instructions below to set up the VPN service correctly. If you make mistakes, don’t worry: you can abort the script by pressing Ctrl+C, typing “A,” and restart it anytime.

./algo

The first thing Algo will ask you is the cloud provider to use. We will stay with Amazon LightSail for the sake of this manual.

Select VPN server cloud provider

Next, give your VPN server a unique name.

Choose VPN server name

When asked “Do you want macOS/iOS IPsec clients to enable “Connect On Demand” when connected to cellular networks?” and “Do you want macOS/iOS IPsec clients to enable “Connect On Demand” when connected to Wi-Fi?” answer “Yes”: type “y” and press Enter. This will allow you to configure your clients to route all traffic through the VPN server at all times.
When asked, “List the names of any trusted Wi-Fi networks where macOS/iOS IPsec clients should not use “Connect On Demand,” don’t answer anything. You will be able to configure it later at the client-side if required.

When asked “Do you want to retain the keys (PKI)?” your answer will depend on whether you have plans to add more VPN users in the future. In this manual, we will answer “Yes” and demonstrate how to retain the PKI keys and Algo configurations for future use. But it is important to understand that if someone gets ahold of your PKI keys, they would be able to fully compromise your VPN server and all your network communications through it as a result.

When asked “Do you want to enable DNS ad blocking on this VPN server?” I recommend answering “Yes.” We are going to change this configuration later manually. If you are lazy, it will allow you to skip that part and fall back to the Algo default adblocking mechanism. However, it is worth noting that in this case allowing access to particular resources you would like to whitelist will be much more complicated, and we are not going to cover it in this manual.

When asked “Do you want each user to have their own account for SSH tunneling?” answer “No.” If you have reasons to do otherwise, you probably do not really need this manual.

Now, you will have to use the access key credentials of the technical user we have previously created in IAM. Copy “Access key ID” and paste it to the Algo input in your jump host SSH window as “aws_access_key.” Then, copy the “Secret access key” and paste it to Algo as “aws_secret_key” at the next step. To ensure your content is pasted correctly, use the built-in clipboard editor instead of just pasting the data into the window.

Wait until Algo setup runs
Insert cloud access key

Once the keys are inserted correctly, Algo will proceed to region selection.

Select VPN server cloud region

You can choose a region of your liking based on your preference of jurisdiction and privacy regime. Also, keep in mind that it will affect the websites’ behavior (e.g., default language) as you will be seen as a resident of the selected region. For instance, if you speak French, I assume Paris is the location of your choice.

If everything went well, there would be no more questions, and Algo will start deploying your new VPN server. At this point, you clearly understand why I have recommended you to read through the manual and collect the keys before you run Algo. You have probably disconnected a few times from your jump host console and had to start the process from scratch. So, while you are waiting for Algo to complete, make sure you generate some action in the console window — just press Enter once in a while to prevent disconnection.

Once the Algo script is complete, you will see the following picture. Copy the full text of the congratulations message and put it somewhere safe. The last 3 lines are the most important.

Wait until Algo setup is complete

Step 4. Download your VPN configurations

Next, zip and download the Algo directory. Run the following commands in the console.

cd ..
sudo apt -y install zip
zip -e -x “algo/.env/*” -r algo.zip algo/

Zip utility will ask you for a password. Select a strong one. Then, create a new directory “www,” move the zip file there, enter it, and fire up a simple web server.

mkdir www
mv algo.zip www/
cd www
sudo python3 -m http.server 80

Now, open the public IP address of your jump host in a new browser window. You can find the IP in the LightSail console.

Access jump host via HTTP
Download VPN client config

Just download the archive to your local disk and unzip it. Make sure you stop the webserver after that.

Stop the HTTP server

Check if all the config files are present in the archive.

Access VPN client configuration files

If you see the directory named by IP address and a bunch of config files in it, this means that everything went well, and you can shut down or kill your jump host now. In the LightSail console, you should see the newly created VPN server with the name you gave it during the Algo execution and the IP address the same as in the “configs” subdirectory name.

You can start using your VPN by configuring the client devices. I recommend using native WireGuard software wherever possible. Otherwise, use IPSec/IKE2.


Next, I will show you how to configure DNS-based anti-tracking mechanisms in your new VPN service. For now, play around with it and tell me if you had any trouble configuring it.

Прочитано в 2019

Давав собі обіцянку у 2019 році більше читати. Ніби вийшло, хоча хотілося б іще більше. На жаль, подкасти та новини забирають більше часу, ніж здається. Але і цю проблему вже вирішую: подробиці згодом, але головне правило – назад до RSS. Щодо книжок – спрацьовує тактика паралельного читання трьох творів: одного в аудіо, одного на папері, і одного в Kindle. Останній варіант, щоправда, по швидкості значно “просідає”. Також, зайшов варіант із купівлею українських перекладів творів, прочитаних раніше в оригіналі чи російською.

Отже, з того, що варто згадати з 2019.

По роботі
– Shoshana Zuboff. The Age of Surveillance Capitalism: The Fight for a Human Future at the New Frontier of Power
– Bruce Schneier. Click Here to Kill Everybody: Security and Survival in a Hyper-connected World

Для душі
– John Brockman et al. This Will Make You Smarter: New Scientific Concepts to Improve Your Thinking
– Brian Christian, Tom Griffiths. Algorithms to Live By: The Computer Science of Human Decisions
– Stephen Hawking. Brief Answers to the Big Questions
– Annaka Harris. Conscious: A Brief Guide to the Fundamental Mystery of the Mind

Щоб не казали, що не читаю популярну літературу
– Cixin Liu. The Three-Body Problem 
– Cixin Liu. The Dark Forest
– Cixin Liu. Death’s End

Бо модно
– Історія України від діда Свирида, том І
– Ентоні Берджес. Механічний апельсин
– Тарас Шевченко. Кобзар (ювілейне видання)

Перечитав українською
– Джордж Орвелл. 1984
– Пол Екман. Теорія брехні

Перечитав в оригіналі
– Daniel Kahneman. Thinking, Fast and Slow
– Richard Dawkins. The Selfish Gene

Читайте більше.