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

nixos/pam: assemble rules from modular configuration #255547

Merged
merged 15 commits into from
Oct 16, 2023

Commits on Sep 24, 2023

  1. nixos/pam: clean up rules

    Makes the rules more uniform in structure and style. This makes it
    easier to automate subsequent commits. No behavior changes.
    Majiir committed Sep 24, 2023
    Configuration menu
    Copy the full SHA
    dd45897 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0f9d719 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2023

  1. nixos/pam: extract header comments

    Unblocks converting the rules from one big string to a rich data
    structure.
    Majiir committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    d6bb805 View commit details
    Browse the repository at this point in the history
  2. nixos/pam: automatically populate rule type

    Eliminates a redundancy between the 'rules' suboptions and the type
    specified in each rule.
    
    We eventually want to give each rule a name so that we can merge config
    overrides. The PAM name is a natural choice for rule name, but a PAM is
    often used in multiple rule types. Organizing rules by type and rule
    name avoids name collisions.
    Majiir committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    3c85d15 View commit details
    Browse the repository at this point in the history
  3. nixos/pam: define rules as submodules

    Allows us to decompose rules into multiple fields that we later format
    as textual rules. Eventually allows users to override individual fields.
    Majiir committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    fbd7427 View commit details
    Browse the repository at this point in the history
  4. nixos/pam: give each rule a name

    These names are internal identifiers. They will be used as keys so that
    users can reconfigure rules by merging a rule config with the same name.
    The name is arbitrary. The built-in rules are named after the PAM where
    practical.
    Majiir committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    0563e0a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    25bc21f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    12a488e View commit details
    Browse the repository at this point in the history
  7. nixos/pam: extract args field

    Module arguments have common escaping rules for all PAMs.
    Majiir committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    6eea7fb View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2023

  1. nixos/pam: add settings option for common argument styles

    Adds easily overrideable settings for the most common PAM argument
    styles. These are:
    
    - Flag (e.g. "use_first_pass"): rendered for true boolean values. false
      values are ignored.
    
    - Key-value (e.g. "action=validate"): rendered for non-null, non-boolean
      values.
    
    Most PAM arguments can be configured this way. Others can still be
    configured with the 'args' option.
    Majiir committed Oct 11, 2023
    Configuration menu
    Copy the full SHA
    5b8439f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e86487e View commit details
    Browse the repository at this point in the history
  3. nixos/pam: convert rules to attrs, add order field

    Makes it possible to override properties of a rule by name. Introduces
    an 'order' field that can be overridden to change the sequence of rules.
    
    For now, the order value for each built-in rule is derived from its
    place in the hardcoded list of rules.
    Majiir committed Oct 11, 2023
    Configuration menu
    Copy the full SHA
    077cdcc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    43f7cb4 View commit details
    Browse the repository at this point in the history
  5. nixos/pam: generate apparmor includes from rules

    Removes redundant config from the module. Fixes a bug where some modules
    (e.g. ussh) were added to apparmor even though they had no rules enabled.
    Majiir committed Oct 11, 2023
    Configuration menu
    Copy the full SHA
    e712b6e View commit details
    Browse the repository at this point in the history
  6. nixos/pam: add maintainer

    Majiir committed Oct 11, 2023
    Configuration menu
    Copy the full SHA
    9d6e6e1 View commit details
    Browse the repository at this point in the history