splunk
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 >= 2.7.14 < 6.0.0
- , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'jorritfolmer-splunk', '3.4.1'
Learn more about managing modules with a PuppetfileDocumentation
Puppet module to deploy Splunk into any imaginable topology on Windows and Linux.
This Puppet module can be used on Windows and Linux to create and arrange the following Splunk instances into simple, distributed or (multisite) clustered topologies:
- Splunk indexers
- Splunk search heads
- Splunk cluster masters
- Splunk search head deployers
- Splunk deployment servers
- Splunk heavy forwarders
- Splunk universal forwarders
It does so with the following principles in mind:
Principles
- Splunk above Puppet. Puppet is only used to configure the running skeleton of a Splunk constellation. It tries to keep away from Splunk administration as much as possible. For example, why deploy Splunk apps to forwarders through Puppet if you can use Splunk's multi-platform deployment server?
- Power to the Splunkers. A Splunk installation should typically not be administered by the IT or IT-infra teams. This Puppet module should smooth the path to implementing segregation of duties between administrators and watch(wo)men (ISO 27002 12.4.3 or BIR 10.10.3).
- Secure by default.
- Splunk runs as user splunk instead of root.
- No services are listening by default except the bare minimum (8089/tcp)
- TLSv1.1 and TLSv1.2 are enabled by default
- Perfect Forward Secrecy (PFS) using Elliptic curve Diffie-Hellman (ECDH)
- Ciphers are set to modern compatibility
- Admin password can be set using its SHA512 hash in the Puppet manifests instead of plain-text.
- Supports any topology. Single server? Redundant multi-site clustering? Heavy forwarder in a DMZ?
Prerequisites
- A running Puppet master
- A running repository server with splunk and splunkforwarder packages. See below if you need help setting it up.
Quick-start
Define a single standalone Splunk instance on Linux that you can use to index and search, for example with the trial license:
node 'splunk-server.internal.corp.tld' {
class { 'splunk':
httpport => 8000,
kvstoreport => 8191,
inputport => 9997,
}
}
Or define a single standalone Splunk instance on Windows with:
node 'splunk-server.internal.corp.tld' {
class { 'splunk':
package_source => '//dc01/Company/splunk-6.6.1-aeae3fe0c5af-x64-release.msi',
httpport => 8000,
kvstoreport => 8191,
inputport => 9997,
}
}
See the other examples below for more elaborate topologies.
Splunk YUM repository (Red Hat based)
If you don't already have a local repository server, the quickest way is to install Apache on the Puppet master and have this serve the yum repository.
yum install httpd
yum install createrepo
mkdir /var/www/html/splunk
cd /var/www/html/splunk
- download splunk-x.y.x.rpm
- download splunk-forwarder-x.y.x.rpm
createrepo .
- make sure Apache allows directory index listing
- surf to http://your.repo.server/splunk and check if you get a directory listing
Then add something like this to every node definition in site.pp, and require it from the splunk class so it it evaluated before the splunk class.
yumrepo { "splunk":
baseurl => "http://your.repo.server/splunk",
descr => "Splunk repo",
enabled => 1,
gpgcheck => 0
}
Splunk APT repository (Debian/Ubuntu based)
If you don't already have a local repository server, the quickest way is to install Apache on the Puppet master and have this serve the APT repository.
apt-get install apache2
apt-get install dpkg-dev
mkdir /var/www/html/splunk
cd /var/www/html/splunk
- download splunk-x.y.x.deb
- download splunk-forwarder-x.y.x.deb
dpkg-scanpackages . /dev/null |gzip -c > Packages.gz
- make sure Apache allows directory index listing
- surf to http://your.rhel-repo.server/splunk and check if you get a directory listing
Then add something like this to every node definition in site.pp, and make sure to require these files from the splunk class so they are evaluated before the splunk class. Because the APT repository above isn't signed, puppet won't be able to install splunk or splunkforwarder, except when setting APT::Get::AllowUnauthenticated
somewhere in /etc/apt/apt.conf.d/
. You may have to run apt-get update before the Splunk repository is available in apt-get.
file { "/etc/apt/apt.conf.d/99allowunsigned":
ensure => present,
content => "APT::Get::AllowUnauthenticated "true";\n",
}
file { "/etc/apt/sources.list.d/splunk.list":
ensure => present,
content => "deb http://your.apt-repo.server/splunk ./\n",
}
CIFS share with .msi files (Windows based)
For Windows installations just put the .msi Splunk installation files for Windows on a share that is accessible from all your Windows servers.
- create a share that can be accessed by all your Windows servers
- download the relevant Splunk .msi files from the Splunk website into this share
- specify
package_source
and point to one of these .msi files
Puppet-Splunk installation
- SSH to your Puppet master
cd /etc/puppet/modules
orcd /etc/puppetlabs/code/environments/production/modules
, depending on your Puppet versionpuppet module install jorritfolmer-splunk
orgit clone https://github.com/jorritfolmer/puppet-splunk.git; mv puppet-splunk splunk
- Create your Splunk topology, see below for examples.
Usage
To give this module a try, you don't necessarily have to setup a Certiticate Authority for the various SSL certificates that Splunk uses.
By default, this module reuses the Puppet client SSL key (4096 bits) and client certificate, so we can save us the trouble of setting up and maintaining our own certificate authority.
For quick testing in heterogeneous non-production environments you can revert to using the Splunk provides certs and CA with reuse_puppet_certs => false
. Or you can point to your own certificates with sslcertpath
and sslrootcapath
.
The Splunk module doesn't manage the state of the splunk service, except configure to start Splunk or Splunkforwarder at boot time. However, if you do want Puppet to interfere while performing a cluster rolling restart or an indexer restart, have a look at the service
parameter.
Example 1:
Define a single standalone Splunk instance that you can use to index and search, for example with the trial license. This time use the Splunk provided non-production testing certificates instead of reusing the ones signed by the Puppet CA, for example for testing in heterogeneous environments with non-Puppetized Splunk forwarders.
node 'splunk-server.internal.corp.tld' {
class { 'splunk':
httpport => 8000,
kvstoreport => 8191,
inputport => 9997,
reuse_puppet_certs => false,
sslcertpath => 'server.pem',
sslrootcapath => 'cacert.pem',
}
}
To define a standalone Splunk instance running on Windows:
node 'splunk-server.internal.corp.tld' {
class { 'splunk':
package_source => '//dc01/Company/splunk-6.6.1-aeae3fe0c5af-x64-release.msi',
httpport => 8000,
kvstoreport => 8191,
inputport => 9997,
reuse_puppet_certs => false,
sslcertpath => 'server.pem',
sslrootcapath => 'cacert.pem',
}
}
Example 2a:
Extends the example above with a node that will run the Splunk universal forwarder. It uses the first server as Deployment Server (ds =>
) where apps, inputs and outputs can be managed and deployed through Forwarder Management.
node 'splunk-server.internal.corp.tld' {
class { 'splunk':
httpport => 8000,
kvstoreport => 8191,
inputport => 9997,
}
}
node 'some-server.internal.corp.tld' {
class { 'splunk':
type => 'uf',
ds => 'splunk-server.internal.corp.tld:8089',
}
}
The equivalent for Windows environments:
node 'splunk-server.internal.corp.tld' {
class { 'splunk':
package_source => '//dc01/Company/splunk-6.6.1-aeae3fe0c5af-x64-release.msi',
httpport => 8000,
kvstoreport => 8191,
inputport => 9997,
}
}
node 'some-server.internal.corp.tld' {
class { 'splunk':
package_source => '//dc01/Company/splunkforwarder-6.6.1-aeae3fe0c5af-x64-release.msi',
type => 'uf',
ds => 'splunk-server.internal.corp.tld:8089',
}
}
Example 2b:
Almost identical to example 2a, except with some SSL downgrading, not suitable for production. This will allow non-Puppetized Splunk clients to connect to the various servicessince the default Splunk config isn't compatible with modern compability. Setting the deploymentserver to intermediate compatibility will allow these clients to make the initial connection, after which you can deploy a common_ssl_base config app to them with modern ssl compatibility. The manifest below will also use the Splunk provided non-production certificates, instead of the ones signed by the Puppet CA.
node 'splunk-server.internal.corp.tld' {
class { 'splunk':
httpport => 8000,
kvstoreport => 8191,
inputport => 9997,
sslcompatibility => 'intermediate',
reuse_puppet_certs => false,
sslcertpath => 'server.pem',
sslrootcapath => 'cacert.pem',
}
}
node 'some-server.internal.corp.tld' {
class { 'splunk':
type => 'uf',
ds => 'splunk-server.internal.corp.tld:8089',
reuse_puppet_certs => false,
sslcertpath => 'server.pem',
sslrootcapath => 'cacert.pem',
}
}
Example 3:
One deployment/license server, one search head, and two indexers. Note that for the search head to add the indexer as its search peer, the indexer needs to be running before the search head manifest is executed. This means that you'll have to manage intra-node dependencies manually or through an orchestration tool like Terraform.
node 'splunk-ds.internal.corp.tld' {
class { 'splunk':
admin => {
# Set the admin password to changemeagain
hash => '$6$MR9IJFF7RBnVA.k1$/30EBSzy0EJKZ94SjHFIUHjQjO3/P/4tx0JmWCp/En47MJceaXsevhBLE2w/ibjHlAUkD6k0U.PmY/noe9Jok0',
fn => 'Deployment Server Administrator',
email => 'changemeagain@example.com',
},
# Enable the web server
httpport => 8000,
# Use the best-practice to forward all local events to the indexers
tcpout => [
'splunk-idx1.internal.corp.tld:9997',
'splunk-idx2.internal.corp.tld:9997',
],
service => {
ensure => running,
enable => true,
},
}
}
node 'splunk-sh.internal.corp.tld' {
class { 'splunk':
admin => {
# A plaintext password needed to be able to add search peers,
# so also make sure the indexer you're pointing to is running,
# you can remove this if everything is up and running:
pass => 'changemeagain',
hash => '$6$MR9IJFF7RBnVA.k1$/30EBSzy0EJKZ94SjHFIUHjQjO3/P/4tx0JmWCp/En47MJceaXsevhBLE2w/ibjHlAUkD6k0U.PmY/noe9Jok0',
fn => 'Search head Administrator',
email => 'changemeagain@example.com',
},
httpport => 8000,
kvstoreport => 8191,
# Use a License Master and Deployment Server
lm => 'splunk-ds.internal.corp.tld:8089',
ds => 'splunk-ds.internal.corp.tld:8089',
tcpout => [
'splunk-idx1.internal.corp.tld:9997',
'splunk-idx2.internal.corp.tld:9997', ],
# Use these search peers
searchpeers => [
'splunk-idx1.internal.corp.tld:8089',
'splunk-idx2.internal.corp.tld:8089', ],
# splunk must be running to be able add search peers,
# you can remove this if everything is up and running:
service => {
ensure => running,
enable => true,
},
}
}
node 'splunk-idx1.internal.corp.tld', 'splunk-idx2.internal.corp.tld' {
class { 'splunk':
admin => {
hash => '$6$MR9IJFF7RBnVA.k1$/30EBSzy0EJKZ94SjHFIUHjQjO3/P/4tx0JmWCp/En47MJceaXsevhBLE2w/ibjHlAUkD6k0U.PmY/noe9Jok0',
fn => 'Indexer Administrator',
email => 'changemeagain@example.com',
},
inputport => 9997,
lm => 'splunk-ds.internal.corp.tld:8089',
ds => 'splunk-ds.internal.corp.tld:8089',
# splunk must be running for it to be added as search peer,
# you can remove this if everything is up and running
service => {
ensure => running,
enable => true,
}
}
}
Example 4:
A Splunk indexer cluster consisting of one deployment/license/searchhead server, a cluster master, and three cluster peers. The cluster master also acts as license master.
node 'splunk-sh.internal.corp.tld' {
class { 'splunk':
admin => {
hash => '$6$MR9IJFF7RBnVA.k1$/30EBSzy0EJKZ94SjHFIUHjQjO3/P/4tx0JmWCp/En47MJceaXsevhBLE2w/ibjHlAUkD6k0U.PmY/noe9Jok0',
fn => 'Search Head Administrator',
email => 'changemeagain@example.com',
},
httpport => 8000,
kvstoreport => 8191,
lm => 'splunk-cm.internal.corp.tld:8089',
tcpout => [ 'splunk-idx1.internal.corp.tld:9997', 'splunk-idx2.internal.corp.tld:9997', ],
clustering => {
mode => 'searchhead',
cm => 'splunk-cm.internal.corp.tld:8089',
}
}
}
node 'splunk-cm.internal.corp.tld' {
class { 'splunk':
admin => {
hash => '$6$MR9IJFF7RBnVA.k1$/30EBSzy0EJKZ94SjHFIUHjQjO3/P/4tx0JmWCp/En47MJceaXsevhBLE2w/ibjHlAUkD6k0U.PmY/noe9Jok0',
fn => 'Cluster Master Administrator',
email => 'changemeagain@example.com',
},
httpport => 8000,
tcpout => [ 'splunk-idx1.internal.corp.tld:9997', 'splunk-idx2.internal.corp.tld:9997', ],
clustering => {
mode => 'master',
replication_factor => 2,
search_factor => 2,
}
}
}
node 'splunk-idx1.internal.corp.tld',
'splunk-idx2.internal.corp.tld',
'splunk-idx3.internal.corp.tld' {
class { 'splunk':
admin => {
hash => '$6$MR9IJFF7RBnVA.k1$/30EBSzy0EJKZ94SjHFIUHjQjO3/P/4tx0JmWCp/En47MJceaXsevhBLE2w/ibjHlAUkD6k0U.PmY/noe9Jok0',
fn => 'Cluster Peer Administrator',
email => 'changemeagain@example.com',
},
inputport => 9997,
lm => 'splunk-cm.internal.corp.tld:8089',
clustering => {
mode => 'slave',
cm => 'splunk-cm.internal.corp.tld:8089',
}
}
}
Example 5
Enabling Single Sign-On through Active Directory Federation Services (ADFS) as an Identity provider:
node 'splunk-sh.internal.corp.tld' {
class { 'splunk':
...
auth => {
authtype => 'SAML',
saml_idptype => 'ADFS',
saml_idpurl => 'https://sso.internal.corp.tld/adfs/ls',
},
...
}
}
On the ADFS side:
-
Add a new Relying Party Trust, by importing the XML from
https://splunk-sh.internal.corp.tld/saml/spmetadata
. Since this metadata is kept behind a Splunk login, you'll have to:- first browse to
https://splunk-sh.internal.corp.tld/account/login?loginType=Splunk
- then browse to
https://splunk-sh.internal.corp.tld/saml/spmetadata
, and copy/paste the SAML metadata XML to the Windows server. - import the SAML metadata XML from the relying party (Splunk) from a file
- first browse to
-
Add a new claim rule to map Active Directory attributes to new claims
-
import the Splunk Root CA (/opt/splunk/etc/auth/cacert.pem) in the Trusted Root Certificates store of the Windows server,
-
If you're using your own certificates:
Set-ADFSRelyingPartyTrust -TargetIdentifier splunk-sh1.internal.corp.tld -EncryptionCertificateRevocationCheck none
-
If you're using your own certificates:
Set-ADFSRelyingPartyTrust -TargetIdentifier splunk-sh1.internal.corp.tld -SigningCertificateRevocationCheck none
-
Set-ADFSRelyingPartyTrust -TargetIdentifier splunk-sh1.internal.corp.tld -EncryptClaims $False
-
Set-ADFSRelyingPartyTrust -TargetIdentifier splunk-sh1.internal.corp.tld -SignedSamlRequestsRequired $False
, otherwise you'll find messages like these in the Windows Eventlog:System.NotSupportedException: ID6027: Enveloped Signature Transform cannot be the last transform in the chain.
You can use the SAML tracer Firefox plugin to see what gets posted to Splunk via ADFS after a succesful authentication. The relevant part should look something like this:
...
<Subject>
<NameID>jfolmer@testlab.local</NameID>
<SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<SubjectConfirmationData InResponseTo="host15.testlab.local.12.AF9F4C1A-EAEA-4EF5-A501-E57AB33D7776"
NotOnOrAfter="2016-11-04T21:23:34.597Z"
Recipient="https://host15.testlab.local:8000/saml/acs"
/>
</SubjectConfirmation>
</Subject>
<Conditions NotBefore="2016-11-04T21:18:34.581Z"
NotOnOrAfter="2016-11-04T22:18:34.581Z"
>
<AudienceRestriction>
<Audience>host15.testlab.local</Audience>
</AudienceRestriction>
</Conditions>
<AttributeStatement>
<Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name">
<AttributeValue>Jorrit Folmer</AttributeValue>
</Attribute>
<Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress">
<AttributeValue>jfolmer@testlab.local</AttributeValue>
</Attribute>
<Attribute Name="http://schemas.microsoft.com/ws/2008/06/identity/claims/role">
<AttributeValue>Domain Users</AttributeValue>
<AttributeValue>Splunk Admins</AttributeValue>
</Attribute>
</AttributeStatement>
...
Example 6
Use LDAP as an authentication provider, e.g. with Active Directory. The example below also maps 2 groups in AD to Splunk admin, and 1 group to Splunk user.
node 'splunk-sh.internal.corp.tld' {
class { 'splunk':
...
auth => {
authtype => 'LDAP',
ldap_host => 'dc01.internal.corp.tld',
ldap_binddn => 'CN=Splunk Service Account,CN=Users,DC=corp,DC=tld',
ldap_binddnpassword => 'changeme',
ldap_sslenabled => 0,
ldap_userbasedn => 'CN=Users,DC=corp,DC=tld',
ldap_groupbasedn => 'CN=Users,DC=corp,DC=tld;OU=Groups,DC=corp,DC=tld',
},
rolemap => {
'admin' => 'Splunk Admins;Domain Admins',
'user' => 'Splunk Users',
},
...
}
}
Example 7
Splunk search head clustering (SHC) not only requires configuration management, but also some orchestration to get it up and running.
Since the SH Deployer also has an active role in configuration management, you will have to take some extra steps in the right order to prevent Puppet and SH deployer from interferring with each other.
node 'splunk-sh1.internal.corp.tld',
'splunk-sh2.internal.corp.tld',
'splunk-sh3.internal.corp.tld' {
class { 'splunk':
...
shclustering => {
mode => 'searchhead',
shd => 'splunk-shd.internal.corp.tld:8089',
pass4symmkey => 'SHCl33tsecret',
label => 'My First SHC',
},
...
}
}
node 'splunk-shd.internal.corp.tld' {
class { 'splunk':
...
shclustering => {
mode => 'deployer',
pass4symmkey => 'SHCl33tsecret',
},
...
}
}
Steps:
- Do a puppet run on the SH deployer and SH cluster nodes, but don't start Splunk yet.
- Copy the $SPLUNKHOME/etc/apps/puppet* directories created by Puppet from a SH cluster node to etc/shcluster/apps/ on the SH deployer
- Start the SH deployer and the SH cluster nodes
- Perform a `splunk bootstrap shcluster-captain -servers_list "https://splunk-sh1.internal.corp.tld:8089,https://splunk-sh2.internal.corp.tld:8089,https://splunk-sh1.internal.corp.tld:8089" -auth admin:changemeagain
Example 8
Configure a multisite cluster with 2 sites with 1 indexer each. Site 1 hosts splunk-cm and splunk-idx1. Site 2 hosts splunk-idx2.
node 'splunk-cm.internal.corp.tld' {
class { 'splunk':
admin => {
hash => '$6$MR9IJFF7RBnVA.k1$/30EBSzy0EJKZ94SjHFIUHjQjO3/P/4tx0JmWCp/En47MJceaXsevhBLE2w/ibjHlAUkD6k0U.PmY/noe9Jok0',
fn => 'Cluster Master Administrator',
email => 'changemeagain@example.com',
},
httpport => 8000,
tcpout => [ 'splunk-idx1.internal.corp.tld:9997', 'splunk-idx2.internal.corp.tld:9997', ],
clustering => {
mode => 'master',
replication_factor => 2,
search_factor => 2,
site => 'site1',
available_sites => 'site1,site2',
site_replication_factor => 'origin:1, total:2',
site_search_factor => 'origin:1, total:2',
}
}
}
node 'splunk-idx1.internal.corp.tld' {
class { 'splunk':
admin => {
hash => '$6$MR9IJFF7RBnVA.k1$/30EBSzy0EJKZ94SjHFIUHjQjO3/P/4tx0JmWCp/En47MJceaXsevhBLE2w/ibjHlAUkD6k0U.PmY/noe9Jok0',
fn => 'Cluster Peer Administrator',
email => 'changemeagain@example.com',
},
inputport => 9997,
lm => 'splunk-cm.internal.corp.tld:8089',
clustering => {
site => 'site1',
mode => 'slave',
cm => 'splunk-cm.internal.corp.tld:8089',
}
}
}
node 'splunk-idx2.internal.corp.tld' {
class { 'splunk':
admin => {
hash => '$6$MR9IJFF7RBnVA.k1$/30EBSzy0EJKZ94SjHFIUHjQjO3/P/4tx0JmWCp/En47MJceaXsevhBLE2w/ibjHlAUkD6k0U.PmY/noe9Jok0',
fn => 'Cluster Peer Administrator',
email => 'changemeagain@example.com',
},
inputport => 9997,
lm => 'splunk-cm.internal.corp.tld:8089',
clustering => {
site => 'site2',
mode => 'slave',
cm => 'splunk-cm.internal.corp.tld:8089',
}
}
}
Example 9
Configure an index cluster with indexer discovery
node 'splunk-cm.internal.corp.tld' {
class { 'splunk':
admin => {
hash => '$6$MR9IJFF7RBnVA.k1$/30EBSzy0EJKZ94SjHFIUHjQjO3/P/4tx0JmWCp/En47MJceaXsevhBLE2w/ibjHlAUkD6k0U.PmY/noe9Jok0',
fn => 'Cluster Master Administrator',
email => 'changemeagain@example.com',
},
httpport => 8000,
tcpout => 'indexer_discovery',
clustering => {
mode => 'master',
replication_factor => 2,
search_factor => 2,
indexer_discovery => true,
}
}
}
node 'splunk-idx1.internal.corp.tld','splunk-idx2.internal.corp.tld' {
class { 'splunk':
admin => {
hash => '$6$MR9IJFF7RBnVA.k1$/30EBSzy0EJKZ94SjHFIUHjQjO3/P/4tx0JmWCp/En47MJceaXsevhBLE2w/ibjHlAUkD6k0U.PmY/noe9Jok0',
fn => 'Cluster Peer Administrator',
email => 'changemeagain@example.com',
},
inputport => 9997,
lm => 'splunk-cm.internal.corp.tld:8089',
clustering => {
mode => 'slave',
cm => 'splunk-cm.internal.corp.tld:8089',
}
}
}
node 'some-server.internal.corp.tld' {
class { 'splunk':
type => 'uf',
tcpout => 'indexer_discovery',
clustering => {
cm => 'host03.testlab.local:8089',
}
}
}
Parameters
Main splunk class
type
Optional. When omitted it installs the Splunk server type.
Use type => "uf"
if you want to have a Splunk Universal Forwarder.
httpport
Optional. When omitted, it will not start Splunk web.
Set httpport => 8000
if you do want to have Splunk web available.
kvstoreport
Optional. When omitted, it will not start Mongodb.
Set kvstoreport => 8191
if you do want to have KVstore available.
inputport
Optional. When omitted, it will not start an Splunk2Splunk listener.
Set kvstoreport => 9997
if you do want to use this instance as an indexer.
tcpout
Optional. When omitted, it will not forward events to a Splunk indexer.
Set tcpout => 'splunk-idx1.internal.corp.tld:9997'
if you do want to
forward events to a Splunk indexer.
Set `tcpout => 'indexer_discovery' if you want to use indexer discovery instead of specifying indexers manually. Requires specifying a cluster master through:
clustering => {
cm => 'splunk-cm.internal.corp.tld:8089'
}
package_source
Optional
- For Windows: Use this to point to the .msi installation file. This can be a UNC path like \DC01\Company\splunkforwarder-6.6.1-aeae3fe0c5af-x64-release.msi
- For Linux: Use this to point to the URL of a Splunk RPM file. WARNING: this will cause the entire RPM file to be downloaded at every Puppet run by the package provider, even though it is already installed. Create your own local repository if you don't want this.
splunk_os_user
Optional. Run the Splunk instance as this user. Defaults to splunk
splunk_bindip
Optional. Bind to this specific IP instead of 0.0.0.0
splunk_home
Optional. Used if you're running Splunk outside of /opt/splunk or /opt/splunkforwarder.
lm
Optional. Used to point to a Splunk license manager.
ds
Optional. Used to point to a Splunk deployment server
ds_intermediate
Optional. Used to configure the deployment server as a deploymentclient. This is useful if you want to retain one central deployment server instead of multiple, for example one for each DMZ. Defaults to undef.
repositorylocation
Optional. Used to configure the location on the deployment client where the
incoming apps from the deployment server are stored. Use master-apps
or
shcluster/apps
if you want to use the deployment server to also deploy to
intermediate locations on the cluster master or search head deployer.
phonehomeintervalinsec
Optional. Unsed to configure the phonehomeinterval of the deploymentclient. Defaults to undef.
sslcompatibility
Optional. Used to configure the SSL compatibility level as defined by Mozilla Labs:
-
modern
(default) -
intermediate
-
old
Also see the Compatibility section below.
reuse_puppet_certs
Optional. By default the certificates signed by the Puppet CA will be reused. However if you want to do some quick testing with non-Puppetized nodes, set this to false
, and make sure to point sslcertpath => 'server.pem'
and sslrootcapath => 'cacert.pem'
to the default Splunk testing certs.
true
(default)false
sslcertpath
Optional. Can be together with reuse_puppet_certs => false
to point to either your own certificates, or to the default Splunk provided testing certficates.
Note that the path is relative to $SPLUNK_HOME/etc/auth/
sslrootcapath
Optional. Can be together with reuse_puppet_certs => false
to point to either your own CA certificates, or to the default Splunk provided testing CA certficates.
Note that the path is relative to $SPLUNK_HOME/etc/auth/
admin
Optional. Used to create a local admin user with predefined hash, full name and email This is a hash with 3 members:
-
hash
(SHA512 hash of the admin password. To generate the hash use one of:grub-crypt --sha-512
(RHEL/CENTOS)mkpasswd -m sha-512
(Debian)python -c 'import crypt,getpass; print(crypt.crypt(getpass.getpass(), crypt.mksalt(crypt.METHOD_SHA512)))'
-
pass
(Plaintext password, only used for search heads to add search peers in distributed search) -
fn
(Full name) -
email
(Email address)
minfreespace
Optional. Used to specify the minimum amount of freespace in kb before Splunk stops indexing data.
service
Optional. Used to manage the running and startup state of the Splunk/Splunkforwarder service. This is a hash with 2 members:
ensure
(not enabled by default)enable
(defaults to true)
searchpeers
Optional. Used to point a Splunk search head to (a) Splunk indexer(s)
clustering
Optional. Used to configure Splunk indexer clustering. This is a hash with 4 members:
-
mode
(can be one ofmaster
,searchhead
,slave
) -
replication_factor
-
search_factor
-
cm
(points to cluster master in case of searchhead,slave, or forwarder in case of indexer discovery) -
indexer_discovery
(enables indexer discovery on the master node)For multisite indexer clustering:
-
thissite
(assigns this node to a site, value can be site1..site63.site
is a reserved word in Puppet 4.x hence the choice forthissite
)For cluster masters of multisite indexer clusters:
-
available_sites
(e.g. 'site1,site2') -
site_replication_factor
(e.g. 'origin:1, total:2') -
site_search_factor
(e.g. 'origin:1, total:2')
shclustering
Optional. Used to configure Splunk search head clustering. This is a hash with 3 members:
mode
(can be one ofsearchhead
,deployer
)replication_factor
shd
(points to search head deployer, but see caveat in Example 7)
use_ack
Optional. Used to request indexer acknowlegement when sending data. Defaults to false.
version
Optional. Specify the Splunk version to use.
For example to install the 6.2.2 version: verion => '6.2.2-255606'
.
auth
Optional. Used to configure Splunk authentication. Currently supports 'Splunk' (default) 'SAML' and 'LDAP'. This is a hash with the following members:
authtype
(can be one ofSplunk
,LDAP
,SAML
)saml_idptype
(specifies the SAML identity provider type to use, currently only supportsADFS
)saml_idpurl
(specifies the base url for the identity provider, for ADFS IdP's this will be something like https://sso.corp.tld/adfs/ls )ldap_host
ldap_binddn
ldap_binddnpassword
ldap_userbasedn
ldap_groupbasedn
ldap_sslenabled
ldap_usernameattribute
ldap_groupmemberattribute
ldap_groupnameattribute
ldap_realnameattribute
requireclientcert
Optional. Used on a server to require clients to present an SSL certificate. Can be an array with:
inputs
: require clients to present a certificate when sending data to Splunksplunkd
: require deployment clients and search peers to present a certificate when
For example require both splunkd and inputs connections to present a certificate:
requireclientcert => ['splunkd','inputs'],
Or only require forwarders to present a certificate when sending data;
requireclientcert => 'inputs',
rolemap
Optional. Specifies the role mapping for SAML and LDAP Defaults to:
{
'admin' => 'Domain Admins',
'power' => 'Power Users',
'user' => 'Domain Users',
}
Compatibility
Set sslcompatibility in these cases:
- If you have older 6.0, 6.1, 6,2 or 6.3 releases that connect to Splunk 6.6 (see SPL-141961, SPL-141964)
- If you have older 6.0, 6,1 releases that connect to Splunk 6.2, 6,3, 6,4 or 6,5
- If you have 6.2, 6,3, 6.4 or 6.5 releases with default Splunk ssl settings that connect to Splunk managed by this module
Changelog
Moved to CHANGELOG.md
Test coverage
Moved to TEST_COVERAGE.md
Roadmap
- Managed service account for Windows installations
- Convert examples to patterns or building blocks
Out-of-scope
- Search head load-balancing
- Search head pooling
- Managing apps or inputs on Splunkforwarders, see principle 1.
3.4.1
- Added package_source for Linux in repository-less environments
- Perform first-time-run after an upgrade
- Fix boot-start for older Splunk UF versions
- Add ssl3 to intermediate_compatibility due to SPL-141961 and SPL-141964
3.4.0
- Added indexer discovery
3.3.0
- Added requireclientcert
- Successfully verified compatibility with Puppet 5.0.0 (Ruby 2.4) through Travis
3.2.0
- Added support for Windows
3.1.3
- Fixed typo in ds_intermediate parameter (Issue #11)
- Added forgotten ecdhcurvename_intermediate parameter (Issue #11)
- Removed obsolete use_certs parameter (Issue #11)
- Added TEST_COVERAGE.md
3.1.2
- Fixed forgotten repositorylocation (issue #9)
- Added instructions to generate SHA512 password hashes (Issue #10)
- Updated arrows to follow Puppet style guide
3.1.1
- Fixed typo in Puppet SSL directory pathname
3.1.0
- Added minfreespace parameter
- Fixed metadata.json
- Fixed hardcoded ecdhcurve
3.0.2
- Changed curve to secp384r1 to support Chrome
- Added AES256-GCM-SHA384 to cipherlist because mongod doesn't support curves and fails client helo's from Splunk. These failures appeared with Splunk 6.5.x
3.0.1
- Fixed failing ca.crt reuse from open-source Puppet
3.0.0
- Added support for multisite indexer clustering
- Added replication_port parameter to configure index cluster replication port.
- Moved useACK paramter to use_ack due to Puppet stricter language check
2.1.2
- Improved SAML support and updated settings for Splunk 6.4 and Splunk 6.5
2.1.1
- Improved search head clustering (SHC) support: Puppet now only places the initial SHC node configuration, and won't touch it afterwards. This allows the SH deployer to take over after initial configuration. A staging SHC instance is no longer necessary.
- Improved search head clustering (SHC) support:
splunk init shcluster
is no longer necessary, onlysplunk bootstrap shcluster-captain
2.1.0
- Added search head clustering (SHC) support, although only useful for staging purposes due to the overruling nature of the search head deployer (SHD)
- Added support to reuse Puppet certs from /etc/puppetlabs/puppet/ssl whenever commercial Puppet is used.
2.0.0
- Moved Splunk configuration out of etc/system/local to individual Splunk config apps
- Add LDAP authentication support
1.0.9
- Added phonehomeintervalinsec parameter to configure phoneHomeIntervalInSec for the deploymentclient
1.0.8
- Improved adding search peers
- Added class containment, to properly support
require =>
from other resources or classes. This add a dependency on puppetlabs-stdlib.
1.0.7
- Added rpsec tests
- Added github->travis-ci integration
- Fixed issues for Puppet 2.7
1.0.6
- Add SAML authentication support through ADFS as IdP
1.0.5
- Specify IP to bind to
1.0.4
- Optionally specify Splunk version to install
- Merged PR #1 from @timidri
1.0.3
- Added
ds_intermediate
parameter to create a deployment server that can deploy apps from an another upstream deployment server.
1.0.2
- Added
use_ack
parameter to manage indexer acknowledgement - Updated README with Debian / Ubuntu prerequisites.
1.0.1
- Added
service
parameter to manage start and running state of the Splunk or Splunkforwarder service.
1.0.0
Initial release:
- License master
- Splunk web
- Standalone search head
- KVstore
- Standalone indexer
- Deployment server
- Deployment client
- Distributed search
- Forwarding with load-balancing
- Data input with SSL
- Index clustering: cluster master
- Index clustering: cluster peer
- Index clustering: search head
Dependencies
- puppetlabs/stdlib (>= 3.2.0 < 5.0.0)
The MIT License (MIT) Copyright (c) 2016 Jorrit Folmer 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.