summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2024-09-01 22:09:11 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2024-09-01 22:13:19 +0200
commit838714aa6f91fa4024de92862a1d3cc4dcf53171 (patch)
tree5461a8991cce952e68952f034773b7a69e79ef0e
parentf4f38e0875c8c7ecec2493ecedf167b84d8ae31d (diff)
downloadpuppet.KATH-838714aa6f91fa4024de92862a1d3cc4dcf53171.tar.gz
puppet.KATH-838714aa6f91fa4024de92862a1d3cc4dcf53171.tar.bz2
puppet.KATH-838714aa6f91fa4024de92862a1d3cc4dcf53171.zip
puppetserver/: Add server config for puppetserver 7.9.x.
-rw-r--r--puppetserver/conf.d/auth.conf263
-rw-r--r--puppetserver/conf.d/ca.conf10
-rw-r--r--puppetserver/conf.d/global.conf5
-rw-r--r--puppetserver/conf.d/metrics.conf53
-rw-r--r--puppetserver/conf.d/puppetserver.conf74
-rw-r--r--puppetserver/conf.d/web-routes.conf16
-rw-r--r--puppetserver/conf.d/webserver.conf6
-rw-r--r--puppetserver/logback.xml57
-rw-r--r--puppetserver/request-logging.xml18
-rw-r--r--puppetserver/services.d/bootstrap.cfg17
-rw-r--r--puppetserver/services.d/ca.cfg6
11 files changed, 525 insertions, 0 deletions
diff --git a/puppetserver/conf.d/auth.conf b/puppetserver/conf.d/auth.conf
new file mode 100644
index 0000000..5059f0a
--- /dev/null
+++ b/puppetserver/conf.d/auth.conf
@@ -0,0 +1,263 @@
+authorization: {
+ version: 1
+ rules: [
+ {
+ # Allow nodes to retrieve their own catalog
+ match-request: {
+ path: "^/puppet/v3/catalog/([^/]+)$"
+ type: regex
+ method: [get, post]
+ }
+ allow: "$1"
+ sort-order: 500
+ name: "puppetlabs v3 catalog from agents"
+ },
+ {
+ # Allow services to retrieve catalogs on behalf of others
+ match-request: {
+ path: "^/puppet/v4/catalog/?$"
+ type: regex
+ method: post
+ }
+ deny: "*"
+ sort-order: 500
+ name: "puppetlabs v4 catalog for services"
+ },
+ {
+ # Allow nodes to retrieve the certificate they requested earlier
+ match-request: {
+ path: "/puppet-ca/v1/certificate/"
+ type: path
+ method: get
+ }
+ allow-unauthenticated: true
+ sort-order: 500
+ name: "puppetlabs certificate"
+ },
+ {
+ # Allow all nodes to access the certificate revocation list
+ match-request: {
+ path: "/puppet-ca/v1/certificate_revocation_list/ca"
+ type: path
+ method: get
+ }
+ allow-unauthenticated: true
+ sort-order: 500
+ name: "puppetlabs crl"
+ },
+ {
+ # Allow nodes to request a new certificate
+ match-request: {
+ path: "/puppet-ca/v1/certificate_request"
+ type: path
+ method: [get, put]
+ }
+ allow-unauthenticated: true
+ sort-order: 500
+ name: "puppetlabs csr"
+ },
+ {
+ # Allow the CA CLI to access the certificate_status endpoint
+ match-request: {
+ path: "/puppet-ca/v1/certificate_status"
+ type: path
+ method: [get, put, delete]
+ }
+ allow: {
+ extensions: {
+ pp_cli_auth: "true"
+ }
+ }
+ sort-order: 500
+ name: "puppetlabs cert status"
+ },
+ {
+ match-request: {
+ path: "^/puppet-ca/v1/certificate_revocation_list$"
+ type: regex
+ method: put
+ }
+ allow: {
+ extensions: {
+ pp_cli_auth: "true"
+ }
+ }
+ sort-order: 500
+ name: "puppetlabs CRL update"
+ },
+ {
+ # Allow the CA CLI to access the certificate_statuses endpoint
+ match-request: {
+ path: "/puppet-ca/v1/certificate_statuses"
+ type: path
+ method: get
+ }
+ allow: {
+ extensions: {
+ pp_cli_auth: "true"
+ }
+ }
+ sort-order: 500
+ name: "puppetlabs cert statuses"
+ },
+ {
+ # Allow authenticated access to the CA expirations endpoint
+ match-request: {
+ path: "/puppet-ca/v1/expirations"
+ type: path
+ method: get
+ }
+ allow: "*"
+ sort-order: 500
+ name: "puppetlabs CA cert and CRL expirations"
+ },
+ {
+ # Allow the CA CLI to access the certificate clean endpoint
+ match-request: {
+ path: "/puppet-ca/v1/clean"
+ type: path
+ method: put
+ }
+ allow: {
+ extensions: {
+ pp_cli_auth: "true"
+ }
+ }
+ sort-order: 500
+ name: "puppetlabs cert clean"
+ },
+ {
+ # Allow unauthenticated access to the status service endpoint
+ match-request: {
+ path: "/status/v1/services"
+ type: path
+ method: get
+ }
+ allow-unauthenticated: true
+ sort-order: 500
+ name: "puppetlabs status service - full"
+ },
+ {
+ match-request: {
+ path: "/status/v1/simple"
+ type: path
+ method: get
+ }
+ allow-unauthenticated: true
+ sort-order: 500
+ name: "puppetlabs status service - simple"
+ },
+ {
+ match-request: {
+ path: "/puppet/v3/environments"
+ type: path
+ method: get
+ }
+ allow: "*"
+ sort-order: 500
+ name: "puppetlabs environments"
+ },
+ {
+ # Allow nodes to access all file_bucket_files. Note that access for
+ # the 'delete' method is forbidden by Puppet regardless of the
+ # configuration of this rule.
+ match-request: {
+ path: "/puppet/v3/file_bucket_file"
+ type: path
+ method: [get, head, post, put]
+ }
+ allow: "*"
+ sort-order: 500
+ name: "puppetlabs file bucket file"
+ },
+ {
+ # Allow nodes to access all file_content. Note that access for the
+ # 'delete' method is forbidden by Puppet regardless of the
+ # configuration of this rule.
+ match-request: {
+ path: "/puppet/v3/file_content"
+ type: path
+ method: [get, post]
+ }
+ allow: "*"
+ sort-order: 500
+ name: "puppetlabs file content"
+ },
+ {
+ # Allow nodes to access all file_metadata. Note that access for the
+ # 'delete' method is forbidden by Puppet regardless of the
+ # configuration of this rule.
+ match-request: {
+ path: "/puppet/v3/file_metadata"
+ type: path
+ method: [get, post]
+ }
+ allow: "*"
+ sort-order: 500
+ name: "puppetlabs file metadata"
+ },
+ {
+ # Allow nodes to retrieve only their own node definition
+ match-request: {
+ path: "^/puppet/v3/node/([^/]+)$"
+ type: regex
+ method: get
+ }
+ allow: "$1"
+ sort-order: 500
+ name: "puppetlabs node"
+ },
+ {
+ # Allow nodes to store only their own reports
+ match-request: {
+ path: "^/puppet/v3/report/([^/]+)$"
+ type: regex
+ method: put
+ }
+ allow: "$1"
+ sort-order: 500
+ name: "puppetlabs report"
+ },
+ {
+ # Allow nodes to update their own facts
+ match-request: {
+ path: "^/puppet/v3/facts/([^/]+)$"
+ type: regex
+ method: put
+ }
+ allow: "$1"
+ sort-order: 500
+ name: "puppetlabs facts"
+ },
+ {
+ match-request: {
+ path: "/puppet/v3/static_file_content"
+ type: path
+ method: get
+ }
+ allow: "*"
+ sort-order: 500
+ name: "puppetlabs static file content"
+ },
+ {
+ match-request: {
+ path: "/puppet/v3/tasks"
+ type: path
+ }
+ allow: "*"
+ sort-order: 500
+ name: "puppet tasks information"
+ },
+ {
+ # Deny everything else. This ACL is not strictly
+ # necessary, but illustrates the default policy
+ match-request: {
+ path: "/"
+ type: path
+ }
+ deny: "*"
+ sort-order: 999
+ name: "puppetlabs deny all"
+ }
+ ]
+}
diff --git a/puppetserver/conf.d/ca.conf b/puppetserver/conf.d/ca.conf
new file mode 100644
index 0000000..11ee678
--- /dev/null
+++ b/puppetserver/conf.d/ca.conf
@@ -0,0 +1,10 @@
+certificate-authority: {
+ # allow CA to sign certificate requests that have subject alternative names.
+ # allow-subject-alt-names: false
+
+ # allow CA to sign certificate requests that have authorization extensions.
+ # allow-authorization-extensions: false
+
+ # enable the separate CRL for Puppet infrastructure nodes
+ # enable-infra-crl: false
+}
diff --git a/puppetserver/conf.d/global.conf b/puppetserver/conf.d/global.conf
new file mode 100644
index 0000000..2db9aee
--- /dev/null
+++ b/puppetserver/conf.d/global.conf
@@ -0,0 +1,5 @@
+global: {
+ # Path to logback logging configuration file; for more
+ # info, see http://logback.qos.ch/manual/configuration.html
+ logging-config: /etc/puppet/puppetserver/logback.xml
+}
diff --git a/puppetserver/conf.d/metrics.conf b/puppetserver/conf.d/metrics.conf
new file mode 100644
index 0000000..0e03d50
--- /dev/null
+++ b/puppetserver/conf.d/metrics.conf
@@ -0,0 +1,53 @@
+# settings related to metrics
+metrics: {
+ # a server id that will be used as part of the namespace for metrics produced
+ # by this server
+ server-id: localhost
+ registries: {
+ puppetserver: {
+ # specify metrics to allow in addition to those in the default list
+ #metrics-allowed: ["compiler.compile.production"]
+
+ reporters: {
+ # enable or disable JMX metrics reporter
+ jmx: {
+ enabled: true
+ }
+ # enable or disable Graphite metrics reporter
+ #graphite: {
+ # enabled: true
+ #}
+ }
+
+ }
+ }
+
+ # this section is used to configure settings for reporters that will send
+ # the metrics to various destinations for external viewing
+ reporters: {
+ #graphite: {
+ # # graphite host
+ # host: "127.0.0.1"
+ # # graphite metrics port
+ # port: 2003
+ # # how often to send metrics to graphite
+ # update-interval-seconds: 5
+ #}
+ }
+ metrics-webservice: {
+ jolokia: {
+ # Enable or disable the Jolokia-based metrics/v2 endpoint.
+ # Default is true.
+ # enabled: false
+
+ # Configure any of the settings listed at:
+ # https://jolokia.org/reference/html/agents.html#war-agent-installation
+ servlet-init-params: {
+ # Specify a custom security policy:
+ # https://jolokia.org/reference/html/security.html
+ # policyLocation: "file:///etc/puppetlabs/puppetserver/jolokia-access.xml"
+ }
+ }
+ }
+
+}
diff --git a/puppetserver/conf.d/puppetserver.conf b/puppetserver/conf.d/puppetserver.conf
new file mode 100644
index 0000000..512b784
--- /dev/null
+++ b/puppetserver/conf.d/puppetserver.conf
@@ -0,0 +1,74 @@
+# configuration for the JRuby interpreters
+jruby-puppet: {
+ # Where the puppet-agent dependency places puppet, facter, etc...
+ # Puppet server expects to load Puppet from this location
+ ruby-load-path: [/usr/lib/puppetserver/ruby/vendor_ruby]
+
+ # This setting determines where JRuby will install gems. It is used for loading gems,
+ # and also by the `puppetserver gem` command line tool.
+ gem-home: /var/lib/puppetserver/jruby-gems
+
+ # This setting defines the complete "GEM_PATH" for jruby. If set, it should include
+ # the gem-home directory as well as any other directories that gems can be loaded
+ # from (including the vendored gems directory for gems that ship with puppetserver)
+ gem-path: [${jruby-puppet.gem-home}, "/usr/lib/puppetserver/vendored-jruby-gems"]
+
+ # PLEASE NOTE: Use caution when modifying the below settings. Modifying
+ # these settings will change the value of the corresponding Puppet settings
+ # for Puppet Server, but not for the Puppet CLI tools. This likely will not
+ # be a problem with server-var-dir, server-run-dir, or server-log-dir unless
+ # some critical setting in puppet.conf is interpolating the value of one
+ # of the corresponding settings, but it is important that any changes made to
+ # server-conf-dir and server-code-dir are also made to the corresponding Puppet
+ # settings when running the Puppet CLI tools. See
+ # https://docs.puppetlabs.com/puppetserver/latest/puppet_conf_setting_diffs.html#overriding-puppet-settings-in-puppet-server
+ # for more information.
+
+ # (optional) path to puppet conf dir; if not specified, will use
+ # /etc/puppet
+ server-conf-dir: /etc/puppet
+
+ # (optional) path to puppet code dir; if not specified, will use
+ # /etc/puppet/code
+ server-code-dir: /etc/puppet/code
+
+ # (optional) path to puppet var dir; if not specified, will use
+ # /var/lib/puppetserver
+ server-var-dir: /var/lib/puppetserver
+
+ # (optional) path to puppet run dir; if not specified, will use
+ # /var/run/puppetserver
+ server-run-dir: /run/puppetserver
+
+ # (optional) path to puppet log dir; if not specified, will use
+ # /var/log/puppetserver
+ server-log-dir: /var/log/puppetserver
+
+ # (optional) maximum number of JRuby instances to allow
+ #max-active-instances: 1
+
+ # (optional) Whether or not to track lookups during compilation; turning
+ # this on will send that information to puppetdb
+ # track-lookups: true
+}
+
+# settings related to HTTPS client requests made by Puppet Server
+http-client: {
+ # A list of acceptable protocols for making HTTPS requests
+ #ssl-protocols: [TLSv1.3, TLSv1.2]
+
+ # A list of acceptable cipher suites for making HTTPS requests
+ #cipher-suites: [TLS_RSA_WITH_AES_256_CBC_SHA256,
+ # TLS_RSA_WITH_AES_256_CBC_SHA,
+ # TLS_RSA_WITH_AES_128_CBC_SHA256,
+ # TLS_RSA_WITH_AES_128_CBC_SHA]
+
+ # Whether to enable http-client metrics; defaults to 'true'.
+ #metrics-enabled: true
+}
+
+# settings related to profiling the puppet Ruby code
+profiler: {
+ # enable or disable profiling for the Ruby code; defaults to 'true'.
+ #enabled: true
+}
diff --git a/puppetserver/conf.d/web-routes.conf b/puppetserver/conf.d/web-routes.conf
new file mode 100644
index 0000000..43e97d3
--- /dev/null
+++ b/puppetserver/conf.d/web-routes.conf
@@ -0,0 +1,16 @@
+web-router-service: {
+ # These two should not be modified because the Puppet 4.x agent expects them to
+ # be mounted at these specific paths
+ "puppetlabs.services.ca.certificate-authority-service/certificate-authority-service": "/puppet-ca"
+ "puppetlabs.services.master.master-service/master-service": "/puppet"
+ "puppetlabs.services.legacy-routes.legacy-routes-service/legacy-routes-service": ""
+
+ # This controls the mount point for the puppet admin API.
+ "puppetlabs.services.puppet-admin.puppet-admin-service/puppet-admin-service": "/puppet-admin-api"
+
+ # This controls the mount point for the status API
+ "puppetlabs.trapperkeeper.services.status.status-service/status-service": "/status"
+
+ # This controls the mount point for the metrics API
+ "puppetlabs.trapperkeeper.services.metrics.metrics-service/metrics-webservice": "/metrics"
+}
diff --git a/puppetserver/conf.d/webserver.conf b/puppetserver/conf.d/webserver.conf
new file mode 100644
index 0000000..19a757d
--- /dev/null
+++ b/puppetserver/conf.d/webserver.conf
@@ -0,0 +1,6 @@
+webserver: {
+ access-log-config: /etc/puppet/puppetserver/request-logging.xml
+ client-auth: want
+ ssl-host: 0.0.0.0
+ ssl-port: 8140
+}
diff --git a/puppetserver/logback.xml b/puppetserver/logback.xml
new file mode 100644
index 0000000..9d3645c
--- /dev/null
+++ b/puppetserver/logback.xml
@@ -0,0 +1,57 @@
+<configuration scan="true" scanPeriod="60 seconds">
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX} %-5p [%t] [%c{2}] %m%n</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="F1" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <!-- TODO: this path should not be hard-coded -->
+ <file>/var/log/puppetserver/puppetserver.log</file>
+ <append>true</append>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <!-- rollover daily -->
+ <fileNamePattern>/var/log/puppetserver/puppetserver-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
+ <!-- each file should be at most 200MB, keep 90 days worth of history, but at most 1GB total-->
+ <maxFileSize>200MB</maxFileSize>
+ <maxHistory>90</maxHistory>
+ <totalSizeCap>1GB</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX} %-5p [%t] [%c{2}] %m%n</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="STATUS" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>/var/log/puppetserver/puppetserver-status.log</file>
+ <append>true</append>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <!-- rollover daily -->
+ <fileNamePattern>/var/log/puppetserver/puppetserver-status-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
+ <!-- each file should be at most 200MB, keep 90 days worth of history, but at most 1GB total-->
+ <maxFileSize>200MB</maxFileSize>
+ <maxHistory>90</maxHistory>
+ <totalSizeCap>1GB</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <!-- note that this will only log the JSON message (%m) and a newline (%n)-->
+ <pattern>%m%n</pattern>
+ </encoder>
+ </appender>
+
+ <!-- without additivity="false", the status log messages will be sent to every other appender as well-->
+ <logger name="puppetlabs.trapperkeeper.services.status.status-debug-logging" level="debug" additivity="false">
+ <appender-ref ref="STATUS"/>
+ </logger>
+
+ <logger name="org.eclipse.jetty" level="INFO"/>
+ <logger name="org.apache.http" level="INFO"/>
+ <logger name="jruby" level="info"/>
+
+ <root level="info">
+ <!--<appender-ref ref="STDOUT"/>-->
+ <!-- ${logappender} logs to console when running the foreground command -->
+ <appender-ref ref="${logappender}"/>
+ <appender-ref ref="F1"/>
+ </root>
+</configuration>
diff --git a/puppetserver/request-logging.xml b/puppetserver/request-logging.xml
new file mode 100644
index 0000000..9fa05ce
--- /dev/null
+++ b/puppetserver/request-logging.xml
@@ -0,0 +1,18 @@
+<configuration debug="false">
+ <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>/var/log/puppetserver/puppetserver-access.log</file>
+ <append>true</append>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <!-- rollover daily -->
+ <fileNamePattern>/var/log/puppetserver/puppetserver-access-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
+ <!-- each file should be at most 200MB, keep 90 days worth of history, but at most 1GB total-->
+ <maxFileSize>200MB</maxFileSize>
+ <maxHistory>90</maxHistory>
+ <totalSizeCap>1GB</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>%h %l %u [%t] "%r" %s %b "%i{Referer}" "%i{User-Agent}" %D %i{Content-Length} %mdc{jruby.borrow-time:--}</pattern>
+ </encoder>
+ </appender>
+ <appender-ref ref="FILE" />
+</configuration>
diff --git a/puppetserver/services.d/bootstrap.cfg b/puppetserver/services.d/bootstrap.cfg
new file mode 100644
index 0000000..9639ff3
--- /dev/null
+++ b/puppetserver/services.d/bootstrap.cfg
@@ -0,0 +1,17 @@
+puppetlabs.services.request-handler.request-handler-service/request-handler-service
+puppetlabs.services.jruby.jruby-puppet-service/jruby-puppet-pooled-service
+puppetlabs.services.jruby-pool-manager.jruby-pool-manager-service/jruby-pool-manager-service
+puppetlabs.services.puppet-profiler.puppet-profiler-service/puppet-profiler-service
+puppetlabs.trapperkeeper.services.webserver.jetty9-service/jetty9-service
+puppetlabs.trapperkeeper.services.webrouting.webrouting-service/webrouting-service
+puppetlabs.services.config.puppet-server-config-service/puppet-server-config-service
+puppetlabs.services.master.master-service/master-service
+puppetlabs.services.puppet-admin.puppet-admin-service/puppet-admin-service
+puppetlabs.trapperkeeper.services.authorization.authorization-service/authorization-service
+puppetlabs.services.versioned-code-service.versioned-code-service/versioned-code-service
+puppetlabs.trapperkeeper.services.scheduler.scheduler-service/scheduler-service
+puppetlabs.trapperkeeper.services.status.status-service/status-service
+puppetlabs.trapperkeeper.services.metrics.metrics-service/metrics-service
+puppetlabs.trapperkeeper.services.metrics.metrics-service/metrics-webservice
+puppetlabs.services.jruby.jruby-metrics-service/jruby-metrics-service
+puppetlabs.services.analytics.analytics-service/analytics-service
diff --git a/puppetserver/services.d/ca.cfg b/puppetserver/services.d/ca.cfg
new file mode 100644
index 0000000..e3c1c84
--- /dev/null
+++ b/puppetserver/services.d/ca.cfg
@@ -0,0 +1,6 @@
+# To enable the CA service, leave the following line uncommented
+puppetlabs.services.ca.certificate-authority-service/certificate-authority-service
+# To disable the CA service, comment out the above line and uncomment the line below
+#puppetlabs.services.ca.certificate-authority-disabled-service/certificate-authority-disabled-service
+puppetlabs.trapperkeeper.services.watcher.filesystem-watch-service/filesystem-watch-service
+