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

freeipa: init at 4.10.1 #207115

Merged
merged 6 commits into from
Mar 30, 2023
Merged

freeipa: init at 4.10.1 #207115

merged 6 commits into from
Mar 30, 2023

Conversation

s1341
Copy link
Contributor

@s1341 s1341 commented Dec 21, 2022

Description of changes

This PR allows nixos to be a fully-fledged freeipa (https://www.freeipa.org/page/Main_Page) client, by adding an ipa configuration module, and all required tools.

This PR is a replacement for #22789, which updates all components and has been tested to work. I.e. I have tested that it is possible to login using credentials stored in the freeipa server. All credit goes to @outergod who did all the heavy lifting.

The configuration blob can be taken as is from the PR above.

Things still to do:

  • Fix a quirk with the sssd pam configuration, which makes it impossible to change passwords. (I have a fix for this, but am unsure whether to include it in this PR).
  • Fix sudo-ing using sssd and freeipa sudo-rules. Need help from freeipa developers to debug and resolve.
  • Allow configuration of a FAST binding principal in the ipa configuration module.
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python 8.has: module (update) This PR changes an existing module in `nixos/` labels Dec 21, 2022
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 8.has: package (new) This PR adds a new package labels Dec 21, 2022
pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
pkgs/os-specific/linux/freeipa/ipa-client-install Outdated Show resolved Hide resolved
pkgs/os-specific/linux/freeipa/default.nix Outdated Show resolved Hide resolved
pkgs/os-specific/linux/freeipa/default.nix Outdated Show resolved Hide resolved
pkgs/os-specific/linux/freeipa/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/pki-core/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/pki-core/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/pki-core/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/pki-core/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/pki-core/default.nix Outdated Show resolved Hide resolved
@s1341
Copy link
Contributor Author

s1341 commented Dec 22, 2022

wow @SuperSandro2000 thanks for the amazingly in-depth review. I will address everything later today.

@RaitoBezarius RaitoBezarius marked this pull request as draft December 22, 2022 15:39
@s1341
Copy link
Contributor Author

s1341 commented Dec 26, 2022

I believe I have addressed all review comments at this point.

@s1341 s1341 marked this pull request as ready for review December 26, 2022 07:15
@benley
Copy link
Member

benley commented Dec 26, 2022

This looks awesome! I'll try setting up some nodes with the new module after I get back to work (next week)

@s1341
Copy link
Contributor Author

s1341 commented Dec 26, 2022

Feel free to ping me on irc or matrix if you need help getting things working. It should just work but I’m available to help.

pkgs/os-specific/linux/freeipa/default.nix Outdated Show resolved Hide resolved
pkgs/os-specific/linux/freeipa/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/yubico/default.nix Outdated Show resolved Hide resolved
nixos/modules/security/ipa.nix Outdated Show resolved Hide resolved
@s1341
Copy link
Contributor Author

s1341 commented Mar 16, 2023

@bjornfor I cleaned up all the commits. Please take another look.

@s1341
Copy link
Contributor Author

s1341 commented Mar 19, 2023

Can we merge this?

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix the build failure ofborg discovered

@s1341
Copy link
Contributor Author

s1341 commented Mar 20, 2023

@SuperSandro2000 what build failure?

@benley
Copy link
Member

benley commented Mar 29, 2023

I don't know what build failure @SuperSandro2000 is referring to either. If we can't find it and there are no specific objections, perhaps we can actually merge this PR soon?

@s1341
Copy link
Contributor Author

s1341 commented Mar 29, 2023

I’d like that.

@benley benley merged commit ff296a7 into NixOS:staging Mar 30, 2023
@s1341
Copy link
Contributor Author

s1341 commented Mar 30, 2023

Yay! Thanks!

@benley
Copy link
Member

benley commented Mar 30, 2023

Oh hm, it's going into the staging branch - does that get merged to master automatically at some point?

@s1341
Copy link
Contributor Author

s1341 commented Mar 30, 2023

Yes... it just takes a few weeks I think

@SuperSandro2000
Copy link
Member

Those build failures:

image

You should know about them, if you have commit rights.

Not sure where it exactly fails because ofborg interlaces the logs into one.

@benley
Copy link
Member

benley commented Mar 30, 2023

Oh, I mistakenly assumed that the checks would display a red X for a failure. The grey square was too easy to overlook, sorry.

@SuperSandro2000
Copy link
Member

Yeah, that is a known problem.

I think freeipa is not building, so when this PR reaches master it will likely also not build.

@benley
Copy link
Member

benley commented Mar 30, 2023

I'm taking a look to see if these are easy fixes. If not I suppose we'll want to temporarily revert.

@benley
Copy link
Member

benley commented Mar 30, 2023

fwiw it appears that freeipa builds cleanly if you cherry-pick the commits from this PR onto the master branch. It's going to take a while for me to build staging to see the failure.

@benley
Copy link
Member

benley commented Mar 30, 2023

The build failures I'm now seeing on the staging branch are things that I don't think could be caused by this PR:

collect2: error: ld returned 1 exit status
make[3]: *** [../../gcc-12.2.0/gcc/lto/Make-lang.in:96: lto1] Error 1
make[3]: *** Waiting for unfinished jobs....
collect2: error: ld returned 1 exit status
make[3]: *** [../../gcc-12.2.0/gcc/cp/Make-lang.in:136: cc1plus] Error 1
make[3]: *** Waiting for unfinished jobs....
collect2: error: ld returned 1 exit status
make[3]: *** [../../gcc-12.2.0/gcc/lto/Make-lang.in:96: lto1] Error 1
collect2: error: ld returned 1 exit status
make[3]: *** [../../gcc-12.2.0/gcc/lto/Make-lang.in:102: lto-dump] Error 1
collect2: error: ld returned 1 exit status
make[3]: *** [../../gcc-12.2.0/gcc/c/Make-lang.in:87: cc1] Error 1
rm gcc.pod
make[3]: Leaving directory '/build/build/gcc'
make[2]: *** [Makefile:4961: all-stage1-gcc] Error 2
make[2]: Leaving directory '/build/build'
make[1]: *** [Makefile:25612: stage1-bubble] Error 2
make[1]: Leaving directory '/build/build'
make: *** [Makefile:25949: bootstrap] Error 2
error: builder for '/nix/store/sm9v2r9qsnidajynb21xc73ggl2w23j9-gfortran-12.2.0.drv' failed with exit code 2;
       last 10 log lines:
       > make[3]: *** [../../gcc-12.2.0/gcc/lto/Make-lang.in:102: lto-dump] Error 1
       > collect2: error: ld returned 1 exit status
       > make[3]: *** [../../gcc-12.2.0/gcc/c/Make-lang.in:87: cc1] Error 1
       > rm gcc.pod
       > make[3]: Leaving directory '/build/build/gcc'
       > make[2]: *** [Makefile:4961: all-stage1-gcc] Error 2
       > make[2]: Leaving directory '/build/build'
       > make[1]: *** [Makefile:25612: stage1-bubble] Error 2
       > make[1]: Leaving directory '/build/build'
       > make: *** [Makefile:25949: bootstrap] Error 2
       For full logs, run 'nix log /nix/store/sm9v2r9qsnidajynb21xc73ggl2w23j9-gfortran-12.2.0.drv'.
error: 1 dependencies of derivation '/nix/store/9ilxr4qw168x8gxhn5pna3fvp6dkw5nw-gfortran-wrapper-12.2.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/c64c4jb4iplgh6ffks9gk2wwjfm46ls3-python3.10-numpy-1.24.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/7w1bcry5fmdxlxbp96r2rqlkrcscx4gs-python3.10-scipy-1.10.1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/9qnsyw74vpd8w2pwjmqx163px1gc5zv3-python3.10-fonttools-4.38.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/k3yinhpm0364llmqk514z24y7blacvq7-python3.10-pillow-9.4.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/0ymza05gqcanw14r0fb8127vdzngwl52-liberation-fonts-2.1.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/zvq7hb7p5lc8aqapl0fqiymgp59qj3rb-python3.10-qrcode-7.4.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/jv2chndjkvbks3hiij1419xnqq7x8dpd-freeipa-4.10.1.drv' failed to build

@benley
Copy link
Member

benley commented Mar 30, 2023

I suspect this is going to be fine when it hits master. @SuperSandro2000 am I missing something glaringly obvious?

@SuperSandro2000
Copy link
Member

Yes, gfortran will be certainly fixed before hitting master.

@trofi
Copy link
Contributor

trofi commented Mar 30, 2023

Fails to eval in staging as:

$ nix-env -qa --json --arg config 'import <nixpkgs/pkgs/top-level/packages-config.nix>' --option build-users-group  '""' -I nixpkgs=. -f .
error:
       … while calling the 'abort' builtin

         at /home/slyfox/dev/git/nixpkgs-staging/lib/customisation.nix:179:65:

          178|
          179|     in if missingArgs == [] then makeOverridable f allArgs else abort error;
             |                                                                 ^
          180|

       error: evaluation aborted with the following error message: 'Function called without required argument "pkgconfig" at /home/slyfox/dev/git/nixpkgs-staging/pkgs/os-specific/linux/freeipa/default.nix:4, did you mean "pkg-config" or "pkgconf"?'

Looks related?

@trofi
Copy link
Contributor

trofi commented Mar 31, 2023

Ah, it's the result of alias use. Attempting to fix as #224026

@Silver-Golden
Copy link
Member

o/
I am testing this out on unstable.
By any chance does anyone have a config of this working?
And Looking at teh code it seems like computers cannot automatically enroll themselves, are there any plans for auto enroll?

@s1341
Copy link
Contributor Author

s1341 commented May 22, 2023

@Silver-Golden I have it working. You need to have a freeipa server set up. This PR only adds the client and a module for client configuration. You need to enroll once. The reason there isn't auto-enroll is becuase you need a password for an ipa account which is allowed to enroll users.

If you want, I can share my freeipa-server and auto-enroll nix scripts.

@benley
Copy link
Member

benley commented May 22, 2023

If you want, I can share my freeipa-server and auto-enroll nix scripts.

Please do, I would find an auto-enroll script useful too.

You don't have freeipa-server running on nixos, do you? Because that would be very cool.

@s1341
Copy link
Contributor Author

s1341 commented May 23, 2023

I have freepia-server running in docker on nixos, with a declarative docker container. I will try to clean things up and post in the next couple of days.

@s1341
Copy link
Contributor Author

s1341 commented May 29, 2023

@benley: I've posted my configs for a freeipa-server (docker) and an ipa-tuura (https://github.com/freeipa/ipa-tuura) instance. The ipa-tuura instance is an ipa client (using the module in this PR), and also has an auto-enroll service (see systemd.services.init-sssd). Let me know what you think.

https://gist.github.com/s1341/125b95ddc2edb4f7e174eca1ab217ca6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants