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

Issue: unclear definitions of domainname case and adsys breaking dconf #1054

Closed
2 tasks done
snussbaumermpreis opened this issue Jul 24, 2024 · 14 comments · Fixed by #1079
Closed
2 tasks done

Issue: unclear definitions of domainname case and adsys breaking dconf #1054

snussbaumermpreis opened this issue Jul 24, 2024 · 14 comments · Fixed by #1079
Labels
bug Something isn't working jira Import to Jira

Comments

@snussbaumermpreis
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and found none that matched mine

Describe the issue

**adsys does not accept uppercase domainnames and lowercase ones mixed like this:

[sssd]
domains = domain.tld
config_file_version = 2
services = nss, pam, ifp
default_domain_suffix = domain.tld

[domain/DOMAIN.TLD]
default_shell = /bin/bash
krb5_store_password_if_offline = False
cache_credentials = True
krb5_realm = DOMAIN.TLD
realmd_tags = manages-system joined-with-adcli
id_provider = ad
ldap_sasl_authid = HOSTNAME$
fallback_homedir = /home/%u@%d
ad_domain = domain.tld
use_fully_qualified_names = True
ldap_id_mapping = True
access_provider = ad
account_cache_expiration = 1
ad_gpo_access_control = enforcing
ad_gpo_cache_timeout = 30
ad_gpo_ignore_unreadable = True
ad_hostname = HOSTNAME.DOMAIN.TLD
ad_gpo_map_remote_interactive = +nx
auto_private_groups = true
ldap_user_ssh_public_key = altSecurityIdentities
ldap_user_extra_attrs = altSecurityIdentities

This is only with newer Versions (0.14.1) older ones (0.9.2) worked, the result is a crash of the daemon with the following output:**

Jul 17 15:06:09 HOSTNAME systemd[1]: Starting ADSys daemon service...
Jul 17 15:06:09 HOSTNAME adsysd[35284]: level=error msg="couldn't create adsys service: could not initialize AD backend: can't get domain configuration from {Conf:/etc/sssd/sssd.conf CacheDir:/var/lib/sss/db}:could not find AD domain section corresponding to "domain.tld">
Jul 17 15:06:09 HOSTNAME systemd[1]: adsysd.service: Main process exited, code=exited, status=1/FAILURE
Jul 17 15:06:09 HOSTNAME systemd[1]: adsysd.service: Failed with result 'exit-code'.
Jul 17 15:06:09 HOSTNAME systemd[1]: Failed to start ADSys daemon service.

Now logins fail because of adsys pam.

The fix is obviously to change the domainname to lower case or all to uppercase. But as stated before older versions supported the Config of these Domainnames.

So sssd.conf then is for example:

[sssd]
domains = domain.tld
config_file_version = 2
services = nss, pam, ifp
default_domain_suffix = domain.tld

[domain/domain.tld]
default_shell = /bin/bash
krb5_store_password_if_offline = False
cache_credentials = True
krb5_realm = DOMAIN.TLD
realmd_tags = manages-system joined-with-adcli
id_provider = ad
ldap_sasl_authid = HOSTNAME$
fallback_homedir = /home/%u@%d
ad_domain = domain.tld
use_fully_qualified_names = True
ldap_id_mapping = True
access_provider = ad
account_cache_expiration = 1
ad_gpo_access_control = enforcing
ad_gpo_cache_timeout = 30
ad_gpo_ignore_unreadable = True
ad_hostname = HOSTNAME.DOMAIN.TLD
ad_gpo_map_remote_interactive = +nx
auto_private_groups = true
ldap_user_ssh_public_key = altSecurityIdentities
ldap_user_extra_attrs = altSecurityIdentities

But then the second issue arises (I don't know if they are really related, but it is definitly only with the newer versions).

The new user somehow does not get a dconf profile, and therefor can not change any settings saved in dconf/gsettings(Favorites, Background, Proxy Settings, Gedit does not work, ....). This is because the user now gets an environment variable: DCONF_PROFILE=[email protected] and that dconf profile does not exist and ~/.config/dconf/user is not created! So the user has no dconf profile where the settings could be saved as far as I understand this. This issue exists in new as well as existing users. The following error is thrown basically everywhere, some examples from syslog:

Jul 16 11:36:46 HOSTNAME gsettings[21570]: unable to open named profile ([email protected]): using the null configuration.
Jul 16 11:36:46 HOSTNAME gsettings[21572]: unable to open named profile ([email protected]): using the null configuration.
Jul 16 11:36:46 HOSTNAME gsettings[21579]: unable to open named profile ([email protected]): using the null configuration.
Jul 16 11:36:46 HOSTNAME gsettings[21587]: unable to open named profile ([email protected]): using the null configuration.
Jul 16 11:36:46 HOSTNAME gsd-xsettings[21496]: unable to open named profile ([email protected]): using the null configuration.
Jul 16 11:36:46 HOSTNAME gsd-media-keys[21477]: unable to open named profile ([email protected]): using the null configuration.
Jul 16 11:36:46 HOSTNAME gsd-power[21478]: unable to open named profile ([email protected]): using the null configuration.
Jul 16 11:36:46 HOSTNAME evolution-alarm[21531]: unable to open named profile ([email protected]): using the null configuration.
Jul 16 11:36:47 HOSTNAME gnome-initial-s[21668]: unable to open named profile ([email protected]): using the null configuration.
Jul 16 11:36:47 HOSTNAME xdg-desktop-por[21571]: unable to open named profile ([email protected]): using the null configuration.
Jul 16 11:36:47 HOSTNAME xdg-desktop-por[21511]: unable to open named profile ([email protected]): using the null configuration.
Jul 16 11:36:47 HOSTNAME xdg-desktop-por[21903]: unable to open named profile ([email protected]): using the null configuration.
Jul 16 11:36:47 HOSTNAME nautilus[21428]: unable to open named profile ([email protected]): using the null configuration.
Jul 16 11:36:48 HOSTNAME gnome-shell[20903]: DING: (gjs:21964): dconf-WARNING **: 11:36:48.088: unable to open named profile ([email protected]): using the null configuration.

In summary:
adsys does not support uppercase Domainnames in sssd.conf at least since Version 0.14.1.
adsys somehow messes with the dconf profile and it does not get created.

Possible solutions:
Provide clear indications on how to format Domainnames (uppercase/lowercase) in sssd.conf! I have not found any documentation which mentions how this should be handled... Also it is unclear to me what case the mentions of the domain should have in the GPOs? -> Admingroups for sudo for example.

As I can not exactly say what the underlying problem with DCONF is someone should take a deeper look and fix the problem or provide a solution.

Steps to reproduce it

Domainname Case Issues:

  1. Install Ubuntu 22.04. Desktop
  2. Join machine to AD Domain with realmd and sssd, use Uppercase Domainname in the sssd.conf as seen above in the Description
  3. Install adsys 0.9.2
  4. This should work
  5. Install adsys 0.14.1 (no config required)
  6. Daemon crashes with the error:

adsysd[35284]: level=error msg="couldn't create adsys service: could not initialize AD backend: can't get domain configuration from {Conf:/etc/sssd/sssd.conf CacheDir:/var/lib/sss/db}:could not find AD domain section corresponding to "domain.tld"

Remidation:
Downgrade adsys to 0.9.2
It works again...
OR
Use lowercase domainname -> this leads to the dconf issue.

DCONF Issue:

  1. Install Ubuntu 22.04. Desktop
  2. Join machine to AD Domain with realmd and sssd, use lowercase Domainname in the sssd.conf as seen above
  3. Install adsys 0.14.1 (no config required)
  4. Login with a Domainuser
  5. start a terminal and run gedit from there.
  6. gedit starts but is not usable (cant type etc.) and in the terminal you will see:

unable to open named profile ([email protected]): using the null configuration.

Ubuntu users: System information

Report for the case issue in domainnames:
Note: The entries connected to the error start at 14:30
adsysreport_caseissue.txt

Report for the issue with dconf:
I can not see how you would be able to spot anything related to this issue (which is not present in the bugreport above) in the system information here, if needed I can reproduce it again and upload this, but I currently do not neccesarilly want to got throught all the hassle with the user profile again, so I did not include this for now.

Non Ubuntu users: System information

Environment

  • adsys version: please run adsysctl version
  • Distribution: (NAME in /etc/os-release)
  • Distribution version: (VERSION_ID on /etc/os-release):

Log files

Please redact/remove sensitive information:

adsys service logs can be acquired by running `adsysctl service cat -v`.
You can increase the amount of information displayed by increasing the verbosity level (-v) to -vv or -vvv.

Application settings

Please redact/remove sensitive information:

Paste the contents of your adsys.yaml file here, if you created one.

Additional information

If this makes any difference, please note our domainname has a two level tld:
domain.subtld.tld

I have also commented on the following issue:

Issue: Get error: unable to open named profile (user): using the null configuration. #1002

(which is exactly the dconf issue), but as there was no response until now, and that case was also open since May and the original post hat had little info about the cause and link with adsys I decided to open this new one, do what you want with this. I am just hoping to get some kind of mitigation or fix for this issue...

I have opened a case with Canonical for this because it affects multiple production servers which can not be updated until a Mitigation or a Fix is provided.

Double check your logs

  • I have redacted any sensitive information from the logs
@snussbaumermpreis snussbaumermpreis added the bug Something isn't working label Jul 24, 2024
@snussbaumermpreis
Copy link
Author

snussbaumermpreis commented Jul 25, 2024

Hi,

I did go through the hassle to reproduce the dconf issue once again to provide you with the bug report and some more infos!

The file is attached.
adsysreport-dconf.txt

Additional Info:
If you get this problem, downgrading to adsys 0.9.2 alone wont help, you have to uninstall it completetly, then login (everything should work now) and reinstall 0.9.2!

@jibel jibel added the jira Import to Jira label Jul 25, 2024
@jibel
Copy link
Collaborator

jibel commented Jul 25, 2024

Thanks for this very complete bug report. We will have a look and keep you posted.

@cristianapas
Copy link

The dconf part is the same issue of #1002 but I don't have experience on get logs and report errors

@nobbe
Copy link

nobbe commented Aug 9, 2024

Got the same issue, it's totally bricks endpoints with ubuntu 24.04 since adsys 0.9.2 isn't available there.

@jibel jibel changed the title Issue: unclear defintiions of domainname case and adsys breaking dconf Issue: unclear definitions of domainname case and adsys breaking dconf Aug 13, 2024
@denisonbarbosa
Copy link
Member

Hey, everyone!

Here is an update on this:

  1. The DCONF issue is handled by Fix DCONF policy manager removing userdb on empty policy  #1070. The error for unable to open named profile ([email protected]): using the null configuration. is related to the user not having a DCONF profile associated with it. This happens due to ADSys not creating/removing the user profile if there is nothing to apply. It was something introduced before, but the regression will be fixed.

Note: This didn't break authentication as DCONF would switch to using the default user profile, but it affected the possibility of changing any DCONF-related setting (such as the background picture).

  1. The domainname case is a bit more complicated. SSSD allows domain/DOMAIN.COM sections in sssd.conf and also allows domain/domain.com (both resolving to the same domain). However, these have effects on some other parts of the system, such as NSS. The sss module (you can check this by looking at /etc/nsswitch.conf), which comes from SSSD, uses the domain as listed in domain/DOMAIN.COM to match and generate the user entry. So, in a case where you have domain/DOMAIN.COM, you have the following behavior:
# getent is a command for querying the NSS databases for entries
user@machine:~$ getent passwd [email protected]
[email protected]:*:{uid}:{gid}:user:/home/[email protected]:/bin/bash

user@machine:~$ getent passwd [email protected]
[email protected]:*:{uid}:{gid}:user:/home/[email protected]:/bin/bash

user@machine:~$ getent passwd [email protected]
[email protected]:*:{uid}:{gid}:user:/home/[email protected]:/bin/bash

Thus, if you change the config to domain/domain.com instead (which is also valid from the SSSD perspective), the returned values would be [email protected] instead, but, from the OS perspective, those are different users.

As SSSD mainly deals with authentication, this is not a big deal. But ADSys has to deal with environment variables, DCONF values, mounts, and so on. So this has way more impact on it.

TLDR: We are still discussing the best way (if there's any) to handle this without risking breaking sensitive stuff (there's a lot of these). Meanwhile, I suggest you editing the /etc/sssd/sssd.conf file and using the lowercased domain format (i.e. domain/domain.com).

@snussbaumermpreis
Copy link
Author

Hello @denisonbarbosa

Thank you so much for fixing this issue and the info on the case issue!
The answer for the issue with the domainname case is not what I hoped for, but what I expected. I only dont get how the login is working in 0.9.2 and broken in 0.14. I will check on this again once you fix becomes available in a release.

Thanks, appreciate it!

@denisonbarbosa
Copy link
Member

denisonbarbosa commented Aug 14, 2024

Hey, @snussbaumermpreis. In adsys 0.9.2, we supported only the SSSD backend, so the codebase was very different from what we have in 0.13+, as we added support for the winbind backend also, which involved quite some changes in the code and it is now more generic (so we can't rely on some stuff that we used to before, when there was only SSSD).

@aitzubi
Copy link

aitzubi commented Aug 25, 2024

We are facing the dconf issue as well and it is a huge issue for us. Big company based in Spain. The dconf issue won't let us save keyboard mapping info so we are forced to use english keyboard layout instead of spanish. And the same happens with a lot of different settings. They just won't save and won't apply.

As stated by @snussbaumermpreis , previous versions (0.9.2) worked like a charm but the latest won't.

@denisonbarbosa any way to know when will the fixed version rollout to customers?

Happy to help providing more info for debbuging,

Kind regards

@denisonbarbosa
Copy link
Member

denisonbarbosa commented Aug 26, 2024

Hey, @aitzubi! If you configure at least one DCONF policy through the AD controller, it should work (provided you keep the domain name lowercased, as mentioned here). As soon as the pull request is merged, we'll upload the fixes to a PPA so you guys can try it out while we proceed with the SRU to release the fixes into the archive.
We'll let you guys know once it's available!

@aitzubi
Copy link

aitzubi commented Aug 26, 2024

@denisonbarbosa it does not work. I've tried to use lowercase settings and it just does not work. I've also tried to remove the latest version of adsys and to reinstall the 0.9.2 version but it does not work. It gets installed but users are unable to login. Something related to be unable to read users gpos.

I will open a ticket tomorrow with canonical because this makes our ubuntu fleet unusable due to be unable to save some critical settings.

@snussbaumermpreis
Copy link
Author

@aitzubi Hi, I have made the same observations under some circumstances. I would suggest you try to PURGE adsys 0.14 then reboot, and then try to install 0.9.2, at least this always worked for me. Also maybe try to clear SSSD cache (if you are using SSSD backend) if you change the Domainname case.

Another possible issue with unreadable gpos is some gpos which are unable to be parsed by adsys, in my experience blocking inheritance and enforcing the gpos you want to apply can help here. BUT this has always been a computer gpo issue for me.

I hope some of this is able to get you back to a working setup.

@aitzubi
Copy link

aitzubi commented Aug 27, 2024

Hi @snussbaumermpreis ,

You were right. After purging and rebooting, i was able to install 0.9.2 and it works without clearing sssd cache. Thanks!

Nevertheless, this should be fixed asap as being unable to save settings is a deal breaker for non english adsys users.

Just one question as i was unable to test it myself. Is certificate autoenrollment available in 0.9.2? Or was a feature that was added later?

Thanks guys!

@denisonbarbosa
Copy link
Member

Hey, guys! The fixed version (0.14.2) is now available at ppa:ubuntu-enterprise-desktop/adsys if you'd like to use it while we are preparing things for releasing the fixes into the archive. Thanks again for reporting the issue and helping us make adsys better!

@aitzubi
Copy link

aitzubi commented Sep 2, 2024

Hey, guys! The fixed version (0.14.2) is now available at ppa:ubuntu-enterprise-desktop/adsys if you'd like to use it while we are preparing things for releasing the fixes into the archive. Thanks again for reporting the issue and helping us make adsys better!

@denisonbarbosa i just tested it and I can confirm that it works! After installing it and rebooting, i logged in with my domain user and everything was working as expected. I can write in spanish after a couple of weeks! That's huge!

Thank you very much and feel free to contact if you want me to test something.

Kind regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jira Import to Jira
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants