Web Application Security Fundamentals #14: Security Mindset & Practical Checklist
Security mindset, practical checklists untuk setiap fase development, dan panduan untuk continuous learning dalam web application security.
Web Application Security Fundamentals #14: Security Mindset & Practical Checklist (FINAL)
Seri "Web Application Security Fundamentals" berakhir di sini. Modul terakhir bukan teknis, tetapi mindset shift — dari "security is optional" menjadi "security is essential".
The Security Mindset
Principle 1: Assume Breach
Tidak jika jika terjadi breach, tetapi kapan. Dengan mindset ini:
- Design untuk detect & contain breaches (logging, monitoring)
- Tidak rely pada single perimeter defense
- Compartmentalize access (lateral movement mitigated)
Traditional: "Keep attackers out"
Secure: "Assume they're in, detect them quickly, minimize damage"
Principle 2: Security is Process, Not Product
Security bukan:
- ❌ One-time security audit
- ❌ Buying security tools
- ❌ Hiring security expert
Security adalah:
- ✅ Continuous threat modeling
- ✅ Regular testing & monitoring
- ✅ Education & training
- ✅ Incident response readiness
Principle 3: Fail Secure, Not Convenient
# ❌ Convenient but dangerous
try:
authenticate_user()
except:
pass # Allow access even if auth fails!
# ✅ Secure but requires more work
try:
authenticate_user()
except:
return 'Authentication failed', 401 # Deny by default
Principle 4: Security is Everyone's Responsibility
- Developers: Write secure code
- Architects: Design secure systems
- QA: Test for security
- Operations: Harden infrastructure
- Management: Allocate resources
- Users: Follow policies
"If security is only security team's job, it will fail." — DevSecOps mantra
Pre-Development Checklist
Before you write a single line of code:
- [ ] Threat Model ← Start here!
- [ ] Identify assets (data, functionality, users)
- [ ] Identify threat actors (external hacker, disgruntled employee, etc)
- [ ] Map attack vectors (network, social engineering, supply chain)
- [ ] Design mitigations (preventive, detective, responsive)
- [ ] Security Requirements
- [ ] Authentication: How verify user is who they claim?
- [ ] Authorization: Who can do what?
- [ ] Confidentiality: What data needs encryption?
- [ ] Integrity: What data needs tamper-detection?
- [ ] Logging: What events must be logged?
- [ ] Compliance: What regulations apply? (GDPR, PDP, PCI-DSS, etc)
- [ ] Secure SDLC Plan
- [ ] Code review process defined
- [ ] Security testing tools selected (SAST, DAST)
- [ ] Dependency scanning enabled
- [ ] Penetration testing scheduled
- [ ] Incident response plan drafted
Development Checklist
Input Validation
- [ ] All inputs validated server-side
- [ ] Whitelist validation used (not blacklist)
- [ ] Length, type, format checks implemented
- [ ] File uploads restricted (type, size, content)
- [ ] No command/query injection possible
Authentication & Authorization
- [ ] Password hashing: Argon2id or bcrypt
- [ ] Session tokens: 256+ bit random
- [ ] Cookies: HttpOnly, Secure, SameSite flags
- [ ] MFA: Available (TOTP preferred)
- [ ] Authorization: Checked every request
- [ ] Rate limiting: Implemented on login
Data Protection
- [ ] Sensitive data encrypted in transit (TLS 1.2+)
- [ ] Sensitive data encrypted at rest
- [ ] Encryption keys: Not hardcoded, rotated regularly
- [ ] No credentials in logs or error messages
- [ ] Cache headers: Prevent caching sensitive data
Error Handling
- [ ] No stack traces in user responses
- [ ] Generic error messages ("Invalid input" not "Username not found")
- [ ] Detailed errors logged server-side
- [ ] No sensitive info in error messages
Logging & Monitoring
- [ ] Security events logged: Login, auth failures, privilege changes
- [ ] Failed login attempts logged
- [ ] Data access logged (compliance)
- [ ] Logs stored securely (not world-readable)
- [ ] Alerting on anomalies
Dependencies
- [ ]
npm audit/pip checkpassing - [ ] OWASP Dependency-Check integrated in CI/CD
- [ ] No known vulnerabilities in dependencies
- [ ] Minimized dependencies (smaller attack surface)
- [ ] Dependency versions pinned (reproducible builds)
Code Quality
- [ ] Code review process: 2 reviewers minimum
- [ ] Security checklist: Reviewed per PR
- [ ] No hardcoded secrets
- [ ] No SQL/command concatenation
- [ ] Parameterized queries used throughout
- [ ] Output encoding context-appropriate
Testing Checklist
- [ ] Unit Tests - Negative path tests (invalid input handling)
- [ ] Integration Tests - Authorization boundaries
- [ ] SAST Scanning - SonarQube, Semgrep (automated code analysis)
- [ ] DAST Scanning - OWASP ZAP, Burp Suite (runtime scanning)
- [ ] Penetration Testing - Manual testing for logic flaws
- [ ] Dependency Scanning - OWASP Dependency-Check
- [ ] Infrastructure Testing - TLS configuration, headers, hardening
Deployment Checklist
- [ ] Configuration
- [ ] Debug mode OFF
- [ ] Unnecessary services disabled
- [ ] Default credentials changed
- [ ] Firewall rules restrictive (least privilege network access)
- [ ] Security Headers
- [ ] HSTS (force HTTPS)
- [ ] CSP (prevent XSS)
- [ ] X-Frame-Options (prevent clickjacking)
- [ ] X-Content-Type-Options (prevent MIME sniffing)
- [ ] Cache-Control (prevent sensitive data caching)
- [ ] Monitoring & Alerting
- [ ] Logs centralized (not on servers)
- [ ] Alerts configured for anomalies
- [ ] Incident response playbook ready
- [ ] On-call rotation defined
- [ ] Secrets Management
- [ ] Database passwords in secret manager (not config files)
- [ ] API keys rotated regularly
- [ ] Encryption keys secured
- [ ] Access to secrets logged
- [ ] Backup & Recovery
- [ ] Backups encrypted
- [ ] Restore tested regularly
- [ ] Backup retention policy defined
- [ ] RTO/RPO defined (recovery time/point objectives)
Post-Deployment Checklist
- [ ] Monitoring
- [ ] Application performance monitored
- [ ] Security events alerted
- [ ] Anomaly detection running
- [ ] Logs reviewed regularly
- [ ] Maintenance
- [ ] Patches applied promptly (OS, framework, dependencies)
- [ ] Security advisories monitored
- [ ] Penetration testing scheduled annually
- [ ] Security audits scheduled annually
- [ ] Incident Response
- [ ] Incident playbook documented
- [ ] On-call team trained
- [ ] Communication plan defined
- [ ] Post-incident reviews scheduled
30-Day Security Challenge
Week 1: Awareness
- Read OWASP Top 10 twice
- Understand your application's architecture
- Identify 3 assets worth protecting
Week 2: Threat Modeling
- Create threat model for top 3 assets
- Map attack vectors
- Design mitigations
Week 3: Implementation
- Fix 3 high-risk vulnerabilities
- Add security headers
- Enable dependency scanning
Week 4: Testing
- Attempt SQL injection on your app
- Attempt XSS attack
- Run security scanner
- Conduct code review with security focus
Final Wisdom
"The best security is the one that is built in from the beginning, not bolted on at the end."
"Security is a practice, not a project."
"Your competitor's breach is your lesson."
Resources to Continue Learning
- OWASP Top 10
- OWASP ASVS
- OWASP WSTG
- PortSwigger Web Security Academy
- SANS Security Training
- HackTheBox
- TryHackMe
Kesimpulan
Anda telah mempelajari 14 modul Web Application Security Fundamentals. Dari understanding basic concepts (#01-#03), melalui attack vectors (#04-#05), secure practices (#06-#12), sampai business impact (#13) dan security mindset (#14).
Tahap berikutnya: Praktik. Ambil aplikasi yang Anda kerjakan, lakukan threat modeling, fix vulnerabilities, add tests. Keamanan aplikasi web adalah kombinasi dari knowledge, practice, dan persistence.
Jangan takut untuk break things dalam safe environment (local lab, staging). Itu cara terbaik untuk belajar.
🎓 Seri Selesai
Terima kasih telah mengikuti "Web Application Security Fundamentals" dari awal sampai akhir. Semoga Anda sekarang:
- ✅ Mengerti konsep fundamental web security
- ✅ Bisa identify vulnerabilities
- ✅ Tahu cara remediate dengan tepat
- ✅ Berkontribusi pada security culture di organisasi Anda
Next steps: Ambil sertifikasi atau join bug bounty program untuk memperkuat practical skills.
Feedback & Perbaikan? Hubungi kami melalui email atau form di website.
Selamat belajar & stay secure! 🔒
Post Terkait
Cloud, Container & IaC Security #03: Tutorial kube-hunter + Checkov untuk Kubernetes dan IaC Security
Episode 03/5: tutorial lengkap kube-hunter + Checkov dengan practical workflow, command dan security assessment.
Cloud, Container & IaC Security #02: Tutorial Dive + kube-bench untuk Container dan Kubernetes Hardening
Episode 02/5: tutorial lengkap Dive + kube-bench dengan practical workflow, command dan security assessment.
Cloud, Container & IaC Security #01: Tutorial Lengkap Trivy + Grype untuk Container Vulnerability dan SBOM
Episode 01/5: tutorial lengkap Trivy + Grype dengan practical workflow, command dan security assessment.