$msg.=$this->l10n->t('- The `%1$s` HTTP header is not set to `%2$s`. Some features might not work correctly, as it is recommended to adjust this setting accordingly.',[$header,$expected])."\n";
$msg.=$this->l10n->t(
'- The `%1$s` HTTP header is not set to `%2$s`. Some features '
.'might not work correctly, as it is recommended to adjust this '
.'setting accordingly.',
[$header,$expected]
)."\n";
}else{
$msg.=$this->l10n->t('- The `%1$s` HTTP header is not set to `%2$s`. This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.',[$header,$expected])."\n";
$msg.=$this->l10n->t(
'- The `%1$s` HTTP header is not set to `%2$s`. This is a '
.'potential security or privacy risk, as it is recommended to adjust '
.'this setting accordingly.',
[$header,$expected]
)."\n";
}
}
}
@ -75,7 +109,8 @@ class SecurityHeaders implements ISetupCheck {
$msg.=$this->l10n->t('- The `Strict-Transport-Security` HTTP header is not set to at least `%d` seconds (current value: `%d`). For enhanced security, it is recommended to use a long HSTS policy.',[$minimumSeconds,$transportSecurityValidity])."\n";
$msg.=$this->l10n->t(
'- The `Strict-Transport-Security` HTTP header is set below the recommended minimum of `%d` seconds '
.'(current value: `%d`). '
.'For better security, enable a long HSTS policy. ',
[$minimumSeconds,$transportSecurityValidity]
)."\n";
}
}elseif(!empty($transportSecurityValidity)){
$msg.=$this->l10n->t('- The `Strict-Transport-Security` HTTP header is malformed: `%s`. For enhanced security, it is recommended to enable HSTS.',[$transportSecurityValidity])."\n";
$msg.=$this->l10n->t(
'- The `Strict-Transport-Security` HTTP header is malformed: `%s`. '
.'For better security, configure a valid HSTS policy. ',
[$transportSecurityValidity]
)."\n";
}else{
$msg.=$this->l10n->t('- The `Strict-Transport-Security` HTTP header is not set (should be at least `%d` seconds). For enhanced security, it is recommended to enable HSTS.',[$minimumSeconds])."\n";
$msg.=$this->l10n->t(
'- The `Strict-Transport-Security` HTTP header is not set to the recommended minimum of `%d` seconds. '
.'For better security, enable HSTS. ',
[$minimumSeconds]
)."\n";
}
if(!empty($msg)){
returnSetupResult::warning(
$this->l10n->t('Some headers are not set correctly on your instance')."\n".$msg,
$this->l10n->t('Some headers are not set correctly on your instance.')."\n"
.$msg."\n"
.'If you believe this is incorrect, review your `overwrite.cli.url` and `trusted_domains` settings. '
.'These settings may include URLs that do not use HTTPS or bypass your reverse proxy, '
.'which can affect header checks. '
.'Additionally, ensure your DNS records and server configuration are consistent with your HTTPS setup.',