SEC/Lesson 7 of 7/8 min read
Security Operations and Secure Development
Vulnerability management and CVSS, penetration testing, logging and SIEM, incident response phases, digital forensics basics, backups and recovery, secure SDLC, secrets management, and compliance frameworks.
On this page
Vulnerability Management
Vulnerability management is the continuous cycle of finding, prioritizing and fixing weaknesses:
- Asset inventory: you cannot protect what you do not know you have.
- Scan: network and host scanners (Nessus, OpenVAS), container and dependency scanners.
- Prioritize by risk: severity, exploitability (is it being exploited in the wild?), exposure, and asset value.
- Remediate: patch, reconfigure, or apply compensating controls.
- Verify and report.
CVE
A CVE (Common Vulnerabilities and Exposures) ID such as CVE-2021-44228 (Log4Shell) uniquely names a publicly disclosed vulnerability so everyone refers to the same issue. CWE classifies the underlying weakness type (CWE-79 is XSS, CWE-89 is SQL injection).
CVSS
CVSS (Common Vulnerability Scoring System) scores severity from 0 to 10.
| Score | Severity |
|---|---|
| 0.1 to 3.9 | Low |
| 4.0 to 6.9 | Medium |
| 7.0 to 8.9 | High |
| 9.0 to 10.0 | Critical |
Base metrics include attack vector (network, adjacent, local, physical), attack complexity, privileges required, user interaction, scope, and impact on confidentiality, integrity and availability.
CVSS measures severity, not risk. Combine it with EPSS (probability of exploitation) and CISA KEV (known exploited vulnerabilities) to decide what to fix first.
Testing your defenses
Penetration Testing
Penetration testing is an authorized, scoped, time-boxed simulated attack to find exploitable weaknesses.
- Black box: no prior knowledge. Grey box: some knowledge or credentials. White box: full access to source and architecture.
- Phases: planning and scope agreement (rules of engagement, written authorization), reconnaissance, scanning, exploitation, post-exploitation, reporting with remediation advice.
A vulnerability assessment lists weaknesses; a pentest proves which ones are actually exploitable and chains them.
Red Team
A red team emulates a real adversary end to end (phishing, physical entry, stealth) with objectives such as "reach the payment database", to test detection and response, not just find bugs.
Blue Team
The blue team defends: monitoring, detection, incident response, hardening. A purple team exercise has red and blue working together to tune detections in real time.
Bug Bounty
A bug bounty program rewards external researchers for responsibly reporting vulnerabilities (HackerOne, Bugcrowd, Intigriti). It complements pentests with continuous testing by many eyes. A vulnerability disclosure policy (VDP) and a security.txt file tell researchers how to report safely, even without rewards.
Logging and monitoring
Log security-relevant events: authentication successes and failures, authorization failures, privilege changes, admin actions, input validation failures, and configuration changes. Include timestamp (UTC, synchronized clocks), user, source IP, action, and outcome. Never log passwords, tokens or full card numbers. Ship logs off-host so an attacker cannot erase them.
SIEM
A SIEM (Security Information and Event Management: Splunk, Microsoft Sentinel, Elastic) collects logs from across the organization, normalizes and correlates them, and raises alerts from detection rules ("10 failed logins followed by a success from a new country"). SOAR tools automate response playbooks on top.
SOC
A Security Operations Center (SOC) is the team that monitors alerts around the clock, triages them, and escalates incidents. Typical tiers: L1 triage, L2 investigation, L3 threat hunting and detection engineering. Alert fatigue from false positives is the main operational challenge.
Incident Response
Incident response is the organized way to handle a security incident and limit damage. The NIST lifecycle:
- Preparation: plans, playbooks, contacts, tooling, logging, training, tabletop exercises.
- Detection and analysis: identify the incident, determine scope and severity, preserve evidence.
- Containment: short-term (isolate hosts, disable accounts, block IPs) and long-term (rebuild clean systems).
- Eradication: remove malware, close the entry point, reset credentials.
- Recovery: restore systems from clean backups, monitor closely for reinfection.
- Post-incident activity: a blameless lessons learned review, then improve controls and detections.
(SANS uses a similar six steps: preparation, identification, containment, eradication, recovery, lessons learned.)
Communication matters as much as technology: legal, management, customers, and regulators (GDPR requires notifying the authority within 72 hours of becoming aware of a personal data breach).
Digital Forensics
Digital forensics collects and analyzes evidence to understand what happened, in a way that holds up legally.
- Order of volatility: collect the most volatile first: CPU registers and cache, RAM, network state, running processes, disk, logs, backups.
- Work on forensic copies (bit-for-bit disk images), verified with hashes; never on the original.
- Build a timeline from file system timestamps, logs and artifacts.
Chain of Custody
Chain of custody documents every person who handled a piece of evidence, when, and why. Without it, evidence may be inadmissible in court.
Backups and recovery
RPO
Recovery Point Objective: the maximum acceptable data loss, measured in time. An RPO of 1 hour means backups or replication at least hourly.
RTO
Recovery Time Objective: the maximum acceptable downtime before service is restored.
Lower RPO and RTO cost more (continuous replication, hot standby sites). Business continuity and disaster recovery plans set them per system. Test restores regularly: an untested backup is a hope, not a plan.
| Site | Ready in | Cost |
|---|---|---|
| Hot site | Minutes | Highest |
| Warm site | Hours to a day | Medium |
| Cold site | Days to weeks | Lowest |
Secure SDLC
A secure SDLC builds security into every phase instead of testing it in at the end ("shift left"):
| Phase | Security activity |
|---|---|
| Requirements | Security and privacy requirements, abuse cases |
| Design | Threat modeling, secure design review |
| Implementation | Secure coding standards, code review, SAST, secret scanning |
| Testing | DAST, dependency scanning, pentests, fuzzing |
| Deployment | Hardened configs, IaC scanning, signed artifacts |
| Maintenance | Patching, monitoring, vulnerability management |
SAST
Static Application Security Testing analyzes source code without running it (Semgrep, CodeQL, SonarQube). Finds issues early with exact line numbers; prone to false positives and blind to runtime configuration.
DAST
Dynamic Application Security Testing attacks the running application from outside (OWASP ZAP, Burp Suite). Finds real exploitable runtime issues and misconfigurations; cannot point at the exact line and covers only reachable paths.
Others: SCA (software composition analysis of dependencies), IAST (instrumentation inside the running app), fuzzing (random and malformed inputs to find crashes).
Secrets Management
Hard-coded API keys and passwords in code or Git history are one of the most common causes of breaches.
- Store secrets in a secrets manager (HashiCorp Vault, AWS Secrets Manager, cloud KMS), injected at runtime.
- Prefer short-lived, dynamic credentials and workload identity (OIDC federation from CI to the cloud) over long-lived keys.
- Scan commits for secrets (gitleaks, GitHub push protection).
- If a secret is committed, rotate it immediately: deleting the commit does not remove it from clones, forks and caches.
- Encrypt data at rest with keys in a KMS or HSM; separate key management from data access.
Compliance
Compliance means meeting the requirements of laws, regulations and standards. It sets a baseline; being compliant does not make you secure.
| Framework | Scope |
|---|---|
| ISO/IEC 27001 | Information security management system (certifiable) |
| SOC 2 | Service organization controls; trust services criteria (security, availability, confidentiality, processing integrity, privacy) |
| PCI DSS | Organizations handling payment card data |
| HIPAA | US healthcare data |
| GDPR | Personal data of people in the EU; lawful basis, data subject rights, 72-hour breach notification |
| India's DPDP Act 2023 | Digital personal data of individuals in India |
| NIST CSF | Voluntary framework: Govern, Identify, Protect, Detect, Respond, Recover |
Quick revision
- Vulnerability management: inventory, scan, prioritize by real risk, fix, verify.
- CVE names a vulnerability; CVSS scores severity (not risk); use EPSS and KEV to prioritize.
- Pentests prove exploitability within scope; red teams test detection; bug bounties add continuous testing.
- SIEM correlates logs into alerts; the SOC triages them.
- Incident response: prepare, detect and analyze, contain, eradicate, recover, learn. Isolate before powering off.
- Forensics: order of volatility, work on hashed copies, keep chain of custody.
- RPO is tolerable data loss, RTO is tolerable downtime; test restores.
- Shift left: threat modeling, SAST, DAST, SCA, secret scanning; rotate leaked secrets immediately.