Skip to content

Conversation

@aneta-petrova
Copy link
Member

@aneta-petrova aneta-petrova commented Dec 16, 2025

What changes are you introducing?

Updating documentation on enabling FreeIPA-based authentication for foremanctl. This also includes publishing a foremanctl-flavored Configuring User Authentication guide.

Why are you introducing these changes? (Explanation, links to references, issues, etc.)

theforeman/foremanctl#312

Anything else to add? (Considerations, potential downsides, alternative solutions you have explored, etc.)

N/A

Contributor checklists

  • I am okay with my commits getting squashed when you merge this PR.
  • I am familiar with the contributing guidelines.

Please cherry-pick my commits into:

  • Foreman 3.17/Katello 4.19
  • Foreman 3.16/Katello 4.18 (Satellite 6.18)
  • Foreman 3.15/Katello 4.17
  • Foreman 3.14/Katello 4.16 (Satellite 6.17; orcharhino 7.4)
  • Foreman 3.13/Katello 4.15 (EL9 only)
  • Foreman 3.12/Katello 4.14 (Satellite 6.16; orcharhino 7.2 on EL9 only; orcharhino 7.3)
  • We do not accept PRs for Foreman older than 3.12.

Summary by Sourcery

Update Kerberos SSO and external authentication documentation to cover foremanctl and related workflows.

Documentation:

  • Refresh Kerberos SSO guides for FreeIPA and Active Directory to align with current foremanctl behavior and terminology.
  • Extend user authentication documentation with updated procedures for configuring authentication sources, enrolling servers in FreeIPA, and logging in with FreeIPA credentials, including hammer CLI usage.
  • Add a new procedure describing how to reset external authentication configuration for Kerberos SSO.
  • Update the Configuring User Authentication guide index and nightly documentation metadata to include the foremanctl-focused content.

@sourcery-ai
Copy link

sourcery-ai bot commented Dec 16, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates Kerberos SSO and FreeIPA authentication documentation to incorporate foremanctl workflows, including enrollment, login, and recovery steps, and aligns the Configuring User Authentication guide and nightly metadata with the new content.

File-Level Changes

Change Details Files
Align Kerberos SSO and FreeIPA configuration docs with foremanctl workflows and terminology.
  • Adjust existing Kerberos SSO with FreeIPA assembly to reference foremanctl usage and flows.
  • Update Active Directory Kerberos SSO, external user groups, HBAC, and authentication source modules to mention or integrate foremanctl where applicable.
  • Clarify steps and prerequisites in FreeIPA and AD SSO setup to better match current tooling behavior.
guides/common/assembly_configuring-kerberos-sso-with-freeipa-in-project.adoc
guides/common/modules/con_configuring-kerberos-sso-for-active-directory-users-in-project.adoc
guides/common/modules/proc_configuring-external-user-groups.adoc
guides/common/modules/proc_configuring-host-based-access-control-for-freeipa-users-logging-in-to-project.adoc
guides/common/modules/proc_configuring-the-active-directory-authentication-source-on-projectserver.adoc
guides/common/modules/proc_configuring-the-freeipa-authentication-source-on-projectserver.adoc
Refresh enrollment and CLI login procedures to cover FreeIPA-based authentication for foremanctl and hammer.
  • Update enrollment instructions for joining the server to a FreeIPA domain to reflect current commands and flags relevant to foremanctl usage.
  • Revise CLI login procedure using FreeIPA credentials, ensuring hammer usage is consistent with foremanctl-based auth flows.
guides/common/modules/proc_enrolling-projectserver-in-your-freeipa-domain.adoc
guides/common/modules/proc_logging-in-to-hammer-cli-with-freeipa-credentials.adoc
Introduce recovery documentation for resetting external authentication configuration when using Kerberos SSO.
  • Add a new procedure module that walks through resetting external authentication configuration for Kerberos SSO scenarios.
  • Ensure the new reset procedure is referenced by or compatible with the other Kerberos SSO documentation modules.
guides/common/modules/proc_resetting-external-authentication-configuration-for-kerberos-sso.adoc
Wire updated modules into the main Configuring User Authentication guide and nightly documentation metadata.
  • Update the Configuring User Authentication guide master assembly to include or reference the refreshed Kerberos/FreeIPA and foremanctl-related modules.
  • Adjust nightly release JSON metadata so the updated and new documentation is available in the nightly build navigation.
guides/doc-Configuring_User_Authentication/master.adoc
web/releases/nightly.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions bot added Needs tech review Requires a review from the technical perspective Needs style review Requires a review from docs style/grammar perspective Needs testing Requires functional testing labels Dec 16, 2025
@github-actions
Copy link

github-actions bot commented Dec 16, 2025

The PR preview for b8abbb8 is available at theforeman-foreman-documentation-preview-pr-4543.surge.sh

The following output files are affected by this PR:

show diff

show diff as HTML

@aneta-petrova aneta-petrova marked this pull request as ready for review December 16, 2025 18:32
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • In the new and updated Kerberos/FreeIPA modules, double-check that references to foremanctl vs. hammer are consistently scoped (for example, in titles, prerequisites, and command snippets) so users can easily tell which tool a given step applies to.
  • Since you added proc_resetting-external-authentication-configuration-for-kerberos-sso.adoc, consider linking to this procedure from the main Kerberos SSO configuration assembly and any troubleshooting sections so users can discover the reset workflow when they run into misconfiguration issues.
  • For the nightly.json changes, verify that the new or updated entries for the Configuring User Authentication and Kerberos/FreeIPA docs use consistent slugs/URLs and titles with the corresponding master.adoc files to avoid broken or duplicated navigation items.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the new and updated Kerberos/FreeIPA modules, double-check that references to `foremanctl` vs. `hammer` are consistently scoped (for example, in titles, prerequisites, and command snippets) so users can easily tell which tool a given step applies to.
- Since you added `proc_resetting-external-authentication-configuration-for-kerberos-sso.adoc`, consider linking to this procedure from the main Kerberos SSO configuration assembly and any troubleshooting sections so users can discover the reset workflow when they run into misconfiguration issues.
- For the `nightly.json` changes, verify that the new or updated entries for the Configuring User Authentication and Kerberos/FreeIPA docs use consistent slugs/URLs and titles with the corresponding `master.adoc` files to avoid broken or duplicated navigation items.

## Individual Comments

### Comment 1
<location> `guides/common/modules/proc_resetting-external-authentication-configuration-for-kerberos-sso.adoc:17` </location>
<code_context>
 +
 [options="nowrap", subs="+quotes,verbatim,attributes"]
 ----
+ifdef::foremanctl[]
+# foremanctl deploy --pam-service foreman-prod
+endif::[]
</code_context>

<issue_to_address>
**issue (review_instructions):** The .Verification section for the foremanctl variant is just a placeholder and does not provide actual verification steps, so the verification instruction is not fulfilled.

The non-foremanctl path includes a concrete verification step (`--help | grep foreman-ipa-authentication` and expected values), but the foremanctl path only has the placeholder `#How can users verify this?#`.

Please add explicit verification instructions for the foremanctl scenario (for example, a command or UI check that confirms external authentication has been reset and what output or behavior to expect), or otherwise align it with the level of verification provided for the installer-based variant.

<details>
<summary>Review instructions:</summary>

**Path patterns:** `guides/common/modules/proc*.adoc`

**Instructions:**
- Verification steps are included where appropriate.

</details>
</issue_to_address>

### Comment 2
<location> `guides/common/modules/proc_resetting-external-authentication-configuration-for-kerberos-sso.adoc:13` </location>
<code_context>
+[IMPORTANT]
+====
+Resetting external authentication prevents users from accessing {Project} as described in xref:configuring-kerberos-sso-with-{FreeIPA-context}-in-{project-context}[] and xref:configuring-kerberos-sso-for-active-directory-users-in-project_{context}[].
+However, some configuration files, such as configuration files for the System Security Services Daemon (SSSD), will remain modified because {Project} does not have access to the previous state of these files.
+====
+
</code_context>

<issue_to_address>
**suggestion (review_instructions):** The phrase "will remain modified" uses passive voice and could be rephrased to an active construction to meet the style requirement.

Consider rephrasing to avoid the passive construction, for example:

"However, some configuration files, such as those for the System Security Services Daemon (SSSD), stay in their modified state because {Project} does not have access to their previous state."

This keeps the meaning while avoiding passive voice.

<details>
<summary>Review instructions:</summary>

**Path patterns:** `guides/common/*.adoc,guides/common/modules/*.adoc`

**Instructions:**
Avoid passive voice in verbs.

</details>
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@aneta-petrova
Copy link
Member Author

aneta-petrova commented Dec 16, 2025

These preview links are relevant for tech review:

Configuring User Authentication, update to contain only content that's expected to work with foremanctl:

Configuring User Authentication, based on the current installer (section 12. Resetting external authentication configuration for Kerberos SSO is mostly new and needs a review):

@aneta-petrova aneta-petrova force-pushed the foremanctl-kerberos-auth branch from ff45f7c to b752f34 Compare December 16, 2025 18:41
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Not a complete read through but some things that jumped out to me.

Can we define {project-package-install} as just {package-install} for foremanctl? We already do that for everything except the satellite builds everywhere else and keeps the changes smaller.

Copy link
Contributor

@adamruzicka adamruzicka left a comment

Choose a reason for hiding this comment

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

It reads well, but the verification part for disabling with foremanctl needs to be flushed out

Comment on lines 42 to 44
ifdef::foremanctl[]
#How can users verify this?#
endif::[]
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if output of foremanctl is stable enough to do something like we do with the old installer. The following is a bit of a poor man's solution, but it should work.

$ curl -k -u : --negotiate https://foreman.example.com/users/extlogin
<html><body>You are being <a href="https://foreman.example.com/users/login">redirected</a>.</body></html>

Copy link
Member Author

Choose a reason for hiding this comment

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

Considering that the ext auth options are expected to be mutually exclusive, and thus users or foremanctl itself should check if there is an ext auth source already configured, it would be great if we had a more user-friendly way of checking the current configuration. Can something like that be implemented?

And on a similar note: What will happen if users try to configure an external auth source in a situation where a different one is already configured? I was hoping foremanctl deploy --external-authentication could display a warning in this case. Alternatively, I might have to write a prerequisite for each of the configuration procedures but that would certainly be a lot more error-prone than the tool displaying a message.

Copy link
Contributor

Choose a reason for hiding this comment

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

thus users or foremanctl itself should check if there is an ext auth source already configured

I still haven't had my morning coffee so I might be a bit slower. Why should they need to check?

An alternative would be checking settings, but that doesn't tell the whole story as large chunk of the configuration takes place outside of foreman.

## Should be true when external-authentication is ipa or ipa_with_api
# hammer setting info --name authorize_login_delegation | grep -e Name -e Value
Name:          authorize_login_delegation
Value:         true

## Should be true when external-authentication is ipa_with_api
# hammer setting info --name authorize_login_delegation_api | grep -e Name -e Value
Name:          authorize_login_delegation_api
Value:         false

What will happen if users try to configure an external auth source in a situation where a different one is already configured?

The current model is that external authentication either is or is not configured. Whether you use ipa or ipa_with_api just changes how, but you can't really have multiple external auth sources configured at the same time. Much like the old installer, foremanctl works in a "make it so" way, so if they try to configure an external auth source in any way, it will happen, replacing what was there before.

Copy link
Member Author

Choose a reason for hiding this comment

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

thus users or foremanctl itself should check if there is an ext auth source already configured

I still haven't had my morning coffee so I might be a bit slower. Why should they need to check?

If I configure the ipa_with_api source, forget about it, and then configure ipa, what will happen?

Similarly, in the future, if I configure the hypothetical oidc source, forget about it, and then configure ipa, what will happen?

Will the configuration get overwritten without a warning? Or will foremanctl refuse to perform the action because it will notice that an authentication source is already configured?

Copy link
Member Author

Choose a reason for hiding this comment

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

Much like the old installer, foremanctl works in a "make it so" way, so if they try to configure an external auth source in any way, it will happen, replacing what was there before.

And this is the answer to the question I clarified above :) If foremanctl doesn't notify the users about any previously used configuration, I lean towards thinking that it should. Or, if that's not possible, that we should have a user-friendly way of checking for any currently used auth source.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if output of foremanctl is stable enough to do something like we do with the old installer. The following is a bit of a poor man's solution, but it should work.

$ curl -k -u : --negotiate https://foreman.example.com/users/extlogin
<html><body>You are being <a href="https://foreman.example.com/users/login">redirected</a>.</body></html>

I was trying to find out what the message looks like when external authentication is not configured (because this is a section on resetting the ext auth source). However, I still got the You are being redirected message. This is on a server that has never had ext auth configured.

So now I wonder what I'm doing wrong. What should the message look like on a system where ext auth has been reset?

Copy link
Member Author

Choose a reason for hiding this comment

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

What I really don't like about the current state of foremanctl is that it doesn't show me current configuration. Old satellite-installer --help would show me what arguments are default/last => going to be used if I don't specify them. I think the correct way to resolve this would be to add this functionality to foremanctl.

@ekohl Is this something you could/should define as a feature to be implemented?

However, it's out of scope of this PR. I think it's nice to add the IDM verification procedure as proposed by Adam, especially since such a thing is in the AD section.

No action yet, I'm trying to get more clarification on this (see my previous comment above).

Also, documentation definitely has to specify that AD and IDM are mutually exclusive - I'm surprised it's not there yet. That is IMO also the right place to note that any previous configuration will be overswritten.

Added.

Copy link
Contributor

Choose a reason for hiding this comment

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

So now I wonder what I'm doing wrong. What should the message look like on a system where ext auth has been reset?

Nothing, there is no difference between external auth being reset and external auth never being set up in the first place. If external auth is set up, this would either pass and redirect you to /hosts or fail and then you'd get 401. If external auth is not set up (or was reset) you'll get a redirect to the login page (/users/login).

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh! I was looking at the verification step for configuring (pre-foremanctl) AD integration and I completely missed that the difference is /users/login vs /hosts! Now I get it, thanks.

Copy link
Member Author

Choose a reason for hiding this comment

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

However, it's out of scope of this PR. I think it's nice to add the IDM verification procedure as proposed by Adam, especially since such a thing is in the AD section.

No action yet, I'm trying to get more clarification on this (see my previous comment above).

Added now.

@pr-processor pr-processor bot added the Waiting on contributor Requires an action from the author label Dec 17, 2025
@aneta-petrova aneta-petrova removed the Waiting on contributor Requires an action from the author label Dec 17, 2025
* Username and password
* Kerberos single sign-on

ifndef::foremanctl[]
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean that these are not available with foremanctl? I think that's not true.

Copy link
Member Author

Choose a reason for hiding this comment

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

I excluded these lines (for now) because the NOTE leads to an LDAP procedure which uses foreman-maintain. The maintain tool will be replaced by foremanctl, which means the procedure cannot yet be included in a foremanctl guide. We can include it after we know what the replacement for foreman-maintain service restart will look like and that the procedure works in the foremanctl world.

The other link leads to an AD procedure, which is being exposed in this PR. However, modifying the NOTE to include two links for a pre-foremanctl version of the guide and one link for the post-foremanctl version would take some rewriting. I don't think it's worth it right now -- we can just include the whole NOTE again after we verify that the LDAP procedure is safe for foremanctl.

The attack is possible even if the user did not previously enter the {Project} login credentials anywhere, for example in the browser.
====
ifndef::foremanctl[]
. If Hammer is not configured to negotiate authentication, initiate an authentication session manually:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we leave a guide to setup Hammer manually, in case the user doesn't want to use --add-feature hammer?

Copy link
Member Author

Choose a reason for hiding this comment

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

On the docs side, there is a strong preference towards documenting only one way to accomplish a user's goal -- the most user-friendly one. Based on that, my answer would be no. Let me know if I'm missing something.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hammer may be installed on non-Satellite hosts. That is, on hosts without foremanctl.

endif::[]

ifndef::foremanctl[]
include::common/modules/ref_overview-of-authentication-methods-in-foreman.adoc[leveloffset=+1]
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand changes in this whole file. Does it mean that with foremanctl, we drop many parts of docs including overview? LDAP? Why? Some of those things have nothing to do with either foreman-installer or foremanctl.

Copy link
Member Author

@aneta-petrova aneta-petrova Dec 18, 2025

Choose a reason for hiding this comment

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

The overview includes procedures, which have not yet been verified for foremanctl. I have now readded it, but only with links to the IPA and AD sections.

LDAP uses foreman-maintain (to restart services). This will also be replaced by foremanctl.

The idea for using the foremanctl conditionals is to start with an empty guide (basically everything hidden behind ifndef::foremanctl[] and then expose the things that we verify in the foremanctl world. That's why this PR starts with hiding everything (okay, that could have been a separate PR... I should probably make sure I don't squash commits when merging), and then re-includes only the things that are related to Kerberos authentication.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, I didn't know we were this organized with docs migration to foremanctl!

@aneta-petrova aneta-petrova force-pushed the foremanctl-kerberos-auth branch from b0073ce to b4e1a67 Compare December 18, 2025 19:03
@aneta-petrova
Copy link
Member Author

These preview links are relevant for tech review:

Configuring User Authentication, update to contain only content that's expected to work with foremanctl:

* https://theforeman-foreman-documentation-preview-pr-4543.surge.sh/nightly/Configuring_User_Authentication/index-foremanctl-katello.html

* https://theforeman-foreman-documentation-preview-pr-4543.surge.sh/nightly/Configuring_User_Authentication/index-foremanctl-satellite.html

Configuring User Authentication, based on the current installer (section 12. Resetting external authentication configuration for Kerberos SSO is mostly new and needs a review):

* https://theforeman-foreman-documentation-preview-pr-4543.surge.sh/nightly/Configuring_User_Authentication/index-katello.html

* https://theforeman-foreman-documentation-preview-pr-4543.surge.sh/nightly/Configuring_User_Authentication/index-satellite.html

A few threads are still open (for visibility due to open questions not related to the documentation update or just interesting information being shared) but other than that, I think I've implemented all the feedback so far. Which means these guides are ready for re-review.

----
# {foreman-installer} --foreman-pam-service {project-context}-prod
ifdef::foremanctl[]
# foremanctl deploy --external-authentication-pam-service foreman-prod
Copy link
Contributor

Choose a reason for hiding this comment

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

--external-authentication-pam-service only makes sense in combination with --external authentication so this part presumes that --external-authentication has been specified previously, otherwise it wouldn't work.

`foremanctl deploy`
endif::[]
ifndef::foremanctl[]
{foreman-installer}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{foreman-installer}
`{foreman-installer}`

<html><body>You are being <a href="_{foreman-example-com}_/hosts">redirected</a>.</body></html>
----
+
When external authentication is configured correctly, the `curl` command redirects you to `{foreman-example-com}/hosts`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
When external authentication is configured correctly, the `curl` command redirects you to `{foreman-example-com}/hosts`.
When external authentication is configured correctly, the `curl` command redirects you to `\https://{foreman-example-com}/hosts`.

The backslash prevents asciidoctor to render a link to the "example.com" domain which does not exist. Similar to:

guides/common/modules/proc_creating-custom-alternate-content-sources-by-using-web-ui.adoc
13:For example, if your base URL is `\https://{server-example-com}` and your subpaths are `rhel10/` and `rhel9/`, then {Project} will search `\https://{server-example-com}/rhel10/` an [... 1 more match]

<html><body>You are being <a href="https://_{foreman-example-com}_/users/login">redirected</a>.</body></html>
----
+
When external authentication is disabled, the `curl` command redirects you to `{foreman-example-com}/users/login`.
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs style review Requires a review from docs style/grammar perspective Needs tech review Requires a review from the technical perspective Needs testing Requires functional testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants