The Challenge
You need to bring existing infrastructure up to security standards before going to production or passing a security audit. Most cloud deployments start with permissive defaults that leave data unencrypted, networks open, and credentials stored in configuration files. This prompt systematically addresses each security gap.
What You'll Build
- → Encryption at rest and in transit
- → Least-privilege network security rules
- → Centralized secrets management
- → Audit logging for all administrative actions
- → Automated compliance checking
Try This Prompt in Pulumi Neo
Run this prompt in Neo to deploy your infrastructure, or edit it to customize.
Best For
Architecture Overview
This architecture applies security hardening across four layers: data protection, network security, credential management, and audit and compliance. Rather than being a standalone deployment, these security controls wrap around your existing infrastructure, adding encryption to data stores, tightening network rules, moving secrets out of configuration files, and enabling logging and compliance monitoring.
Data protection starts with encryption. Managed encryption keys encrypt all data at rest in databases, object storage, and file systems. TLS certificates encrypt all data in transit between services, users, and external systems. Key rotation happens automatically on a schedule, so encryption remains strong without manual intervention.
Network security moves from the common “allow all” defaults to least-privilege rules. Each security group or firewall rule permits only the specific ports and source ranges that a service requires. This limits the blast radius of a compromise: an attacker who gains access to one service cannot reach other services unless the network rules explicitly permit that communication path.
Data Encryption
Managed encryption keys provide encryption at rest for all data stores. Each service can use a dedicated key, which allows fine-grained access control over who can encrypt and decrypt data. TLS certificates, provisioned through the cloud provider’s certificate management service, encrypt data in transit. Certificate renewal is automatic, eliminating the risk of expired certificates causing outages or security lapses.
Network Security
Network security groups or firewall rules are tightened to follow the principle of least privilege. Each rule specifies the exact port, protocol, and source range needed for the service to function. Rules that allow access from “anywhere” (0.0.0.0/0) are replaced with specific CIDR ranges or security group references. This review process often reveals overly permissive rules that were set during initial development and never tightened.
Secrets Management
Credentials, API keys, database passwords, and other sensitive values move from environment variables, configuration files, or source code into a managed secrets store. Applications retrieve secrets at runtime through the cloud provider’s API, which means secrets never appear in code repositories or deployment artifacts. Access to each secret is controlled by IAM policies, creating an auditable record of which services access which credentials.
Audit and Compliance
Audit logging records every administrative API call, including who made the call, when, from which IP address, and what changed. These logs are stored immutably so they cannot be tampered with. Automated compliance rules continuously evaluate resource configurations against security policies and flag violations, such as an unencrypted database or a public S3 bucket, as soon as they appear.
Common Customizations
- Add vulnerability scanning: Extend the prompt to include container image scanning or host-based vulnerability assessment that checks for known CVEs in deployed software.
- Map to a specific framework: Request compliance rules aligned with a specific framework like CIS Benchmarks, SOC 2, PCI-DSS, or HIPAA for targeted compliance monitoring.
- Add automated remediation: Ask for Lambda functions or automation rules that automatically fix common violations like re-enabling encryption or closing open security groups.
- Add identity federation: Request integration with your corporate identity provider (Okta, Azure AD, Google Workspace) for single sign-on to cloud resources.
Related Prompts
Build a Security and Compliance Stack
You need infrastructure that meets security and compliance requirements from day one. Rather than retrofitting security …
Deploy PCI-DSS Compliant Payment Infrastructure on Azure
You need infrastructure that meets PCI-DSS requirements for processing, storing, or transmitting payment card data. Any …
Deploy HIPAA-Compliant Infrastructure on AWS
You need infrastructure that meets HIPAA requirements for handling protected health information. Healthcare applications …