Repository navigation
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
|
Closing this for now. It changes the schema of the shared |
Part of JETPACK-2882
Proposed changes
jetpack_waf_blocklogtable gets three nullable columns:method,request_uri(up to 2048 bytes) anduser_agent(up to 512 bytes). The IP address is not stored.admin_init(Waf_Blocklog_Manager::maybe_upgrade_blocklog_table(), tracked byjetpack_waf_blocklog_schema_version), only while the firewall is on.Waf_Blocklog_Manager::get_recent_blocks()returnsmethod,urianduserAgent(null for older rows).METHOD /uriand the user agent under its label. Rows logged before the upgrade look as they did.Related product discussion/links
Does this pull request change what data or activity we track or use?
The firewall now keeps the method, URL and user agent of blocked requests in the site's own database, alongside the rule and reason it already kept. It's capped at the same 100 rows and isn't sent anywhere. The "Share data with Jetpack" log file already contained these fields; nothing about what's shared changes.
Testing instructions
wp db query "DESCRIBE wp_jetpack_waf_blocklog"now listsmethod,request_urianduser_agent, andwp option get jetpack_waf_blocklog_schema_versionis2.GET /?jetpack_waf_test=…and your browser's user agent. Rows from before the upgrade show only the label and time.wp db query "ALTER TABLE wp_jetpack_waf_blocklog DROP COLUMN method, DROP COLUMN request_uri, DROP COLUMN user_agent"andwp option update jetpack_waf_blocklog_schema_version 1. Without visiting wp-admin, add your IP to the block list (wp option update jetpack_waf_ip_block_list <ip>) and request the home page: it's still a 403, a row is still logged, and there are no PHP errors. Then visit wp-admin and the columns come back.