Diff
8 years ago
dashboard
7 years ago
rest-api
7 years ago
.htaccess
7 years ago
Diff.php
14 years ago
GeoLite2-Country.mmdb
7 years ago
IPTraf.php
8 years ago
IPTrafList.php
7 years ago
compat.php
8 years ago
conntest.php
7 years ago
cronview.php
8 years ago
dbview.php
8 years ago
diffResult.php
8 years ago
email_genericAlert.php
7 years ago
email_newIssues.php
7 years ago
email_unlockRequest.php
8 years ago
email_unsubscribeRequest.php
7 years ago
flags.php
7 years ago
live_activity.php
8 years ago
menu_dashboard.php
7 years ago
menu_dashboard_options.php
7 years ago
menu_firewall.php
7 years ago
menu_firewall_blocking.php
8 years ago
menu_firewall_blocking_options.php
8 years ago
menu_firewall_waf.php
7 years ago
menu_firewall_waf_options.php
7 years ago
menu_options.php
7 years ago
menu_scanner.php
7 years ago
menu_scanner_credentials.php
8 years ago
menu_scanner_options.php
8 years ago
menu_support.php
8 years ago
menu_tools.php
7 years ago
menu_tools_diagnostic.php
7 years ago
menu_tools_importExport.php
7 years ago
menu_tools_livetraffic.php
7 years ago
menu_tools_twoFactor.php
8 years ago
menu_tools_whois.php
8 years ago
menu_wordfence_central.php
7 years ago
sysinfo.php
8 years ago
unknownFiles.php
8 years ago
viewFullActivityLog.php
8 years ago
wf503.php
7 years ago
wfAPI.php
7 years ago
wfActivityReport.php
7 years ago
wfAdminNoticeQueue.php
8 years ago
wfArray.php
7 years ago
wfBrowscap.php
8 years ago
wfBrowscapCache.php
7 years ago
wfBulkCountries.php
7 years ago
wfCache.php
9 years ago
wfCentralAPI.php
7 years ago
wfConfig.php
7 years ago
wfCrawl.php
8 years ago
wfCredentialsController.php
7 years ago
wfCrypt.php
8 years ago
wfDB.php
7 years ago
wfDashboard.php
7 years ago
wfDateLocalization.php
8 years ago
wfDiagnostic.php
7 years ago
wfDict.php
8 years ago
wfDirectoryIterator.php
8 years ago
wfHelperBin.php
11 years ago
wfHelperString.php
11 years ago
wfIPWhitelist.php
7 years ago
wfImportExportController.php
7 years ago
wfIssues.php
7 years ago
wfJWT.php
7 years ago
wfLockedOut.php
7 years ago
wfLog.php
7 years ago
wfMD5BloomFilter.php
8 years ago
wfNotification.php
8 years ago
wfOnboardingController.php
7 years ago
wfPersistenceController.php
8 years ago
wfRESTAPI.php
7 years ago
wfScan.php
7 years ago
wfScanEngine.php
7 years ago
wfSchema.php
7 years ago
wfStyle.php
8 years ago
wfSupportController.php
7 years ago
wfUnlockMsg.php
7 years ago
wfUpdateCheck.php
8 years ago
wfUtils.php
7 years ago
wfVersionCheckController.php
8 years ago
wfView.php
10 years ago
wfViewResult.php
8 years ago
wordfenceClass.php
7 years ago
wordfenceConstants.php
7 years ago
wordfenceHash.php
7 years ago
wordfenceScanner.php
7 years ago
wordfenceURLHoover.php
7 years ago
menu_firewall_waf_options.php
246 lines
| 1 | <?php |
| 2 | if (!defined('WORDFENCE_VERSION')) { exit; } |
| 3 | $waf = wfWAF::getInstance(); |
| 4 | $d = new wfDashboard(); unset($d->countriesNetwork); |
| 5 | $firewall = new wfFirewall(); |
| 6 | $config = $waf->getStorageEngine(); |
| 7 | $wafURL = wfPage::pageURL(wfPage::PAGE_FIREWALL); |
| 8 | $wafConfigURL = network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options#configureAutoPrepend'); |
| 9 | $wafRemoveURL = network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options#removeAutoPrepend'); |
| 10 | /** @var array $wafData */ |
| 11 | |
| 12 | $backPage = new wfPage(wfPage::PAGE_FIREWALL); |
| 13 | if (isset($_GET['source']) && wfPage::isValidPage($_GET['source'])) { |
| 14 | $backPage = new wfPage($_GET['source']); |
| 15 | } |
| 16 | ?> |
| 17 | <script type="application/javascript"> |
| 18 | (function($) { |
| 19 | WFAD.wafData = <?php echo json_encode($wafData); ?>; |
| 20 | WFAD.restoreWAFData = JSON.parse(JSON.stringify(WFAD.wafData)); //Copied into wafData when canceling changes |
| 21 | |
| 22 | $(function() { |
| 23 | document.title = "<?php esc_attr_e('Firewall Options', 'wordfence'); ?>" + " \u2039 " + WFAD.basePageName; |
| 24 | |
| 25 | WFAD.wafConfigPageRender(); |
| 26 | |
| 27 | //Hash-based option block linking |
| 28 | if (window.location.hash) { |
| 29 | var hashes = WFAD.parseHashes(); |
| 30 | var hash = hashes[hashes.length - 1]; |
| 31 | var block = $('.wf-block[data-persistence-key="' + hash + '"]'); |
| 32 | if (block.length) { |
| 33 | if (!block.hasClass('wf-active')) { |
| 34 | block.find('.wf-block-content').slideDown({ |
| 35 | always: function() { |
| 36 | block.addClass('wf-active'); |
| 37 | $('html, body').animate({ |
| 38 | scrollTop: block.offset().top - 100 |
| 39 | }, 1000); |
| 40 | } |
| 41 | }); |
| 42 | |
| 43 | WFAD.ajax('wordfence_saveDisclosureState', {name: block.data('persistenceKey'), state: true}, function() {}); |
| 44 | } |
| 45 | else { |
| 46 | $('html, body').animate({ |
| 47 | scrollTop: block.offset().top - 100 |
| 48 | }, 1000); |
| 49 | } |
| 50 | |
| 51 | history.replaceState('', document.title, window.location.pathname + window.location.search); |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | var updatePendingCircles = function() { |
| 56 | $('#circle-waf-coverage, #circle-waf-rules, #circle-waf-blacklist, #circle-waf-brute').wfCircularProgress({pendingOverlay: Object.keys(WFAD.pendingChanges).length > 0}); |
| 57 | }; |
| 58 | var coalescingUpdateTimer = false; |
| 59 | |
| 60 | $('.wf-option, .wf-rule-toggle').on('change', function() { |
| 61 | clearTimeout(coalescingUpdateTimer); |
| 62 | coalescingUpdateTimer = setTimeout(updatePendingCircles, 100); |
| 63 | }); |
| 64 | }); |
| 65 | |
| 66 | $(window).on('wfOptionsReset', function() { |
| 67 | WFAD.wafData = JSON.parse(JSON.stringify(WFAD.restoreWAFData)); |
| 68 | WFAD.wafConfigPageRender(); |
| 69 | }); |
| 70 | })(jQuery); |
| 71 | </script> |
| 72 | <div class="wf-options-controls"> |
| 73 | <div class="wf-row"> |
| 74 | <div class="wf-col-xs-12"> |
| 75 | <?php |
| 76 | echo wfView::create('options/block-controls', array( |
| 77 | 'backLink' => $backPage->url(), |
| 78 | 'backLabelHTML' => sprintf(__('<span class="wf-hidden-xs">Back to </span>%s', 'wordfence'), $backPage->label()), |
| 79 | 'restoreDefaultsSection' => wfConfig::OPTIONS_TYPE_FIREWALL, |
| 80 | 'restoreDefaultsMessage' => __('Are you sure you want to restore the default Firewall settings? This will undo any custom changes you have made to the options on this page. If you have manually disabled any rules or added any custom whitelisted URLs, those changes will not be overwritten.', 'wordfence'), |
| 81 | ))->render(); |
| 82 | ?> |
| 83 | </div> |
| 84 | </div> |
| 85 | </div> |
| 86 | <div class="wf-options-controls-spacer"></div> |
| 87 | <?php |
| 88 | if (wfOnboardingController::shouldShowAttempt3()) { |
| 89 | echo wfView::create('onboarding/disabled-overlay')->render(); |
| 90 | echo wfView::create('onboarding/banner')->render(); |
| 91 | } |
| 92 | else if (wfConfig::get('touppPromptNeeded')) { |
| 93 | echo wfView::create('gdpr/disabled-overlay')->render(); |
| 94 | echo wfView::create('gdpr/banner')->render(); |
| 95 | } |
| 96 | ?> |
| 97 | <div class="wrap wordfence"> |
| 98 | <div class="wf-container-fluid"> |
| 99 | <?php |
| 100 | if (function_exists('network_admin_url') && is_multisite()) { |
| 101 | $firewallURL = network_admin_url('admin.php?page=WordfenceWAF#top#waf'); |
| 102 | $blockingURL = network_admin_url('admin.php?page=WordfenceWAF#top#blocking'); |
| 103 | } |
| 104 | else { |
| 105 | $firewallURL = admin_url('admin.php?page=WordfenceWAF#top#waf'); |
| 106 | $blockingURL = admin_url('admin.php?page=WordfenceWAF#top#blocking'); |
| 107 | } |
| 108 | ?> |
| 109 | <div class="wf-row"> |
| 110 | <div class="wf-col-xs-12"> |
| 111 | <div class="wp-header-end"></div> |
| 112 | <?php if (isset($storageExceptionMessage)): ?> |
| 113 | <div class="notice notice-error"><p><?php echo $storageExceptionMessage; ?></p></div> |
| 114 | <?php endif; ?> |
| 115 | </div> |
| 116 | </div> |
| 117 | <div class="wf-row"> |
| 118 | <div class="<?php echo wfStyle::contentClasses(); ?>"> |
| 119 | <div id="waf-options" class="wf-fixed-tab-content"> |
| 120 | <?php |
| 121 | echo wfView::create('common/section-title', array( |
| 122 | 'title' => __('Firewall Options', 'wordfence'), |
| 123 | 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF), |
| 124 | 'helpLabelHTML' => __('Learn more<span class="wf-hidden-xs"> about the Firewall</span>', 'wordfence'), |
| 125 | 'showIcon' => true, |
| 126 | ))->render(); |
| 127 | ?> |
| 128 | <div class="wf-row"> |
| 129 | <div class="wf-col-xs-12"> |
| 130 | <div class="wf-block wf-active"> |
| 131 | <div class="wf-block-content"> |
| 132 | <ul class="wf-block-list wf-block-list-horizontal wf-block-list-nowrap wf-waf-coverage"> |
| 133 | <li> |
| 134 | <?php |
| 135 | if (function_exists('network_admin_url') && is_multisite()) { $optionsURL = network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options'); } |
| 136 | else { $optionsURL = admin_url('admin.php?page=WordfenceWAF&subpage=waf_options'); } |
| 137 | echo wfView::create('common/status-detail', array( |
| 138 | 'id' => 'waf-coverage', |
| 139 | 'percentage' => $firewall->wafStatus(), |
| 140 | 'activeColor' => ($firewall->firewallMode() == wfFirewall::FIREWALL_MODE_LEARNING ? '#ececec' : null /* automatic */), |
| 141 | 'title' => __('Web Application Firewall', 'wordfence'), |
| 142 | 'subtitle' => ($firewall->firewallMode() == wfFirewall::FIREWALL_MODE_LEARNING ? __('Currently in Learning Mode', 'wordfence') : __('Stops Complex Attacks', 'wordfence')), |
| 143 | 'link' => $optionsURL, |
| 144 | 'linkLabel' => null, |
| 145 | 'statusTitle' => __('Web Application Firewall Status', 'wordfence'), |
| 146 | 'statusList' => $firewall->wafStatusList(), |
| 147 | 'statusExtra' => ($firewall->firewallMode() == wfFirewall::FIREWALL_MODE_LEARNING ? wfView::create('waf/status-tooltip-learning-mode')->render() : ''), |
| 148 | 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_STATUS_OVERALL), |
| 149 | ))->render(); |
| 150 | ?> |
| 151 | </li> |
| 152 | <li> |
| 153 | <?php |
| 154 | echo wfView::create('common/status-detail', array( |
| 155 | 'id' => 'waf-rules', |
| 156 | 'percentage' => $firewall->ruleStatus(), |
| 157 | 'activeColor' => ($firewall->firewallMode() == wfFirewall::FIREWALL_MODE_LEARNING ? '#ececec' : null /* automatic */), |
| 158 | 'title' => __('Firewall Rules: ', 'wordfence') . ($firewall->ruleMode() == wfFirewall::RULE_MODE_PREMIUM ? __('Premium', 'wordfence') : __('Community', 'wordfence')), |
| 159 | 'subtitle' => ($firewall->firewallMode() == wfFirewall::FIREWALL_MODE_LEARNING ? __('Currently in Learning Mode', 'wordfence') : ($firewall->ruleMode() == wfFirewall::RULE_MODE_PREMIUM ? __('Rules updated in real-time', 'wordfence') : __('Rule updates delayed by 30 days', 'wordfence'))), |
| 160 | 'link' => 'https://www.wordfence.com/gnl1wafUpgrade/wordfence-signup/', |
| 161 | 'linkLabel' => null, |
| 162 | 'linkNewWindow' => true, |
| 163 | 'statusTitle' => __('Firewall Rules Status', 'wordfence'), |
| 164 | 'statusList' => $firewall->wafStatusList('rules'), |
| 165 | 'statusExtra' => ($firewall->firewallMode() == wfFirewall::FIREWALL_MODE_LEARNING ? wfView::create('waf/status-tooltip-learning-mode')->render() : ''), |
| 166 | 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_STATUS_RULES), |
| 167 | ))->render(); |
| 168 | ?> |
| 169 | </li> |
| 170 | <li> |
| 171 | <?php |
| 172 | echo wfView::create('common/status-detail', array( |
| 173 | 'id' => 'waf-blacklist', |
| 174 | 'percentage' => $firewall->blacklistStatus(), |
| 175 | 'title' => __('Real-Time IP Blacklist: ', 'wordfence') . ($firewall->blacklistMode() == wfFirewall::BLACKLIST_MODE_ENABLED ? __('Enabled', 'wordfence') : __('Disabled', 'wordfence')), |
| 176 | 'subtitle' => __('Blocks requests from known malicious IPs', 'wordfence'), |
| 177 | 'link' => (($firewall->ruleMode() == wfFirewall::RULE_MODE_PREMIUM && $firewall->blacklistMode() == wfFirewall::BLACKLIST_MODE_DISABLED) ? network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options#waf-options-advanced') : 'https://www.wordfence.com/gnl1wafUpgrade/wordfence-signup/'), |
| 178 | 'linkLabel' => null, |
| 179 | 'linkNewWindow' => !($firewall->ruleMode() == wfFirewall::RULE_MODE_PREMIUM && $firewall->blacklistMode() == wfFirewall::BLACKLIST_MODE_DISABLED), |
| 180 | 'statusTitle' => __('Blacklist Status', 'wordfence'), |
| 181 | 'statusList' => $firewall->wafStatusList('blacklist'), |
| 182 | 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_STATUS_BLACKLIST), |
| 183 | ))->render(); |
| 184 | ?> |
| 185 | </li> |
| 186 | <li> |
| 187 | <?php |
| 188 | echo wfView::create('common/status-detail', array( |
| 189 | 'id' => 'waf-brute', |
| 190 | 'percentage' => $firewall->bruteForceStatus(), |
| 191 | 'title' => __('Brute Force Protection', 'wordfence') . ($firewall->bruteForceStatus() == 0 ? __(': Disabled', 'wordfence') : ''), |
| 192 | 'subtitle' => __('Stops Password Guessing Attacks', 'wordfence'), |
| 193 | 'link' => network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options#waf-options-bruteforce'), |
| 194 | 'linkLabel' => null, |
| 195 | 'statusTitle' => __('Brute Force Protection Status', 'wordfence'), |
| 196 | 'statusList' => $firewall->bruteForceStatusList(), |
| 197 | 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_WAF_STATUS_BRUTE_FORCE), |
| 198 | ))->render(); |
| 199 | ?> |
| 200 | </li> |
| 201 | </ul> |
| 202 | </div> |
| 203 | </div> |
| 204 | </div> |
| 205 | </div> |
| 206 | <?php |
| 207 | echo wfView::create('waf/options-group-basic-firewall', array( |
| 208 | 'firewall' => $firewall, |
| 209 | 'waf' => $waf, |
| 210 | 'stateKey' => 'waf-options-basic', |
| 211 | 'collapseable' => false, |
| 212 | ))->render(); |
| 213 | ?> |
| 214 | <?php |
| 215 | echo wfView::create('waf/options-group-advanced-firewall', array( |
| 216 | 'firewall' => $firewall, |
| 217 | 'waf' => $waf, |
| 218 | 'stateKey' => 'waf-options-advanced', |
| 219 | ))->render(); |
| 220 | ?> |
| 221 | <?php |
| 222 | echo wfView::create('waf/options-group-brute-force', array( |
| 223 | 'firewall' => $firewall, |
| 224 | 'waf' => $waf, |
| 225 | 'stateKey' => 'waf-options-bruteforce', |
| 226 | ))->render(); |
| 227 | ?> |
| 228 | <?php |
| 229 | echo wfView::create('waf/options-group-rate-limiting', array( |
| 230 | 'firewall' => $firewall, |
| 231 | 'waf' => $waf, |
| 232 | 'stateKey' => 'waf-options-ratelimiting', |
| 233 | ))->render(); |
| 234 | ?> |
| 235 | <?php |
| 236 | echo wfView::create('waf/options-group-whitelisted', array( |
| 237 | 'firewall' => $firewall, |
| 238 | 'waf' => $waf, |
| 239 | 'stateKey' => 'waf-options-whitelisted', |
| 240 | ))->render(); |
| 241 | ?> |
| 242 | </div> <!-- end waf options block --> |
| 243 | </div> <!-- end content block --> |
| 244 | </div> <!-- end row --> |
| 245 | </div> <!-- end container --> |
| 246 | </div> |