Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Добавить аутентификацию / Add authentication #1

Closed
Enfernuz opened this issue Feb 3, 2018 · 1 comment
Closed
Assignees

Comments

@Enfernuz
Copy link
Owner

Enfernuz commented Feb 3, 2018

Т.к. RPC-сервис предполагает доступ к персональным и финансовым данным, критически важным является предоставление пользователю механизмов аутентификации клиентов сервиса.
ZeroMQ поддерживает, помимо никакой, два вида аутентификации:

  • PLAIN: базовая аутентификация по user/password. Лучше чем ничего, но всё равно очень уязвимо;
  • CURVE: аутентификация и шифрование с использованием криптографии.

Есть ещё механизм GSSAPI -- он был добавлен в более поздних версиях ZeroMQ и имплементирован не во всех языковых обвязках ZeroMQ.

Для работы с CURVE библиотеке ZeroMQ нужна библиотека libsodium. В поставке бинарных файлов для Windows находятся библиотеки, не имеющие связи с libsodium. К тому же, крайняя версия ZeroMQ там ограничивается 4.0.4, в которой всё ещё присутствует баг, при котором при использовании PLAIN-аутентификации клиент автоматически переоткрывает соединение при неудачной попытке аутентификации (см. zeromq/libzmq#882 -- исправлено в 4.1.0).

Таким образом, необходимо собрать крайнюю стабильную версию библиотеки ZeroMQ под Windows, слинкованную с libsodium, и внедрить её в проект.


As the RPC-service is meant to give access to personal and financial data, it is of critical importance to give the user some authentication mechanisms.
ZeroMQ supports two types of authentication (aside from none):

  • PLAIN: basic authentication on a user/password pair. Better than nothing but still very unreliable;
  • CURVE: cryptographic authentication & encryption

There's another one called GSSAPI -- it was added in the later versions of ZeroMQ and haven't yet been implemented in many ZeroMQ language bindings.

To support CURVE ZeroMQ needs a library named libsodium. The binary files package for Windows consists of binaries that are not linked with libsodium. Besides, the ZeroMQ library in those packages has the version up to 4.0.4 in which there's still a bug when using the PLAIN authentication: the client automatically reopens the connection after a failed authentication attempt (see zeromq/libzmq#882 -- it was fixed in 4.1.0).

Thus, we need to build the last stable version of ZeroMQ on Windows linked against libsodium and integrate it into the project.

@Enfernuz Enfernuz self-assigned this Feb 3, 2018
@Enfernuz Enfernuz changed the title Add authentication / Добавить аутентификацию Добавить аутентификацию / Add authentication Feb 3, 2018
Enfernuz added a commit that referenced this issue Feb 10, 2018
Enfernuz added a commit that referenced this issue Feb 12, 2018
Enfernuz added a commit that referenced this issue Feb 15, 2018
refactoring.
Enfernuz added a commit that referenced this issue Mar 3, 2018
refactoring.
@Enfernuz
Copy link
Owner Author

Enfernuz commented Mar 9, 2018

Реализовано.

  • Библиотека libzmq собрана в Visual Studio 2017 с platform toolset v141 и параметром /MD из исходников версии 4.2.3 и статически слинкована с libsodium, собранной в Visual Studio 2017 с platform toolset v141 и параметром /MT из исходников версии 1.0.16.

  • Дополнительно внедрена возможность настройки RPC и PUB точек подключения через файл config.json.


Done.

  • libzmq has been built with Visual Studio 2017 with the platform toolset v141 and /MD parameter from the source files of 4.2.3 and statically linked with libsodium, which has been built in Visual Studio 2017 with the platform toolset v141 and /MT parameter from the source files of 1.0.16.

  • Also implemented configuration of RPC and PUB endpoints via config.json file.

@Enfernuz Enfernuz closed this as completed Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant