Skip to content

Commit

Permalink
Add selinux module for caddy
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd-ntrf committed Aug 17, 2023
1 parent ef275f6 commit 7d9769f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Binary file added site/profile/files/reverse_proxy/caddy.pp
Binary file not shown.
11 changes: 11 additions & 0 deletions site/profile/files/reverse_proxy/caddy.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

module caddy 1.0;

require {
type sysctl_net_t;
type httpd_t;
class file { open read };
}

#============= httpd_t ==============
allow httpd_t sysctl_net_t:file { open read };
6 changes: 6 additions & 0 deletions site/profile/manifests/reverse_proxy.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
) {
selinux::boolean { 'httpd_can_network_connect': }

selinux::module { 'caddy_somaxconn':
ensure => 'present',
source_pp => 'puppet:///modules/profile/reverse_proxy/caddy.pp',
}

firewall { '200 httpd public':
chain => 'INPUT',
dport => [80, 443],
Expand Down Expand Up @@ -131,6 +136,7 @@
enable => true,
require => [
Package['caddy'],
Selinux::Module['caddy_somaxconn'],
],
subscribe => [
File['/etc/caddy/Caddyfile'],
Expand Down

0 comments on commit 7d9769f

Please sign in to comment.