webserver
Version information
This version is compatible with:
- Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 4.7.0 < 6.0.0
- ,
Start using this module
Add this module to your Puppetfile:
mod 'fheinle-webserver', '0.1.0'
Learn more about managing modules with a PuppetfileDocumentation
krb-webserver
This is a wrapper around Apache
and Apache::Vhost
from
puppetlabs/apache that adds SSL
and Kerberos compatible with FreeIPA.
Table of Contents
- Description
- Setup
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
Description
This wrapper installs the required Apache2 modules for authentication using Kerberos and SSSD, so it also respects HBAC rules defined in FreeIPA.
For a vhost, it enables Kerberos based authentication for its document root and sets up its configuration with an SSL certificate retrieved from your FreeIPA server. Both options can be disabled.
Setup
What krb-webserver affects
- Apache configuration: enables modules
- Apache vhosts: adds 1 http and optionally 1 https vhost
- PAM configuration: adds new config file in
/etc/pam.d/
- File system: creates document root directory
Setup Requirements
You should set up a Kerberos principal in FreeIPA and retrieve both an SSL key
and accompanying certificate for your host. Also, retrieve the ticket for your
principal and store it in a keytab accessible by apache, e.g. in
/etc/apache2/krb5_keytab
.
You will need to install and set up apache separately, maybe with puppetlabs/apache.
Usage
Configuring your webserver for Kerberos auth is easy:
class {'::webserver': }
This will install required packages and enable mod_authnz_pam
and
mod_auth_kerb
. Also, it will create a new pam configuration for web access
that requires SSSD for authorization.
Setting up a new vhost:
webserver::vhost {'awesome_vhost':
$vhost_name = $::facts['fqdn'],
$docroot = "/var/www/${vhost_name}/html",
$ssl = true,
$kerberos = true,
$web_user = 'www-data',
$default_vhost = false,
$ssl_cert_filename = "/etc/apache2/ssl/${vhost_name}.crt.crt",
$ssl_key_filename = "/etc/apache2/ssl/${vhost_name}.crt.key",
$krb_auth_realm = undef,
$krb_5keytab = undef,
$krb_servicename = 'http'
}
Those are the default settings, obviously you need to override them with your
customizations. Especially make sure to set the correct values to $krb5_*
.
Reference
Class webserver
Enables mod_auth_kerb
and mod_authnz_pam
, create a PAM configuration file
that requires SSSD.
- This class has no configuration settings
Defined Type webserver::vhost
Create a new apache virtual host. This will create a $docroot
directory owned
by $web_user
. If $ssl
is set to true, additionally to a https
vhost it
will create a http
vhost redirecting to https
automatically.
vhost_name
: Hostname the vhost uses, i.e.ServerName
in apachedocroot
: directory static files will be served fromssl
: bool use SSL?kerberos
: bool require Kerberos?web_user
: usernamedocroot
will belong todefault_vhost
: bool is this the default apache vhost?ssl_cert_filename
: Path to SSL certificatessl_key_filename
: Path to SSL private keykrb_auth_realm
: optional ifkerberos
isfalse
name of your kerberos realmkrb_5keytab
: optinal ifkerberos
isfalse
path to kerberos keytab file accessible by apachekrb_servicename
optional ifkerberos
isfalse
name of your kerberos service name you set up in FreeIPA
Limitations
Currently this is a limited wrapper around vhost creation, i.e. it will not pass
through additional apache vhost settings to the module it wraps. You may,
however, access that instance of Apache::Vhost
using the regular puppet syntax
of Apache::Vhost[your.vhost.here]
.
Dependencies
- puppetlabs/apache (>= 3.0.0 < 4.0.0)
MIT License Copyright (c) 2018 Florian Heinle Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.