-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
572 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -423,7 +423,8 @@ function spbc_settings__register() | |
'waf__xss_check', | ||
'waf__sql_check', | ||
'waf__file_check', | ||
'waf__exploit_check' | ||
'waf__exploit_check', | ||
'waf_blocker__enabled' | ||
), | ||
), | ||
'waf__xss_check' => array( | ||
|
@@ -461,6 +462,12 @@ function spbc_settings__register() | |
'description' => __('Check traffic for known exploits.', 'security-malware-firewall'), | ||
'parent' => 'waf__enabled', | ||
), | ||
'waf_blocker__enabled' => array( | ||
'type' => 'field', | ||
'title' => __('WAF Blocker', 'security-malware-firewall'), | ||
'description' => __('Blocking a visitor for 24 hours after several WAF detected brute force attempts.', 'security-malware-firewall'), | ||
'parent' => 'waf__enabled', | ||
), | ||
'traffic_control__enabled' => array( | ||
'type' => 'field', | ||
'title' => __('Traffic Control', 'security-malware-firewall'), | ||
|
@@ -1932,13 +1939,13 @@ function spbc_field_security_logs__prepare_data(&$table) | |
|
||
foreach ($table->rows as $row) { | ||
$ip = IP::reduceIPv6($row->auth_ip); | ||
$allow_layout = '<a href="#" onclick="return spbc_sec_logs__allow_ip(\'' | ||
. esc_attr($ip) | ||
. '\')" class="spbcGreen tbl-row_action--allow" data-ip=' . $ip . '>' | ||
$allow_layout = '<a href="#" onclick="return spbc_sec_logs__allow_ip(\'' | ||
. esc_attr($ip) | ||
. '\')" class="spbcGreen tbl-row_action--allow" data-ip=' . $ip . '>' | ||
. esc_html__('Allow', 'security-malware-firewall') . '</a>'; | ||
$ban_layout = '<a href="#" onclick="return spbc_sec_logs__ban_ip(\'' | ||
. esc_attr($ip) | ||
. '\')" class="spbc---red tbl-row_action--ban" data-ip=' . $ip . '>' | ||
$ban_layout = '<a href="#" onclick="return spbc_sec_logs__ban_ip(\'' | ||
. esc_attr($ip) | ||
. '\')" class="spbc---red tbl-row_action--ban" data-ip=' . $ip . '>' | ||
. esc_html__('Ban', 'security-malware-firewall') . '</a>'; | ||
|
||
$user = get_user_by('login', $row->user_login); | ||
|
@@ -2153,6 +2160,7 @@ function spbc_field_traffic_control_logs__prepare_data(&$table) | |
$status = '<span class="spbcRed">' . __('Blocked. Hazardous network. SFW source', 'security-malware-firewall') . '</span>'; | ||
break; | ||
case 'DENY_BY_BFP': | ||
case 'DENY_BY_WAF_BLOCKER': | ||
$status = '<span class="spbcRed">' . __('Blocked by BruteForce protection system', 'security-malware-firewall') . '</span>'; | ||
break; | ||
|
||
|
@@ -2367,6 +2375,37 @@ function spbc_field_scanner__prepare_data__files(&$table) | |
unset($row->actions['replace']); | ||
} | ||
|
||
if ( !empty($row->status) ) { | ||
if ( $row->status === 'DENIED_BY_CT' ) { | ||
$cloud_status = '<span class="spbcRed">' . __('File hash', 'security-malware-firewall') . ':[' . esc_html($row->full_hash) . ']' . '</span>'; | ||
unset($row->actions['send']); | ||
unset($row->actions['view_bad']); | ||
} | ||
} | ||
|
||
if ( !empty($row->status) ) { | ||
if ( $row->status === 'DENIED_BY_CT' ) { | ||
$cloud_status = '<span class="spbcRed">' . __('File hash', 'security-malware-firewall') . ':[' . esc_html($row->full_hash) . ']' . '</span>'; | ||
unset($row->actions['send']); | ||
unset($row->actions['view_bad']); | ||
} | ||
if ( !empty($row->analysis_status) ) { | ||
if ( $row->analysis_status === 'DANGEROUS' ) { | ||
$status = '<span class="spbcRed">' . __('File is denied by ' . $spbc->data["wl_company_name"] . ' team', 'security-malware-firewall') . '</span>'; | ||
} | ||
} | ||
} | ||
|
||
if ( $table->type === 'critical' && in_array($row->fast_hash, spbc_get_list_of_scheduled_critical_files_to_send())) { | ||
$status = __('File will be automatically send for Cloud analysis within 5 minutes.', 'security-malware-firewall'); | ||
unset($row->actions['send']); | ||
unset($row->actions['approve']); | ||
unset($row->actions['quarantine']); | ||
unset($row->actions['delete']); | ||
unset($row->actions['compare']); | ||
unset($row->actions['replace']); | ||
} | ||
|
||
$table->items[] = array( | ||
'cb' => $row->fast_hash, | ||
'uid' => $row->fast_hash, | ||
|
@@ -2425,6 +2464,21 @@ function spbc_field_scanner__prepare_data__files(&$table) | |
$ws_string .= '</p>'; | ||
} | ||
} | ||
if ( ! empty($weak_spots['DENIED_HASH'])) { | ||
// collecting all kinds of code | ||
$all_unique_weak_spots = array(); | ||
foreach ($weak_spots['DENIED_HASH'] as $_string => $weak_spot_in_string) { | ||
$all_unique_weak_spots[] = $weak_spot_in_string[0]; | ||
} | ||
$all_unique_weak_spots = array_unique($all_unique_weak_spots); | ||
foreach ($all_unique_weak_spots as $weak_spot_in_string) { | ||
|
||
$ws_string .= '<p style="margin: 0;"><span class="spbcRed"><i setting="hash_' . str_replace(' ', '_', $weak_spot_in_string) . '" class="spbc_long_description__show spbc-icon-help-circled"></i> Hash: </span>' | ||
. 'denied'; | ||
|
||
$ws_string .= '</p>'; | ||
} | ||
} | ||
if ( ! empty($weak_spots['DANGER'])) { | ||
// collecting all kinds of code | ||
$all_unique_weak_spots = array(); | ||
|
@@ -2433,10 +2487,12 @@ function spbc_field_scanner__prepare_data__files(&$table) | |
} | ||
$all_unique_weak_spots = array_unique($all_unique_weak_spots); | ||
foreach ($all_unique_weak_spots as $weak_spot_in_string) { | ||
|
||
$ws_string .= '<p style="margin: 0;"><span class="spbcRed"><i setting="danger_' . str_replace(' ', '_', $weak_spot_in_string) . '" class="spbc_long_description__show spbc-icon-help-circled"></i> Danger: </span>' | ||
. (strlen($weak_spot_in_string) > 30 | ||
? substr($weak_spot_in_string, 0, 30) . '...' | ||
: $weak_spot_in_string); | ||
|
||
$ws_string .= '</p>'; | ||
} | ||
} | ||
|
@@ -2877,6 +2933,7 @@ function spbc_field_scanner() | |
. '<span class="spbc_overall_scan_status_get_modules_hashes">' . __('Receiving plugin and theme hashes', 'security-malware-firewall') . '</span> -> ' | ||
. '<span class="spbc_overall_scan_status_clean_results">' . __('Preparing', 'security-malware-firewall') . '</span> -> ' | ||
. '<span class="spbc_overall_scan_status_file_system_analysis">' . __('Scanning for modifications', 'security-malware-firewall') . '</span> -> ' | ||
. '<span class="spbc_overall_scan_status_get_denied_hashes">' . __('Updating statuses for the denied files', 'security-malware-firewall') . '</span> -> ' | ||
. '<span class="spbc_overall_scan_status_get_approved_hashes">' . __('Updating statuses for the approved files', 'security-malware-firewall') . '</span> -> '; | ||
|
||
if ($spbc->settings['scanner__file_monitoring']) { | ||
|
@@ -3380,6 +3437,7 @@ function spbc_list_table__get_args_by_type($table_type) | |
$args['sql']['add_col'][] = 'analysis_status'; | ||
$args['sql']['add_col'][] = 'pscan_status'; | ||
$args['sql']['add_col'][] = 'pscan_pending_queue'; | ||
$args['sql']['add_col'][] = 'full_hash'; | ||
break; | ||
|
||
case 'suspicious': | ||
|
@@ -4225,6 +4283,12 @@ function spbc_get_key_auto($direct_call = false) | |
'success' => true, | ||
'reload' => false, | ||
); | ||
} elseif ( ! isset($result['auth_key'])) { | ||
$out = array( | ||
'success' => true, | ||
'reload' => false, | ||
'msg' => __('Please use the manual option to get the access key to ensure its safety.', 'security-malware-firewall') | ||
); | ||
} else { | ||
$settings['spbc_key'] = trim($result['auth_key']); | ||
$settings['spbc_key'] = preg_match('/^[a-z\d]*$/', $settings['spbc_key']) ? $settings['spbc_key'] : $spbc->settings['spbc_key']; // Check key format a-z\d | ||
|
@@ -4652,6 +4716,11 @@ function spbc_settings__get_description() | |
'title' => __('Directory exclusions ruleset', 'security-malware-firewall'), | ||
'desc' => __('This rules will exclude the directory and all subdirectories matching the specified path. Any type of directory separator is acceptable. Example: wp-content/themes/yourtheme/skipthisdir', 'security-malware-firewall'), | ||
), | ||
'hash_denied_hash' => array( | ||
'title' => 'denied_hash', | ||
'desc' => __('The file hash is in denied list. It means that the Security analysts have marked this file | ||
as critically dangerous early. We do recommend you to order the Security Audit service.', 'security-malware-firewall') | ||
), | ||
'no_description' => array( | ||
'title' => esc_html($setting_id), | ||
'desc' => __('No description provided yet for this item. We are sorry about this. Please, contact [email protected] for further help.', 'security-malware-firewall'), | ||
|
Oops, something went wrong.