Содержание
- Задачи для средней школы. Скрещивание Microsoft Active Directory (LDAP) и Hashicorp Vault на домашнем стенде, часть 2
- Часть 0 из N. Что такое Hashicorp Vault, причем тут AD (LDAP), и кто в кого авторизуется
- Ссылки для части 0, которые я не добавил с самого начала
- Часть 6 из N. Настраиваем Debian 11 для Vault
- Часть 7 из N. Скачивание Vault
- Часть 8 из N. Выбор дистрибутива Vault
- Часть 9 из N. Первичная установка Vault
- Часть 10 из N. Первичная настройка Vault
- Часть 11 из N. Мои первые секреты
- Часть 12 из N. Проверка LDAP
- Ldaperr dsid 0c090436 comment acceptsecuritycontext error data 52e v23f0
- Asked by:
- Question
Задачи для средней школы. Скрещивание Microsoft Active Directory (LDAP) и Hashicorp Vault на домашнем стенде, часть 2
В комментариях к первой части задали правильные вопросы, с ответов на них и начну.
Про что эта статья (в трех частях). Это не статья «какие мы молодцы», это переписанное руководство по дообучению коллег всяким мелочам на примере, приближенном к рабочему. В данном случае — как и куда смотреть в MS AD/логи и Linux на элементарном уровне, что откуда качать и настраивать, и иные базовые задачи. Попутно упомянуто, с какими проблемами столкнулся я, когда переписывал руководство (и какие типовые ошибки допустил, на что мне указали в комментариях к первой части). Повторюсь, на мой взгляд такую базу надо в школе давать, и теоретическую и практическую.
Почему разбито на три части, а не один длиннопост: потому что такого формата задачи с непривычки занимают «вечер на часть», и читать и делать удобнее по частям.
В первой части: ставим MS Windows server, готовим AD.
В второй части: ставим Debian, просто запускаем Vault и немного траблшутим.
В третьей части: занимаемся тем, ради чего все и затевалось — логинимся в Vault под доменной учетной записью, раздаем права AD юзерам и AD группам.
Часть 0 из N. Что такое Hashicorp Vault, причем тут AD (LDAP), и кто в кого авторизуется
В любой организации размерами больше 2 человек, рано или поздно появляется необходимость разграничить доступ, и чаще всего самым простым способом — парой логин-пароль. Легче всего настроить одно хранилище логинов-паролей, и затем обращаться к нему (сарказм: все остальные пароли, конечно, хранить в незашифрованном текстовом файле на сетевом диске с общим доступом Everyone/Everyone — чтобы хакерам / тестерам коллегам было удобней). Начну с неочевидного утверждения — если (до недавнего времени) начинался разговор об авторизации (и аутентификации) в рамках большой организации — то рано или поздно на горизонте были или Microsoft Active Directory или Samba.
По Samba и ее развитию на Habr на удивление мало материалов — беглый поиск нашел только статью из 2015 года, и не нашел ничего про патчи июля 2022 для Samba 4.16.4, 4.15.9 и 4.14.14 — в том числе CVE-2022-32744.
К сожалению, или к радости — не все так просто в современной среде. Если бы у нас были только постоянные, исключительно внутренние пользователи и постоянные ПК — все было бы куда проще. Если. У нас есть и одноразовые пароли, и секреты (токены), и сертификаты, и пароли с ограниченным сроком действия (в AD эта функция есть), и пароли с ограниченной областью и временем входа (в AD тоже есть), и облака 100 видов, и масса других ключей. При этом: не все приложения и не все разработчики желают как-то добавлять в свое (даже внутреннее) приложение авторизацию через AD; разработчики даже 1с частенько не желают работать от чего то меньшего, чем от локального администратора или от рута, причем в RDP сессии — им, в 1с, видите ли непривычно, что там есть пересылка отладки. Все доступы к хранению и изменению паролей надо как-то учитывать — то есть настраивать и аудит, и пересылку событий, и какой-то сборщик логов с анализом, а там и автоматизированное реагирование на инциденты не за горами (Qradar и прочие IRP/SOAR/SGRC ). Как следствие — нужно хранилище «секретов вообще», но при этом само хранилище должно выполнять какие-то функции по облегчению жизни — например, по автоматизации смены паролей в том же AD.
Если совсем упростить задачу, то нам в какой-то момент захотелось, кроме вышеперечисленного управления всеми секретами, упростить задачу условно-безопасной передачи паролей третьей стороне. У третьей стороны были индивидуальные постоянные записи в AD, через которую они могли бы авторизоваться в системе хранения прочих секретов. До 2020 года с всеми этими задачами справлялся RatticDB, но его судьба упомянута в первой части. На наш взгляд, все эти задачи по управлению паролями и секретами как раз и решал Vault.
В чем еще профит: и мы, и коллеги из соседних отделов и подрядчиков ходили за одноразовыми и групповыми паролями в Vault через авторизацию в AD, но — у Vault есть функционал по операциям в AD. Конечно, все это можно и скриптом автоматизировать, но рано или поздно скрипт превращается или в какого-то монстра, или в набор слабо связанных скриптов, и данные между десятком скриптов разве что не по шине (RabbitMQ) ходят. Всего этого хотелось избежать.
К сожалению, прекрасная статья (не обсуждая саму организацию, 20$ is 20$) появилась только в 2022 году, а видео из 2020 года я пропустил.
Ссылки для части 0, которые я не добавил с самого начала
Часть 6 из N. Настраиваем Debian 11 для Vault
Скачиваем ISO, создаем VM в VMware Player, тип сети – NAT, далее-далее, LVM – все на одном диске.
Можно и без LVM, нам диск расширять не придется (его и без lvm можно расширять). В случае рабочей сети, возможно, стоит LVM зашифровать. Хуже не будет. Лучше, впрочем, тоже — в любом случае нужен бекап.
Устанавливаем без GUI, только SSH (на скрине не выбран) и standard utilities.
После установки заходим как юзер (vuser), смотрим адрес (ip a) и дальше работаем по SSH. Вспоминаем, что ip 192.168.31.151 закреплен за сервером с AD. В больших организациях за статическими ip адресами нужен учет, в любом IPAM – хоть в SolarWinds IPAM, хоть в Netbox, хоть в phpIPAM. Netbox, по моему, лучший.
Vi тут и застрять можно, и никакого q!
su
nano /etc/network/interfaces
До изменений:
The primary network interface
allow-hotplug ens33
iface ens33 inet dhcp
iface ens33 inet static
address 192.168.31.155
netmask 255.255.255.0
gateway 192.168.31.2
dns-nameserver 192.168.31.151
Сразу настроим NTP
systemctl status systemd-timesyncd
nano /etc/systemd/timesyncd.conf
(и пропишем что нам надо)
Поставим массу нужного и не нужного.
nano /etc/apt/sources.list
добавим
deb http://deb.debian.org/debian bullseye main contrib non-free
Он сказал поехали и запил водой.
apt update
apt list —upgradable
apt upgrade -y
apt install sudo curl gnupg2 unzip openssl ldap-utils tcpdump –y
(нужно из этого не все, но часть нужна для примеров отладки)
В рабочей среде не забываем про использование sudo — правим
nano /etc/sudoers
Где-то тут перезагрузимся
systemctl reload
и, наконец, переходим к установке vault.
Часть 7 из N. Скачивание Vault
При попытке сделать по руководству
получим запрет. Упомянутые тут зеркала Yandex и Express 42 или недоступны, или содержат ссылки на старый релиз на официальном сайте (до июля работали). Но на официальном сайте есть прямые ссылки на http, и указан sha256, смекаете?
Часть 8 из N. Выбор дистрибутива Vault
Если верить release notes (даже на 22 августа 2022), то ничего новее 11.0 не было с 21 июня. При этом на https://www.vaultproject.io/downloads лежит ссылка на ault_1.11.2_linux_amd64.zip
с sha256 – ace4138269cb7214c73529f984b793d66074e3a3ad373eaa77bc9b39490d9ef9 для vault_1.11.2_linux_amd64.zip
Cледите за цифрами, я по ошибке сначала скачал vault_1.1.2_linux_amd64.zip вместо vault_1.11.2_linux_amd64.zip
Скачиваем с официального сайта, сверяем md5 и прочие sha на хосте —
Get-FileHash vault_1.11.2_linux_amd64.zip -Algorithm SHA256
Закачаем архив куда положено ему. Из командной строки
pscp c:softvault_1.11.2_linux_amd64.zip vuser@192.168.31.155:/home/vuser
или из powershell
.pscp c:softvault_1.11.2_linux_amd64.zip vuser@192.168.31.155:/home/vuser
(pscp из комплекта к putty, можно Winscp заменить или как угодно еще).
Пойдем обратно в терминал Debian
cd /home/vuser
ls
Распакуем архив
unzip vault_1.11.2_linux_amd64.zip
и дальше пойдем от рута, хотя это и неправильно.
su
mv ./vault /usr/local/bin/
vault –h
На следующем шаге все руководства, включая официальное, рекомендуют запустить в dev-режиме. Dev режим – когда конфигурация не сохраняется, все в памяти.
Окей,
vault server -dev
оно запустилось, и что? CTRL-C
Дальше надо читать много про hcl файлы и секреты из официальной документации, и я настоятельно рекомендую это сделать и попробовать до проведения следующих шагов.
Часть 9 из N. Первичная установка Vault
Нам интересно настроить связку с AD, поэтому пойдем быстро и без SSL (и CA для SSL у меня в стенде пока нет):
Почти все как в официальной документации, кроме адресов.
Важный момент: следите за пробелами/позицией (в nano для этого есть CTRL-C) и учитывайте перенос строк – точнее, их разницу между Windows (rn) и linux(n). В дальнейшем это мне здорово портило жизнь.
Запускаемся в сессии рута:
vault server -config=/home/vuser/vaultconfig1.hcl
На этом в данной сессии (рута) больше работ нет. Приложение работает «как приложение».
Возникает вопрос, а не запустить ли все это сразу как сервис? И да, и нет. Если делать шифрованный LVM, то при каждой перезагрузке на сервер придется ходить вручную (и, если это VM — через консоль) и вводить ключ для запуска. Если делать автозагрузку сервиса, то все равно — после каждой перезагрузки по умолчанию надо вводить три ключа из пяти. Если прописать и ввод ключей дешифровки в автозагрузку, то я не очень понимаю, насколько это безопасно. Однако тут каждый сам решает, как ему лучше делать в продуктивной среде. Еще один вопрос для боевой среды: где держать файл конфигурации, в домашнем каталоге, или куда-то переместить «для удобства».
Часть 10 из N. Первичная настройка Vault
Дальше есть два пути. Странный и более-менее правильный.
Странный. Открываем браузер и идем на http://192.168.31.155:8200
Получаем вот такую живопись (описанную в руководстве чуть позже, чем ssh – в разделе Web UI):
Более-менее правильный, и в соответствии с руководством: Открываем новую ssh сессию, настраиваем переменную:
и выполняем первичную инициализацию хранилища.
vault operator init
Кавычки имеют значение, проверяйте.
Пример неправильных кавычек и потом сразу правильных:
получаем пять ключей (параметр настраивается, но по умолчанию 5) и One Ring to rule them all самый главный root токен. Схороните и токен и ключи, распечатайте, а распечатку в сундук.
Пока все идет как по руководству
Если сейчас сходить в браузер, то получим запрос на ввод ключей разблокировки (unseal). Можно ввести там любые три из пяти. Можно в SSH –
vault operator unseal
Часть 11 из N. Мои первые секреты
Для проверки работы авторизации создадим (из GUI) два key-value хранилища.
Path — kv_userAD – и в нем секрет adsecret-user c какой-то парой key/value
Path — kv_groupAD и в нем секрет adsecret-group c другой парой key/value
Картинок не будет, для простых операций GUI достаточен (раньше был только в Ent версии)
Часть 12 из N. Проверка LDAP
Для чего весь этот текст и писался. Практика (моя личная) показывает, что зачастую MS сервисами занимается одна группа, серверами другая, Linux третья. Между ними не всегда присутствует дружба, потому что дружба — это магия, а несанкционированная магия — это ересь. Знать куда смотреть при отладке связи Linux (или IPMI с линукс на серверах) и AD — иногда полезно.
Перед тем как идти дальше в Vault, проверим работу ldap search
ldapsearch -x -b «dc=contoso,dc=lab» -H ldap://192.168.31.151
и получим result: 1 Operations error
Сделаем чуть лучше, зря чтоли специального пользователя заводили?
Сначала посмотрим в AD, какой CN мы сотворили.
Открываем RDP до контроллера домена, AD — users and computers, включаем advanced features:
Ищем и открываем обьект пользователя Vault connector, идем в Attribute editor, листаем до CN
И DN (можно оттуда и скопировать, если печатать лень) –
CN=Vault connector,OU=Vault,OU=Robo base,DC=contoso,DC=lab
Ключи: -b = searchbase
ldapsearch -b «OU=Robo base,DC=contoso,DC=lab» -H ldap://192.168.31.151 -D «CN=Vault connector,OU=Vault,OU=Robo base,DC=contoso,DC=lab» -W
если у вас на этом этапе возникают ошибки, при вроде правильном пароле — то проверьте кавычки, — или тире, и главное – журнал событий Windows, есть в нем ошибки входа или нет. Если ошибок входа нет – то проблема где-то в CN/OU/кавычках. Иначе вы должны видеть ошибку входа в Event viewer / Security:
В Debian должны появляться ошибки:
ldap_bind: Invalid credentials (49)
additional info: 80090308: LdapErr: DSID-0C090436, comment: AcceptSecurityContext error, data 52e, v4f7c
Возникают? Отлично. В AD users and computers нажмите правую кнопку на юзере и смените ему пароль на Pa!!word2
ldapsearch -b «OU=Robo base,DC=contoso,DC=lab» -H ldap://192.168.31.151 -D «CN=Vault connector,OU=Vault,OU=Robo base,DC=contoso,DC=lab» -W
Нам, между тем, нужен другой OU —
ldapsearch -b «OU=N Watch,OU=Zoo MSK,DC=contoso,DC=lab» -H ldap://192.168.31.151 -D «CN=Vault connector,OU=Vault,OU=Robo base,DC=contoso,DC=lab» -W
Причины такого поведения — в изначальном пароле, а точнее методе его задачи. Powershell работает по разному с разными кавычками, см — статья про квотирование и кавычки.
Я написал с двойными кавычками, как
но если вы сделаете
То увидите какой пароль получился на самом деле. Будьте внимательны в таких вопросах.
В третьей части: занимаемся тем, ради чего все и затевалось — логинимся в Vault под доменной учетной записью, раздаем права юзерам и AD группам.
Источник
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Asked by:
Question
We are developing a LDAP authentication against Active Directory, we met the follow errors, although the username and password are correct.
LDAP: error code 49 — 80090308: LdapErr: DSID-0C090334, comment: AcceptSecurityContext error, data 52e, vece
The user detail is: CN=Peter, Lia ,OU=DEV,OU=HK_U,OU=cita,OU=US,DC=achtest,DC=local
As you may saw, the last name of this user has a backslash, plus a space in CN, we guess it may be the problem, since other users don’t have this problem if the last name of users don’t have a backslash and a space.
However we don’t know how we can add a new user to duplicate this issue, since it’s not way to add a new user with space in the end of name, the Active Directory will auto trim the space when system save the new user to database.
My questions are:
1. Do you have this kind of experience? Any idea to resolve?
2. How we can add a new user with a space in the end of last name? and then we can replicate this issue again?
Источник
I have a user at Active Directory LDAP as follows:
dn: CN=test44,OU=adduserspd,DC=addiam,DC=local
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
cn: test44
sn: test44
userPassword:: dGVzdDEyMw==
givenName: a
distinguishedName: CN=test44,OU=adduserspd,DC=addiam,DC=local
instanceType: 4
whenCreated: 20210719112205.0Z
whenChanged: 20210719154614.0Z
uSNCreated: 48807
uSNChanged: 49210
name: test44
objectGUID:: kHzOfDVztEictCZgD2sK7g==
userAccountControl: 66048
badPwdCount: 23
codePage: 0
countryCode: 0
badPasswordTime: 132711842865805975
lastLogoff: 0
lastLogon: 0
pwdLastSet: 132711810368404085
primaryGroupID: 513
objectSid:: AQUAAAAAAAUVAAAANJehYHpPGd4MmIXVWgYAAA==
accountExpires: 9223372036854775807
logonCount: 0
sAMAccountName: $QI1000-T26H6SSO71UL
sAMAccountType: 805306368
objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=addiam,DC=local
dSCorePropagationData: 16010101000000.0Z
mail: placeholder@mail.com
unixHomeDirectory: User
When I try to search that user, with the following «ldapsearch» command, I’m getting an authentication issue.
admin@PC1-01:~> ldapsearch -x -LLL -h 11.14.18.111:389 -D test44 -w 'test123' -b"dc=addiam,dc=local" -s sub "(objectClass=user)"
ldap_bind: Invalid credentials (49)
additional info: 80090308: LdapErr: DSID-0C090439, comment: AcceptSecurityContext error, data 52e, v4563
According to what I found regarding error «52e», which means that the user exists and the provided credentials are wrong. But I can see that the user’s «userPassword» attribute contains the correct password in base64 encoded form.
I also tried with the following, but the result was same
admin@PC1-01:~> ldapsearch -x -LLL -h 11.14.18.111:389 -D test44 -w 'test123' -b"cn=test44,ou=adduserspd,dc=addiam,dc=local" -s sub "(objectClass=user)"
ldap_bind: Invalid credentials (49)
additional info: 80090308: LdapErr: DSID-0C090439, comment: AcceptSecurityContext error, data 52e, v4563
admin@PC1-01:~>
Appreciate if someone can explain what could be the cause for this situation.
LDAP For Operators login
This thread has been viewed 5 times
-
1.
LDAP For Operators loginPosted Mar 29, 2013 05:08 PM
I was trying to set this up like we did on our Clearpass Guest class but im unable…
Do we have to do somethign on the AD to make this work?
Im trying this on the Clearpass Server
Server URL:ldap://172.16.3.31/ou=Users,ou=Grupos_Usuarios,dc=abc,dc=local
bind dn = putting a user with domain administrative rights
bind password= the password of that user
i get this error
LDAP Bind failed: Invalid credentials (80090308: LdapErr: DSID-0C0903C5, comment: AcceptSecurityContext error, data 52e, v23f0), bind DN was: cdelarosa
do i need to activate something on the AD to make this work? or i need soemthign else?
-
2.
RE: LDAP For Operators loginBest Answer
Posted Mar 31, 2013 02:48 PM
«AcceptSecurityContext error, data 52e» means: invalid credentials. This means your username or password is incorrect.
If you are sure your password is correct, try specifying the DN of the bind user, instead of just the username.
-
3.
RE: LDAP For Operators loginPosted Mar 31, 2013 03:13 PM
You mean like this?
CN=cdelarosa,CN=Users,CN=Colaboradores,DC=abc,DC=local
the user is cdelarosa
its contained on
Users
Sub OU = Colaboradores
The domain is abc.local
Im sure the pasword is correct… i even copy and pasted it to be sure i was typing it correctly
Error
LDAP Bind failed: Invalid credentials (80090308: LdapErr: DSID-0C0903C5,
comment: AcceptSecurityContext error, data 52e, v23f0), bind DN was:
CN=cdelarosa,CN=Users,CN=Colaboradores,DC=abc,DC=local -
4.
RE: LDAP For Operators loginPosted Mar 31, 2013 06:32 PM
Are you using any special characters in the password… :;>)+ there was a known issues with binding with a special character. Try using a simple password and see if the fixes the issue
From the Release Notes
«Domain join operations will fail if the domain password contains special characters such as a space,
quotes, or a “$” symbol.»
-
5.
RE: LDAP For Operators loginPosted Mar 31, 2013 07:13 PM
Hello Arnold i already tried that…
My password had a dot i mean .
i made a new user without any character in the password didnt work either…
The configuration doesnt seems to be hard
On the server URL
ldap://172.16.3.31/ou=Users,ou=Grupos_Usuarios,dc=abc,dc=local
Thats the ip of the domain controller
Users is the OU that contain the group of the operators i designed which is cpoperators, inside that group my username is the one that belongs to that group
now on the BN
CN=cpoperator,CN=Users,DC=abc,DC=local
cpoperator is the user im using to authenticate, it is inside the ou Users in the domain abc.local
Isnt that correct?
I am missing something?
I could even join to the domain with no issue with my user name…
-
6.
RE: LDAP For Operators loginPosted Apr 01, 2013 04:56 PM
Maybe you need «OU=Users» rather than «CN=Users» ?
Check your DN very carefully.
-
7.
RE: LDAP For Operators loginPosted Apr 03, 2013 09:15 PM
I got it correctly on the amigopod server i just made a typo when i was putting the message…
So thats not it
-
8.
RE: LDAP For Operators loginPosted Apr 04, 2013 09:00 PM
You were right Amigodave
The guy on the tac did a dsquery which solve it
But it was not that i was putting the wrong DN because i was putting my user name as my login name like cdelarosa
Instead it was Carlos De La Rosa
CN=Carlos De La Rosa,OU=Colaboradores,OU=Users,DC=abc,DC=local
I was using
CN=cdelarosa,OU=Colaboradores,OU=Users,DC=alternetworks,DC=local
At the end was this last thing my bad! i should have checked with dsquery.
Anyways Thanks Amigodave
-
9.
RE: LDAP For Operators loginPosted Sep 03, 2013 04:11 PM
Thanks tarnold for quoting the release notes to us — I hadn’t noticed that line.
Banged my head for a day before I though to look for an authentication error from CP to AD.
Last updated on: March 10th, 2021
vScope supports both Discovery of and integration with the Active Directory. If something goes wrong you will be prompted with an error message that can give you a hint of the cause to the issue.
The error messages might look something like this:
INVALID_CREDENTIALS: 80090308: LdapErr: DSID-0C09042F, comment: AcceptSecurityContext error, data 52e, v2580
INVALID_CREDENTIALS: 80090308: LdapErr: DSID-0C090400, comment: AcceptSecurityContext error, data 775, v1db1
The code is listed after Data (in this case 52e and 775).
Here is a list of common error codes that might show up:
| Error code | Error | Description |
|---|---|---|
| 525 | User not found | Returned when an invalid username is supplied. |
| 52e | Invalid credentials | Returned when a valid username is supplied but an invalid password/credential is supplied. If this error is received, it will prevent most other errors from being displayed. |
| 530 | Not permitted to logon at this time | Returned when a valid username and password/credential are supplied during times when login is restricted. |
| 531 | Not permitted to logon from this workstation | Returned when a valid username and password/credential are supplied, but the user is restriced from using the workstation where the login was attempted. |
| 532 | Password expired | Returned when a valid username is supplied, and the supplied password is valid but expired. |
| 533 | Account disabled | Returned when a valid username and password/credential are supplied but the account has been disabled. |
| 701 | Account expired | Returned when a valid username and password/credential are supplied but the account has expired. |
| 773 | User must reset password | Returned when a valid username and password/credential are supplied, but the user must change their password immediately (before logging in for the first time, or after the password was reset by an administrator). |
| 775 | Account locked out | Returned when a valid username is supplied, but the account is locked out. Note that this error will be returned regardless of whether or not the password is invalid. |
Further reading
You can read more about integrating vScope with Active Directory on this Knowledge Base post.
-
#1
I was able to create a realm for my domain. » test.net » and sync over the group of users i wanted to pull into PVE, Assigned groups / roles to my users.
however when i go to login as the user i am using username (no @ or anything after) the AD password for the user, and selecting the realm I get a Login failed. Please try again. this happens even with the same user i did my sync with.
Can someone point me to which logs i should be viewing to troubleshoot this type of issue? or is there another step to get Active Directory working for ldap logins?
-
#2
After doing some digging in the lgos i get Authentication Failure; rhose=xxx.xxx.xxx.xxx (the server i tried to login from) user =me@domain.net msg=80090308: LdapErr: DSID-0c090446, comment: AcceptSecurityContect error, data 52e, v2580
this indicates that i used the wrong password. but its no the wrong password. also this is attempting with the same user i did my sync with. which my user was synced and assigned permissions.
-
#3
We have the same issue. Active Directory Sync is working. Got groups and users.
Code:
Feb 25 12:28:07 proxmox5 pvedaemon[15648]: <root@pam> starting task UPID:proxmox5:00005C83:02BDD29C:603789C7:auth-realm-sync-test:company.com:root@pam:
Feb 25 12:28:08 proxmox5 pvedaemon[15648]: <root@pam> end task UPID:proxmox5:00005C83:02BDD29C:603789C7:auth-realm-sync-test:company.com:root@pam: OK
Feb 25 12:28:13 proxmox5 pvedaemon[4847]: <root@pam> starting task UPID:proxmox5:00005CE6:02BDD4CE:603789CD:auth-realm-sync:company.com:root@pam:
Feb 25 12:28:13 proxmox5 pvedaemon[4847]: <root@pam> end task UPID:proxmox5:00005CE6:02BDD4CE:603789CD:auth-realm-sync:company.com:root@pam: OK
When I try to login with the same user that is used for sync (which is also in the group) I get
Code:
Feb 25 12:28:45 proxmox5 pvedaemon[4847]: authentication failure; rhost=x.x.x.x user=proxmox@company.com msg=80090308: LdapErr: DSID-0C090453, comment: AcceptSecurityContext error, data 52e, v3839#000 at /usr/share/perl5/PVE/LDAP.pm line 83.
Proxmox Version 6.3-3
Last edited: Feb 25, 2021
-
#4
I’ve got the same error as you guys on Proxmox Version 6.3-3
Did you find a solution on this at all?
Code:
authentication failure; rhost=x.x.x.x user=firstname.surname@domain.local msg=80090308: LdapErr: DSID-0C090439, comment: AcceptSecurityContext error, data 52e, v4563
-
#5
I would like to know this as well. Is it a configuration error or bug? sync works fine.
-
#6
LdapErr: DSID-0C090453, comment: AcceptSecurityContext error,
means login error on the ad side
make sure that the user can bind with «user@domain» on the ad server
-
#7
I’m confronting similar issue. I test my user credentials on a domain computer, as @dcsapak suggest, with:
powershell: runas /u:<username>@<domainname> notepad.exe and works, Notepad was open if credential are valid, if I on purpose mistype the password it fails.
But when I try to login on Proxmox I get the error message. Any suggestions?
My environment:
Code:
proxmox-ve: 7.1-1 (running kernel: 5.13.19-6-pve)
pve-manager: 7.1-12 (running version: 7.1-12/b3c09de3)
pve-kernel-helper: 7.1-14
pve-kernel-5.13: 7.1-9
pve-kernel-5.11: 7.0-10
pve-kernel-5.13.19-6-pve: 5.13.19-15
pve-kernel-5.13.19-5-pve: 5.13.19-13
pve-kernel-5.13.19-2-pve: 5.13.19-4
pve-kernel-5.11.22-7-pve: 5.11.22-12
pve-kernel-5.4.27-1-pve: 5.4.27-1
ceph: 16.2.7
ceph-fuse: 16.2.7
corosync: 3.1.5-pve2
criu: 3.15-1+pve-1
glusterfs-client: 9.2-1
ifupdown: not correctly installed
ifupdown2: 3.1.0-1+pmx3
ksm-control-daemon: 1.4-1
libjs-extjs: 7.0.0-1
libknet1: 1.22-pve2
libproxmox-acme-perl: 1.4.1
libproxmox-backup-qemu0: 1.2.0-1
libpve-access-control: 7.1-7
libpve-apiclient-perl: 3.2-1
libpve-common-perl: 7.1-5
libpve-guest-common-perl: 4.1-1
libpve-http-server-perl: 4.1-1
libpve-network-perl: 0.7.0
libpve-storage-perl: 7.1-2
libqb0: 1.0.5-1
libspice-server1: 0.14.3-2.1
lvm2: 2.03.11-2.1
lxc-pve: 4.0.12-1
lxcfs: 4.0.12-pve1
novnc-pve: 1.3.0-2
openvswitch-switch: not correctly installed
proxmox-backup-client: 2.1.5-1
proxmox-backup-file-restore: 2.1.5-1
proxmox-mini-journalreader: 1.3-1
proxmox-widget-toolkit: 3.4-7
pve-cluster: 7.1-3
pve-container: 4.1-4
pve-docs: 7.1-2
pve-edk2-firmware: 3.20210831-2
pve-firewall: 4.2-5
pve-firmware: 3.3-6
pve-ha-manager: 3.3-3
pve-i18n: 2.6-2
pve-qemu-kvm: 6.2.0-2
pve-xtermjs: 4.16.0-1
qemu-server: 7.1-4
smartmontools: 7.2-pve2
spiceterm: 3.2-2
swtpm: 0.7.1~bpo11+1
vncterm: 1.7-1
zfsutils-linux: 2.1.4-pve1
Last edited: Apr 21, 2022
-
#8
Ran into the same issue with following datacenter -> Permissions -> Realms configuration:
Code:
Realm: REALM.EXAMPLE.COM
Domain: example.com
What it solved for me:
Code:
Realm: REALM.EXAMPLE.COM
Domain: realm.example.com
Not sure whether this as OP’s problem, but I hope this helps somebody.
-
#9
It worked for me, too. thx
LDAP-Auth
-
petrocelli1966
- OpenVPN User
- Posts: 21
- Joined: Wed Dec 23, 2020 10:12 pm
LDAP-Auth
Hi All,
I have been reading and trying in vain for the past few days so I would really appreciate dome assistance.
I am trying to get openVPN to authenticate to Active Directory whixh is on Windows 2012.
I run OpenVPN 2.5 on FreeBSD. My config files are below. From the client I am getting wrong credentials.
On the server I get this error:
Code: Select all
LDAP bind failed: Invalid credentials (80090308: LdapErr: DSID-0C090436, comment: AcceptSecurityContext error, data 52e, v23f0)
Unable to bind as CN=openvpnquery,CN=Users,DC=mayberryinv,DC=net
LDAP connect failed.
2021-01-12 08:12:51 us=33643 72.252.144.69:58128 PLUGIN_CALL: POST /usr/local/lib/openvpn-auth-ldap.so/PLUGIN_AUTH_USER_PASS_VERIFY status=1
2021-01-12 08:12:51 us=33686 72.252.144.69:58128 PLUGIN_CALL: plugin function PLUGIN_AUTH_USER_PASS_VERIFY failed with status 1: /usr/local/lib/openvpn-auth-ldap.so
2021-01-12 08:12:51 us=34192 72.252.144.69:58128 TLS Auth Error: Auth Username/Password verification failed for peer
I am sure the password is correct however.
auth-ldap.conf
Code: Select all
<LDAP>
# LDAP server URL
URL ldap://192.168.1.18:389
BindDN openvpnquery@domain.com
Password Password
Timeout 15
TLSEnable no
FollowReferrals no
</LDAP>
<Authorization>
BaseDN "DC=domain,DC=net"
SearchFilter "sAMAccountName=%u"
RequireGroup false
</Authorization>
Server config
local 192.168.1.5
proto udp4
dev tun
ca /usr/local/etc/openvpn/server/ca.crt
cert /usr/local/etc/openvpn/server/issued/server.crt
key /usr/local/etc/openvpn/server/private/server.key # This file should be kept secret
dh /usr/local/etc/openvpn/server/dh.pem
server 10.9.0.0 255.255.255.0
push route x.x.x.x
push «dhcp-option DNS y.y.y.y»
push «dhcp-option DOMAIN domain.net»
tls-auth /usr/local/etc/openvpn/server/ta.key 0 # This file is secret
tls-ciphersuites TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
tls-version-min 1.2
cipher AES-256-GCM
data-ciphers AES-256-GCM
persist-key
persist-tun
crl-verify /usr/local/etc/openvpn/crl/crl.pem
plugin /usr/local/lib/openvpn-auth-ldap.so «/usr/local/etc/openvpn/server/auth-ldap.conf»
reneg-sec 28800
auth SHA256
Client config
client
dev tun
;proto tcp
proto udp
remote z.z.z.z
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
remote-cert-tls server
tls-auth ta.key 1
cipher AES-256-GCM
verb 3
;mute 20
auth-nocache
auth SHA256
auth-user-pass
allow-pull-fqdn
;redirect-gateway def1
reneg-sec 0
Last edited by Pippin on Tue Jan 12, 2021 4:42 pm, edited 1 time in total.
Reason: Formatting
-
petrocelli1966
- OpenVPN User
- Posts: 21
- Joined: Wed Dec 23, 2020 10:12 pm
Re: LDAP-Auth [Solved]
Post
by petrocelli1966 » Wed Jan 13, 2021 1:21 pm
Well things have started working now. I had to change the line BaseDN «DC=domain,DC=net» to BaseDN «OU=Units,DC=domain,DC=net» which is the OU the user is in. Not sure why this happened. We have a huge user base in AD. Not sure if it was failing really or just timing out but it was saying auth-fail. Anyway, it is working now so this can be closed. Thanks.
Overview
I’m trying to get Proxmox to perform user authentication via LDAP with a Windows Server 2016 ADDS server. Proxmox is convinced that my credentials are incorrect.
Environment
-
Proxmox 6.3-1, PVE 6.3-6
-
Windows Server 2019 Datacenter 1809, b17763.1823
-
The Proxmox server and Domain Controller are on the same network (the DC is a guest on the Proxmox instance).
-
The DC’s root certificate has been added to the Proxmox server’s store.
-
Proxmox’s realm binding is set up with a dedicated standard user account in the OU
OU=Service Users,DC=subdomain,DC=domain,DC=tld. -
I have an administrative account in the standard
CN=Users,DC=subdomain,DC=domain,DC=tld. -
Proxmox’s realm binding is as follows via the GUI:
General --- Domain: DC=subdomain,DC=domain,DC=tld Default: True Server: dc.subdomain.domain.tld Fallback Server: Unused Port: Default SSL: True Verify Certificate: True Require TFA: None Sync Options --- Bind User: CN=ServiceAccount,OU=Service Users,DC=subdomain,DC=domain,DC=tld E-Mail Attribute: mail Groupname Attr.: sAMAccountName User Classes: user Group Classes: group User Filter: (&(objectCategory=Person)(sAMAccountName=*)(memberOf=CN=InfrastructureAdmins,CN=Users,DC=subdomain,DC=domain,DC=tld)) Group Filter: (sAMAccountName=InfrastructureAdmins)
What’s Happening
- Proxmox’s login page gives the error message «Login failed. Please try again».
- Proxmox’s syslog shows the line entry
hostname pvedaemon[pid]: authentication failure; rhost=10.9.0.50 user=username@realm msg=80090308: LdapErr: DSID-0C090439, comment: AcceptSecurityContext error, data 52e, v4563.- The error code
52esuggests that the password is incorrect.
- The error code
- I’m not seeing any entries for ServiceAccount or username in the DC’s security event log when the login fails.
What I’ve Tried
- I’ve verified that Proxmox can communicate with the DC; when the realm is synced, it successfully pulls groups and users from the domain.
- I’ve verified that the binding user
ServiceAccountcan log in to a domain-joined computer. - I’ve verified that the account I’m testing with (my admin account) can log in to domain-joined computers; it’s the account I’m logged into the DC with.
- I’ve also created a test account with no additional settings, just the proper group membership, and attempted to use it to log into Proxmox.
- I’ve tried simplifying the passwords for both my user account and the binding account down to
P4$$w0rd. - LDAP works for other systems with a similar binding account.
Any guidance or suggestions would be greatly appreciated.
asked Mar 28, 2021 at 2:05
I can’t be sure you and I have the same problem, but I solved the same symptoms by:
- Ensure the ‘domain’ in the LDAP settings is the actual AD domain name (eg.
ad.example.com). Proxmox will append this to a user name in order to log on, so the LDAP server will reject you if you’ve got it wrong. - Ensure the user or group logging on has a Role assigned to them. You can do this by going to Datacentre->Permissions (the «title», not the things inside the pull-down!) and add a Group Permission (in my case, I used the LDAP group I’d created called
ProxmoxAdminsand assigned it theAdministratorrole)
Things I’ve noticed are that the log messages don’t tell you the cause of the problem at all. I’ve also noticed that LDAP groups cannot have spaces in them (eg. Proxmox Admins doesn’t work, ProxmoxAdmins does). You can see this if you do a «sync preview» in the LDAP settings). And lastly, just because «sync» works, doesn’t mean users will — it only tests the Bind credentials (a useful check, but not everything!).
answered Jan 24, 2022 at 13:46


