Web Server Hardening
What this is: Securing Apache, Nginx, and IIS web servers through configuration hardening, TLS deployment, and security headers.
Competition relevance: Infrastructure hardening. Focus on SSL/TLS, security headers, and eliminating information disclosure.
Why it matters: Web servers are public-facing attack surfaces. Misconfigurations lead to compromise or information leakage.
WSOS 2026 alignment: This topic directly supports Section 4: Secure systems operation and maintenance (configuring and maintaining web server infrastructure) and Section 5: Secure systems protection and defence (implementing TLS encryption and security controls on public-facing services).
Competition area: Spans the infrastructure hardening area (web server deployment and configuration) and the infrastructure hardening area (secure coding) (implementing web security headers and preventing information disclosure).
Offline competence: Use Apache/Nginx documentation in /usr/share/doc/apache2 or /usr/share/doc/nginx, check man openssl for certificate operations, and reference Mozilla SSL Configuration Generator (download offline). Test configurations with nginx -t or apachectl configtest without internet.
Competency Matrix
Section titled “Competency Matrix”| Level | Expectation |
|---|---|
| Regional | Deploy self-signed SSL certificate. Configure HTTPS redirect. Basic security headers. |
| National | Deploy proper CA-signed certificate with full chain. Strong cipher suites. HSTS implementation. |
| Squad/Team Selection | Perfect Forward Secrecy. OCSP stapling. Content Security Policy (CSP). |
| International | Mutual TLS. Certificate pinning. Advanced CSP with nonces. |
Technical Content
Section titled “Technical Content”SSL/TLS Setup
Section titled “SSL/TLS Setup”Generate self-signed certificate (regional):
# OpenSSLopenssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj "/CN=example.com"
# Apache configuration<VirtualHost *:443> ServerName example.com SSLEngine on SSLCertificateFile /etc/ssl/certs/cert.pem SSLCertificateKeyFile /etc/ssl/private/key.pem</VirtualHost>
# Enable SSL modulea2enmod sslsystemctl restart apache2Nginx SSL:
server { listen 443 ssl; server_name example.com;
ssl_certificate /etc/ssl/certs/cert.pem; ssl_certificate_key /etc/ssl/private/key.pem;
ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on;}HTTPS redirect:
# Nginxserver { listen 80; server_name example.com; return 301 https://$server_name$request_uri;}# Apache (.htaccess or VirtualHost)RewriteEngine OnRewriteCond %{HTTPS} offRewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]Competition context: Verify certificate installation with openssl s_client -connect example.com:443. Screenshot browser showing HTTPS lock icon.
Strong Cipher Suites
Section titled “Strong Cipher Suites”Modern cipher configuration (national+):
# Nginx - Mozilla Modern configurationssl_protocols TLSv1.3;ssl_prefer_server_ciphers off;
# Nginx - Mozilla Intermediate (broader compatibility)ssl_protocols TLSv1.2 TLSv1.3;ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;ssl_prefer_server_ciphers off;# ApacheSSLProtocol -all +TLSv1.2 +TLSv1.3SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384SSLHonorCipherOrder offTest cipher strength:
nmap --script ssl-enum-ciphers -p 443 example.comSecurity Headers
Section titled “Security Headers”Essential headers (regional+):
# Nginxadd_header X-Frame-Options "SAMEORIGIN" always;add_header X-Content-Type-Options "nosniff" always;add_header X-XSS-Protection "1; mode=block" always;add_header Referrer-Policy "no-referrer-when-downgrade" always;# Apache (requires mod_headers)Header always set X-Frame-Options "SAMEORIGIN"Header always set X-Content-Type-Options "nosniff"Header always set X-XSS-Protection "1; mode=block"Header always set Referrer-Policy "no-referrer-when-downgrade"HTTP Strict Transport Security (HSTS):
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;Content Security Policy (CSP) - national+:
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';" always;Competition context: Use browser developer tools (F12) to verify headers are present. Screenshot Network tab showing headers.
Information Disclosure Prevention
Section titled “Information Disclosure Prevention”Hide server version:
# Nginx - nginx.confserver_tokens off;# Apache - httpd.conf or security.confServerTokens ProdServerSignature OffDisable directory listing:
# Nginxautoindex off;# ApacheOptions -IndexesRemove default pages:
# Apacherm /var/www/html/index.htmlrm -rf /var/www/html/icons/
# Nginxrm /var/www/html/index.nginx-debian.htmlRate Limiting
Section titled “Rate Limiting”Nginx rate limiting (national+):
# Define rate limit zonelimit_req_zone $binary_remote_addr zone=loginlimit:10m rate=5r/m;
# Apply to login endpointlocation /login { limit_req zone=loginlimit burst=5 nodelay; proxy_pass http://backend;}Apache mod_ratelimit:
<Location "/login"> SetOutputFilter RATE_LIMIT SetEnv rate-limit 400</Location>Competition Strategy & Marking
Section titled “Competition Strategy & Marking”What gets marked:
- HTTPS enabled and accessible
- HTTP redirects to HTTPS
- Security headers present (verify with curl/browser)
- Server version hidden
- Strong cipher suites configured
Evidence and reporting requirements:
- Browser screenshot showing HTTPS lock icon with valid certificate
curl -I https://example.comoutput showing all required security headersopenssl s_client -connect example.com:443output showing TLS version and cipher suite- Configuration file snippets (apache2.conf, nginx.conf) with line numbers showing changes
nmap --script ssl-enum-ciphers -p 443 example.comoutput proving strong ciphers- Browser DevTools screenshot (F12 → Network tab) showing security headers
- Test evidence showing HTTP → HTTPS redirect works (curl -L output)
- Service status showing web server running after configuration changes
- Clear naming:
webserver_https_enabled.png,webserver_security_headers.png
Time allocation:
- SSL certificate deployment: 10-15 minutes
- HTTPS redirect: 5 minutes
- Security headers: 10 minutes
- Server hardening (hide version, disable indexes): 5 minutes
Time-boxed drill suggestion: 45-minute web server hardening sprint: Given an Apache or Nginx server with HTTP only, generate a self-signed certificate, enable HTTPS, configure HTTP → HTTPS redirect, add security headers (X-Frame-Options, X-Content-Type-Options, HSTS, CSP), disable server version disclosure, disable directory listing, test configuration, and document all changes with curl/openssl output and screenshots.
False Flags / Wrong Paths
Section titled “False Flags / Wrong Paths”Practice Checklist
Section titled “Practice Checklist”- Can generate and install self-signed SSL certificate
- Can configure HTTPS redirect for Apache and Nginx
- Can configure strong cipher suites (TLS 1.2+)
- Can add security headers (X-Frame-Options, HSTS, CSP)
- Can hide server version information
- Can disable directory listing
- Can test SSL configuration with openssl and nmap
- Can verify headers with curl and browser dev tools
References
Section titled “References”- Regional Roadmap: Infrastructure hardening
- National Roadmap: Infrastructure hardening
Unofficial study guide, not endorsed by WorldSkills International or WorldSkills UK. Topics are example areas to prepare for, not the content of any test project: competition tasks are confidential, competitions are closed book, and formats change between competitions. More about this site.