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

Can't connect via ldap-proxy plugin #3906

Open
gitalexch opened this issue Apr 12, 2024 · 6 comments
Open

Can't connect via ldap-proxy plugin #3906

gitalexch opened this issue Apr 12, 2024 · 6 comments
Labels
Type: Possible bug Suspected bug by user

Comments

@gitalexch
Copy link

Top-level intent

Can't Connect via ldap-proxy with "privacyIDEA-LDAP-Proxy" User-Agent value

Steps to reproduce

  1. Connecting with "privacyIDEA-LDAP-Proxy" User-Agent -- get 400 error
  2. Connecting with "FreeRADIUS" User-Agent -- All OK.

Expected outcome

The UserAgent should be possible to configure

Actual outcome

What did actually happen?

Configuration

  • privacyIDEA version: 3.7+
  • Installation method: from PyPI, ...)
  • Python version: 3.10+
  • Operating system: AlmaLinux 9
  • Webserver: nginx
  • Token database: PostgreSQL

Log file

Set PI_LOGLEVEL = logging.DEBUG in pi.cfg and take a look at the privacyidea.log!
If appropriate, attach the log file or paste relevant portions.
ldapsearch -D 'CN=otptest,OU=Test,OU=_Users,DC=my,DC=domain' -W -H ldaps://127.0.0.1:636 -b 'DC=my,DC=domain'
Enter LDAP Password:
ldap_bind: Invalid credentials (49)
additional info: Failed to authenticate. Wrong HTTP response (400)

It seems, that User-Agent FreeRADIUS is somewhere hardcoded and it could connect without authorisation, I was tried to find, but failed, so I think that it should be configurable and maybe additionally protected by unexpired tocken

@gitalexch gitalexch added the Type: Possible bug Suspected bug by user label Apr 12, 2024
Copy link

Thank you for filing an issue and sharing your observations or ideas. Please be sure to provide as much information as possible to help us to work on this issue.

@gitalexch
Copy link
Author

gitalexch commented Apr 14, 2024

Can be closed(or changed to future request) I have found in log, that "No subscription for your client." and finale answer at community, but anyway I suggest to add token to applications(i.e. to pi-ldapproxy and FreeRADIUS ) to protect from unauthorised requests and add more detailed return code(something like "Error 400 No subscription for your client.").

@plettich
Copy link
Member

We already use the user-agent value to determine the plugin (and it's corresponding subscription).
We'll have to discuss if we want to augment the 400 error-message.

@gitalexch
Copy link
Author

Yes, but the plugin could be standalone and communicate via public network not only localhost interface, it seems using token for protection could be good Idea, maybe add token to subscription to additional verification?

@plettich
Copy link
Member

Yes, but the plugin could be standalone and communicate via public network not only localhost interface, it seems using token for protection could be good Idea, maybe add token to subscription to additional verification?

Hi @gitalexch i am not sure if i understand You correctly. Do You mean adding some kind of secret token to the user-agent string? Like User-Agent: privacyIDEA-LDAP-Proxy/10/<secret token>?
We can already require a valid API-key:
https://privacyidea.readthedocs.io/en/v3.9.2/policies/authorization.html#api-key-required

@gitalexch
Copy link
Author

gitalexch commented Apr 26, 2024

Hi, Yes, I mean something like API-key, maybe not in User-Agent attribute, but separate in Authorization or PI-Authorization attribute and built into subscription with subscription expiration date and so on...

And, I think it would be correct if you change label to Feature request....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Possible bug Suspected bug by user
Projects
None yet
Development

No branches or pull requests

2 participants