9
0
Fork 1

Fixes with auth..

This commit is contained in:
Johan Björklund 2024-11-20 14:24:22 +01:00
parent fd68ed866d
commit c36ed664ff
Signed by: bjorklund
GPG key ID: 5E8401339C7F5037
3 changed files with 32 additions and 20 deletions

View file

@ -5,6 +5,7 @@ class soc::intelmq(
String $servername = $facts['networking']['fqdn'],
Boolean $use_snakeoil = false,
String $apache_group = 'sunet-cert',
Boolean $use_shib = false,
) {
include sunet::systemd_reload

View file

@ -94,7 +94,18 @@ class soc::sso(
ensure => installed,
}
exec { 'Make sure mod_shib is loaded':
command => 'a2enmod shib',
creates => '/etc/apache2/mods-enabled/shib.load',
}
exec { 'Make sure authz_groupfile is loaded':
command => 'a2enmod authz_groupfile',
creates => '/etc/apache2/mods-enabled/authz_groupfile.load',
}
$shibbase = '/etc/shibboleth'
} elsif $ssotype == 'docker' {
$shibbase = '/opt/sso/shibboleth'

View file

@ -33,17 +33,20 @@
SSLSessionTickets off
Header always set Strict-Transport-Security "max-age=63072000"
<IfModule mod_shib.c>
<Location />
AuthType shibboleth
ShibRequestSetting requireSession On
ShibUseHeaders On
<Location />
<% if $use_shib -%>
AuthType shibboleth
ShibRequestSetting requireSession On
ShibUseHeaders On
AuthGroupFile /etc/apache2/groups.txt
Require group <%= @apache_group %>
<% else -%>
Require all granted
<% end -%>
</Location>
AuthGroupFile /etc/apache2/groups.txt
Require group <%= @apache_group %>
</Location>
</IfModule>
<IfModule mod_proxy.c>
ProxyRequests Off
<Location "/api">
@ -69,19 +72,16 @@
Alias /intelmq-manager /opt/intelmq/www/intelmq-manager
<Directory /opt/intelmq/www/intelmq-manager>
<IfModule mod_shib.c>
<Location />
AuthType shibboleth
ShibRequestSetting requireSession On
ShibUseHeaders On
<% if $use_shib -%>
AuthType shibboleth
ShibRequestSetting requireSession On
ShibUseHeaders On
AuthGroupFile /etc/apache2/groups.txt
Require group <%= @apache_group %>
</Location>
</IfModule>
<IfModule !mod_shib.c>
AuthGroupFile /etc/apache2/groups.txt
Require group <%= @apache_group %>
<% else -%>
Require all granted
</IfModule>
<% end -%>
<IfModule mod_headers.c>
Header set Content-Security-Policy "script-src 'self'"