RepositoryPHPRSSerbia
igorhrcek

igorhrcek/wp-cli-secure-command

Secure package for WP CLI, built to provide an easier way of securing your WordPress installation

95sao
9fork
1issue
0lượt xem

🔐 wp-cli-secure-command — Bảo vệ WordPress chỉ bằng một vài lệnh WP-CLI

Một gói WP-CLI duy nhất, quản lý mọi khía cạnh bảo mật phổ thông của WordPress — từ header bảo mật tới phân quyền file — hỗ trợ cả Apache/LiteSpeed và nginx.

wp-cli-secure-command là một package WP-CLI giúp bạn triển khai (hoặc gỡ bỏ) các quy tắc bảo mật phổ biến lên website WordPress một cách nhanh chóng và nhất quán. Thay vì phải thủ công sửa .htaccess hoặc nginx.conf, bạn chỉ cần chạy một lệnh và mọi quy tắc đều được áp dụng tự động, phù hợp cho cả môi trường Apache/LiteSpeed và nginx.

✨ Điểm nổi bật

  • Triển khai toàn bộ quy tắc bảo mật: wp secure all áp dụng mọi quy tắc cùng lúc, wp secure flush gỡ bỏ toàn bộ.
  • Thêm Security Headers: tự động chèn HSTS, Referrer-Policy, X-Content-Type-Options và X-Frame-Options.
  • Chặn truy cập file/thư mục nhạy cảm: bao gồm readme.txt, xmlrpc.php, wp-config.php, .git, v.v. — có hỗ trợ block tùy chỉnh qua --files và --directories.
  • Chặn quét thông tin tác giả: ngăn chặn kỹ thuật brute-force dựa trên việc liệt kê username.
  • Vô hiệu hóa thực thi PHP: ngăn chặn thực thi trực tiếp file .php trong wp-content/plugins, uploads, themes, wp-includes.
  • Vô hiệu hóa trình soạn thảo file WordPress: ngăn chặn chỉnh sửa file qua giao diện web.
  • Kiểm tra và sửa phân quyền: tự động đặt 0644 cho file và 0755 cho thư mục theo chuẩn WordPress.
  • Quét toàn vẹn file: so sánh checksum MD5 từ WordPress.org để phát hiện file bị thay đổi hoặc chèn mã độc.

💡 Vì sao đáng chú ý

Thay vì phụ thuộc vào plugin bảo mật nặng nề hoặc cấu hình thủ công rắp rối, wp-cli-secure-command mang lại cách tiếp cận tối giản: mọi bảo vệ đều qua lệnh WP-CLI, dễ tích hợp vào pipeline triển khai (CI/CD). Đặc biệt hữu ích cho DevOps hoặc quản trị viên WordPress muốn nhanh chóng “chạm bản vá” bảo mật sau khi cài đặt hoặc triển khai.


#WordPress #Security #Hardening #WP-CLI #OpenSource #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

Repository
imthenachoman/How-To-Secure-A-Linux-Server

An evolving how-to guide for securing a Linux server.

32.1k
Sep 7, 2026
RepositoryPHP
wp-cli/wp-cli

⚙️ WP-CLI framework

5.2k
Nov 25, 2026
RepositoryPHP
cytopia/devilbox

A modern Docker LAMP stack and MEAN stack for local development

4.5k
Apr 19, 2024
RepositoryPHP
wp-cli/profile-command

Quickly identify what's slow with WordPress

295
Nov 23, 2026
RepositoryPHP
typisttech/image-optimize-command

Easily optimize images using WP CLI

173
Nov 3, 2026
RepositoryPHP
wp-cli/restful

Unlocking the potential of the WP REST API at the command line

155
Nov 24, 2026
RepositoryPHP
wp-cli/entity-command

Manage WordPress comments, menus, options, posts, sites, terms, and users.

105
Nov 26, 2026
RepositoryPHP
nlemoine/wp-cli-fixtures

Easily generate custom fake data for WordPress using YAML and WP-CLI

102
Aug 29, 2025
RepositoryPHP
wp-cli/db-command

Performs basic database operations using credentials stored in wp-config.php.

76
Nov 9, 2026