Test if Safe jail is enabled (#2617)

This commit is contained in:
Christophe Maudoux 2021-09-19 22:09:10 +02:00
parent 5f687217c7
commit 9b50811f5e
2 changed files with 15 additions and 1 deletions

View File

@ -1038,11 +1038,19 @@ sub tests {
# Warn if Impersonation and proxyAuthServiceImpersonation are simultaneously enabled
impersonationProxy => sub {
return ( -1,
'Impersonation and internal portal Impersonation are simultaneously enabled'
'Impersonation and internal portal Impersonation are simultaneously enabled'
)
if ( $conf->{impersonationRule}
and $conf->{proxyAuthServiceImpersonation} );
return 1;
},
# CheckDevOps requires Safe jail
checkDevOpsWithSafeJail => sub {
return ( 0, 'Safe jail must be enabled with CheckDevOps plugin' )
if ( $conf->{checkDevOps}
and !$conf->{useSafeJail} );
return 1;
}
};
}

View File

@ -51,6 +51,12 @@ sub init {
$self->addAuthRoute( checkdevops => 'run', ['POST'] )
->addAuthRouteWithRedirect( checkdevops => 'display', ['GET'] );
unless ( $self->conf->{useSafeJail} ) {
$self->logger->warn(
'"CheckDevOps" plugin enabled WITHOUT SafeJail');
return 0;
}
return 1;
}