Part II: Vulnerability Study Chapter 1

Introduction to Network Security

Security fundamentals, CIA triad, MITRE ATT&CK, threat modeling, attack-defense framework, and ethical considerations

Chapter 1: Introduction to Network Security

The $10 Billion Wake-Up Call

On June 27, 2017, a software update for a Ukrainian tax program called M.E.Doc delivered something unexpected: NotPetya, the most destructive cyberattack in history. Within hours, it had spread to 65 countries, encrypting systems and rendering them permanently unusable.

Maersk, the world’s largest shipping company, lost 49,000 laptops, 1,200 applications, and nearly all 6,500 servers. They rebuilt their entire IT infrastructure in 10 daysβ€”what normally takes 6 months. Total cost: $300 million. FedEx lost $400 million. Merck lost $870 million. Global damages exceeded $10 billion.

NotPetya wasn’t ransomware seeking profitβ€”it was a weapon designed to destroy. It exploited EternalBlue (the same vulnerability behind WannaCry), spread through SMB, and used credential harvesting to move laterally. Network security failures at every level enabled its spread: unpatched systems, flat networks without segmentation, and inadequate monitoring.

This attack demonstrated that network security isn’t optionalβ€”it’s existential. In Part II, you’ll learn the attacks that make incidents like NotPetya possible, and the defenses that could have stopped them.


From Theory to Security

In Part I, you learned how networks move data reliably from source to destination. But reliability isn’t enough. In a world where networks carry financial transactions, medical records, government secrets, and personal communications, we need more than just deliveryβ€”we need security.

What Is Network Security?

Network security is the practice of protecting network infrastructure and the data that traverses it from unauthorized access, misuse, modification, or denial of service. It encompasses:

  • Technologies: Firewalls, encryption, intrusion detection
  • Processes: Incident response, vulnerability management, access control
  • Practices: Security monitoring, penetration testing, user awareness

The Security Mindset

As you’ll see throughout Part II, the protocols that make networking possible often prioritize functionality over security. They were designed in an era of trusted academic networks and limited connectivity. Understanding these design decisionsβ€”and their security implicationsβ€”is essential for both attacking and defending systems.

PRO TIP

The best defenders understand attacks deeply. The best attackers understand defenses thoroughly. This chapter provides the foundation for both perspectives.


The CIA Triad

The CIA triad is the foundational model for information security, defining three core objectives that security measures aim to protect.

The CIA Triad

The CIA Triad:
═══════════════════════════════════════════════════════════════════

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   CONFIDENTIALITY   β”‚
                    β”‚                     β”‚
                    β”‚  Only authorized    β”‚
                    β”‚  access to data     β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚                β”‚                β”‚
              β–Ό                β”‚                β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   INTEGRITY     │◄───────┴─────►│  AVAILABILITY   β”‚
    β”‚                 β”‚               β”‚                 β”‚
    β”‚  Data is        β”‚               β”‚  Systems are    β”‚
    β”‚  trustworthy    β”‚               β”‚  accessible     β”‚
    β”‚  and accurate   β”‚               β”‚  when needed    β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
    All three must be balanced based on the asset's requirements

Confidentiality

Confidentiality ensures that information is accessible only to those authorized to access it. It protects against unauthorized disclosure.

Network ThreatExampleImpact
EavesdroppingPacket capture on unencrypted WiFiCredentials stolen
MITM attacksARP spoofing to intercept trafficData exfiltration
Unauthorized accessCompromised server leaking databaseCustomer data breach
Traffic analysisTiming attacks reveal patternsMetadata exposure

Countermeasures:

  • Encryption (TLS, VPNs, WPA3)
  • Access controls and authentication
  • Network segmentation
  • Data classification

Integrity

Integrity ensures that information is accurate and hasn’t been modified by unauthorized parties. It protects against unauthorized modification.

Network ThreatExampleImpact
Packet modificationMITM altering transaction amountsFinancial fraud
DNS poisoningFake DNS responses redirect usersPhishing success
Session hijackingInjecting commands into active sessionAccount takeover
Malware injectionModifying downloads in transitSystem compromise

Countermeasures:

  • Cryptographic integrity checks (MACs, digital signatures)
  • DNSSEC, certificate pinning
  • Input validation
  • Version control and audit trails

Availability

Availability ensures that information and systems are accessible when needed by authorized users. It protects against denial of service.

Network ThreatExampleImpact
DDoS attacksVolumetric flood overwhelming serversService outage
SYN floodsExhausting connection tablesApplication unavailable
RansomwareEncrypting critical systemsOperations halt
Physical attacksCutting fiber linesNetwork disconnection

Countermeasures:

  • Redundancy and failover
  • DDoS mitigation services
  • Rate limiting
  • Backups and disaster recovery

Beyond CIA: The Extended Model

Modern security often considers additional properties:

PropertyDescriptionExample Control
AuthenticationVerifying identityMulti-factor authentication
AuthorizationControlling permissionsRole-based access control
Non-repudiationProving actions occurredDigital signatures, audit logs
AccountabilityTracing to responsible partyLogging, monitoring

MITRE ATT&CK Framework

What Is MITRE ATT&CK?

MITRE ATT&CK (Adversarial Tactics, Techniques, and Common Knowledge) is a globally-accessible knowledge base of adversary behavior based on real-world observations. It provides a common language for describing attacks and mapping defenses.

MITRE ATT&CK Matrix (Simplified)

MITRE ATT&CK Matrix (Simplified):
═══════════════════════════════════════════════════════════════════

TACTICS (The "Why" - Adversary Goals):
β”Œβ”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”
β”‚ Recon β”‚Accessβ”‚Exec β”‚Persistβ”‚Priv Escβ”‚Defenseβ”‚Cred  β”‚Discoveryβ”‚   β”‚
β”‚       β”‚      β”‚     β”‚       β”‚        β”‚Evasionβ”‚Accessβ”‚         β”‚...β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”˜
   β”‚       β”‚      β”‚      β”‚        β”‚        β”‚       β”‚       β”‚
   β–Ό       β–Ό      β–Ό      β–Ό        β–Ό        β–Ό       β–Ό       β–Ό

TECHNIQUES (The "How" - Methods Used):
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚Phishing β”‚β”‚PowerShellβ”‚Scheduledβ”‚β”‚Exploitationβ”‚
β”‚         β”‚β”‚         β”‚β”‚  Task   β”‚β”‚for Priv Escβ”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚Scanning β”‚β”‚WMI      β”‚β”‚Registry β”‚β”‚Valid       β”‚
β”‚         β”‚β”‚         β”‚β”‚Run Keys β”‚β”‚Accounts    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚...      β”‚β”‚...      β”‚β”‚...      β”‚β”‚...         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Each technique has:
- ID (e.g., T1566 for Phishing)
- Description
- Examples from real attacks
- Detection methods
- Mitigation strategies

ATT&CK Tactics (Enterprise)

TacticDescriptionNetwork Examples
ReconnaissanceGathering informationPort scanning, OSINT
Resource DevelopmentEstablishing infrastructureC2 servers, domains
Initial AccessGetting into the networkPhishing, exploitation
ExecutionRunning malicious codeScripts, commands
PersistenceMaintaining accessBackdoors, scheduled tasks
Privilege EscalationGaining higher permissionsExploits, credential theft
Defense EvasionAvoiding detectionObfuscation, disabling AV
Credential AccessStealing credentialsKeylogging, LSASS dumping
DiscoveryLearning the environmentNetwork scanning, enumeration
Lateral MovementMoving through networkPass-the-hash, RDP
CollectionGathering target dataData staging
Command & ControlCommunicating with implantsDNS tunneling, HTTPS C2
ExfiltrationStealing dataData transfer over C2
ImpactDisruption or destructionRansomware, wipers

Using ATT&CK in This Book

Throughout Part II, we’ll reference ATT&CK techniques where relevant:

Example ARP Spoofing

Example: ARP Spoofing

MITRE ATT&CK Mapping:
β”œβ”€β”€ Tactic: Credential Access, Collection
β”œβ”€β”€ Technique: T1557 - Adversary-in-the-Middle
β”œβ”€β”€ Sub-technique: T1557.002 - ARP Cache Poisoning
β”œβ”€β”€ Detection: Monitor for ARP anomalies
└── Mitigation: DAI, network segmentation

TRY IT YOURSELF

Explore the ATT&CK framework at https://attack.mitre.org/

  • Browse techniques by tactic
  • Look up real-world examples
  • Check detection and mitigation guidance

Threat Modeling

Threat modeling is a structured approach to identifying, quantifying, and addressing security risks. Before you can defend a system, you need to understand what you’re defending against.

Key Questions

  1. What are we protecting? (Assets)
  2. Who might attack it? (Threat actors)
  3. How might they attack? (Threat vectors)
  4. What’s the impact if they succeed? (Risk assessment)
  5. How do we prevent or detect it? (Countermeasures)

Threat Actors

Understanding who might attack helps predict their capabilities, motivations, and methods:

Actor TypeMotivationCapabilityPatienceExamples
Script KiddiesFun, braggingLowLowUsing Metasploit without understanding
HacktivistsPolitical/socialLow-MediumMediumAnonymous, protest movements
CybercriminalsFinancial gainMedium-HighMediumRansomware gangs, fraud rings
InsidersVariedVariesHighDisgruntled employees
CompetitorsBusiness advantageMediumHighCorporate espionage
Nation-StatesEspionage, sabotageVery HighVery HighAPT groups (APT28, Lazarus)

Attack Surface

The attack surface is the sum of all possible attack vectorsβ€”every point where an attacker could potentially enter or extract data.

Network Attack Surface

Network Attack Surface:
═══════════════════════════════════════════════════════════════════

External Attack Surface:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Internet-facing services (web, email, VPN)                      β”‚
β”‚ DNS records revealing infrastructure                            β”‚
β”‚ Cloud resources and APIs                                        β”‚
β”‚ Third-party connections                                         β”‚
β”‚ Remote access mechanisms                                        β”‚
β”‚ Social media/OSINT information                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Internal Attack Surface:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Internal network services                                       β”‚
β”‚ Workstations and servers                                        β”‚
β”‚ Network infrastructure devices                                  β”‚
β”‚ Wireless networks                                               β”‚
β”‚ Physical access points                                          β”‚
β”‚ User credentials and permissions                                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Supply Chain Attack Surface:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Third-party software and updates                                β”‚
β”‚ Vendor network connections                                      β”‚
β”‚ Cloud service providers                                         β”‚
β”‚ Outsourced services                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Reducing attack surface:

  • Disable unnecessary services
  • Close unused ports
  • Remove default accounts
  • Network segmentation
  • Principle of least privilege

STRIDE Threat Model

Microsoft’s STRIDE model categorizes threats:

ThreatDescriptionCIA PropertyExample
SpoofingPretending to be something elseAuthenticationARP spoofing, IP spoofing
TamperingModifying data or codeIntegrityMITM modification, DNS poisoning
RepudiationDenying an actionNon-repudiationDeleting logs, forging timestamps
Information DisclosureExposing dataConfidentialityPacket sniffing, data breach
Denial of ServiceMaking unavailableAvailabilityDDoS, SYN flood
Elevation of PrivilegeGaining capabilitiesAuthorizationPrivilege escalation exploit

The Attack-Defense Framework

Every Attack Has a Defense

Throughout Part II, we’ll analyze each attack using a consistent framework:

AttackDefense Analysis Framework

Attack-Defense Analysis Framework:
═══════════════════════════════════════════════════════════════════

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        ATTACK                                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ What:        Description of the attack technique                β”‚
β”‚ Why:         What makes this attack possible                    β”‚
β”‚ How:         Step-by-step attack process                        β”‚
β”‚ Prerequisites: What attacker needs (access, tools, knowledge)   β”‚
β”‚ Impact:      What damage can result                             β”‚
β”‚ MITRE ATT&CK: Relevant technique IDs                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       DETECTION                                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Indicators:  What to look for (logs, traffic patterns)          β”‚
β”‚ Tools:       Detection technologies and methods                 β”‚
β”‚ Signatures:  Specific detection rules (Snort, Sigma, etc.)      β”‚
β”‚ Behavior:    Anomaly-based detection approaches                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       MITIGATION                                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Prevention:  Stop the attack from succeeding                    β”‚
β”‚ Reduction:   Limit the impact if attack succeeds                β”‚
β”‚ Controls:    Specific technologies and configurations           β”‚
β”‚ Best Practices: Operational and procedural defenses             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Example: ARP Spoofing Analysis

AttackDefense Example ARP Spoofing

Attack-Defense Example: ARP Spoofing
═══════════════════════════════════════════════════════════════════

ATTACK:
β”œβ”€β”€ What: Send fake ARP replies to poison victim's cache
β”œβ”€β”€ Why: ARP has no authentication
β”œβ”€β”€ How: Send "gateway IP is at attacker MAC"
β”œβ”€β”€ Prerequisites: Same Layer 2 network as victim
β”œβ”€β”€ Impact: MITM position, traffic interception
└── ATT&CK: T1557.002 (ARP Cache Poisoning)

DETECTION:
β”œβ”€β”€ Indicators: Multiple MACs for same IP, ARP storms
β”œβ”€β”€ Tools: arpwatch, IDS, DAI logs
β”œβ”€β”€ Signatures: ARP reply without request, MAC changes
└── Behavior: Unusual gateway MAC in client ARP tables

MITIGATION:
β”œβ”€β”€ Prevention: Dynamic ARP Inspection (DAI), static ARP
β”œβ”€β”€ Reduction: Network segmentation, encryption (TLS)
β”œβ”€β”€ Controls: DHCP snooping, 802.1X, private VLANs
└── Best Practices: Monitor ARP, segment sensitive systems

Defense in Depth

Defense in depth is the principle of layering multiple security controls so that if one fails, others remain. No single security measure is perfect; layers provide redundancy.

Defense in Depth Layers

Defense in Depth Layers:
═══════════════════════════════════════════════════════════════════

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚          POLICIES & PROCEDURES      β”‚
                    β”‚    (Security policies, training)    β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚            PHYSICAL SECURITY        β”‚
                    β”‚    (Guards, locks, cameras, badges) β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚          PERIMETER SECURITY         β”‚
                    β”‚    (Firewalls, DMZ, IDS/IPS)        β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚          NETWORK SECURITY           β”‚
                    β”‚ (Segmentation, NAC, monitoring)     β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚          ENDPOINT SECURITY          β”‚
                    β”‚    (AV, EDR, patching, hardening)   β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚        APPLICATION SECURITY         β”‚
                    β”‚  (Input validation, secure coding)  β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚            DATA SECURITY            β”‚
                    β”‚   (Encryption, access controls)     β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

If one layer fails, others still protect the asset

THINK ABOUT IT

NotPetya spread so effectively because multiple defense layers failed: unpatched systems (endpoint), flat networks (network), and inadequate monitoring (perimeter). Which single improvement would have had the biggest impact?


Unauthorized access to computer systems is illegal virtually everywhere. Understanding the law is essential for security professionals.

Key Laws:

LawJurisdictionKey Provisions
CFAAUnited StatesCriminalizes unauthorized access
CMAUnited KingdomSimilar to CFAA
GDPREuropean UnionData protection, breach notification
HIPAAUS (Healthcare)Health information protection
PCI-DSSGlobal (Cards)Payment card security standards

Critical Legal Principles:

  1. Authorization is everything: Having permission is the difference between penetration testing and crime
  2. Scope matters: Exceeding authorized scope can be illegal
  3. Intent isn’t always required: Some laws don’t require malicious intent
  4. Documentation protects you: Written authorization is essential
  5. Data handling matters: Even authorized testers must handle data properly

** COMMON MISTAKE**

β€œI was just testing security” is not a legal defense. Even well-intentioned unauthorized testing can result in criminal charges. Always get written authorization before testing.

Responsible Disclosure

When you discover a vulnerability, how you handle it matters:

ApproachProcessProsCons
Full DisclosurePublish immediatelyForces quick patchesEnables attackers
Non-DisclosureReport only to vendorVendor has timeMay be ignored
CoordinatedPrivate report, then publishBalanced approachRequires vendor cooperation

Coordinated Disclosure Best Practices:

  1. Report to vendor privately with full details
  2. Give 90 days to develop patch (standard timeline)
  3. Publish after patch is available
  4. Publish earlier if actively exploited or vendor unresponsive

Bug Bounty Programs:

  • HackerOne, Bugcrowd (platforms)
  • Company programs (Google, Microsoft, Apple)
  • Legal safe harbor often provided
  • Financial rewards for valid reports

Ethical Guidelines

Beyond legality, ethical considerations guide professional behavior:

Core Principles:

  1. Do no harm: Minimize impact even during authorized testing
  2. Respect privacy: Protect any data you encounter
  3. Be honest: Report findings accurately, don’t exaggerate
  4. Maintain trust: Don’t abuse access or knowledge
  5. Give back: Contribute to the security community

Security Testing Types

Vulnerability Assessment

Systematic identification of security weaknesses:

  • Automated scanning tools (Nessus, Qualys, OpenVAS)
  • Configuration review
  • Results in prioritized vulnerability list
  • Regular cadence (weekly, monthly)

Penetration Testing

Authorized simulation of attacks to test defenses:

TypeKnowledgeSimulates
Black BoxNo prior knowledgeExternal attacker
White BoxFull knowledgeInsider or targeted attack
Gray BoxPartial knowledgeCompromised user scenario

Red Team vs Blue Team

Red Team: Adversary simulation

  • Full-scope attack simulation
  • Tests people, process, and technology
  • May include social engineering, physical access
  • Goal: Test overall security posture

Blue Team: Defense and response

  • Monitors for attacks
  • Investigates incidents
  • Improves defenses
  • Goal: Detect and respond effectively

Purple Team: Collaborative improvement

  • Red explains techniques
  • Blue improves detection
  • Faster improvement cycle
  • Shared learning

Security Controls

By Function

TypePurposeExamples
PreventiveStop attacksFirewalls, encryption, access controls
DetectiveIdentify attacksIDS, SIEM, log analysis
CorrectiveFix and restoreBackups, incident response, patches
DeterrentDiscourage attackersWarning banners, visible cameras
CompensatingAlternative controlsExtra monitoring when can’t patch

By Implementation

TypeDescriptionExamples
AdministrativePolicies and proceduresSecurity policy, training, background checks
TechnicalTechnology solutionsFirewalls, encryption, MFA
PhysicalPhysical protectionsLocks, guards, cameras, environmental

Key Takeaways

  1. The CIA triad (Confidentiality, Integrity, Availability) defines core security objectives

  2. MITRE ATT&CK provides a common language for describing attacks and mapping defenses

  3. Threat modeling identifies what to protect, from whom, and how

  4. Defense in depth layers controls so no single failure is catastrophic

  5. Authorization separates security testing from cybercrimeβ€”always get written permission

  6. The attack-defense framework we’ll use throughout Part II analyzes attacks, detection, and mitigation together


Self-Assessment

  1. Comprehension: How does NotPetya illustrate failures in defense in depth?

  2. Application: Using STRIDE, categorize the following: ARP spoofing, DDoS attack, SQL injection, credential theft.

  3. What if: Your penetration test exceeds the agreed scope when you discover a critical vulnerability. What should you do?


Review Questions

  1. What are the three components of the CIA triad, and how do network attacks threaten each?
  2. What is MITRE ATT&CK, and how is it useful for security professionals?
  3. Why is authorization essential for security testing?
  4. What is defense in depth, and why is it important?
  5. How does coordinated disclosure balance vendor needs with user protection?
  6. What’s the difference between red team and penetration testing?