Skip to content

Examples-pilot fixes#63

Open
SergeyFM wants to merge 4 commits into
masterfrom
examples_pilot_fixes
Open

Examples-pilot fixes#63
SergeyFM wants to merge 4 commits into
masterfrom
examples_pilot_fixes

Conversation

@SergeyFM
Copy link
Copy Markdown

Прошу рассмотреть исправления дистрибутива GMonit onPrem с самоподписанными сертификатами.
Исправлены ошибки, добавлена инструкция по инсталляции.

1. исправлен путь до geoip.mmdb для grafana
2. исправлен путь до сертификатов для nginx
1. Заключил названия переменных в скобки, чтобы они разрешались
2. Добавил подробностей по ssl протоколам
3. отключил ssl_stapling, чтобы не было лишних warnings в логах
1. Указал версию, для которой этот дистрибутив проверялся
2. Заменил CA_FILE на pem фал
3. Отформатировал файл для ясности
Добавил инструкцию по инсталляции этого дистрибутива GMonit.

# Версия GMonit
TAG=
TAG=v3-3135
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это приведет к ошибкам, не стоит прописывать конкретные значения.
Например, кто-то забудет и будет использовать старую версию

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нам обязательно надо указывать ту версию, на которой проверялся этот дистрибутив. Поэтому считаю, что надо указывать версию на которой этот дистрибутив проходил QA.

# Для этих доменов выпущен самоподписанный сертификат на 100 лет.
# Команды для выпуска сертификата вы найдете в директории ./ssl
# Passwords
GRAFANA_ADMIN_PASSWORD=123456789 #пароль для admin в Grafana
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

так делать нельзя, т.к. из-за ошибок у клиентов будет дефолтный пароль, и этот дефолтный пароль общедоступен

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs/lite.md

Line 27 in f66e11c

`openssl rand -base64 <n>`, где `<n>` - длинна пароля/токена
пользуйтесь

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не совсем корректно, так как <n> - количество случайных байт, которые будут сгенерированы до кодирования, длина результата будет другой из-за base64.
В инструкцию для lite на маркетплейсе поехала незамердженная версия.

ssl_certificate SSL_CERT;
ssl_certificate_key SSL_KEY;
ssl_trusted_certificate SSL_CHAIN_CERT;
ssl_certificate ${SSL_CERT};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

отступы не стоит менять

@@ -0,0 +1,213 @@
# Инструкция по подготовке и запуску GMonit
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

файл должен называться Readme.md чтобы он открывался при заходе в директорию на гитхабе


### 6. Разместить файлы сертификатов
- Скопировать созданные сертификаты в директорию `gmonit/ssl` дистрибутива GMonit.
- Файл `rootCA.crt` на сервере `sudo cp rootCA.crt /usr/local/share/ca-certificates/` -> `sudo update-ca-certificates`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

так нельзя делать по соображениям безопасности, и нет причины это делать

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Напиши пожалуйста подробнее, как надо делать.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тебе нужно понять что именно ты тут делаешь.
Ты добавляешь свой сертификат в систему, когда, не если, приватный ключ утечет, то злоумышленник сможет притвориться ЛЮБЫМ сайтом, в том числе банком, и провернуть атаку человек посередине

- На машине пользователя (Windows) добавить домены в `C:\Windows\System32\drivers\etc\hosts`.
- На Linux машине: `sudo nano /etc/hosts`.

### 4. Выпустить Root Certificate Authority (CA)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отмечу еще, что если клиенту нужны самоподписанные сертификаты, то почти наверняка
в компании есть собственный корневой сертификат и процессы по выпуску конечных сертификатов.

Может быть не стоит здесь давать эти рекомендации.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Наша задача: сделать установку нашего дистрибутива гладкой и понятной. Я отметил, что при наличии сертификатов, эти шаги можно пропустить. А для тестовой установки проверенные шаги по генерации сертификатов позволят сотруднику не совершить ошибок при создании сертификатов.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Чтобы не было ошибок для QA там лежали сертификаты, выпущенные на 100 лет или вроде того

### 5. Выпустить SSL-сертификат
- Создать конфигурационный файл.
```bash
nano cert.conf
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cat <<EOF > cert.conf
[req]
default_bits = 2048
default_md = sha256
...
EOF

image: umputun/nginx-le:v1.7.0
volumes:
- ./nginx/ssl:/etc/nginx/ssl
- ./ssl:/gmonit/ssl
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines -16 to +18
ssl_certificate SSL_CERT;
ssl_certificate_key SSL_KEY;
ssl_trusted_certificate SSL_CHAIN_CERT;
ssl_certificate ${SSL_CERT};
ssl_certificate_key ${SSL_KEY};
ssl_trusted_certificate ${SSL_CHAIN_CERT};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем?[2]

Comment on lines +23 to +24
ssl_stapling off;
ssl_stapling_verify off;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

оно и так выключено


# in caddy it's also unlimited, leaving it as is for now
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 Syntax: 	ssl_ciphers ciphers;
Default: 	

ssl_ciphers HIGH:!aNULL:!MD5;

ssl_trusted_certificate ${SSL_CHAIN_CERT};

# in caddy it's also unlimited, leaving it as is for now
ssl_protocols TLSv1.2 TLSv1.3;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 Syntax: 	ssl_protocols [SSLv2] [SSLv3] [TLSv1] [TLSv1.1] [TLSv1.2] [TLSv1.3];
Default: 	

ssl_protocols TLSv1.2 TLSv1.3;

volumes:
- ./ssl:/gmonit/ssl
- ./***.mmdb:/gmonit/geoip.mmdb
- ./geoip.mmdb:/gmonit/geoip.mmdb
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это наверное в .env вынести просто и здесь подставлять

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants