Giter Site home page Giter Site logo

puppet-sssd's Introduction

sssd

Build Status Codecov Puppet Forge version Puppet Forge downloads Puppet Forge - PDK version

Table of Contents

  1. Description
  2. Setup - The basics of getting started with sssd
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Description

This module will install the SSSD packages, configure any services and domains, and optionally configure the D-Bus system service.

CentOS, RHEL, Scientific and Oracle Enterprise Linux is supported using Puppet 5 or later.

Setup

Beginning with sssd

You need to configure at least one domain for SSSD to start up so the bare minimum would be:

include sssd
sssd::domain { 'example.com':
  id_provider => 'ldap',
  ...
}

Usage

Configure SSSD to use LDAP for NSS:

class { 'sssd':
  domains  => {
    'example.com' => {
      'id_provider'           => 'ldap',
      'ldap_schema'           => 'rfc2307',
      'ldap_uri'              => ['ldap://192.0.2.1'],
      'ldap_search_base'      => 'dc=example,dc=com',
      'ldap_tls_reqcert'      => 'never',
      'ldap_id_use_start_tls' => false,
      'ldap_default_bind_dn'  => 'cn=Manager,dc=example,dc=com',
      'ldap_default_authtok'  => 'secret',
    },
  },
  services => {
    'nss' => {},
  },
}

class { 'nsswitch':
  passwd => ['files', 'sss'],
  shadow => ['files', 'sss'],
  group  => ['files', 'sss'],
}

Class['sssd'] -> Class['nsswitch']

Extend the above example to also make the SSSD data available over D-Bus:

include dbus
include sssd
sssd::service { 'nss': }
sssd::domain { 'example.com':
  id_provider           => 'ldap',
  ldap_schema           => 'rfc2307',
  ldap_uri              => ['ldap://192.0.2.1'],
  ldap_search_base      => 'dc=example,dc=com',
  ldap_tls_reqcert      => 'never',
  ldap_id_use_start_tls => false,
  ldap_default_bind_dn  => 'cn=Manager,dc=example,dc=com',
  ldap_default_authtok  => 'secret',
}
include sssd::dbus

class { 'nsswitch':
  passwd => ['files', 'sss'],
  shadow => ['files', 'sss'],
  group  => ['files', 'sss'],
}

Class['sssd'] -> Class['nsswitch']

Reference

The reference documentation is generated with puppet-strings and the latest version of the documentation is hosted at https://bodgit.github.io/puppet-sssd/ and available also in the REFERENCE.md.

Limitations

This module takes the (somewhat laborious) approach of creating parameters for each sssd.conf setting rather than just pass in a large hash of settings which should result in more control.

Any setting that accepts the boolean TRUE/FALSE values is mapped to a native Puppet boolean type. Any multi-valued setting accepts an array of values.

Currently almost all parameters are optional, the only mandatory parameter is that of the identity provider (id_provider) for the sssd::domain defined type. This may change in the future if the logic becomes more obvious.

This module has been built on and tested against Puppet 5 and higher.

The module has been tested on:

  • Red Hat/CentOS Enterprise Linux 6/7

Development

The module relies on PDK and has both rspec-puppet and beaker-rspec tests. Run them with:

$ bundle exec rake spec
$ PUPPET_INSTALL_TYPE=agent PUPPET_INSTALL_VERSION=x.y.z bundle exec rake beaker:<nodeset>

Please log issues or pull requests at github.

puppet-sssd's People

Contributors

bodgit avatar jhoblitt avatar pbrideau avatar scnaeg avatar weijianwen avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

puppet-sssd's Issues

transfer to voxpupuli?

@bodgit I believe it has been over a year since a commit has been made to this repo. Would you consider transferring the module to voxpupuli?

noop not working on sssd::domain as expected

sssd::domain {
        'example.com':
          noop                           => true,
          dyndns_update                  => true,
....

actual output

Notice: /Stage[main]/Base/Sssd::Domain[example.com]/Sssd_conf[domain/example.com/dyndns_update]/ensure: created

expected output

Notice: /Stage[main]/Base/Sssd::Domain[example.com]/Sssd_conf[domain/example.com/dyndns_update]/ensure: current_value 'absent', should be 'present' (noop)

SELinux labelling of directories with Systemd

Notice: /Stage[main]/Sssd::Config/File[/etc/systemd/system/sssd-autofs.service.d]/seltype: seltype changed 'sssd_unit_file_t' to 'systemd_unit_file_t'
Notice: /Stage[main]/Sssd::Config/File[/etc/systemd/system/sssd-pac.service.d]/seltype: seltype changed 'sssd_unit_file_t' to 'systemd_unit_file_t'
Notice: /Stage[main]/Sssd::Config/File[/etc/systemd/system/sssd-pam.service.d]/seltype: seltype changed 'sssd_unit_file_t' to 'systemd_unit_file_t'
Notice: /Stage[main]/Sssd::Config/File[/etc/systemd/system/sssd-ssh.service.d]/seltype: seltype changed 'sssd_unit_file_t' to 'systemd_unit_file_t'
Notice: /Stage[main]/Sssd::Config/File[/etc/systemd/system/sssd-sudo.service.d]/seltype: seltype changed 'sssd_unit_file_t' to 'systemd_unit_file_t'

Search base validation

Based on #1 we can validate DN's. However the search bases as specified in sssd.conf have additional parameters and also multiple search bases like search_base[?scope?[filter][?search_base?scope?[filter]]*].

It should be possible to create an SSSD-specific validation function that uses the bodgitlib-provided validate_ldap_dn and validate_ldap_filter functions and then it just needs to validate the scope values itself and that the whole string conforms to the right format.

Secrets responder

Apparently only works via Systemd socket activation anyway so dependent on #5, probably also doesn't work on RHEL/CentOS 6.

ipa_server in version 2 no longer accepts _srv_

From the man page sssd-ipa

If no servers are specified, the back end automatically uses service discovery to try to find a server. Optionally, the user may choose to use both fixed server addresses and service discovery by inserting a special keyword, _srv_, in the list of servers

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Sssd::Domain[daboyz.lan.com]: parameter 'ipa_server' index 0 expects a Bodgitlib::Host = Variant[Bodgitlib::Hostname = Bodgitlib::Domain = Pattern[/(?x) ^ (?= [a-z0-9.-]{2,255} ) ( (?= [a-z0-9-]{1,63} \. ) [a-z0-9]+ ( - [a-z0-9]+ )* \. )* [a-z]{2,63} $/], IP::Address::NoSubnet = Variant[IP::Address::V4::NoSubnet = Pattern[/\A([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])){3}\z/], IP::Address::V6::NoSubnet = Variant[IP::Address::V6::NoSubnet::Full = Pattern[/\A[[:xdigit:]]{1,4}(:[[:xdigit:]]{1,4}){7}\z/], IP::Address::V6::NoSubnet::Compressed = Pattern[/\A:(:|(:[[:xdigit:]]{1,4}){1,7})\z/, /\A([[:xdigit:]]{1,4}:){1}(:|(:[[:xdigit:]]{1,4}){1,6})\z/, /\A([[:xdigit:]]{1,4}:){2}(:|(:[[:xdigit:]]{1,4}){1,5})\z/, /\A([[:xdigit:]]{1,4}:){3}(:|(:[[:xdigit:]]{1,4}){1,4})\z/, /\A([[:xdigit:]]{1,4}:){4}(:|(:[[:xdigit:]]{1,4}){1,3})\z/, /\A([[:xdigit:]]{1,4}:){5}(:|(:[[:xdigit:]]{1,4}){1,2})\z/, /\A([[:xdigit:]]{1,4}:){6}(:|(:[[:xdigit:]]{1,4}){1,1})\z/, /\A([[:xdigit:]]{1,4}:){7}:\z/], IP::Address::V6::NoSubnet::Alternative = Pattern[/\A([[:xdigit:]]{1,4}:){6}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])){3}\z/, /\A([[:xdigit:]]{1,4}:){5}:([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])){3}\z/, /\A([[:xdigit:]]{1,4}:){4}(:[[:xdigit:]]{1,4}){0,1}:([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])){3}\z/, /\A([[:xdigit:]]{1,4}:){3}(:[[:xdigit:]]{1,4}){0,2}:([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])){3}\z/, /\A([[:xdigit:]]{1,4}:){2}(:[[:xdigit:]]{1,4}){0,3}:([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])){3}\z/, /\A([[:xdigit:]]{1,4}:){1}(:[[:xdigit:]]{1,4}){0,4}:([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])){3}\z/, /\A:(:[[:xdigit:]]{1,4}){0,5}:([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])){3}\z/]]]] value, got String (file: /etc/puppetlabs/code/environments/development/modules/base/manifests/init.pp, line: 118) on node xxxxxxxxxxx

Support socket activation on Systemd systems

Instead of maintaining the services = ... section, enable sssd-${service}.socket. PAM is a special case as it has two sockets.

The ifp/dbus service already uses D-Bus activation.

Bodgitlib::Domain $dns_discovery_main does not allow for SRV records

In sssd::domain, the dns_discovery_domain is being validated as a Bodgitlib::Domain. This is problematic as SSSD isn't actually asking for domain but a FQDN or SRV.

  Optional[Bodgitlib::Domain]                                                           $dns_discovery_domain 

I have been setting this value to something like dev._locations.example.com.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.