22 "securityLevel" =>
array(
23 "method" =>
"checkSecurityLevel"
25 "errorReporting" =>
array(
26 "method" =>
"checkErrorReporting",
27 "base_message_key" =>
"SECURITY_SITE_CHECKER_ERROR_REPORTING",
30 "exceptionDebug" =>
array(
31 "method" =>
"checkExceptionDebug",
32 "base_message_key" =>
"SECURITY_SITE_CHECKER_EXCEPTION_DEBUG",
36 "method" =>
"checkDbDebug",
37 "base_message_key" =>
"SECURITY_SITE_CHECKER_DB_DEBUG",
40 "dbPassword" =>
array(
41 "method" =>
"checkDbPassword"
43 "scriptExtension" =>
array(
44 "method" =>
"checkScriptExtension"
46 "modulesVersion" =>
array(
47 "method" =>
"checkModulesVersion"
50 "method" =>
"checkCaptchaOn"
52 "hostsRestricted" =>
array(
53 "method" =>
"checkHostsRestricted",
54 "base_message_key" =>
"SECURITY_SITE_CHECKER_HOSTS_NOT_RESTRICTED",
59 protected static $expectedScriptExtensions =
"php,php3,php4,php5,php6,phtml,pl,asp,aspx,cgi,dll,exe,ico,shtm,shtml,fcg,fcgi,fpl,asmx,pht,py,psp";
71 $actualExtensions = getScriptFileExt();
72 $missingExtensions = array_diff(
73 explode(
",", self::$expectedScriptExtensions),
77 if(!empty($missingExtensions))
80 "SECURITY_SITE_CHECKER_DANGER_EXTENSIONS",
82 getMessage(
"SECURITY_SITE_CHECKER_DANGER_EXTENSIONS_ADDITIONAL",
array(
83 "#EXPECTED#" => self::$expectedScriptExtensions,
84 "#ACTUAL#" => join(
",", $actualExtensions),
85 "#MISSING#" => join(
",", $missingExtensions)
88 return self::STATUS_FAILED;
91 return self::STATUS_PASSED;
97 if(!CSecurityFilter::IsActive())
109 if($adminPolicy !=
"high")
112 "SECURITY_SITE_CHECKER_ADMIN_SECURITY_LEVEL",
119 return self::STATUS_FAILED;
121 return self::STATUS_PASSED;
136 return self::STATUS_FAILED;
138 return self::STATUS_PASSED;
149 $validErrorReporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR|E_PARSE;
151 COption::GetOptionInt(
"main",
"error_reporting", $validErrorReporting) != $validErrorReporting
152 && COption::GetOptionInt(
"main",
"error_reporting",
"") != 0
154 return self::STATUS_FAILED;
156 return self::STATUS_PASSED;
169 is_array($exceptionConfig)
170 && isset($exceptionConfig[
'debug'])
171 && $exceptionConfig[
'debug']
173 return self::STATUS_FAILED;
175 return self::STATUS_PASSED;
188 $updates = static::getAvailableUpdates();
192 "SECURITY_SITE_CHECKER_MODULES_VERSION",
194 getMessage(
"SECURITY_SITE_CHECKER_MODULES_VERSION_ARRITIONAL",
array(
198 return self::STATUS_FAILED;
204 return self::STATUS_FAILED;
207 return self::STATUS_PASSED;
215 $sign =
",.#!*%$:-^@{}[]()'\"-+=<>?`&;";
249 require_once(
$_SERVER[
'DOCUMENT_ROOT'].
'/bitrix/modules/main/classes/general/update_client.php');
252 $installedModules = CUpdateClient::GetCurrentModules(
$errors);
256 $stableVersionsOnly = COption::GetOptionString(
'main',
'stable_versions_only',
'Y');
258 $updateList = CUpdateClient::GetUpdatesList(
$errors, LANG, $stableVersionsOnly);
263 !isset($updateList[
'MODULES'])
264 || !is_array($updateList[
'MODULES'])
265 || !isset($updateList[
'MODULES'][0][
'#'])
272 if (!$updateList[
'MODULES'][0][
'#'])
278 !isset($updateList[
'MODULES'][0][
'#'][
'MODULE'])
279 || !is_array($updateList[
'MODULES'][0][
'#'][
'MODULE'])
285 foreach ($updateList[
'MODULES'][0][
'#'][
'MODULE'] as $module)
287 if (array_key_exists($module[
'@'][
'ID'], $installedModules))
288 $result[] = $module[
'@'][
'ID'];
297 if (COption::GetOptionString(
"main",
"new_user_registration",
"N") ==
"Y" && COption::GetOptionString(
"main",
"captcha_registration",
"N") !=
"Y")
302 if (COption::GetOptionString(
"main",
"captcha_restoring_password",
"N") !=
"Y")
308 return $isFailed ? self::STATUS_FAILED : self::STATUS_PASSED;
314 return $hosts->getActive() ? self::STATUS_PASSED: self::STATUS_FAILED;
addUnformattedDetailError($baseMessageKey, $critical, $additionalInfo="")
static $expectedScriptExtensions
static getAvailableUpdates()
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
$_SERVER["DOCUMENT_ROOT"]
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)