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

fix: ensure we fail authentication when user auth failed #406

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

didrocks
Copy link
Member

@didrocks didrocks commented Jul 2, 2024

Authd has a high priority in the PAM stack. When we don’t ignore on purpose the authentication to pass to other modules, we should fail immediately it.
We thus mirror requisite with still allowing the none authentication access part to be skipped.

UDENG-3413

Authd has a high priority in the PAM stack. When we don’t ignore on
purpose the authentication to pass to other modules, we should fail
immediately it.
We thus mirror requisite with still allowing the none authentication
access part to be skipped.
@didrocks didrocks marked this pull request as ready for review July 2, 2024 09:08
@didrocks didrocks requested a review from a team as a code owner July 2, 2024 09:08
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.29%. Comparing base (05ca163) to head (676de03).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #406      +/-   ##
==========================================
- Coverage   84.40%   84.29%   -0.11%     
==========================================
  Files          77       77              
  Lines        6686     6691       +5     
  Branches       75       75              
==========================================
- Hits         5643     5640       -3     
- Misses        732      735       +3     
- Partials      311      316       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@3v1n0 3v1n0 left a comment

Choose a reason for hiding this comment

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

This is good.

GDM should be already ok with this. Maybe for making it more explicit also the debian/authd.gdm-authd.pam could be changed:

diff --git a/debian/authd.gdm-authd.pam b/debian/authd.gdm-authd.pam
index ea3ee6f6..7aed7ae9 100644
--- a/debian/authd.gdm-authd.pam
+++ b/debian/authd.gdm-authd.pam
@@ -7,6 +7,7 @@ auth    substack        common-auth
 
 auth    requisite       pam_nologin.so
 auth    optional        pam_gnome_keyring.so
+auth    sufficient      pam_permit.so
 
 account [default=ignore success=ok user_unknown=ignore]	pam_authd.so
 # This is potentially loading pam_authd.again but we've checks in AcctMgmt() to
@@ -31,6 +32,9 @@ session required        pam_limits.so
 session required        pam_env.so readenv=1
 session required        pam_env.so readenv=1 envfile=/etc/default/locale
 @include common-session
+
 session optional        pam_mkhomedir.so
 session optional        pam_gnome_keyring.so auto_start
+session sufficient      pam_permit.so
+
 @include common-password

@didrocks
Copy link
Member Author

didrocks commented Jul 2, 2024

Do you mind adding a separate PR for the gdm part? Let’s merge that in in between.

@didrocks didrocks merged commit d3d60d3 into main Jul 2, 2024
6 checks passed
@didrocks didrocks deleted the fail-authentication-when-authentication-failed branch July 2, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants