
The AWS Puzzle: From an 'F' grade in Amplify to ISO 27001 (Part 3: Frontend and Auditing)
We often assume that keeping our .env file secret means our web application is secure. In this series finale, we examine security at the delivery layer with AWS Amplify, why HTTP headers are just the tip of the iceberg, and how the contrast between breaking a wall with a chisel and building with discipline leads us to true ISO 27001 governance: standardizing daily operational processes so audits and technical reviews are seamless.
Series: The AWS Oversights Puzzle (Level 100: Fundamentals) (3 articles)
- 3The AWS Puzzle: From an 'F' grade in Amplify to ISO 27001 (Part 3: Frontend and Auditing) This article
Seguridad Cloud, Cumplimiento y Respuesta a Incidentes
How we got here: from a local meetup talk to a series that grew along the way
When I began drafting the first article of this series, my sole intention was to share a different perspective on cloud security following an invitation from the AWS User Group Minatitlán. I wanted to step away from traditional slide theory and demonstrate how foundational cloud services interact when someone simply interacts with the terminal without any specialized hacking tools.
However, while writing and publishing, I submitted session proposals (CFP) to regional events like AWS Community Day Peru and AWS Student Community Day Chile, alongside joining Purplespace Academy as an ambassador. The opportunity to bring these security and governance topics to broader community spaces caused the series to evolve step by step.
To be completely honest: this series finale did not end up the way I had initially sketched it in my drafts, which is why it took me a little longer between posts.
The attacker's chisel vs. the defender's discipline
Looking back at our journey up to this point, there is a very interesting contrast in how security works:
To attack (as we saw in Part 1), you truly do not need advanced tooling or movie-style exploits. All it takes is understanding foundational AWS building blocks, seeing how they interact, and chipping away patiently. It is just like being asked to bring down a concrete wall: you take a hammer and chisel and strike at the weakest points. Sooner or later, with persistence, the wall crumbles. You may not have torn it down cleanly or elegantly, but simple
curl requests got the job done.In contrast, defending (which we covered in Part 2) is a completely different story. Tearing down a wall requires persistence; but raising it and keeping it standing demands discipline, planning, and methodology. We had to implement Infrastructure as Code with AWS CDK, understand why migrating from IMDSv1 to IMDSv2 can break applications if legacy SDKs are overlooked, replace static SSH keys with AWS Systems Manager, and realize that CloudTrail does not audit S3 downloads for free unless specific Data Events are configured.
Now, in this third installment, we examine the final piece of the puzzle: web delivery, frontend posture, and operational governance.
The false sense of frontend security: "I kept my .env out of Git, so I'm safe"
Today, it is very common to use managed hosting services such as AWS Amplify. You connect your GitHub repository, configure automated deployments, and within minutes your frontend is globally distributed with an SSL certificate.
The standard habit most of us learn early on is ensuring that the
.env file containing secrets is added to .gitignore . Many developers assume that this single action makes their production website completely secure.However, web security goes far beyond keeping credentials out of source control. When we run a newly deployed application through public analysis tools like SecurityHeaders.com, the initial result is frequently an F grade:

An F grade indicates that your web server delivers content without providing the browser any instructions on how to protect itself:
- Clickjacking: An attacker can embed your application inside an invisible frame (
<iframe>) on an external domain to trick users into performing unintended clicks on your buttons.
- MIME-Sniffing: Legacy browsers attempt to deduce the content type of received files, allowing an apparently benign file to be interpreted and executed as malicious code.
- Transport Degradation: The connection fails to strictly enforce HTTPS for subsequent requests across the domain.
This is why the principle of defense in depth (security in layers) is fundamental. While we will explore multi-layered architectures in detail in a future article, the core takeaway is clear: you cannot wager the security of your entire project on a single defensive check.
The common mistake: asking AI and injecting <meta> tags
When greeted by that bright red grade, a common initial reaction today is asking an AI assistant for a quick fix. Often, the AI provides a suggestion that appears sensible on the surface but is practically ineffective:
"Add
<meta http-equiv='...'> tags inside the <head> of your index.html file."To illustrate why this does not solve the problem, I often share an everyday analogy:
The Laundry Care Label: Imagine a delicate garment whose internal label clearly states: "Wash cold, do not bleach". However, the person doing the laundry never checks the inside: they drop the garment into a washing machine filled with boiling water. The fabric shrinks and is ruined. Only when pulling the damaged clothes out of the tub do they notice the label. The warning arrived too late because the damage already happened during the process.
The web browser operates the exact same way: it must receive security restrictions before parsing and rendering the document. Fundamental directives like
Strict-Transport-Security (HSTS) and X-Frame-Options are strictly ignored by web standards when declared inside HTML <meta> tags; they must travel directly within the HTTP protocol headers.A solution with AWS Amplify: protocol-level headers with customHttp.yml
Headers must be injected by the content delivery network (CDN / Amazon CloudFront) or by the web server before the very first byte of HTML is served.
In AWS Amplify, this is handled by adding a configuration file named
customHttp.yml to the root of your repository, or by navigating directly to the Amplify Console and setting them under the custom headers section:customHeaders: - pattern: '**/*' headers: # Prevents site framing inside iframes (mitigates Clickjacking) - key: 'X-Frame-Options' value: 'DENY' # Prevents browsers from guessing MIME types (mitigates MIME-sniffing) - key: 'X-Content-Type-Options' value: 'nosniff' # Enforces HTTPS connections for 1 year and includes subdomains - key: 'Strict-Transport-Security' value: 'max-age=31536000; includeSubDomains; preload' # Controls referrer information sent with outbound links - key: 'Referrer-Policy' value: 'strict-origin-when-cross-origin' # Restricts browser feature permissions (camera, microphone, geolocation) - key: 'Permissions-Policy' value: 'camera=(), microphone=(), geolocation=()' # Baseline Content Security Policy to restrict trusted origins - key: 'Content-Security-Policy' value: "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:;"After deploying this file in Amplify and re-scanning the domain, your posture shifts completely:

The front gate and the interior deadbolt: compensatory controls and public facade
There is an important nuance that few technical guides discuss: you may not be able to implement an aggressive Content Security Policy (CSP) overnight, particularly if your application relies on dynamic scripts, external payment gateways, or remote fonts that would break under strict enforcement.
Not having a specific header active does not inherently mean your application is compromised, provided you have established an effective complementary or compensatory control (such as rigorous input validation and backend sanitization).
However, consider the practical operational reality:
Imagine you have a high-security double-cylinder deadbolt installed on your front door, but you leave your exterior street gate wide open. A passerby on the sidewalk has no way of knowing how secure your interior door is; they only see an open gate and assume: "Nobody is paying attention here, let's walk in and see what happens."
The web functions identically: you might maintain solid internal protections, but if your public headers score an 'F', your external facade signals to automated scanners and attackers that foundational hygiene is absent. It serves as an open invitation to probe for Clickjacking or injection flaws. And in front of a client or technical assessor evaluating your workload from the outside, the first impression is one of distrust—at least, I certainly would have my doubts.
Conversely, applying headers does not solve everything by magic: locking the exterior gate is essential, but leaving your interior door unlocked or your business logic flawed will still result in an intrusion. Security demands coherence across both your public facade and your internal architecture.
In auditing and compliance, what truly matters is documenting your posture: in ISO/IEC 27001:2022, control A.8.26 (Application security requirements) does not demand blind, instantaneous perfection. Instead, it requires operational coherence. You must know precisely why a directive is not active, what compensatory mechanism mitigates that attack vector, and maintain verified assurance that no unmanaged exposure exists when an auditor or client reviews your workload.
Governance beyond paperwork: lessons from ISO 27001:2022
Throughout this three-part series, we explored oversights involving S3 buckets, EC2 metadata, SSH keys, and web headers. None of these incidents were isolated coincidences: each is directly addressed and mitigated by controls within ISO/IEC 27001:2022.
While a formal standard implementation evaluates all 93 controls in Annex A based on organizational scope, governance is never about writing pretty policies that nobody follows. It is about embedding security into daily operations:
Secure Configuration and Secure Coding (Controls A.8.9 and A.8.28):
The 2022 revision introduced explicit technical controls for secure coding (A.8.28) and configuration management (A.8.9). The SSRF attack in Part 1 originated from an unvalidated URL parameter (
url= ); sanitizing inputs and enforcing hardened baseline configurations (such as requiring IMDSv2 by default in CDK templates) directly satisfies these technical controls.Identity Management, Privileged Access, and Authentication (Controls A.8.2 and A.8.5):
A cornerstone of the standard is ensuring that identities and systems operate under least privilege (A.8.2), scoping IAM policies and eliminating wildcard
* permissions. Additionally, replacing static .pem SSH keys with centralized, short-lived session access via AWS Systems Manager fulfills secure authentication requirements (A.8.5).Event Logging and Activity Monitoring (Controls A.8.15 and A.8.16):
Having CloudTrail enabled is insufficient if you do not understand what it records. Control A.8.16 (monitoring activities, newly introduced in the 2022 revision) mandates observing anomalous access to sensitive data. In Part 2, we highlighted the necessity of selectively enabling Data Events on critical buckets, because an S3 incident that leaves no audit trace cannot be investigated.
The Cloud Shared Responsibility Model (Control A.5.23 and AWS Artifact):
Control A.5.23 covers information security in cloud services. In a formal audit, stating "our SaaS complies because it runs on AWS" immediately disqualifies your claim. Through AWS Artifact, you can download official compliance reports verifying that Amazon secures data center physical facilities and virtualization hypervisors. However, configuring network routing, IAM access policies, S3 public access blocks, and web application headers remains solely your team's responsibility.
In fact, I experienced a very curious bureaucratic loop firsthand: during an organization's audit to achieve our SOC 1 Type 2 attestation report (which is formally an attestation report issued by external auditors rather than a simple certificate), one of the control criteria required us to log into AWS Artifact, download Amazon's SOC 1 Type 2 report, review it, and draft a signed formal letter attesting that we evaluated it and found no subservice organization exceptions affecting our environment.
The irony speaks for itself: you download Amazon's SOC report and sign a formal letter confirming you read it to satisfy the control that grants your own SOC report... which your clients must subsequently download and sign their own letter confirming they read it to satisfy their controls. It feels like excessive administrative overhead, but this formal chain of custody is how operational trust is maintained.
One important operational detail to keep in mind: every report downloaded from AWS Artifact includes an embedded unique watermark tied directly to your AWS account and download session. You cannot simply borrow a PDF from a colleague; AWS maintains direct traceability. Be mindful of where and with whom those documents are shared.
Standardizing processes: BCP and DRP with operational common sense
In any team or project, when internal order is missing, addressing an audit or responding to a client's security questionnaire turns into a chaotic scramble: nobody knows what to answer, team members pass questions around, and days are lost tracking down policies, permissions, and configurations.
Conversely, once you standardize your daily processes (requiring peer-reviewed pull requests before merges, provisioning IAM roles without excessive wildcards, maintaining versioned headers in Git), responding to technical evaluations becomes an orderly, routine task, because audit evidence is generated naturally during daily workflows.
This becomes crystal clear when translating two concepts that often sound overly abstract in textbooks: the Business Continuity Plan (BCP) and the Disaster Recovery Plan (DRP), supported by controls A.5.29, A.5.30, and A.8.13 of ISO/IEC 27001:2022.
These are not static binder documents:
- Business Continuity Plan (BCP - Control A.5.29): How do we keep operating while an active disruption is underway? If a delivery truck gets a flat tire or local grid power fails, continuity means having a predefined response so client commitments do not grind to a halt. In the cloud, this translates to multi-AZ load balancing or serving cached static content through CloudFront while backend services recover.
- Disaster Recovery Plan (DRP - Controls A.5.30 and A.8.13): How do we restore operations if infrastructure suffers catastrophic failure? A DRP is not a backup file stored away and forgotten. Following a severe incident, the plan provides clear, verified steps to restore operations without panicking. In cloud environments: a backup that has never been tested for restoration is not a backup; it is an illusion. Control A.8.13 mandates testing backup restoration regularly. Technical recovery (A.5.30) requires establishing clear recovery objectives (RTO and RPO), automating deployments with declarative templates (CloudFormation or AWS CDK), and performing periodic drills to prove that if a database is corrupted today, your team knows exactly how to rebuild it from scratch without improvisation.
Practical security and standards do not require unattainable enterprise consulting fees. They rely on common sense, everyday discipline, and standardizing how your team responds to operational challenges.
If you would like to explore this hands-on perspective on auditing, risk management, and practical ISO 27001 controls without unnecessary complexity, here is the recording of the community session I delivered at Purplespace Academy:
Closing the series: the complete puzzle
To be completely honest: I did not learn all of this from a pristine textbook. I learned it through real-world trial and error, in projects where systems broke, where tight deadlines challenged us, and where we had to sit down and understand how each piece truly fit together.
I hope that sharing these real-world missteps and lessons helps you avoid those same hurdles across your own cloud environments.
Questions for the community
- Have you tested your application URL on SecurityHeaders.com? What grade did you receive on your initial deployment?
- In your projects, do you enforce complete CSP headers, or have you implemented compensatory controls to support dynamic third-party dependencies?
- In your team or personal initiatives, when was the last time you executed a live restoration drill for your backups (DRP)?
I would love to read your stories and perspectives in the comments below!
Repositories and community references
- Hands-on lab repository (attack and remediation): GitHub Siegfried-FS/lab-red-team
- Community web lab (Chile 2026): GitHub Siegfried-FS/muro-comunidad-aws-chile
- Hands-on workshop recording: AWS User Group Minatitlán on YouTube
- Auditing and governance session: Purplespace Academy on YouTube
#content-creators-latam #AWS #Amplify #Security #WebDev #CloudFront #Auditing #ISO27001:2022
The opinions expressed in this article are those of the author and may not reflect those of AWS.
Series: The AWS Oversights Puzzle (Level 100: Fundamentals) (3 articles)
- 3The AWS Puzzle: From an 'F' grade in Amplify to ISO 27001 (Part 3: Frontend and Auditing) This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article