Cloud Identity, Data and Workload ProtectionIntroduction and ContextCloud computing changes the location, ownership, and operation of information systems, but it does not remove the need for security. Instead, it changes how security responsibilities are divided. A cloud provider normally protects the physical facilities, hardware, and foundational services, while the customer remains responsible for identities, configurations, data, applications, and—depending on the service model—operating systems and workloads. This division is commonly called the shared responsibility model. Cloud security therefore requires more than deploying a firewall or installing antivirus software. A secure cloud environment must control who can access resources, what those identities may do, how information is encrypted, where secrets are stored, how networks are segmented, and how virtual machines, containers, and Kubernetes clusters are hardened and monitored. The central design principle is least privilege: every human, service, workload, and automation process should receive only the permissions necessary for an approved task, for only as long as necessary. Least privilege must be combined with strong authentication, secure defaults, continuous monitoring, vulnerability management, and tested recovery procedures. Learning ObjectivesBy the end of this chapter, a learner should be able to: - Explain the shared responsibility model and its implications for cloud security.
- Design identity and access controls using least privilege, federation, and role-based access.
- Apply encryption, key management, and secrets-management principles.
- Secure cloud networks, storage, databases, virtual machines, containers, and Kubernetes.
- Use cloud security posture management and continuous monitoring to identify misconfiguration.
- Evaluate a cloud security design through risk, governance, operational, and ethical perspectives.
1. The Cloud Security Responsibility ModelCloud services are commonly grouped into three models: | Model | Provider generally manages | Customer generally manages |
|---|
| Infrastructure as a Service (IaaS) | Facilities, hardware, virtualization layer | Operating systems, applications, identities, data, network configuration | | Platform as a Service (PaaS) | Infrastructure, operating system, runtime platform | Application code, identities, data, application configuration | | Software as a Service (SaaS) | Most infrastructure and application platform | Users, access policies, data governance, configuration, integrations |
These boundaries are not absolute. The exact responsibilities depend on the provider, service, contract, and configuration. For example, a managed database provider may patch the database engine, but the customer must still control database users, network exposure, encryption settings, retention, and data classification. A useful security review asks four questions: - Who can access the resource?
- What actions can they perform?
- From where and under what conditions can they act?
- How will the organisation detect, investigate, and recover from misuse?
Cloud security is consequently a lifecycle rather than a one-time configuration exercise. Resources are created through code, changed by administrators or pipelines, monitored during operation, and eventually retired. Security controls must operate throughout that lifecycle. 2. Cloud Identity and Access Management2.1 Identities and principalsA cloud principal is an entity that can be authenticated and authorised. Principals include human users, administrators, applications, virtual machines, containers, serverless functions, CI/CD pipelines, and external partner accounts. Authentication establishes identity; authorisation determines permitted actions. These must not be confused. A user may authenticate successfully but still be denied access to a storage object because the applicable policy does not authorise that action. Identity systems usually implement: - Identification: claiming an identity.
- Authentication: proving control of that identity.
- Authorisation: evaluating permitted actions.
- Accounting and auditing: recording what occurred.
2.2 Strong authenticationAdministrative and sensitive access should use phishing-resistant multifactor authentication where possible, such as hardware security keys or platform authenticators. Passwords alone are vulnerable to phishing, credential stuffing, reuse, and theft from malware. Important practices include: - centralise identity through an enterprise identity provider;
- use single sign-on and federation rather than numerous local accounts;
- prohibit shared administrator accounts;
- require multifactor authentication for privileged access;
- use short-lived credentials instead of permanent access keys;
- review dormant, orphaned, and excessive accounts;
- separate emergency or “break-glass” accounts and monitor their use.
Federation allows a cloud service to trust an external identity provider. A user authenticates with the organisation’s provider, which issues a signed assertion or token. The cloud platform then maps the identity to an appropriate role. Federation reduces password duplication and improves centralised deprovisioning. 2.3 Authorisation and least privilegeCloud authorisation commonly uses policies containing an identity, action, resource, and condition. A policy might allow a deployment role to create virtual machines in one account but deny access to production databases. Effective permission is the result of all applicable policies, explicit denies, resource policies, role assumptions, and organisational restrictions. Least privilege should be applied at several levels: - Resource scope: restrict access to named resources rather than an entire account.
- Action scope: permit required operations rather than all operations.
- Condition scope: restrict by network, device, time, authentication strength, or request context.
- Duration: use temporary elevation for exceptional tasks.
- Separation of duties: require different people or roles to approve and perform high-risk actions.
Role-based access control assigns permissions to roles and users to roles. Attribute-based access control uses attributes such as department, project, data classification, location, or device state. Many cloud environments combine both approaches. A practical permission-review process is: - Identify the business task.
- List the resources and actions genuinely required.
- Create a narrowly scoped role.
- Test normal and denied operations.
- Log usage and remove permissions that are unused.
- Revalidate the role when the task, system, or employee changes.
Permission analysis tools can identify unused grants and excessive privilege, but automated recommendations require human review because rare administrative actions may still be necessary during incidents. 3. Protecting Data in the Cloud3.1 Data classification and lifecycleSecurity controls should reflect information value and sensitivity. A practical classification scheme may include public, internal, confidential, and restricted information. Classification should guide encryption, access, retention, geographic placement, backup, and deletion. The data lifecycle includes creation, storage, use, sharing, archival, and destruction. Each stage presents different risks. For example, an encrypted database may still expose information through an unprotected export, debug log, temporary file, or analytics copy. Data discovery and loss prevention systems can identify sensitive data in object stores, databases, endpoints, and collaboration systems. Detection should be paired with corrective action; finding sensitive information is not itself protection. 3.2 EncryptionEncryption transforms readable plaintext into ciphertext using a cryptographic algorithm and key. Encryption in transit protects data moving between clients, services, and networks, commonly through TLS. Encryption at rest protects stored data on disks, databases, backups, and object storage. Encryption in use is more difficult and may involve confidential-computing technologies that protect memory during processing. TLS does not automatically secure every connection. Certificates must be validated, obsolete protocols disabled, trust stores managed, and service-to-service connections configured correctly. Internal traffic should not be assumed safe merely because it remains within a cloud provider’s network. Encryption is not a substitute for access control. An authorised application may decrypt data, and a compromised application may therefore expose plaintext. Logging, application security, tokenisation, minimisation, and strict permissions remain necessary. 3.3 Key managementA key management service or hardware security module can generate, store, use, rotate, disable, and audit cryptographic keys. A sound key-management design separates key administration from ordinary data administration where practical. Key-management principles include: - assign a clear owner and purpose to each key;
- restrict key use through policies and conditions;
- separate key administrators from data users;
- define rotation and revocation procedures;
- protect backup and recovery of key material;
- log every sensitive key operation;
- test whether encrypted data remains recoverable after key loss or policy change.
Key rotation does not necessarily re-encrypt all historical data. Some services use a new key version for new encryption operations while retaining older versions for decryption. The organisation must understand the service’s exact behaviour and retention requirements. 3.4 Secrets managementPasswords, API tokens, private keys, database credentials, signing keys, and certificates are secrets. They should not be embedded in source code, container images, spreadsheets, tickets, or ordinary environment variables where they can be copied or logged. A secrets manager should provide controlled storage, access policies, auditing, versioning, and—where appropriate—automatic rotation. Applications should retrieve secrets at runtime using workload identity. Rotation must be designed operationally: applications need to handle overlapping credentials, failed rotations, and rollback without service interruption. 4. Cloud Network ProtectionCloud networks are software-defined and highly programmable. Typical components include virtual networks, subnets, route tables, security groups, network access control lists, firewalls, private endpoints, load balancers, DNS, and web application firewalls. A robust design separates public-facing components from private workloads. Internet-facing load balancers may reside in public subnets, while application servers and databases remain in private subnets. Administrative access should use a controlled management path, such as a bastion service, privileged access gateway, or private connectivity, rather than exposing management ports to the internet. Security groups and network controlsA security group is generally a stateful, instance- or interface-associated virtual firewall. It commonly defines allowed inbound and outbound traffic, and return traffic is automatically permitted for an established connection. Network access control lists are commonly subnet-level and stateless, meaning return traffic must be considered separately. Provider implementations differ, so documentation and testing are essential. Best practices include: - deny unnecessary inbound traffic;
- avoid unrestricted administrative ports;
- restrict source ranges to known networks or identities;
- control outbound traffic rather than allowing unrestricted egress by default;
- segment workloads by trust level and function;
- use private service endpoints where available;
- monitor DNS, flow logs, firewall decisions, and unusual egress;
- place a web application firewall in front of public web applications.
Network segmentation limits lateral movement but does not create trust automatically. A compromised workload may still exploit an overly permissive identity role or application connection. Identity, network, host, and application controls must therefore reinforce one another. 5. Storage and Database ProtectionObject and file storageObject storage is frequently misconfigured because permissions may exist at account, bucket, object, identity, and network levels. Public access should be disabled by default. Policies should prevent anonymous reads, accidental public writes, and cross-account exposure. Important controls include: - block public access unless explicitly justified;
- require encryption and secure transport;
- use versioning to support recovery from deletion or overwrite;
- enable immutable retention for records requiring tamper resistance;
- apply lifecycle rules to archive or delete data appropriately;
- log data access and administrative changes;
- scan for sensitive information and anomalous downloads;
- test backup restoration and cross-region recovery.
File systems require attention to both cloud identity and operating-system permissions. A shared file system can be secure at the cloud layer but exposed because a mounted host grants excessive local permissions. DatabasesDatabase protection includes network isolation, strong authentication, least-privileged database roles, patching, encryption, auditing, backup, and query monitoring. Application accounts should not normally have schema-administration rights. Separate read, write, migration, reporting, and break-glass roles where practical. Database secrets should be retrieved from a secrets manager. Encryption keys, backup locations, retention, replicas, and snapshots require explicit review. A snapshot may contain a complete copy of production data and must therefore receive equivalent or stronger protection. Parameterised queries and input validation remain essential because cloud-managed databases do not prevent SQL injection. Managed services reduce infrastructure maintenance but do not eliminate application vulnerabilities. 6. Virtual Machines and WorkloadsVirtual machines should be built from hardened, approved images. Image standards should define supported operating systems, patch levels, logging agents, endpoint protection, time synchronisation, configuration baselines, and removal of unnecessary services. A secure virtual-machine lifecycle includes: - Build an image from trusted sources.
- Scan the image for vulnerabilities and embedded secrets.
- Sign or otherwise attest the image where supported.
- Deploy through controlled infrastructure-as-code.
- Apply identity and network restrictions.
- Patch continuously or replace instances using immutable deployment.
- Monitor processes, files, network connections, and logs.
- Securely retire disks, snapshots, and attached identities.
Agent-based endpoint detection can provide process and file visibility, while cloud-native monitoring can detect configuration drift and suspicious API activity. Neither replaces patch management or secure application design. 7. Containers and KubernetesContainers package an application and its dependencies, but they share the host kernel. They are not equivalent to virtual machines and should not be treated as a complete isolation boundary. Container security begins in the software supply chain: - use minimal trusted base images;
- pin dependencies and record provenance;
- scan images and dependencies for vulnerabilities;
- avoid running as root;
- remove shells and unnecessary packages from production images;
- use read-only filesystems where possible;
- never embed secrets in images;
- sign images and verify signatures before deployment.
Kubernetes introduces a control plane, API server, nodes, workloads, service accounts, admission controls, network policies, and persistent storage. The Kubernetes API is a high-value target. Access should use strong authentication, narrowly scoped Role-Based Access Control, audit logging, and separation between namespaces or environments. Workloads should use dedicated service accounts rather than broad default identities. Kubernetes RBAC should distinguish read, create, update, delete, and administrative actions. Network policies should restrict pod-to-pod communication according to application flows. Admission policies can reject privileged containers, host networking, host filesystem mounts, unsigned images, or missing resource limits. Secrets in Kubernetes require special care. Native secret objects may be encoded rather than strongly encrypted unless encryption at rest is configured. External secret managers, envelope encryption, restricted access, and audit logging provide stronger protection. A secret exposed to a pod may still be read by any process with sufficient permissions inside that pod. 8. Security Posture Management and MonitoringCloud security posture management (CSPM) continuously evaluates cloud resources against security policies, benchmarks, organisational requirements, and regulatory obligations. Typical checks identify public storage, unrestricted security groups, disabled logging, weak authentication, unencrypted databases, excessive permissions, vulnerable images, and unsupported software. Posture management is most effective when findings are prioritised by exploitability, exposure, data sensitivity, business impact, and compensating controls. A long list of low-risk alerts can obscure a small number of urgent weaknesses. Detection engineering should combine: - cloud control-plane audit logs;
- network flow and DNS logs;
- operating-system and container telemetry;
- identity-provider events;
- database and storage access logs;
- vulnerability and configuration data;
- threat-intelligence context.
Important detections include impossible travel, unusual role assumption, creation of access keys, disabling of logs, public exposure of sensitive storage, mass deletion, anomalous data transfer, cryptocurrency mining, and deployment of unauthorised images. Infrastructure as code improves repeatability and reviewability. Security policies can be embedded into deployment pipelines so that insecure resources fail before production. However, policy-as-code can contain errors and may not detect runtime drift; both preventive and detective controls are necessary. 9. Applied Case: A Retailer Migrates Its Customer PlatformThis is an illustrative case. BackgroundA medium-sized retailer moves its web platform to the cloud. The architecture includes a public web front end, application services, a managed relational database, object storage for invoices, and a Kubernetes cluster for background processing. ProblemAn initial review finds that developers use long-lived access keys, the database accepts connections from a broad network range, object-storage permissions are inconsistent, and several containers run as root. Security logs are retained for only seven days. The retailer must protect customer information while maintaining rapid deployment. AnalysisThe major risks are credential theft, excessive privilege, lateral movement, public data exposure, container compromise, and inadequate investigation capability. The risks interact: a stolen developer key could alter network rules, access storage, and disable logging. Approach and solutionThe retailer establishes a central identity provider with multifactor authentication and federated short-lived roles. Developers receive separate development roles, while production deployment requires an approved pipeline. Long-lived keys are removed. The database is moved to private subnets. Its security group permits connections only from the application service. Database credentials are stored in a managed secrets service and rotated using an overlap procedure. Object storage blocks public access, requires encrypted transport, enables versioning, and applies restrictive resource policies. The Kubernetes cluster receives dedicated service accounts, narrowly scoped RBAC, network policies, image scanning, signed-image verification, admission rules, and non-root security contexts. Production images use minimal base images and are rebuilt when critical vulnerabilities are discovered. Central audit logs are protected from alteration and retained according to legal and investigative requirements. CSPM checks run continuously, while infrastructure-as-code checks run before deployment. Alerts are routed to the security operations team and tested through incident exercises. OutcomeThe design reduces standing privilege, limits network paths, improves detection, and makes secure deployment repeatable. The retailer does not claim that encryption or managed services eliminate risk; instead, it documents residual risks such as application vulnerabilities, compromised endpoints, and mistakes in policy changes. Learning points- Identity controls are as important as network controls.
- Managed services reduce operational burden but do not remove customer responsibilities.
- Security must be integrated into the delivery pipeline.
- Logs, backups, and recovery procedures are security controls, not administrative extras.
- Least privilege must include humans, applications, containers, and automation.
10. Governance, Ethics, and RegulationCloud governance should define approved regions, data classifications, retention periods, encryption requirements, identity standards, logging, incident reporting, and supplier responsibilities. Regulatory obligations may arise from privacy, financial, health, education, or critical-infrastructure law. Legal requirements vary by jurisdiction, so technical teams should consult the organisation’s legal and compliance functions. Privacy principles include data minimisation, purpose limitation, access transparency, appropriate retention, and secure disposal. Cloud administrators may technically access sensitive information, but access should be justified, logged, monitored, and limited. Security monitoring must also respect employee privacy and applicable employment law. Artificial intelligence can assist with alert triage, policy analysis, anomaly detection, and remediation suggestions. It should not be granted unrestricted authority to change production access or delete data without human-approved safeguards. AI systems may produce false positives, overlook novel attacks, expose sensitive telemetry, or recommend unsafe changes. Human accountability, testing, explainability, and rollback remain necessary. 11. Challenges and LimitationsCloud security programmes face several persistent difficulties: - rapidly changing resources and ephemeral workloads;
- complex, overlapping permission systems;
- inconsistent controls across multiple providers;
- alert fatigue and poorly prioritised findings;
- limited visibility into provider-managed layers;
- insecure third-party images and software dependencies;
- skills shortages and unclear ownership;
- recovery failures caused by untested backups or lost keys;
- trade-offs between security, cost, availability, and deployment speed.
No single control provides complete protection. Encryption cannot correct excessive application permissions; segmentation cannot prevent stolen credentials; vulnerability scanning cannot prove that a workload is safe; and CSPM cannot replace incident response. Defence in depth and continuous assurance are therefore required. Best-Practice Checklist- Use centralised identity, federation, and phishing-resistant multifactor authentication.
- Prefer short-lived workload credentials and eliminate unnecessary permanent keys.
- Apply least privilege to identities, resources, actions, conditions, and duration.
- Classify data and protect every copy, backup, export, and snapshot.
- Encrypt data in transit and at rest, with controlled and audited key management.
- Store secrets in a secrets manager, not in code or images.
- Keep databases and management interfaces private whenever possible.
- Deny public storage access by default and test recovery.
- Build hardened images and scan, sign, and verify container workloads.
- Use Kubernetes RBAC, service accounts, network policies, admission controls, and audit logs.
- Monitor cloud APIs, identities, networks, hosts, containers, storage, and databases.
- Enforce security through infrastructure-as-code and policy-as-code.
- Prioritise findings by business risk and verify remediation.
- Exercise incident response, key recovery, backup restoration, and account compromise scenarios.
Chapter SummaryCloud security is based on shared responsibility, least privilege, defence in depth, and continuous assurance. Identity systems must authenticate users and workloads strongly, provide narrowly scoped authorisation, and produce reliable audit records. Data protection requires classification, encryption, controlled key management, secure secrets handling, retention, backup, and verified destruction. Cloud networks should separate public and private functions, restrict ingress and egress, and combine security groups with identity and application controls. Storage and databases require protection against public exposure, excessive permissions, insecure snapshots, weak credentials, and unmonitored access. Virtual machines should use hardened images and disciplined patching, while containers and Kubernetes require supply-chain security, non-root execution, scoped service accounts, RBAC, network policies, admission controls, and secure secrets. CSPM, logging, infrastructure-as-code, and policy-as-code improve consistency and detection, but they do not eliminate human error or application risk. Effective cloud security joins technical controls with governance, privacy, regulatory awareness, incident response, and tested recovery. Key TermsLeast privilege: Granting only the access necessary for an approved task. Shared responsibility model: Division of security duties between a cloud provider and its customer. Principal: A human, service, application, or workload that can be authenticated and authorised. Authentication: Verification of an identity. Authorisation: Determination of what an authenticated identity may do. Federation: Trust relationship allowing one identity provider to authenticate users for another service. Role-based access control: Assigning permissions to roles that are then assigned to identities. Attribute-based access control: Authorising according to attributes such as user, resource, device, or context. Encryption at rest: Protection of stored data through cryptographic transformation. Encryption in transit: Protection of data while moving between systems. Key-management service: A service for controlling cryptographic keys and their use. Secrets manager: Controlled storage and retrieval system for credentials, tokens, and private keys. Security group: A virtual firewall controlling traffic for cloud resources or interfaces. Cloud security posture management: Continuous assessment of cloud configurations against security requirements. Infrastructure as code: Defining and deploying infrastructure through version-controlled machine-readable files. Container image: Packaged application code, dependencies, and execution metadata. Kubernetes RBAC: Kubernetes authorisation model that grants permissions to users and service accounts. Network policy: Rule controlling communication between workloads or network endpoints. Admission control: Policy enforcement applied when workloads or resources are submitted to Kubernetes. Defence in depth: Use of multiple independent or complementary security controls. Review Questions5 Short Answer Questions- What is the difference between authentication and authorisation?
- State two advantages of federated cloud identity.
- Why is encryption not a substitute for access control?
- What is the purpose of a secrets manager?
- Name two security controls used to protect Kubernetes workloads.
5 Long Answer Questions- Explain the shared responsibility model for IaaS, PaaS, and SaaS, using examples.
- Describe how an organisation can implement least privilege for human users and workloads.
- Discuss a secure design for cloud object storage containing confidential information.
- Explain how virtual-machine and container security differ and where their controls overlap.
- Describe the role of CSPM, audit logs, infrastructure-as-code, and incident response in continuous cloud assurance.
3 Analytical / Application Questions- A storage bucket containing customer invoices has become publicly readable. Analyse the likely causes, immediate response actions, and long-term preventive controls.
- A Kubernetes application requires access to one database table and one object-storage path. Propose an identity, network, secrets, and monitoring design that applies least privilege.
- An organisation wants to allow an AI tool to remediate cloud misconfigurations automatically. Evaluate the benefits, risks, governance safeguards, and circumstances in which human approval should remain mandatory.
Multiple Choice Questions with AnswersQuestion 1Which statement best describes the shared responsibility model? A. The cloud provider is responsible for every aspect of customer security. B. The customer is responsible for physical data-centre security. C. Security duties are divided between provider and customer according to the service and configuration. D. Security responsibility ends once data is encrypted. Correct Answer: C. Security duties are divided between provider and customer according to the service and configuration. Question 2What is the primary purpose of multifactor authentication? A. To remove the need for authorisation policies B. To require more than one category of evidence for identity verification C. To encrypt all stored data automatically D. To prevent every form of phishing Correct Answer: B. To require more than one category of evidence for identity verification Question 3Which practice most directly supports least privilege? A. Giving every developer administrator access during working hours B. Using a single shared production account C. Granting a role only the actions and resources required for its task D. Allowing all outbound network traffic Correct Answer: C. Granting a role only the actions and resources required for its task Question 4Which statement about encryption is correct? A. Encryption eliminates the need for access control. B. Encryption in transit protects data while it moves between systems. C. Encryption guarantees that stolen credentials cannot be abused. D. Encryption makes backup and key recovery unnecessary. Correct Answer: B. Encryption in transit protects data while it moves between systems. Question 5Where should application database passwords preferably be stored? A. In source-code comments B. Inside a public container image C. In a managed secrets service with controlled access D. In a shared spreadsheet Correct Answer: C. In a managed secrets service with controlled access Question 6Which control is most appropriate for reducing accidental public exposure of object storage? A. Disable all audit logging B. Block public access by default and enforce restrictive policies C. Use a larger storage quota D. Grant anonymous write access but deny anonymous read access Correct Answer: B. Block public access by default and enforce restrictive policies Question 7What is a common characteristic of a stateful security group? A. It automatically permits return traffic for an established permitted connection. B. It operates only on physical routers. C. It requires separate rules for every response packet. D. It replaces identity-based authorisation. Correct Answer: A. It automatically permits return traffic for an established permitted connection. Question 8Which Kubernetes practice provides the strongest least-privilege improvement? A. Using the default service account for every workload B. Running every container as a cluster administrator C. Assigning dedicated service accounts with narrowly scoped RBAC permissions D. Disabling Kubernetes audit logs Correct Answer: C. Assigning dedicated service accounts with narrowly scoped RBAC permissions Question 9What is the main purpose of cloud security posture management? A. To replace all application security testing B. To continuously identify configuration and compliance weaknesses in cloud resources C. To generate encryption keys without policies D. To provide physical access to data centres Correct Answer: B. To continuously identify configuration and compliance weaknesses in cloud resources Question 10Why should backups and snapshots receive strong security controls? A. They never contain production information. B. They may contain complete copies of sensitive production data. C. They cannot be accessed by administrators. D. They automatically expire immediately after creation. Correct Answer: B. They may contain complete copies of sensitive production data.
|