Cloud computing basics
Cloud computing is integral to modern technology. The cloud is essentially “someone else’s computer.”
Types of cloud services
IaaS (Infrastructure as a Service)
- Provides virtualized computing resources over the internet.
- Users manage applications, data, runtime, middleware, and OS.
- Providers manage virtualization, servers, storage, and networking.
PaaS (Platform as a Service)::
- Offers hardware and software tools over the internet.
- Users manage applications and data.
- Providers handle runtime, middleware, OS, virtualization, servers, storage, and networking.
SaaS (Software as a Service):
- Delivers software applications over the internet.
- Providers manage all aspects of the service.
- e.g. Google Suite (Gmail, Google Docs, etc.).
IDaaS (Identity as a Service):
- Manages user identities and access.
- Includes single sign-on (SSO) and multi-factor authentication (MFA).
SECaaS (Security as a Service):
- Provides security services via the cloud.
- Includes automated penetration testing, antivirus (AV), and endpoint detection and response (EDR).
CaaS (Container as a Service):
- Offers container-based virtualization.
- e.g. Amazon S3 buckets and other container services.
FaaS (Function as a Service):
- Enables functions to be executed in the cloud.
- e.g. AWS Lambda.
Responsibility areas
- On-premises: user is responsible for all aspects of infrastructure and software.
- IaaS: provider handles physical aspects and virtualization; user handles software and data.
- PaaS: provider manages everything except applications and data.
- SaaS: provider manages all aspects of the service.
Deployment models
- Public cloud: services offered over the public internet and available to anyone.
- Private cloud: sxclusive to a single organization, offering more control and security.
- Community cloud: shared among multiple organizations with common concerns (e.g. Healthcare providers sharing infrastructure for secure data exchange).
- Hybrid cloud: combination of public, private, and community cloud models.
- Multi-cloud: utilizes services from multiple cloud providers for redundancy or specialized capabilities. Managed through a single interface by third-party brokers.
NIST cloud deployment reference architecture
- Cloud consumer: end user or organization using the cloud service.
- Cloud provider: entity providing cloud services.
- Cloud carrier: enables network connectivity between consumers and providers.
- Cloud broker: manages and integrates multiple cloud services for consumers.
- Cloud auditor: conducts independent assessments of cloud implementations.
Cloud storage architecture
- Front-end: user-facing interaction layer (e.g., APIs, web apps).
- Back-end: physical hardware (servers, networking).
- Middleware: handles data deduplication, replication, and storage efficiency.
Categories of cloud brokers
Service Intermediation
- Description: Enhances an existing service by improving specific capabilities.
- Example: A broker might add security features to a basic cloud storage service, providing encryption and access control that the original service lacks.
Service Aggregation
- Description: Combines multiple services into one unified service. It handles data integration and ensures the services work together seamlessly.
- Example: A broker could integrate cloud storage from one provider, computing power from another, and database services from a third into a single package.
Service Arbitrage
- Description: Provides flexibility in choosing services from multiple providers based on current conditions and requirements. The broker evaluates and selects the best options dynamically.
- Example: A broker might switch between cloud providers for the best price or performance for a specific task, such as shifting from AWS to Azure if Azure offers a better rate or performance for a given workload.
Container basics
A container is a portable software package that includes everything needed to run an application, such as configuration files, libraries, and dependencies. This ensures consistency, scalability, and cost-effectiveness. They simplify the development process by providing predefined environments, reducing setup time, and ensuring applications run consistently across different platforms.
Five-tier container architecture (as defined by EC-Council)
Developer Machines:
- Used for image creation, testing, and accreditation.
- Ensures the image is ready for use.
Testing and Accreditation Systems:
- Verifies and validates image contents.
- Signs the images for integrity and readiness.
Registries:
- Stores container images.
- Supports image delivery via orchestration software.
Orchestrators:
- Transforms images into containers and deploys them.
- Manages large-scale container deployments programmatically.
Hosts: operate and manage containers based on orchestrator instructions.
Key terms and concepts
Docker:
- A leading platform for building, deploying, and managing containerized applications.
- Features:
- Docker Images: Base templates for creating containers.
- Docker Daemon: Manages Docker objects and handles API requests.
- Docker Registry (e.g., Docker Hub): Repository for official and custom container images.
- Docker Files: Text files with commands for creating container images.
Orchestration:
- Automates the container lifecycle, including:
- Provisioning and deployment.
- Resource allocation and scaling.
- Security and monitoring.
- Popular tools: Kubernetes, OpenShift, Docker Swarm, Ansible.
Security Challenges in Containerization
- Untrusted images:
- Public containers may contain outdated software or vulnerabilities.
- Perform thorough checks before deployment.
- Container breakout:
- Attackers may exploit vulnerabilities to escape the container and access the host system.
- Running containers as root increases risks.
- Insecure secrets: API keys, usernames, and passwords stored insecurely in containers can be exploited.
- Noisy neighbor: a container consuming excessive host resources can cause other containers to fail.
- Vulnerable source code: containers used for testing may expose organizations to attacks if insecure code is deployed.
Hacking cloud services
Cloud vulnerability scanning
- Purpose: Identifies security weaknesses in cloud-specific configurations, not just OS or application vulnerabilities.
- Focus Areas:
- Cloud misconfigurations (e.g., AWS, Azure).
- Vulnerable containers and container images.
- Sensitive information leaks and insecure practices.
- Trivy: comprehensive security scanner for container images, Git repositories, virtual machine images, Kubernetes, and AWS. Detects CVEs, IAC issues, sensitive information leaks, and software license violations.
- Clair: open-source tool for static analysis of vulnerabilities in application containers (OCI and Docker).
- DAGDA: performs static analysis for known vulnerabilities, malware, and anomalous activities in Docker images/containers.
- Paloalto Prisma (previously Twistlock): cloud-native cybersecurity platform for full lifecycle security in containerized environments and cloud-native applications.
- Sysdig: focuses on Kubernetes security, enumerating key storage, API objects, configuration files, and open ports.
S3 Discovery and Enumeration
- Common issues:
- Publicly readable buckets exposing sensitive data (keys, credentials, private files).
- Incorrect permissions allowing unauthorized access.
- Tools:
- Manual methods:
- Checking source code for S3 bucket URLs.
- Using brute-forcing techniques with tools like Burp Suite or custom scripts.
AWS privilege escalation techniques
- Public AMIs: downloading and analyzing shared AMIs for sensitive information.
Pentesting AWS environments
- Tools:
- Pakku: framework for AWS penetration testing, automating enumeration and misconfiguration analysis.
- Cloud Goat: creates an insecure AWS environment for testing.
- Focus Areas:
- IAM role analysis and misconfiguration.
- Privilege escalation through found keys or roles.
- Metadata service abuse.
Key security concerns
- Publicly Accessible Resources: public buckets and AMIs exposing sensitive data.
- IAM Misconfigurations: roles with excessive permissions or improper restrictions.
- Metadata Service Exploits: using SSRF vulnerabilities to gain access to AWS credentials.
Cloud security controls
Measures implemented to enhance the security of cloud systems.
Categories
- Standard Security Controls: traditional measures applicable to cloud environments.
- Cloud-Specific Security Controls: tailored measures for cloud systems.
Standard security controls
- Secure Software Development Lifecycle (SDLC):
- Prevent flaws in cloud-hosted applications and APIs.
- Example: Avoid leaking AWS credentials.
- Patching and updates:
- Ensure operating systems, applications, and infrastructure are up-to-date.
- Prevent exploitation of known vulnerabilities (e.g., EternalBlue).
- Change default configurations: avoid using default credentials or settings.
- Firewalls and intrusion detection/prevention: use tools like IDS, IPS, and WAF for monitoring and defense.
- Logging and monitoring: track activity to detect anomalies and respond quickly.
- Denial-of-Service mitigation: use devices or services to prevent DoS/DDoS attacks.
- Encryption: rncrypt sensitive data at rest and in transit.
- Endpoint Protection: feploy antivirus and EDR solutions.
Cloud-specific security controls
- S3 Bucket Permissions:
- Ensure correct access controls for S3 buckets.
- Enable features like default encryption and versioning.
- Docker Security Best Practices (via OWASP):
- Use trusted Docker images.
- Limit container capabilities and use “no new privileges” flags.
- Disable inter-container communication when unnecessary.
- Run Docker in rootless mode.
- Kubernetes Security Best Practices:
- Keep Kubernetes up-to-date.
- Restrict API access using namespaces and network policies.
- Conduct regular security audits.
- Qualys: cloud vulnerability scanning and security assessments.
- Prisma cloud: cloud-native application protection platform by Palo Alto Networks.
- Aqua Sscurity: protects workloads, cloud platforms, and Kubernetes deployments.
- Tenable: comprehensive tools for cloud and on-prem vulnerability management.
- Kubebench: open-source tool for checking Kubernetes deployment security against CIS benchmarks.
- Sumo logic: provides observability and security analytics for cloud deployments.