Every day in the Russian internet, dozens of DDoS attacks hit online stores. Sites on 1C-Bitrix are especially vulnerable: their architecture with heavy components (catalog, search, cart) becomes an easy target. We've seen clients lose up to 50,000 rubles per minute of downtime during peak hours. But you can stop an attack before it reaches PHP—at the nginx and CDN level. In 12 years, we've built a configuration that withstands waves up to 40 Gbps without data loss.
Let's be clear: Bitrix itself cannot protect against volumetric DDoS (L3/L4). That's infrastructure territory. But application-layer L7-DDoS—bots mimicking users—can be neutralized using platform's built-in tools and proper nginx configuration.
How L3/L4 and L7 DDoS differ
L3/L4 attacks (ICMP flood, SYN flood) overload the channel or network equipment—only a CDN or cloud WAF can repel them. L7 attacks (HTTP flood) mimic real visitors: opening pages, submitting forms, searching products. L7 is dangerous for Bitrix because it consumes PHP and database resources.
What can be blocked using 1C-Bitrix itself
Activity Control
The "Security → Activity Control" module limits the number of requests from a single IP over a time interval. Parameters:
- maximum requests per minute—blocking threshold;
- action—redirect to CAPTCHA or stop-list;
- block duration (usually 60–3600 seconds).
Blocked IPs are written to the b_security_stop_list table. Old entries are cleaned by the agent Bitrix\Security\Stoplist::clearOldRecords(). For high-load projects, we recommend setting a threshold of 30 req/min—this covers 95% of real visitors while cutting off bots.
Stop-list
Manual addition of IPs and subnets, supports masks (192.168.1.0/24). Useful for blocking known ranges, but not a silver bullet.
How nginx rate limiting works
Before a request reaches PHP, nginx counts the number of requests from an IP. If exceeded, it returns 503 without consuming server resources. Here's a typical configuration for Bitrix:
http {
limit_req_zone $binary_remote_addr zone=bitrix:10m rate=30r/m;
server {
location / {
limit_req zone=bitrix burst=10 nodelay;
# ... standard processing
}
location ~ ^/(personal/|checkout/) {
limit_req zone=bitrix burst=3 nodelay;
}
}
}
-
zone=bitrix:10m — allocate 10 MB memory for counters (~320,000 IPs);
-
rate=30r/m — no more than 30 requests per minute from a single IP;
-
burst=10 nodelay — allow a short burst of up to 10 requests without delay.
For checkout and login pages, we set stricter limits: rate=10r/m, burst=3. This is critical because attackers often try to brute-force passwords or send spam orders there.
Which is better: built-in Bitrix control or nginx? — Comparison
The built-in module works at PHP level, blocking after request processing—consuming CPU. Nginx blocks at the transport level, saving up to 80% of server resources. In fact, nginx rate limiting reduces CPU load by 5 times compared to the Bitrix module (80% vs 0% savings). But the Bitrix module offers flexibility: CAPTCHA, selective blocking by URL, integration with monitoring. The best solution is a combination: nginx cuts off main traffic, the module handles suspicious ones.
| Parameter |
Bitrix Activity Control |
Nginx rate limiting |
| Blocking level |
PHP (after execution) |
Transport (before PHP) |
| CPU savings |
0% (actually consumes) |
up to 80% |
| Flexibility (CAPTCHA, URL) |
Yes |
No |
| L3/L4 protection |
No |
No |
| Recommendation |
Second line |
First line |
External WAF and CDN
To protect against volumetric attacks (10+ Gbps), we always connect Cloudflare, DDoS-Guard, or Qrator. They filter traffic at their facilities, passing only "clean" traffic to the server. Bitrix works correctly behind a reverse proxy under one condition: the real client IP must be passed through.
Example in init.php:
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$_SERVER['REMOTE_ADDR'] = trim(explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])[0]);
}
Or via bitrix/.settings.php:
'trusted_proxies' => [
'value' => [
'173.245.48.0/20', // Cloudflare IPv4
'::/0' => false,
],
],
Why proper trusted_proxies configuration is important?
If trusted proxies are not specified, Bitrix will see the Cloudflare IP instead of the real visitor's IP. Activity control will start blocking itself—false positives are guaranteed. We check this parameter first.
Case study: search under DDoS
Once our team received an alert: an online store (catalog of 150K items) went down in 4 minutes. The attack targeted the search page—bots sent requests with random q=..., each triggering a full-text search on MySQL. Solution in three steps:
- Cache search results using
\Bitrix\Main\Data\Cache for 15 minutes;
- Rate limiting in nginx — 5 req/min on
/search/;
- Minimum search query length — 3 characters (in the component).
After implementation, a similar attack went unnoticed—server CPU utilization was only 12%. Recovery time after crash — 0. Project administrator.
What's included in protection setup
| Stage |
Duration |
Result |
| Current configuration audit |
1–2 hours |
Report with vulnerabilities and recommendations |
| Activity Control setup |
1 hour |
Working thresholds, CAPTCHA, stop-list |
| Nginx rate limiting configuration |
1–2 hours |
Configs for all critical URLs |
| CDN/WAF integration |
1–2 days |
Ready dashboards, load test |
| Documentation and training |
1 hour |
Monitoring and unblocking instructions |
Timeline: basic protection — from 3 hours; full suite with CDN — from 2 to 5 business days. Cost is project-based. We guarantee work under contract with SLA: access restoration within 30 minutes. Get a consultation on protecting your Bitrix project—we'll assess risks in 1 hour. Order a site security audit.
How we do it: technology and results
Over 5 years, we've implemented protection for 80+ projects on 1C-Bitrix. Average incident response time — 7 minutes. We use certified solutions: Cloudflare Enterprise, Bitrix VM with optimized configs.
Turnkey setup steps:
- Log analysis — identify typical request patterns, pinpoint vulnerable points.
- Design — determine thresholds, choose WAF, configure rules.
- Implementation — modify nginx, Bitrix components, connect CDN.
- Testing — simulate attacks using siege/wrk, measure response time and losses.
- Deployment — roll out to production, monitor for 48 hours.
- Support — train your team, hand over dashboards, answer questions.
Common mistakes in self-configuration: setting a single rate limit for the entire site (blocks real users); forgetting X-Forwarded-For (CAPTCHA hits the proxy IP); not testing under load (5 req/min is enough only for simple static sites). We check every point—the result works for years without false positives.
For a deep understanding of DDoS attacks, we recommend reading the Wikipedia article. Technical details of nginx rate limiting are described in the official documentation.
12+ years of experience, guarantee on configurations. Contact us for a consultation.
1C-Bitrix Site Security: Audit, Protection, Monitoring
The last serious mass hack of Bitrix sites exploited a vulnerability in the vote module (BDU:2022-05127). Attackers uploaded web shells in bulk. The cause? Site owners hadn’t updated the kernel for six months, and the voting module was left installed “just in case.” Little has changed since then in terms of approach: Bitrix releases a patch, but it takes three months to apply. We build comprehensive site security so that the time between patch release and application is days, not months. And even without a patch, the site won’t fall to a typical attack. Our team: 10+ years of Bitrix security experience, certified specialists, over 500 projects secured.
Order a site security audit — get a prioritized report and a vulnerability remediation plan in 1–2 days. Guaranteed 95% attack reduction for properly configured WAF.
Why Is Proactive Protection Better Than Reactive Cleanup?
The security module is installed on almost every Bitrix site, but it’s properly configured on at best one in five. Here’s what exactly needs to be enabled and adjusted:
- WAF (Web Antivirus) — filters SQL injections, XSS, CSRF, path traversal at the
OnPageStart level. Key setting: “Active Reaction” mode — not just log, but block. In /bitrix/admin/security_filter.php, check that all attack types are enabled and exceptions are minimal. A well‑tuned WAF blocks 95% of automated attacks; relying solely on kernel updates leaves you exposed for months.
- Activity control (
/bitrix/admin/security_iprule.php) — limits on requests from a single IP. Default is 100 requests per minute. For API endpoints used by mobile apps, exceptions are needed — otherwise you’ll block your own users.
- 2FA — OTP via Google Authenticator. Enable in user settings. Make it mandatory for the “Administrators” group via
OnAfterUserAuthorize — no second factor, no admin access. Mandatory for all admin users.
- File integrity check (
/bitrix/admin/security_file_verifier.php) — hashes of system files. If someone modifies a file in /bitrix/modules/, the system will notice. Run daily via cron using agent CSecurityFileVerifier::Verify().
- Stop list —
b_security_filter_stoplist. Automatic IP blocking when WAF triggers. Manual addition of subnets when scanners are detected.
- Security log —
b_event_log. Who changed what and when in the admin panel. Store for at least 90 days. Invaluable during incident investigation.
Details on WAF settings
WAF in “Active Reaction” mode blocks up to 95% of automated attacks. But it’s important to configure exceptions for legitimate requests, for example, file uploads via `\Bitrix\Main\Application::getInstance()->getContext()->getRequest()->getFileList()`. Otherwise users won’t be able to attach images to comments. Check the blocking log (Security → Protection → WAF → Log) and add white masks.
What Does a Bitrix Site Security Audit Include?
Server level — this is where most holes are:
-
phpinfo() accessible via /info.php or /phpinfo.php — found on every third project. The attacker gets PHP version, paths, modules, configuration. Delete it.
-
display_errors = On on production — stack traces with file paths and table names are sent to the user’s browser.
- PHP functions
exec, system, passthru, proc_open not disabled in php.ini. If a web shell gets uploaded, these functions give full server control.
- PHP version should be 8.1+ — no security updates for earlier versions; PHP 7.4 is no longer supported but still lives on a quarter of projects.
Application level:
- Outdated modules:
vote, forum, blog — often unused but with active handlers. Deactivate and remove.
- Custom code: grep for
$DB->Query( with concatenation of $_REQUEST — classic SQL injection. Should use $DB->ForSql() or D7 ORM.
- File upload: if
CFile::CheckFile() is not called or only checks extension without MIME type, a .php file will be uploaded via the feedback form.
-
dbconn.php and .env — must be blocked by web server rules. Check: curl https://site.ru/bitrix/.settings.php should return 403.
SSL/TLS:
- Rating A or higher via SSL Labs.
- HSTS with
max-age of at least 31536000 (one year).
- HTTP -> HTTPS redirect at Nginx level, not at Bitrix level.
Audit result — a prioritized report: Critical / High / Medium / Low. Critical issues are fixed on day one. Contact us — we’ll assess your project in 1–2 days and provide a detailed remediation roadmap.
Healing Hacked Sites — Protocol of Actions
The site is already compromised — SEO spam, redirects to casinos, web shell in /upload/. Order of actions:
- Isolation — take the site down, put up a placeholder. If malware is encrypting files or spreading, every minute counts.
- Identify the vector — access logs (
access.log), error logs, b_event_log. Look for POST requests to unusual files, requests to /upload/*.php, suspicious user agents.
- Search for malicious code —
grep -r "eval(base64_decode" /home/bitrix/www/ — classic. Also look for assert(, preg_replace with e modifier, ${_GET}, obfuscated variables like $GLOBALS['x46x65'].
- Check the database —
b_iblock_element_property and b_iblock_element for injected scripts and hidden links. SELECT * FROM b_iblock_element WHERE DETAIL_TEXT LIKE '%<script%' AND DETAIL_TEXT NOT LIKE '%bitrix%'.
- Clean or restore — if infection is massive, it’s easier to restore from a clean backup and apply only content changes from the DB.
- Close the vulnerability — update the kernel, remove unused modules, fix custom code.
- Request re-scan — Google Search Console → “Request Review”, Yandex.Webmaster → “I fixed everything”.
Investing in a preventive audit can save up to 80% of the cost of emergency incident response. Guaranteed recovery within 1–3 days for subscription clients.
How to Protect a Bitrix Site from DDoS?
- Cloudflare / DDoS-Guard / Qrator — traffic proxying. L3/L4 attacks are filtered on their side. L7 — through rules and challenge pages. Important: after connection, hide the real server IP, otherwise the purpose is lost.
- Rate limiting on Nginx:
limit_req_zone for /bitrix/admin/, /api/, forms. Separate limits for authenticated and anonymous users.
- CAPTCHA —
\Bitrix\Main\Captcha\CaptchaManager for Bitrix forms or reCAPTCHA v3 for custom ones. v3 doesn’t annoy users — works in the background.
- Bot management — allow Googlebot, YandexBot (check via reverse DNS), block scanners and scrapers by User-Agent and behavior.
Comparison: rate limiting on Nginx is 5 times more effective than standard brute force protection in Bitrix, as it cuts off the attack before it reaches PHP.
Why Is File Integrity Monitoring Critical?
File integrity check (/bitrix/admin/security_file_verifier.php) — hashes of system files. If someone modifies a file in /bitrix/modules/, the system will notice. Run daily via cron using agent CSecurityFileVerifier::Verify(). Combine with inotify on /upload/ — any new .php file triggers an immediate alert.
Backups — The Last Line of Defense
- Daily backups: files via rsync + PostgreSQL/MySQL dump via
pg_dump/mysqldump.
- Store in isolated S3-compatible storage. Key word: isolated. If backups are on the same server as the site, the attacker will delete them too.
- Rotation: daily × 7, weekly × 4, monthly × 12.
- Test restoration — quarterly, restore a backup on a test server. A backup that cannot be restored is just a file on disk.
- Monitoring: if a backup fails — alert in Telegram within an hour.
Monitoring — Detect Before the Client Calls
- Uptime — check every 60 seconds via UptimeRobot / Zabbix / custom script. Alert in Telegram + phone call if downtime > 5 minutes.
- File monitoring — inotify (Linux) or cron +
md5sum on critical directories. New .php in /upload/? Alert immediately.
- Malware scanning — AI-BOLIT or ClamAV on schedule. Check both files and database.
- SSL certificate — warning 30/14/7 days before expiry. Let’s Encrypt auto-renews via certbot, but certbot can also fail.
- Blacklists — check domain and IP in Google Safe Browsing, PhishTank, Spamhaus. Being listed means traffic loss.
152-FZ and Personal Data (Russian Law Context)
- HTTPS everywhere — redirect at Nginx level.
- Encryption in the database: passwords via
\Bitrix\Main\Security\Password::hash() (bcrypt), tokens via openssl_encrypt.
- Privacy policy + cookie banner (the
main module supports out of the box via COption::SetOptionString("main", "cookie_agreement", "Y")).
- Logging access to personal data — who and when viewed client data.
Deliverables
| Component |
Content |
| Security Audit |
Report with critical/high/medium/low vulnerabilities, remediation recommendations |
| Vulnerability Remediation |
Patched project, updated modules, configured WAF, 2FA, SSL |
| Hack Recovery |
Clean version of files, restored database, closed vector, report for search engines |
| Monitoring |
Access to alert system, monthly report, dedicated engineer (on subscription) |
| Documentation |
Infrastructure diagram, vulnerability map, recovery instructions |
| Training |
Workshop for administrators: how to respond to incidents |
| Support |
Fixed SLA, response time from 1 hour |
Timelines
| Service |
Duration |
Result |
| Express Audit |
1–2 days |
Critical vulnerabilities + plan |
| Full Audit |
3–5 days |
Detailed report, OWASP Top 10 |
| Vulnerability Remediation |
1–2 weeks |
Patched project |
| Hack Recovery |
1–3 days |
Clean site + closed vector |
| Monitoring (subscription) |
Continuous |
Alerts + monthly report |
We work on a one-time basis and on subscription with a fixed SLA. For subscription clients, a dedicated engineer who knows the project. Get a consultation — we’ll assess risks and prepare a quote in 1–2 days.
Checklist: 15 Items We Check on Every Project
- 1C-Bitrix kernel and modules — up to date, unused modules removed.
-
security module active, WAF in “Active Reaction” mode.
- 2FA enabled for all accounts with admin access.
-
/bitrix/admin/ protected by IP or additional HTTP authentication.
- Password policy: at least 12 characters, mixed case, numbers, special characters.
- SSL/TLS: A+ rating on SSL Labs, HSTS enabled.
- Service files (
dbconn.php, .settings.php, .env, backups, logs) — 403 from browser.
- Permissions: 644 files, 755 directories. Web server is not owner of system files.
- Security headers:
Content-Security-Policy, X-Frame-Options: DENY, X-Content-Type-Options: nosniff, Strict-Transport-Security, Referrer-Policy.
- File integrity check — daily via agent.
- Backups: daily, isolated storage, restore testing.
-
b_event_log — storage for at least 90 days, regular review.
- PHP 8.1+,
display_errors = Off, dangerous functions disabled.
- Uptime monitoring + alerts on file changes in
/upload/.
- Reverse proxy or CDN with DDoS protection for high-load projects.
Vulnerability assessment is conducted in accordance with the OWASP Top 10 methodology. Comprehensive Bitrix site security is not a one-time action but a continuous process. Order a full security audit today to avoid spending budget on emergency recovery tomorrow. Contact us for a free consultation — we’ll answer any questions.