Skip to content

Gratis Security

Overview

Gratis Security (version 2.0.0, requires WordPress 6.4+ and PHP 8.1+) is a seven-tab WordPress hardening, monitoring, and firewall suite under Settings → Gratis Security. Operational logs, baselines, threat signatures, IP rules, and quarantined files are stored as JSON and JSONL files inside wp-content/uploads/gratis-security/ (protected with .htaccess deny rules and an index.php guard) and parsed with the simdjson extension when available, keeping MySQL free of log-table overhead. Only plugin settings (gratis_security_settings), login lockout transients, the FIM alert transient, 2FA login nonces, and per-user 2FA meta live in the WordPress database.

Admin UI language note: The admin tab labels and dashboard copy currently render in Lithuanian, while option keys, audit check labels, server diagnostics, and WP-CLI commands are in English. Both the Lithuanian tab names and their English meanings are listed below.

Opening the dashboard

  1. In the WordPress admin sidebar, hover Settings and click Gratis Security (/wp-admin/options-general.php?page=gratis-security).
  2. Until you run the 1-click setup wizard, the plugin opens on Vedlys ir apžvalga (&tab=wizard). Once completed, it opens on Failų stebėjimas (FIM) (&tab=fim).
  3. Switch between the seven tabs via the top navigation bar (wizard, fim, malware, requests, feeds, server, general; legacy &tab=blocks redirects to requests).
Gratis Security Setup Wizard and Security Overview tab
Gratis Security Setup Wizard and Security Overview tab (tab=wizard)

Setup Wizard & Security Audit (wizard)

The Vedlys ir apžvalga tab scores your site from 0 to 100 (Grades A–F) across 14 weighted checks and inspects PHP capabilities (simdjson, inotify, openssl, curl, posix, fileinfo, ClamAV availability, writable storage, and DISABLE_WP_CRON):

  • 14 Posture Checks: PHP runtime version (8.2+ pass, 8.1 warn), DISALLOW_FILE_EDIT / DISALLOW_FILE_MODS, suppressed WP_DEBUG_DISPLAY and display_errors, hardened storage directory, HTTP security headers, XML-RPC blocking, login brute-force protection, WAF mode, FIM status, signature feed freshness (within 7 days), last malware scan status, TOTP 2FA enforcement, wp-config.php permissions (0640/0600), and absence of admin or root administrator usernames.
  • 1-Click PHP Auto-Configuration (no SSH): Creates hardened storage and fim-events.jsonl, applies safe PHP defaults (choosing monitor or block WAF mode), syncs built-in signatures and WordPress.org Core checksums, schedules all four WP-Cron jobs, purges manifest-verified false-positive FIM detections, and runs initial FIM and malware scans.
  • Optional OS-Level Hardening (Step 4): Collapsible commands for Linux auditd syscall rules, a systemd gratis-fim.service (inotifywait) unit, /etc/cron.d/gratis-security, and AIDE, selectable for either the PHP runtime user or root.

File Integrity Monitoring (fim)

The Failų stebėjimas (FIM) tab runs in Server-Assisted mode when SOURCE-MANIFEST.sha256 (and optionally COMPOSER-MANIFEST.sha256) is present at the project root, or Autonomous PHP mode on standard hosting.

Gratis Security File Integrity Monitoring tab
File Integrity Monitoring tab (tab=fim)
  • Core & WordPress.org Plugin Checksums: Verifies core files against official MD5 checksums from api.wordpress.org and WordPress.org plugins against downloads.wordpress.org.
  • Local SHA-256 Baseline: Hashes .php, .js, .css, .json, .yml, .yaml, and .htaccess files in mu-plugins, plugins, themes, packages/plugins, and config into fim-baseline.json. Auto-builds on the first scan if missing; click Atnaujinti bazinę liniją (Baseline) after deliberate updates.
  • Uploads Executable Guard: Flags rogue .php, .phtml, .phar, .cgi, .pl, .py, and double-extension .php. files inside wp-content/uploads/.
  • Diff Viewer & Filters: Filter results by path, component (core, mu-plugins, plugins, themes, vendor, config), or status (modified, missing, untracked). The Diff / Krizė modal compares against local Git, WordPress Core SVN, WordPress.org Plugin SVN, or shows file metadata, SHA-256, and suspicious pattern hits.
  • Scheduling & Alerts: Scheduled hourly by the setup wizard (gratis_security_fim_cron_scan) and sends admin email alerts when notify_email_on_fim is enabled (default on).

Malware Scanner & Quarantine (malware)

The Kenkėjiškas kodas tab scans wp-content across php, phtml, phar, pht, php5, php7, inc, js, htaccess, shtml, cgi, and sh files up to 1.5 MB each.

Gratis Security Malware Scanner and Quarantine tab
Malware Scanner, Quarantine Vault, and Whitelist tab (tab=malware)
  • Quick vs. Deep Scan: Quick Scan (Greita patikra) skips files verified by SOURCE-MANIFEST.sha256 or the SHA-256 whitelist; Deep Scan (Gili patikra) inspects every matching file.
  • Detection Layers: Uploads executable policy, known bad SHA-256 hashes, 43 built-in malware regex rules (obfuscated eval/assert/create_function, webshells such as FilesMan/WSO/c99/r57/b374k/IndoXploit/Alfa-Team/mini_shell/LeafMailer, GIF/PNG/JPEG polyglots, .htaccess backdoors, remote includes, JS droppers/skimmers, and hidden admin creation), plus optional local ClamAV (clamdscan/clamscan).
  • Quarantine Vault & SHA-256 Whitelist: Moves suspicious files into uploads/gratis-security/quarantine/*.quarantine (chmod 0600) with Restore and Delete actions, or exempts verified files by SHA-256 (auto-invalidates if the file changes).
  • Daily Cron & Alerts: Runs daily via gratis_security_malware_cron_scan (default on) and emails the site admin on critical/high findings when notify_email_on_malware is enabled (default on).

Web Application Firewall & IP Rules (requests)

The Užklausos ir WAF tab inspects incoming requests at init priority -9999 and tracks 404 probe floods on template_redirect. WP-CLI, wp-admin, WP-Cron, autosaves, and logged-in users with edit_posts are exempted to prevent Gutenberg or page-builder false positives.

Gratis Security Malicious Requests and WAF tab
Malicious Requests, WAF mode, and IP rules tab (tab=requests)
  • WAF Modes (waf_mode): monitor (default, logs matches without blocking visitors), block (returns HTTP 403 and logs), or off.
  • 29 Built-In Request Rules: Detects SQLi, XSS, path traversal / LFI (php://filter, /etc/passwd, /proc/self/environ), RCE, serialized PHP object injection, sensitive file probes (wp-config.php, .env, .git, phpMyAdmin, Adminer, phpinfo.php), and scanner user-agents (sqlmap, nikto, nuclei, wpscan, etc.).
  • Block XML-RPC (block_xmlrpc): Enabled by default; rejects /xmlrpc.php with HTTP 403 unless disabled.
  • 404 Probe Flood & Auto-Ban: Tracks 404 hits on probe paths (.php, .env, .sql, .bak, .zip, .tar, wp-login, admin, config, .git); 20 hits in 60 seconds triggers a 404_flood event. When auto_ban_enabled is on (default), IPs exceeding auto_ban_threshold (default 5) high/critical strikes in 15 minutes are temporarily banned for auto_ban_minutes (default 60).
  • IP Allowlist, Blocklist & Log: Supports IPv4, IPv6, and CIDR rules. Allowlist entries override blocklists, auto-bans, and WAF rules. Stores up to 2,000 events in malicious-requests.jsonl and fires gratis_security_malicious_request and gratis_security_blocked actions.

Threat Intelligence & Signature Feeds (feeds)

The Parašų atnaujinimai tab merges the built-in signature bundle (version 2026.11.23: 43 malware rules, 29 request rules, 3 bad SHA-256 hashes) with official WordPress.org Core checksums and optional external HTTPS feeds into signatures.json and ip-feed-blocklist.json.

Gratis Security Signature Feeds tab
Threat Intelligence and Signature Feeds tab (tab=feeds)
  • Custom JSON Signature Feed URL: Optional https:// endpoint returning malware_rules, request_rules, bad_hashes, and blocked_ips, authenticated via optional Bearer / X-API-Key token. Remote regexes undergo ReDoS safety validation before merging.
  • External IP Blocklist URL: Optional https:// newline-delimited IPv4/IPv6/CIDR feed (up to 10,000 entries).
  • Daily Sync: Runs automatically via WP-Cron (signature_auto_update, default on) alongside WordPress.org Core checksum caching (sync_wp_checksums, default on).

Server Diagnostics & Event Log Trail (server)

The Serveris ir žurnalai tab inspects the host environment (OS, architecture, init system, PHP user:group, SELinux mode, running inotifywait processes, and installed security binaries) and provides two paginated audit views.

Gratis Security Server Diagnostics and Event Logs tab
Server Diagnostics, Stored Detections, and Event Log Trail tab (tab=server)
  • Stored Detections (fim-detections.jsonl): Up to 2,000 persistent filesystem incident records with open, acknowledged, and resolved workflow statuses, bulk acknowledge, manifest-verified false-positive purge, and resolved cleanup.
  • Live Event Log Trail: Tails fim-events.jsonl and /var/log/audit/audit.log incrementally by inode/offset every 5 minutes via WP-Cron (gratis_security_fim_trail_cron) or on demand, with a 10-second auto-refresh toggle.

General Settings, Headers, Login Protection & 2FA (general)

The Nustatymai tab exposes all core toggles and thresholds in one form.

Gratis Security General Settings tab
General Settings tab (tab=general)

Security Response Headers

Strips X-Powered-By on all WordPress responses (frontend and admin). When Saugumo antraštės (headers_enabled, default on) is enabled, frontend responses emit X-Frame-Options: SAMEORIGIN, X-Content-Type-Options: nosniff, Referrer-Policy: strict-origin-when-cross-origin, X-XSS-Protection: 1; mode=block, Permissions-Policy: geolocation=(), microphone=(), camera=(), an optional Content-Security-Policy (blank by default), and Strict-Transport-Security: max-age=31536000; includeSubDomains when HTTPS is active. Filterable via gratis_security_headers.

Login Brute-Force Protection

Enabled by default (login_protection). Tracks failed attempts per IP (REMOTE_ADDR) in transients (default 5 attempts, 15-minute lockout), clears the counter on successful login, and records login_failed / login_lockout events in malicious-requests.jsonl.

Two-Factor Authentication (TOTP)

Disabled by default (twofa_enabled = 0). Once enabled, administrators (manage_options) can self-enroll or disable TOTP from Users → Profile using any standard authenticator app (Google Authenticator, Aegis, 1Password), or provision secrets via WP-CLI. Enforcement interrupts interactive wp-login.php logins only for administrators who have a confirmed secret (admins without a secret are never locked out; XML-RPC, REST API, and Application Passwords are excluded).

Two-Factor Authentication enrollment section on WordPress User Profile
Per-user TOTP enrollment on Users → Profile

WP-CLI Reference

# Setup wizard diagnostics and 1-click PHP auto-configuration
wp gratis-security wizard [--auto] [--waf-mode=monitor|block] [--no-scans] [--user=php|root] [--format=table|json]
wp gratis-security audit [--format=table|json]

# File integrity monitoring and live event trailing
wp gratis-security fim status|scan|baseline|instructions|wizard|trail|detections|logs|purge-verified
wp gratis-security fim diff wp-content/plugins/example/file.php

# Malware scanning and quarantine management
wp gratis-security scan [--dir=<path>] [--deep] [--clamav] [--format=table|json]
wp gratis-security quarantine list|add <path>|restore <id>|delete <id>

# WAF logs, IP allow/block rules, and auto-bans
wp gratis-security requests list|clear|bans [--category=<cat>] [--severity=<sev>] [--action=blocked|logged] [--since=1h|24h|7d|all]
wp gratis-security requests block-ip|unblock-ip|allow-ip|unban <ip-or-cidr> [--note="reason"]
wp gratis-security blocks

# Threat signature feeds and TOTP 2FA management
wp gratis-security signatures status|update
wp gratis-security 2fa set|reset|disable <user-id-or-login>

Recommended Starting Point

  • Open Settings → Gratis Security and run Automatiškai sukonfigūruoti viską per PHP on the Wizard tab (keep monitor mode first if you want to review traffic before blocking).
  • Inspect Užklausos ir WAF for false positives, then switch waf_mode to block under Nustatymai (or run wp gratis-security wizard --auto --waf-mode=block).
  • Have each administrator enroll TOTP on Users → Profile, then enable twofa_enabled.
  • Set a Content-Security-Policy only after testing it against your active theme and plugins.
  • On Linux VPS/dedicated servers, optionally apply the auditd and gratis-fim.service commands from Step 4 of the Wizard for real-time kernel-level file monitoring.

On this page