Supply Chain Attacks, Credential Theft and Cloud Intrusions
Introduction: The Modern Attack Surface
- What This Book Covers
- How This Book Is Structured
- Who Should Read This Book
- The Principle of Engineering Understanding
- Scope and Limitations
- A Note on Citations and Verification
- The Path Ahead
Chapter 1: Protocol and Architecture Foundations
- HTTP and HTTPS: TLS mechanics, certificates and downgrade attacks
- Authentication and Authorization: Kerberos, OAuth/OIDC, SAML, JWT fundamentals
- Cloud Control Planes and Data Planes: How APIs mediate all cloud operations
- Container and Kubernetes Architecture: Pods, nodes, CNI, orchestration internals
- Cryptography for Attackers and Defenders: Key management, PKI, hashing in practice
- Security Boundaries and Trust Relationships: What “trust” means in modern stacks
Chapter 2: Adversary Tactics, Techniques and the Kill Chain
- MITRE ATT&CK Mapping: Initial access to exfiltration in modern campaigns
- Kill Chain Variations: Traditional vs cloud-native vs supply-chain intrusions
- Attribution and TTPs: Reading adversary behavior from artifacts
- Blue Team Integration: How red and purple teams use the framework
- Detection Engineering Fundamentals: Logs, telemetry and hypothesis-driven detection
- Real Campaign Anatomy: A documented intrusion mapped to ATT&CK
Chapter 3: Package Ecosystems and Dependency Risks
- npm Ecosystem Mechanics: How npm publishes, resolves and caches packages
- Python PyPI and pip: Dependency resolution, wheels and environment management
- Java/Maven, RubyGems and other registries: Architecture and threat models
- Transitive Dependencies: Why indirect deps dominate the attack surface
- Lockfiles, Semver and Dependency Pinning: Practices and gaps
- Case Study: How a single dependency can compromise thousands of projects
Chapter 4: Typosquatting, Dependency Confusion and Package Poisoning
- Typosquatting: Registering lookalike package names and social dynamics
- Dependency Confusion: Internal vs public registry priority attacks (Tidepool, PyPI)
- Subresource Takeover and URL Hijacking: Leveraging broken CNAMEs and redirects
- Malicious Code Injection: What attackers actually do inside packages
- Automated Detection: Tools, scanners and monitoring approaches
Chapter 5: Repository and Source Code Compromise
- GitHub, GitLab, Bitbucket Authentication Models: Personal vs org-level access
- Compromised Developer Accounts: From credential theft to push access
- Malicious Pull Requests: Social engineering and automation abuse
- Webhook and Integration Exploitation: CI triggers and GitHub Actions abuse
- Git History Attacks: Rewriting history, malicious merge commits
- Defense: Repository policies, CODEOWNERS, branch protection, SCA
Chapter 6: Build Pipeline and CI/CD Exploitation
- CI/CD Pipeline Architecture: Triggers, runners, secrets and artifacts
- GitHub Actions Exploitation: Malicious action workflows and self-hosted runner abuse
- Jenkins Security: Groovy sandbox escapes, plugin vulnerabilities, credential theft
- Secrets in Pipelines: Environment variable exposure and log leakage
- Build System Attacks: Compiler injection, BOM poisoning, Makefile manipulation
- Defense: Pipeline hardening, runner isolation, secret scanning, signed artifacts
Chapter 7: Code Signing, Attestation and Artifact Security
- Code Signing Infrastructure: X.509, code-signing certs, cross-platform tools
- Compromised Signing Keys: How attackers get them (SolarWinds, CCleaner)
- Supply Chain Attestation: Sigstore, cosign, in-toto, SLSA
- Binary Analysis and Provenance: Verifying artifact origins
- Certificate Transparency for Code Signing: Monitoring and detection
- Defense: Key management, HSMs, short-lived certs, attestation verification
Chapter 8: Authentication Protocols and Credential Mechanics
- Password Storage: Hashing, salting, rainbow tables and cracking methodologies
- NTLM and Kerberos: Windows authentication internals
- Token-Based Authentication: JWT structure, validation and common mistakes
- Multi-Factor Authentication: OTP, push-based, FIDO2/WebAuthn mechanics
- OAuth 2.0 Authorization Flows: Authorization code, implicit, client credentials
- SAML Assertions and Federation: XML-based identity and trust
Chapter 9: Phishing, Harvesting and Social Engineering at Scale
- Credential Harvesting Pages: Lookalike portals and reverse proxies
- AD FS and Conditional Access Bypass: How phishing evades protections
- Evilginx2 and Modern Phishing Proxies: MFA-aware credential theft
- Email Compromise Chains: From domain spoofing to BEC
- MFA Fatigue and Prompt Bombing: User-targeted authentication attacks
- Defense: Phishing-resistant auth, user awareness, email security controls
Chapter 10: Token Theft, Session Hijacking and Cookie Compromise
- Cookie Attributes and Security: Secure, HttpOnly, SameSite and their limits
- XSS and Session Theft: From stored XSS to token extraction
- Token Storage Best Practices: Client-side vs server-side, HTTP-only vs localStorage
- CSRF and Cross-Origin Attacks: When SameSite fails
- Browser and OS Token Caches: Credential roaming and credential dumping
Chapter 11: Active Directory and On-Premises Identity Attacks
- AD Core: Domains, forests, trusts and authentication flows
- Kerberoasting, AS-REP Roasting and Password Spraying
- DCSync and Golden Ticket: Domain controller compromise mechanics
- ACL Abuse and Privilege Escalation: ACE editing, group membership abuse
- BloodHound and AD Reconnaissance: Graph-based attack path mapping
- Defense: Hardening, constrained delegation, monitoring, tiering models
Chapter 12: Cloud Identity: Azure AD/Entra ID and IAM Exploitation
- Entra ID Architecture: Tenants, users, groups, service principals, conditional access
- Service Principal and App Registration Abuse: Over-permissioned apps
- OAuth/OIDC Attack Vectors in Azure: Consent phishing, token replay
- Privileged Identity Management (PIM): Bypass and abuse
- Cross-Tenant Attacks and Trust: B2B, guest access and federation risks
- Defense: Least privilege, monitoring sign-in logs, PIM policies, conditional access
Chapter 13: Secrets Management and API Key Compromise
- Secrets in Source Code: Accidental commits, GitHub exposure, scanning tools
- Secrets in CI/CD: Environment variables, pipeline artifacts, log leaks
- Cloud Secrets: AWS Secrets Manager, Azure Key Vault, GCP Secret Manager
- API Key Leakage: Public repos, configuration files and SaaS integrations
- Credential Roasting and Token Dumping: From memory and keychain
Chapter 14: AWS Cloud Intrusion: IAM, Metadata and Lateral Movement
- IAM Mechanics: Policies, roles, users, trust relationships, conditions
- Over-Privileged Roles and IAM Policy Abuse: Escalation via iam:PassRole, sts:AssumeRole
- EC2 Instance Metadata Service: IMDSv1 vs IMDSv2, SSRF paths
- S3 Misconfigurations: Public buckets, ACL attacks, data exfiltration
- AWS Lambda and Serverless: Privilege escalation, cold-start attacks
- Defense: SCPs, IAM Access Analyzer, instance metadata hardening, GuardDuty
Chapter 15: Azure Cloud Intrusion: Entra ID, RBAC and Managed Identities
- Azure RBAC: Role definitions, assignments and scope
- Managed Identities and User-Assigned Identities: Abuse vectors
- Azure AD Connect and Hybrid Identity: Compromise bridges between on-prem and cloud
- Key Vault Exploitation: Access policies, permissions escalation
- Azure Resource Graph and Control Plane: Reconnaissance techniques
- Defense: Just-in-time access, PIM, Azure Policy, network segmentation
Chapter 16: Google Cloud Intrusion: IAM, Workload Identity and Kubernetes
- GCP IAM: Service accounts, roles, organization policies
- Workload Identity Federation: How it works and abuse scenarios
- Google Kubernetes Engine (GKE): Node pool attacks, pod identity
- Cloud Storage and Data Loss: Bucket policies and data exfiltration
- Service Control Policies and Organization Policies: Enforcement gaps
Chapter 17: Container Escape, Kubernetes Compromise and Cluster Intrusion
- Container Isolation: Namespaces, cgroups, capabilities and their limits
- Container Escape Techniques: Privileged mode, mount attacks, kernel exploits
- Kubernetes API Server Attacks: RBAC abuse, service account token theft
- Pod Security Policies and Pod Security Standards: What they enforce and bypass
- Egress and CNI Attacks: Network policy abuse and lateral movement
- Defense: Hardening, runtime security, pod security, network policies
Chapter 18: Attack Chain Case Studies
- SolarWinds SUNBURST: Supply chain, persistence and evasion (documented)
- MOVEit Transfer: Third-party vulnerability exploitation at scale
- 2023–2024 npm Supply Chain Campaigns: Malicious packages in action
- Hypothetical Campaign 1: Dependency confusion to cloud lateral movement
- Hypothetical Campaign 2: Phishing to AD compromise to cloud exfiltration
- Common Patterns: What links these campaigns and how defenses fail
Chapter 19: Detection Engineering, Incident Response and Continuous Defense
- Detection Architecture: Logging strategy, telemetry collection, SIEM design
- YARA Rules and File Detection: Writing rules for supply chain indicators
- Sigma and SIEM Rules: Query-based detection for cloud and identity attacks
- Cloud-Native Monitoring: GuardDuty, Microsoft Defender, Chronicle
- Incident Reconstruction: Timeline building, evidence preservation, forensics
- Purple Team Exercises: Validating defenses with adversary emulation
Conclusion: The Engineering Mindset for Defense
Appendix A: Laboratory Setup Guide
- Prerequisites
- Supply Chain Security Lab
- Active Directory Lab
- AWS Cloud Lab
- Kubernetes Security Lab
- Security Notes for All Labs
Appendix B: Tool Reference
Appendix C: MITRE ATT&CK Technique Index
- Supply Chain (Initial Access, Tactic TA0001)
- Credential Access (Tactic TA0006)
- Persistence (Tactic TA0003)
- Privilege Escalation (Tactic TA0004)
- Defense Evasion (Tactic TA0005)
- Lateral Movement (Tactic TA0008)
- Cloud and Containers
- Command and Control (Tactic TA0011)
- Exfiltration (Tactic TA0010)