Skip to content

feat(matic): enable PAM fingerprint auth and fix falcon init - #743

Merged
shunkakinoki merged 1 commit into
mainfrom
feat/matic-fingerprint-pam
Feb 5, 2026
Merged

feat(matic): enable PAM fingerprint auth and fix falcon init#743
shunkakinoki merged 1 commit into
mainfrom
feat/matic-fingerprint-pam

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Feb 5, 2026

Copy link
Copy Markdown
Owner

Changes

  • Enable fingerprint authentication for login, GDM, and sudo via PAM services
  • Fix CrowdStrike Falcon init script to skip cleanup when already installed

Technical Details

  • Added security.pam.services.{login,gdm,sudo}.fprintAuth = true for fingerprint at login
  • Modified falcon init to check if falcond exists before trying to reinitialize (CrowdStrike's kernel module protects its files from removal)

Testing

  • Fingerprint enrollment via sudo fprintd-enroll
  • Verify login/sudo with fingerprint after rebuild

Generated with Claude Code by claude-opus-4-5-20250101


Summary by cubic

Enables fingerprint authentication for login, GDM, and sudo on matic, and updates the Falcon init script to avoid reinitializing when the sensor is already installed.

  • New Features

    • Enabled fprintd and PAM fingerprint auth for login, gdm, and sudo.
  • Bug Fixes

    • Falcon init now checks for /opt/CrowdStrike/falcond and skips cleanup/reinstall to prevent conflicts with protected files.

Written for commit 4ef7f13. Summary will update on new commits.

- Enable fingerprint auth for login, GDM, and sudo via PAM
- Fix falcon init script to skip cleanup when already installed
  (CrowdStrike protects its files with kernel module)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 5, 2026 14:49
@mesa-dot-dev

mesa-dot-dev Bot commented Feb 5, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@shunkakinoki shunkakinoki added the enhancement Indicates new feature requests. label Feb 5, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @shunkakinoki, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances system security and robustness by integrating fingerprint authentication across key system services like login, GDM, and sudo, providing a more convenient and secure access method. Concurrently, it refines the CrowdStrike Falcon agent's initialization process to be more resilient, avoiding conflicts with its self-protection mechanisms by only performing installation steps if the agent is not already present.

Highlights

  • Fingerprint Authentication: Enabled fingerprint authentication for login, GDM (GNOME Display Manager), and sudo operations by configuring the respective PAM services.
  • CrowdStrike Falcon Initialization Fix: Modified the CrowdStrike Falcon initialization script to prevent reinitialization and cleanup if the falcond executable already exists, addressing issues where CrowdStrike's kernel module protects its files from removal.
Changelog
  • named-hosts/matic/default.nix
    • Added security.pam.services.login.fprintAuth = true; to enable fingerprint authentication for user login.
    • Added security.pam.services.gdm.fprintAuth = true; to enable fingerprint authentication for the GNOME Display Manager.
    • Added security.pam.services.sudo.fprintAuth = true; to enable fingerprint authentication for sudo commands.
  • named-hosts/matic/falcon.nix
    • Modified the postInstall script to check for the existence of /opt/CrowdStrike/falcond before proceeding with installation, ensuring the agent is only initialized if not already set up.
    • Removed the previous logic that attempted to remove immutable attributes (chattr -i -R) and forcefully delete (rm -rf) the /opt/CrowdStrike directory, which was problematic due to CrowdStrike's file protection.
Activity
  • The initial draft of this pull request was generated using Claude Code by claude-opus-4-5-20250101.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mesa-dot-dev

mesa-dot-dev Bot commented Feb 5, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Enable PAM fingerprint authentication for login, GDM, and sudo, and fix CrowdStrike Falcon init script to prevent reinitialization errors.

What changed?

  • Enabled fingerprint authentication for login, GDM, and sudo via PAM services
  • Fixed CrowdStrike Falcon init script to skip cleanup when already installed
  • Added security.pam.services.{login,gdm,sudo}.fprintAuth = true for fingerprint at login
  • Modified falcon init to check if falcond exists before trying to reinitialize

Description generated by Mesa. Update settings

@coderabbitai

coderabbitai Bot commented Feb 5, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Fingerprint authentication now available for login, GDM, and sudo services.
  • Improvements

    • Optimized CrowdStrike falcon daemon initialization for better reliability and idempotency.

Walkthrough

Enables fingerprint authentication via PAM for three services (login, GDM, sudo) in NixOS configuration, and refactors CrowdStrike Falcon daemon initialization to be idempotent by guarding setup operations with a file presence check instead of unconditional cleanup.

Changes

Cohort / File(s) Summary
Fingerprint Authentication
named-hosts/matic/default.nix
Enables PAM fingerprint authentication for login, GDM, and sudo services, expanding fingerprint daemon support beyond basic daemon enablement.
CrowdStrike Initialization
named-hosts/matic/falcon.nix
Converts /opt/CrowdStrike setup from unconditional cleanup-and-recopy to conditional, idempotent initialization guarded by presence check of falcond binary. Removes explicit chattr invocation and rm commands.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A fingerprint's touch, idempotent and true,
No more shall we cleanup what we just set anew,
Login, GDM, sudo—all three now know,
A rabbit's delight in the auth's graceful flow! 🌿✨

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/matic-fingerprint-pam

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@shunkakinoki
shunkakinoki merged commit 05befeb into main Feb 5, 2026
29 of 30 checks passed
@shunkakinoki
shunkakinoki deleted the feat/matic-fingerprint-pam branch February 5, 2026 14:50

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request enables fingerprint authentication and updates the CrowdStrike Falcon initialization script. The fingerprint configuration is a good addition. However, the change to the Falcon init script, while fixing the re-initialization issue, introduces a new problem where the agent will not be updated when the Nix package changes. I've provided a suggestion to address this by ensuring the agent files are always synchronized, which should handle both initial installs and upgrades correctly.

Comment on lines +20 to 25
# Only initialize if not already set up (CrowdStrike protects its files)
if [ ! -f /opt/CrowdStrike/falcond ]; then
install -d -m 0770 /opt/CrowdStrike
cp -a ${falcon}/opt/CrowdStrike/. /opt/CrowdStrike/
chown -R root:root /opt/CrowdStrike
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The current logic with if [ ! -f /opt/CrowdStrike/falcond ] prevents the CrowdStrike agent from being updated when the underlying Nix package is changed. This is because the script will skip the installation steps if falcond already exists.

According to the PR description, the agent's files are protected from removal, but cp -a should still be able to overwrite them to perform an upgrade. By removing the conditional, we ensure that the files are always synchronized from the Nix store on startup, which handles both initial installation and upgrades.

    # Always copy files to handle initial install and upgrades.
    # The agent's files are protected from removal, but can be overwritten.
    install -d -m 0770 /opt/CrowdStrike
    cp -a ${falcon}/opt/CrowdStrike/. /opt/CrowdStrike/
    chown -R root:root /opt/CrowdStrike

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR enables fingerprint authentication for PAM services and fixes the CrowdStrike Falcon initialization script to handle file protection more gracefully.

Changes:

  • Added fingerprint authentication support for login, GDM, and sudo via PAM configuration
  • Refactored Falcon init script to check for existing installation rather than attempting cleanup on every service start

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
named-hosts/matic/default.nix Added fprintAuth configuration for login, gdm, and sudo PAM services
named-hosts/matic/falcon.nix Changed initialization logic to skip setup when falcond already exists, avoiding attempts to remove protected files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

services.fprintd.enable = true;
security.pam.services.login.fprintAuth = true;
security.pam.services.gdm.fprintAuth = true;
security.pam.services.sudo.fprintAuth = true;

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

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

The security.pam.services.sudo.fprintAuth = true setting is redundant given that security.sudo.wheelNeedsPassword = false (line 70) already allows passwordless sudo for wheel group members. While this doesn't cause any functional issues, it may create confusion about the actual authentication mechanism being used for sudo.

Consider either:

  1. Removing the fprintAuth setting for sudo since it's not needed with passwordless sudo, or
  2. Adding a comment explaining that this is for future-proofing in case the wheelNeedsPassword setting changes, or
  3. Changing wheelNeedsPassword to true if you want to require either password or fingerprint for sudo.

If the intent is to require authentication (via fingerprint or password) for sudo, you should set security.sudo.wheelNeedsPassword = true.

Copilot uses AI. Check for mistakes.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 2 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="named-hosts/matic/falcon.nix">

<violation number="1" location="named-hosts/matic/falcon.nix:21">
P1: The current initialization logic completely skips the copy step if `falcond` exists, which prevents the sensor from being updated. If you update the `falcon-sensor` package in Nix, the system will continue running the old binary from `/opt/CrowdStrike` instead of the new one from the store.

Using `cmp` allows you to skip initialization when the binary hasn't changed (fixing the restart crash loop) while still attempting to update when the version changes.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

if [ -d /opt/CrowdStrike ]; then
${pkgs.e2fsprogs}/bin/chattr -i -R /opt/CrowdStrike 2>/dev/null || true
# Only initialize if not already set up (CrowdStrike protects its files)
if [ ! -f /opt/CrowdStrike/falcond ]; then

@cubic-dev-ai cubic-dev-ai Bot Feb 5, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1: The current initialization logic completely skips the copy step if falcond exists, which prevents the sensor from being updated. If you update the falcon-sensor package in Nix, the system will continue running the old binary from /opt/CrowdStrike instead of the new one from the store.

Using cmp allows you to skip initialization when the binary hasn't changed (fixing the restart crash loop) while still attempting to update when the version changes.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At named-hosts/matic/falcon.nix, line 21:

<comment>The current initialization logic completely skips the copy step if `falcond` exists, which prevents the sensor from being updated. If you update the `falcon-sensor` package in Nix, the system will continue running the old binary from `/opt/CrowdStrike` instead of the new one from the store.

Using `cmp` allows you to skip initialization when the binary hasn't changed (fixing the restart crash loop) while still attempting to update when the version changes.</comment>

<file context>
@@ -17,19 +17,13 @@ let
-    if [ -d /opt/CrowdStrike ]; then
-      ${pkgs.e2fsprogs}/bin/chattr -i -R /opt/CrowdStrike 2>/dev/null || true
+    # Only initialize if not already set up (CrowdStrike protects its files)
+    if [ ! -f /opt/CrowdStrike/falcond ]; then
+      install -d -m 0770 /opt/CrowdStrike
+      cp -a ${falcon}/opt/CrowdStrike/. /opt/CrowdStrike/
</file context>
Fix with Cubic

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

Labels

enhancement Indicates new feature requests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants