{"id":339211,"date":"2022-10-02T21:00:05","date_gmt":"2022-10-02T21:00:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=339211"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=339211","title":{"rendered":"<span>\u0414\u0440\u0443\u0436\u0438\u043c Sentry Self-Hosted \u0438 LDAP<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Sentry \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043f\u0440\u0430\u0432\u0430\u043c\u0438.<\/p>\n<p>\u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Sentry Self-Hosted \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a LDAP.<\/p>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Sentry Self-Hosted \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f docker, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0442\u0435\u043d\u0434\u0430 Ubuntu 22.04 \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/docs.docker.com\/engine\/install\/ubuntu\/\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.docker.com\/engine\/install\/ubuntu\/<\/a>.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f FreeIPA \u0432 \u0440\u043e\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 LDAP.<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Sentry<\/h2>\n<ol>\n<li>\n<p>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e Sentry \u0441 Github <a href=\"https:\/\/github.com\/getsentry\/self-hosted\/releases\/latest\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/getsentry\/self-hosted\/releases\/latest<\/a><\/p>\n<\/li>\n<\/ol>\n<pre><code>wget https:\/\/github.com\/getsentry\/self-hosted\/archive\/refs\/tags\/22.9.0.tar.gz<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0420\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0430\u0440\u0445\u0438\u0432<\/p>\n<\/li>\n<\/ol>\n<pre><code>tar -xzf 22.9.0.tar.gz<\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>sentry\/enhance-image.example.sh<\/code><\/p>\n<\/li>\n<\/ol>\n<pre><code>cp sentry\/enhance-image.example.sh sentry\/enhance-image.sh<\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <code>sentry\/enhance-image.sh<\/code> \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<\/ol>\n<pre><code>#!\/bin\/bash  apt-get update &amp;&amp; \\         apt-get install -y --no-install-recommends gcc libsasl2-dev libldap2-dev libssl-dev  &amp;&amp; \\         rm -r \/var\/lib\/apt\/lists\/*  pip install sentry-ldap-auth<\/code><\/pre>\n<ol start=\"5\">\n<li>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b s<code>entry\/sentry.conf.example.py<\/code> \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u0434 \u0441\u0435\u0431\u044f<\/p>\n<\/li>\n<\/ol>\n<pre><code>cp sentry\/sentry.conf.example.py sentry\/sentry.conf.py<\/code><\/pre>\n<ol start=\"6\">\n<li>\n<p>\u0412 \u043a\u043e\u043d\u0435\u0446 \u0444\u0430\u0439\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a LDAP<\/p>\n<\/li>\n<\/ol>\n<pre><code>############# # LDAP auth # #############  import ldap from django_auth_ldap.config import LDAPSearch, GroupOfUniqueNamesType  AUTH_LDAP_SERVER_URI = 'ldap:\/\/freeipa.example.com:389'  AUTH_LDAP_BIND_DN = 'krbprincipalname=sentry\/freeipa.example.com@EXAMPLE.COM,cn=services,cn=accounts,dc=example,dc=com'  AUTH_LDAP_BIND_PASSWORD = 'qwerty123'  AUTH_LDAP_USER_SEARCH = LDAPSearch(     'cn=users,cn=accounts,dc=example,dc=com',     ldap.SCOPE_SUBTREE, '(uid=%(user)s)', )  AUTH_LDAP_GROUP_SEARCH = LDAPSearch(     \"cn=groups,dc=example,dc=com\", ldap.SCOPE_SUBTREE, \"(objectClass=groupOfNames)\" )  AUTH_LDAP_GROUP_TYPE = GroupOfUniqueNamesType() AUTH_LDAP_REQUIRE_GROUP = None AUTH_LDAP_DENY_GROUP = None  AUTH_LDAP_USER_ATTR_MAP = {     \"first_name\": \"givenname\",     \"last_name\": \"sn\",     \"email\": \"mail\" }  AUTH_LDAP_FIND_GROUP_PERMS = False AUTH_LDAP_CACHE_GROUPS = True AUTH_LDAP_GROUP_CACHE_TIMEOUT = 3600  AUTH_LDAP_DEFAULT_SENTRY_ORGANIZATION = 'Sentry' AUTH_LDAP_SENTRY_ORGANIZATION_ROLE_TYPE = 'member' AUTH_LDAP_SENTRY_ORGANIZATION_GLOBAL_ACCESS = True AUTH_LDAP_SENTRY_SUBSCRIBE_BY_DEFAULT = False  AUTH_LDAP_SENTRY_USERNAME_FIELD = 'cn' SENTRY_MANAGED_USER_FIELDS = ('email', 'first_name', 'last_name', 'password', )  AUTHENTICATION_BACKENDS = AUTHENTICATION_BACKENDS + (     'sentry_ldap_auth.backend.SentryLdapBackend', )  # optional, for debugging import logging logger = logging.getLogger('django_auth_ldap') logger.addHandler(logging.StreamHandler()) logger.addHandler(logging.FileHandler('\/var\/log\/sentry_ldap.log')) logger.setLevel('DEBUG')  LOGGING['overridable'] = ['sentry', 'django_auth_ldap'] LOGGING['loggers']['django_auth_ldap'] = {     'handlers': ['console'],     'level': 'DEBUG' }<\/code><\/pre>\n<ol start=\"7\">\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Sentry <\/p>\n<\/li>\n<\/ol>\n<pre><code>.\/install.sh<\/code><\/pre>\n<p>    \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0431\u043e\u0440\u043a\u0430 \u043e\u0431\u0440\u0430\u0437\u0430 \u0441 \u043d\u0430\u0448\u0438\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f     \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438, \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.<\/p>\n<ol start=\"8\">\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <\/p>\n<\/li>\n<\/ol>\n<pre><code>Created internal Sentry project (slug=internal, id=1) Would you like to create a user account now? [Y\/n]: Y<\/code><\/pre>\n<ol start=\"9\">\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/p>\n<\/li>\n<\/ol>\n<pre><code>docker-compose up -d<\/code><\/pre>\n<p>    Sentry \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0439\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 <strong>LDAP<\/strong>, \u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0439\u0442\u0438 \u043f\u043e\u0434 \u0441\u0432\u043e\u0435\u0439 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u044c\u044e <strong>LDAP<\/strong>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e6f\/345\/5a4\/e6f3455a45546eed2c34e0ca8cb3ab9d.png\" width=\"723\" height=\"511\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e6f\/345\/5a4\/e6f3455a45546eed2c34e0ca8cb3ab9d.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b\u043c\u0438 \u043f\u0440\u0430\u0432\u0430\u043c\u0438<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dd7\/e05\/d2a\/dd7e05d2aa06326e34cb2ca1095e57cb.png\" width=\"1348\" height=\"908\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dd7\/e05\/d2a\/dd7e05d2aa06326e34cb2ca1095e57cb.png\"\/><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/691140\/\"> https:\/\/habr.com\/ru\/post\/691140\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Sentry \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043f\u0440\u0430\u0432\u0430\u043c\u0438.<\/p>\n<p>\u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Sentry Self-Hosted \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a LDAP.<\/p>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Sentry Self-Hosted \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f docker, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0442\u0435\u043d\u0434\u0430 Ubuntu 22.04 \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/docs.docker.com\/engine\/install\/ubuntu\/\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.docker.com\/engine\/install\/ubuntu\/<\/a>.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f FreeIPA \u0432 \u0440\u043e\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 LDAP.<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Sentry<\/h2>\n<ol>\n<li>\n<p>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e Sentry \u0441 Github <a href=\"https:\/\/github.com\/getsentry\/self-hosted\/releases\/latest\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/getsentry\/self-hosted\/releases\/latest<\/a><\/p>\n<\/li>\n<\/ol>\n<pre><code>wget https:\/\/github.com\/getsentry\/self-hosted\/archive\/refs\/tags\/22.9.0.tar.gz<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0420\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0430\u0440\u0445\u0438\u0432<\/p>\n<\/li>\n<\/ol>\n<pre><code>tar -xzf 22.9.0.tar.gz<\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>sentry\/enhance-image.example.sh<\/code><\/p>\n<\/li>\n<\/ol>\n<pre><code>cp sentry\/enhance-image.example.sh sentry\/enhance-image.sh<\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <code>sentry\/enhance-image.sh<\/code> \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<\/ol>\n<pre><code>#!\/bin\/bash  apt-get update &amp;&amp; \\         apt-get install -y --no-install-recommends gcc libsasl2-dev libldap2-dev libssl-dev  &amp;&amp; \\         rm -r \/var\/lib\/apt\/lists\/*  pip install sentry-ldap-auth<\/code><\/pre>\n<ol start=\"5\">\n<li>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b s<code>entry\/sentry.conf.example.py<\/code> \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u0434 \u0441\u0435\u0431\u044f<\/p>\n<\/li>\n<\/ol>\n<pre><code>cp sentry\/sentry.conf.example.py sentry\/sentry.conf.py<\/code><\/pre>\n<ol start=\"6\">\n<li>\n<p>\u0412 \u043a\u043e\u043d\u0435\u0446 \u0444\u0430\u0439\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a LDAP<\/p>\n<\/li>\n<\/ol>\n<pre><code>############# # LDAP auth # #############  import ldap from django_auth_ldap.config import LDAPSearch, GroupOfUniqueNamesType  AUTH_LDAP_SERVER_URI = 'ldap:\/\/freeipa.example.com:389'  AUTH_LDAP_BIND_DN = 'krbprincipalname=sentry\/freeipa.example.com@EXAMPLE.COM,cn=services,cn=accounts,dc=example,dc=com'  AUTH_LDAP_BIND_PASSWORD = 'qwerty123'  AUTH_LDAP_USER_SEARCH = LDAPSearch(     'cn=users,cn=accounts,dc=example,dc=com',     ldap.SCOPE_SUBTREE, '(uid=%(user)s)', )  AUTH_LDAP_GROUP_SEARCH = LDAPSearch(     \"cn=groups,dc=example,dc=com\", ldap.SCOPE_SUBTREE, \"(objectClass=groupOfNames)\" )  AUTH_LDAP_GROUP_TYPE = GroupOfUniqueNamesType() AUTH_LDAP_REQUIRE_GROUP = None AUTH_LDAP_DENY_GROUP = None  AUTH_LDAP_USER_ATTR_MAP = {     \"first_name\": \"givenname\",     \"last_name\": \"sn\",     \"email\": \"mail\" }  AUTH_LDAP_FIND_GROUP_PERMS = False AUTH_LDAP_CACHE_GROUPS = True AUTH_LDAP_GROUP_CACHE_TIMEOUT = 3600  AUTH_LDAP_DEFAULT_SENTRY_ORGANIZATION = 'Sentry' AUTH_LDAP_SENTRY_ORGANIZATION_ROLE_TYPE = 'member' AUTH_LDAP_SENTRY_ORGANIZATION_GLOBAL_ACCESS = True AUTH_LDAP_SENTRY_SUBSCRIBE_BY_DEFAULT = False  AUTH_LDAP_SENTRY_USERNAME_FIELD = 'cn' SENTRY_MANAGED_USER_FIELDS = ('email', 'first_name', 'last_name', 'password', )  AUTHENTICATION_BACKENDS = AUTHENTICATION_BACKENDS + (     'sentry_ldap_auth.backend.SentryLdapBackend', )  # optional, for debugging import logging logger = logging.getLogger('django_auth_ldap') logger.addHandler(logging.StreamHandler()) logger.addHandler(logging.FileHandler('\/var\/log\/sentry_ldap.log')) logger.setLevel('DEBUG')  LOGGING['overridable'] = ['sentry', 'django_auth_ldap'] LOGGING['loggers']['django_auth_ldap'] = {     'handlers': ['console'],     'level': 'DEBUG' }<\/code><\/pre>\n<ol start=\"7\">\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Sentry <\/p>\n<\/li>\n<\/ol>\n<pre><code>.\/install.sh<\/code><\/pre>\n<p>    \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0431\u043e\u0440\u043a\u0430 \u043e\u0431\u0440\u0430\u0437\u0430 \u0441 \u043d\u0430\u0448\u0438\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f     \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438, \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.<\/p>\n<ol start=\"8\">\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <\/p>\n<\/li>\n<\/ol>\n<pre><code>Created internal Sentry project (slug=internal, id=1) Would you like to create a user account now? [Y\/n]: Y<\/code><\/pre>\n<ol start=\"9\">\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/p>\n<\/li>\n<\/ol>\n<pre><code>docker-compose up -d<\/code><\/pre>\n<p>    Sentry \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0439\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 <strong>LDAP<\/strong>, \u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0439\u0442\u0438 \u043f\u043e\u0434 \u0441\u0432\u043e\u0435\u0439 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u044c\u044e <strong>LDAP<\/strong>.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b\u043c\u0438 \u043f\u0440\u0430\u0432\u0430\u043c\u0438<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/691140\/\"> https:\/\/habr.com\/ru\/post\/691140\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-339211","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/339211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=339211"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/339211\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=339211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=339211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=339211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}