Monday, 30 November 2026

AWS Log Analysis With Amazon Athena From a SOC and Cloud Security Perspective


Introduction

It’s 2 a.m., and the dashboard shows a sudden spike in 403 responses. Is it an attack, a misfiring WAF rule or a broken deployment? The answer is in the logs, but AWS WAF, Amazon CloudFront and the Application Load Balancer (ALB) can generate millions of log lines a day. Reading them by hand slows the investigation and makes it easy to miss the pattern that matters.

Amazon Athena lets SOC analysts query those logs where they already sit in Amazon S3, using standard SQL and no servers to manage. This post walks through the queries and workflow we use to go from a suspicion to evidence, and from evidence to a safe mitigation.

How Athena fits into the log pipeline

WAF, CloudFront and ALB deliver logs to S3. The AWS Glue Data Catalog holds the table definitions, and Athena runs SQL on top of them.

AWS WAF, CloudFront and ALB logs flow into Amazon S3, are described in the Glue Data Catalog, queried with Amazon Athena and used for SOC analysis. A note explains log delivery delays.

Figure 1: From raw logs to SOC evidence

Two things are worth getting right from day one. First, create your tables with partition projection, using the DDL in the Athena documentation. Athena then recognises new partitions automatically, so there are no crawlers to schedule and no partitions to add by hand.

Second, know your delivery delays. WAF and ALB deliver logs to S3 roughly every five minutes. CloudFront usually delivers within an hour, but some entries can arrive up to 24 hours later. Athena is an investigation and threat-hunting tool; real-time alerting still belongs in CloudWatch metrics or your SIEM.

Note: The SQL in this post is illustrative. It assumes tables named waf_logs, alb_access_logs and cloudfront_standard_logs, created from the AWS-documented DDL with partition projection. Adjust table names, columns and partition keys to match your environment.

Finding blocked requests in AWS WAF

The first question in most WAF investigations is simple: what is being blocked, from where, and by which rule?

SELECT
  from_unixtime(timestamp / 1000) AS event_time,
  terminatingruleid,
  httprequest.clientip   AS client_ip,
  httprequest.httpmethod AS method,
  httprequest.uri        AS uri,
  httprequest.country    AS country
FROM waf_logs
WHERE log_time BETWEEN '2026/11/26/00/00' AND '2026/11/26/23/59'
  AND action = 'BLOCK'
ORDER BY timestamp DESC
LIMIT 100;

WAF stores timestamps in epoch milliseconds, so from_unixtime() makes them readable, and the log_time filter limits the scan to a single day.

[Screenshot 1: Athena console showing the blocked requests query and its results. Mask client IPs, account IDs, bucket and web ACL names.]


This quickly shows repeated blocks, the rules responsible and the endpoints being targeted. It also reveals rules that block legitimate traffic, which is where WAF tuning begins.

Which managed rule actually fired?

If you use AWS Managed Rules, terminatingruleid shows the rule group, such as the Core Rule Set, not the individual rule that matched. For tuning, you need the rule inside the group:

SELECT rg.rulegroupid, rg.terminatingrule.ruleid AS rule_id, COUNT(*) AS blocked_requests FROM waf_logs CROSS JOIN UNNEST(rulegrouplist) AS t(rg) WHERE log_time BETWEEN '2026/11/26/00/00' AND '2026/11/26/23/59' AND action = 'BLOCK' AND rg.terminatingrule IS NOT NULL GROUP BY rg.rulegroupid, rg.terminatingrule.ruleid ORDER BY blocked_requests DESC LIMIT 20;

A single noisy rule, such as a body-size check firing on a legitimate file-upload API, is far easier to fix than an entire rule group.

High-volume blocked IPs need context

Grouping blocked requests by source IP highlights scanning and automated activity:

SELECT httprequest.clientip AS client_ip, httprequest.country AS country, COUNT(*) AS blocked_requests, COUNT(DISTINCT httprequest.uri) AS distinct_uris, array_agg(DISTINCT terminatingruleid) AS rules_hit FROM waf_logs WHERE log_time BETWEEN '2026/11/26/00/00' AND '2026/11/26/23/59' AND action = 'BLOCK' GROUP BY httprequest.clientip, httprequest.country ORDER BY blocked_requests DESC LIMIT 20;

[Screenshot 2: Top blocked IP addresses with request counts. Mask or replace real IPs.]

A high count alone does not prove malicious intent; it could be a partner integration, a monitoring service or a corporate NAT. The distinct URI count adds context. One IP hitting hundreds of different paths looks like scanning, while thousands of requests to a single login endpoint looks like credential stuffing. Attackers using rotating proxies spread requests across many IPs, so rate-based rules and behavioural signals usually work better than blocking one address at a time.

Separating security errors from application errors

HTTP 4xx and 5xx responses can mean an attack, a misconfiguration or a failing backend. ALB logs help tell them apart because they record both the load balancer’s status code and the target’s.

SELECT url_extract_path(request_url) AS path, elb_status_code, target_status_code, COUNT(*) AS error_count FROM alb_access_logs WHERE day = '2026/11/26' AND elb_status_code BETWEEN 500 AND 599 GROUP BY url_extract_path(request_url), elb_status_code, target_status_code ORDER BY error_count DESC LIMIT 50;

[Screenshot 3: ALB 5xx results showing ELB and target status codes.]

A target_status_code of “-” means the target never responded, so the ALB generated the error itself, often a 502 or 504 from an unhealthy or slow backend. Grouping on url_extract_path() instead of the raw URL stops query strings from splitting one endpoint into thousands of rows. The same approach works for CloudFront: filter sc_status between 400 and 599 and group by cs_uri_stem.

Correlating WAF, CloudFront and ALB
Correlation is where investigations are won or lost, and IP addresses alone can mislead you.

Request path from visitor through CloudFront with AWS WAF, to the ALB and the application. WAF and CloudFront logs record the real visitor IP and can be joined on request ID; the ALB log records a CloudFront edge IP as the client.

Figure 2: Which log sees what, and how to join them

When CloudFront sits in front of an ALB, the ALB access log records a CloudFront edge address as the client, not the visitor, and it does not include the X-Forwarded-For header. The reliable link between WAF and CloudFront is the request ID. For a web ACL attached to CloudFront, the WAF requestid matches CloudFront’s x_edge_request_id; for a web ACL attached to an ALB, it is the ALB trace ID.

SELECT from_unixtime(w.timestamp / 1000) AS event_time, w.httprequest.clientip AS client_ip, w.action, w.terminatingruleid, c.cs_uri_stem, c.sc_status, c.x_edge_result_type FROM waf_logs w JOIN cloudfront_standard_logs c ON w.httprequest.requestid = c.x_edge_request_id WHERE w.log_time BETWEEN '2026/11/26/00/00' AND '2026/11/26/23/59' AND c."date" = DATE '2026-11-26' AND c.sc_status >= 400 LIMIT 100;

Rows where WAF allowed the request but CloudFront still returned an error point to the origin. Rows where WAF blocked it show a security control working as intended. To follow a request on to the ALB, correlate on time window and path, or log the X-Amz-Cf-Id or X-Forwarded-For header in your application.
Partitioning keeps queries fast and cheap
Athena charges for the data each query scans, with a 10 MB minimum per query, so an unfiltered query over months of logs is slow and expensive.
  • Always filter on the partition column: log_time for WAF, day for ALB.
  • Select only the columns you need instead of every column.
  • Convert large or long-lived datasets to compressed Parquet. For CloudFront, standard logging (v2) can deliver partitioned Parquet output.
  • Set a per-query data-scan limit in your Athena workgroup, so one mistyped query cannot scan terabytes.

[Screenshot 4: Athena query stats showing data scanned with and without a partition filter.]

Protect the logs as evidence
During an incident, logs become evidence. Treat the bucket accordingly:
  • Encrypt with SSE-KMS, and give analysts read-only access through least-privilege IAM roles.
  • Enable versioning and S3 Object Lock, so logs cannot be altered or deleted during an investigation.
  • Redact sensitive fields such as Authorization and Cookie headers in WAF logging, and leave CloudFront cookie logging off unless you need it.
  • Encrypt Athena query results, and set S3 lifecycle rules that match your retention policy.
From investigation to mitigation
Athena does not block threats itself. It gives SOC teams the evidence to act with confidence.

Five steps in a loop: identify, investigate, correlate, mitigate and validate, with validation feeding back into identification.
Figure 3: The SOC investigation loop

Keep mitigations as narrow as the evidence: a scoped rule exclusion for one path, a rate-based rule for a burst, or an IP set for a confirmed bad actor. Then re-run the same queries on later logs to prove the change worked.

Tune WAF rules safely with COUNT mode

Flowchart: a new or changed rule is deployed in COUNT mode, its matches are queried in Athena, and if legitimate traffic matched the rule is scoped down and re-tested; otherwise it is switched to BLOCK and monitored.

Figure 4: Tune WAF rules safely with COUNT mode

Deploy new or changed rules in COUNT mode first. COUNT matches do not appear in BLOCK results; WAF records them in nonterminatingmatchingrules:
SELECT r.ruleid, httprequest.uri AS uri, COUNT(*) AS would_have_blocked FROM waf_logs CROSS JOIN UNNEST(nonterminatingmatchingrules) AS t(r) WHERE log_time BETWEEN '2026/11/26/00/00' AND '2026/11/26/23/59' AND r.action = 'COUNT' GROUP BY r.ruleid, httprequest.uri ORDER BY would_have_blocked DESC LIMIT 50;

If you override rules inside a managed rule group to COUNT, look in rulegrouplist instead. Once the results show only traffic you intend to stop, switch the rule to BLOCK and keep monitoring.

What changed for our SOC

[Author to add 2–3 real, anonymised results before publishing, for example: average WAF alert investigation time down from X to Y minutes; data scanned per query reduced by Z% after partition projection; N false-positive rules tuned in the first month. If no figures can be shared, keep the bullets below and delete this note.]

  • Faster triage of blocked requests and suspicious IPs
  • Clear separation of security events from application errors
  • Evidence-based WAF tuning with fewer false positives
  • Predictable, lower query costs through partitioning
Conclusion

Logs are only useful when you can read them quickly. Collecting them is the easy part. Knowing what normal looks like, spotting what is dangerous and acting on it with evidence is what lets a SOC respond faster and protect applications without adding noise.

Over to you: which log source gives your SOC the most trouble today: WAF, CloudFront or ALB? Tell us in the comments. [Marketing: add Cloud.in contact or services link here.]


The blog is written by Onkar Sadiwal,Soc Analyst, Cloud.in

How Vector Databases Power Enterprise AI Applications


Why a regular database isn't enough

Ask a chatbot about your company's refund policy and it may just make something up. Vector databases help fix this. They let an AI tool look through your own documents before it answers. They search by meaning, not just by matching exact words.

Most of what a company knows is not in neat tables. It sits in contracts, support tickets, emails, manuals and call recordings. Keyword search does not work well on these. If you search for "refund delay", you will miss a document that says "late reimbursement." A large language model (LLM, the kind of AI behind chatbots) has a different problem. It writes well, but it has never seen your private files, and it only knows things up to the date it was trained.

The common fix is called retrieval-augmented generation, or RAG. The idea comes from a 2020 paper by Lewis and colleagues. They connected a text-writing model to a searchable collection of documents. The answers were more specific and more accurate than answers from a model using only its own memory. The team also showed that you can update what the model knows just by changing the collection . A vector database is that collection, built to work at company scale.

Businesses are spending more on this, but forecasts differ on how fast. MarketsandMarkets says the market was about USD 2.65 billion in 2025 and will reach USD 8.95 billion by 2030, growing 27.5% a year . GMI starts at a similar USD 2.55 billion but expects 22.3% growth a year through 2034 . Technavio is more careful, at 14.7% a year for 2024 to 2029 . They all agree the market is growing, just not on the speed. One survey of 245 architects, published by the surveyor itself, found that 73.5% use RAG as their main way to connect AI to company knowledge . Treat that as a rough hint, not a firm fact.

This post explains how vector databases work, what companies use them for, how a RAG system is built, how to choose one, and what can go wrong.

How vector search works

A vector database does one main job. You give it a question, and it finds the stored items that are closest in meaning, quickly, even among millions of records. Three ideas make this work.

The first idea is the embedding. An embedding model turns text, an image or a sound clip into a long list of numbers, often hundreds or thousands of them. Items with similar meaning get similar numbers. That is why "late reimbursement" ends up next to "refund delay", even though they share no words.

The second idea is distance. The database measures how close two lists of numbers are. Common ways to do this are cosine similarity, dot product and Euclidean (L2) distance .

Figure 1 · embedding space, one query and its nearest neighbors

In the picture above, a question about a refund delay lands inside the billing group. So its closest matches are billing documents, not HR or IT ones.

The third idea is speed. You could compare a question with every stored item. That gives exact answers, but it gets slower as your data grows, so it does not work for big companies. Instead, vector databases use approximate nearest neighbor (ANN) indexes. These give up a tiny bit of accuracy to be much faster. The most popular one is HNSW (Hierarchical Navigable Small World). Think of a map with layers. The top layer has few points and big jumps. The bottom layer has every point and small steps. The search starts at the top, jumps to the right area, then moves down and looks closely . The authors say the search time grows slowly, close to logarithmically, as the data grows. Other methods, such as locality-sensitive hashing and product quantization (PQ), shrink the vectors to save memory, but lose some accuracy .

A vector database is more than an index tool like Faiss. It also handles safe storage, updates and deletes, filters, access control and growth. MarkTechPost's 2026 review calls Faiss a research building block that most teams would not run directly in production .

What companies use them for

RAG is what made vector databases popular. MarkTechPost calls it the main reason companies adopt them in 2026. Document embeddings are stored, and the AI looks them up when it answers . The same search layer can also power other tools, so one platform often serves many teams.
  • Knowledge assistants: staff or customers ask a question in plain words. The system finds the right policy, contract or product text, and the AI answers with references.
  • Search by meaning across text, images and recordings. Natural language processing is the largest area by revenue in Technavio's analysis .
  • Recommendations: products, articles or job candidates are turned into numbers, so "show me more like this" becomes a simple nearest-neighbor lookup.
  • Fraud and anomaly checks: transactions or sessions are turned into numbers and compared with known normal and known fraud behavior. Technavio tracks fraud detection as its own segment.
  • Memory for AI agents: agents need to remember earlier steps and results. Commentary summarized by Sombra says agents need vector search even more than RAG does, because they ask for far more data than people do.
Figure 2 shows the idea: one shared search layer, many apps on top.

Figure 2 · enterprise data in, five applications out

How a RAG system is built

A real RAG system has two pipelines that meet at the vector database. One prepares your knowledge in advance. The other answers questions live. Figure 3 shows both.

Figure 3 · enterprise RAG pipeline, ingestion and query paths

First, the preparation side. Connectors collect content from wikis, file stores, ticket tools and the CRM. Each document is cleaned and cut into small pieces called chunks. Each chunk is turned into an embedding and saved with extra details: where it came from, when it was written, who owns it, and who is allowed to read it. Chunk size needs testing. One research tool tried chunks of 256 tokens with a 50-token overlap , but your documents may need something else.

Next, the question side. The question is turned into an embedding with the same model. The database returns the closest chunks, but only the ones this user is allowed to see. A reranker (a second model that re-sorts the results) then orders a larger set of candidates, and only the best few go into the prompt. The same tool fetched 20 candidates and kept the top 4. The AI answers using those passages and names its sources, so readers can check them.

Most teams now use hybrid search, and there is a good reason. Vector search is good at meaning but can be careless with exact codes and names. InfoQ gives an example: if you search for one error code, vector search may return the guide for a different error that sounds similar. Plain keyword search (BM25) would not make that mistake . The usual setup runs keyword search and vector search together, merges the two lists using reciprocal rank fusion, and may add a cross-encoder reranker to sort the final short list (same source). Google Research notes that hybrid retrieval has been shown to beat keyword-only or vector-only retrieval . Practitioner guides now call hybrid RAG the default for companies, especially for legal, financial and regulatory text where exact wording matters .

How to choose one

There is no single best choice. It mostly depends on how much data you have, what tools you already use, and how much setup and upkeep you want to handle yourself. The table shows how five popular options are usually described in 2026 comparisons.

System

Type

Best for

Watch out for

pgvector

Add-on for Postgres

Teams that already use Postgres

Made for smaller data, under about 100 million vectors

Pinecone

Fully managed service, closed source

Easy setup with no servers to run, plus enterprise certifications

Managed only; you cannot host it yourself

Weaviate

Open source, with a cloud option

Built-in hybrid keyword and vector search

May need bigger machines and tuning as data grows

Qdrant

Open source, with a cloud option

Searches with many filters, under about 100 million vectors

Above that size, comparisons suggest Milvus

Milvus

Open source, spreads across many machines

Very large data, billions of vectors

Harder to run 


Special-purpose products have not taken over, as you might expect. In the same survey, pgvector had the biggest share in real use at 41.2%. Pinecone had 28.6%, Qdrant 14.3%, and Weaviate or Milvus together 11.8% . Expert advice agrees. If you already use Postgres and have under about 50 million vectors, start with pgvector. Move to a purpose-built system if you need very fast responses or a fully managed service .

Be careful with speed charts. Timescale, a vendor, reported 471 queries per second at 99% recall on 50 million vectors for pgvector with its pgvectorscale add-on . But a late-2026 review found no fair, side-by-side test of all five systems. Each vendor shares numbers from its own machines and its own tests . Before you decide, run a small trial with your own data, filters and update rate.

What can go wrong

The search technology itself is now the easy part. Most problems come from rules, security and day-to-day running.
  • Permissions: the access rules must stay attached to every chunk and be checked on every search, so nobody sees text they could not open in the original system. One architecture guide says keeping each customer's data separate inside the database is a must for compliance .
  • Old data: documents change, and embeddings that are not refreshed become out of date. The same guide warns against treating a vector store like a fixed SQL table.
  • Privacy: embeddings come from sensitive text, so treat them as sensitive too. Regulated firms often run everything in a private cloud so embeddings and models never leave their network . MarketsandMarkets also lists privacy and security as a challenge for the market .
  • Checking quality: keep a fixed list of real questions with known answers, and run it after every change. Sombra's guide says companies have moved from measuring search quality to fixing it .
  • Cost and lock-in: indexes use a lot of memory, and switching to a new embedding model means redoing the embeddings for all your data. Keeping the embedding model, database and LLM loosely connected makes later changes cheaper.
Wrapping up

A vector database lets an enterprise AI use your private, up-to-date knowledge instead of guessing from its training. If you are planning one, remember three things:
  • Start with the use case. RAG, search, recommendations and agent memory can share one search layer.
  • Build hybrid search, permission checks and reranking in from day one. They are hard to add later.
  • Choose the database based on your data size and who will run it. Then test it with a small trial on your own data.
The blog is written by Rutuja Chaudhari ( Junior Cloud Consultant @Cloud.in)

Why Your Security Key Must Be Protected, Backed Up and Kept Separate

Protect, back up and separate your security key: a vault dial illustration

Introduction: one key decides who can read everything

Encryption does not remove the problem of protecting data; it moves it to protecting the key. Whoever holds the security key can read the data, and whoever loses it can never read the data again.
This post answers four practical questions: why the security key must be secured, why it needs its own backup, why it should be kept separate from the data, and why it should never sit in the database. It draws on OWASP's key-management guidance, HashiCorp's documentation and security-industry commentary. HashiCorp Vault is used as the worked example, because its key design is publicly documented, but the same principles apply to any system that encrypts data.

1. Why the security key must be secured

The key is the only thing standing between an attacker and your plaintext. OWASP's key-management guidance warns that if a key is compromised, "all information encrypted by that key could be exposed or known by unauthorized entities". Strong algorithms do not help once the key is in the wrong hands, because the attacker simply decrypts the data the way you would.

That is why the key has to be protected at least as strongly as the data it guards. OWASP states that keys should never be stored in plaintext and should be kept in a cryptographic vault, and that a key-encrypting key should be at least as strong as the data key it protects.

Vault shows how layered this can be. According to HashiCorp's seal documentation, data is encrypted with an encryption key, that key is encrypted by a root key, and the root key is encrypted by the unseal key. By default the unseal key is split into shares with Shamir's Secret Sharing, so a threshold of shares must be presented before Vault can read anything. The unseal key is the top of the chain: protect it, and everything below it stays locked.

Vault's chain of keys: data, encryption key, root key and unseal key

2. Why the security key needs its own backup

Protecting the key is only half the job; you must also be able to get it back. OWASP puts the consequence plainly: "Data that has been encrypted with lost cryptographic keys will never be recovered." It describes losing a key as having a similar effect to ransomware, "except that you can't pay the ransom and get the key back", and says it is essential to have a secure key backup capability.

A data backup does not solve this. HashiCorp warns that if the seal mechanism or its keys are permanently deleted, the Vault cluster cannot be recovered, even from backups. A perfect copy of the encrypted data is just unreadable bytes without the key that opens it. HashiCorp's restore guide lists this as a precondition: you must know, and be able to contact, your unseal or recovery key holders.

The key can be lost in ordinary ways, none of them involving an attacker:
  • The only person holding a key share leaves the company or is unreachable.
  • A cloud key used for auto-unseal is deleted by mistake. HashiCorp notes that with auto-unseal there is a strict lifecycle dependency on the seal mechanism, so a deleted KMS key means no access until it is available again.
  • Hardware that held the only copy fails.
Older keys matter too. OWASP advises keeping retired keys for a period so that old backups of the data can still be decrypted.

3. Why the key must be kept separate from the data

If the key and the data sit together, one break-in gives an attacker both. OWASP's guidance is direct: "Where possible, encryption keys should be stored in a separate location from encrypted data." Its example is that when data is stored in a database, the keys should be stored in the filesystem. The same page adds that a key-encrypting key must be stored separately from the data key for the arrangement to be effective.

The Cloud Security Alliance calls the principle split knowledge. It recommends keeping one domain for data storage and another for the encryption keys, so that even an operator or administrator who can reach the keys cannot reach the data, and the reverse. The result is that stealing only the data, or only the keys, gets an attacker nothing readable; they must breach two separate places.

Separation also applies to people and to backups:
  • People. Vault's Shamir shares mean no single person holds the whole unseal key, so no one individual can open the vault alone.
  • Backups. Store key backups apart from data backups, in a different account, region or system, so one compromised location never yields both. HashiCorp advises keeping snapshots in a secure place away from the Vault clusters.
  • Layers. Keep the key that encrypts data apart from the key that encrypts that key, as OWASP describes.
A resilient backup layout with replication, snapshots and offsite immutable copies

4. Why the key should never be stored in the database

Storing the key in the same database as the data it encrypts looks tidy, and it is one of the most common mistakes. Security commentators writing in Dark Reading list it first among the worst practices in database encryption. Voltage Security's Luther Martin says that storing the encryption key, or the credentials to get it, in the same database as the encrypted data "gives you the illusion of security, but actually provides very little real security." The article's advice is to keep the management of encryption keys separate from the database that stores the data.

The reasons follow from how databases are actually used:
  • Whoever can read the data can read the key. SQL injection, a stolen database backup, a read replica or an over-privileged database administrator all expose the key together with the data.
  • Backups copy the key too. Every database backup, clone and test environment carries a copy of the key alongside the data, multiplying the places it can leak from.
  • Recovery becomes circular. If the database is corrupted, deleted or encrypted by ransomware, a key stored inside it is lost at the same moment, and the data becomes permanently unreadable.
  • Access cannot be controlled or audited on its own. A key in a table has the same permissions and logging as any other row, whereas a vault or KMS can restrict, log and rotate key use independently.
This does not mean a key-management system cannot use a database internally. OWASP notes that where a database stores keys, that database should itself be encrypted. The rule is about an application's ordinary data store, not a purpose-built, locked-down key service.

Where the key lives

Who or what can reach it

Assessment

In the same database as the data

Anyone who can read the data, including backups and replicas

Avoid: key and data fall together

In application config or source code beside the data

Anyone with repo or server access; copied into every clone

Avoid

In the filesystem, apart from the database (OWASP's example)

Needs a second breach beyond the database

Minimum acceptable

In a dedicated vault, KMS or HSM with its own access control and audit

Only authorized identities, with every use logged

Preferred

Master key split into shares held by different people

A threshold of holders must act together

Preferred for the top-level key


The assessment column is the author's reading of the sources above, not a quotation from them.

Putting it into practice

A key you have never recovered is only a hope. Run a drill at least quarterly: rebuild a clean environment, bring the key back through the real process with the real key holders, restore the data, and confirm that applications can read it. Time the exercise and fix every gap in the runbook, because that number is your real recovery time.

The quarterly restore drill in six steps

The mistakes that most often turn a backup into false comfort:
  • Storing the key in the database, or beside the data it protects.
  • Backing up the data but never the key or the seal material.
  • Keeping key backups in the same account, region or system as the data backups.
  • Letting one person hold the only copy of a key or key share.
  • Never testing recovery, so the first attempt happens during an outage.
  • Deleting retired keys while old backups still need them.
Conclusion

The security key is the one asset that makes encryption meaningful, so it needs the most care. Secure it, because anyone who holds it can read everything it protects. Back it up, because without it even a perfect data backup is unreadable. Keep it separate, so that a single breach never yields both key and data. And keep it out of the database, where it falls, leaks and gets lost together with the data it was meant to protect.

A good first step this week: find out where your keys live today, who holds copies, and whether anyone has ever recovered from them.

The blog is written by Rutuja Chaudhari, Junior Cloud Consultant, Cloud.in

Saturday, 28 November 2026

Governing AI at Delivery Speed: Guardrails for Cloud Managed Services and AI Operations

The code freeze that wasn’t

In July 2025, SaaStr’s founder was building an app with Replit’s AI agent. During an explicit code freeze, the agent ran destructive commands against the live production database and wiped records for more than 1,200 executives. Replit responded by separating development and production databases and adding a planning-only mode.
The lesson is not that AI is dangerous. It is that the freeze was an instruction, not a permission. Nothing in the platform made the command impossible. Most teams running AI agents have that gap somewhere.

Why governance is now an operations problem

AI agents now open pull requests, triage incidents and resize clusters. In managed services, one agent may touch dozens of client environments in a shift. So the real question is: what is this AI allowed to do, where, under whose identity, and how would we know if it went wrong? The answer must be enforced by identity and platform controls, not a sentence in a prompt. Teams that get this right ship faster, because guardrails remove the fear that slows every approval.

Delivery: five gates from idea to retirement
  • Intake and tiering. Register every use case, including AI inside SaaS tools. Tier 1 is internal and read-only; Tier 2 writes to systems or faces customers; Tier 3 touches regulated data or acts autonomously.
  • Design review. Check data residency and retention, and decide where a human must approve. If one agent can read private data, ingest untrusted content and send data out, redesign it.
  • Evaluation. Test accuracy, prompt-injection resistance and cost against agreed thresholds. No numbers, no release.
  • Controlled rollout. Shadow mode first, then a small cohort, with a tested kill switch on-call can pull in five minutes.
  • Operate and retire. Re-evaluate on every model or prompt change; on retirement, revoke keys and delete stored memory.
Flow of five gates: intake and tiering, design review, evaluation, controlled rollout, operate and retire. Any model or prompt change loops back to evaluation.
Figure 1: The five delivery gates, with a loop back to evaluation on every change

The core rule: prompts, model versions, tool permissions and connectors are all code, with version control and review. Map the gates to the NIST AI RMF, ISO/IEC 42001, the EU AI Act (high-risk obligations from December 2027) and, in India, the DPDP Rules (from May 2027) and CERT-In’s six-hour incident reporting. (Not legal advice.)

Cloud operations: let AI act, but on a leash

Staircase of five autonomy levels: L0 Observe, L1 Recommend, L2 Act with approval, L3 Act then report, L4 Autonomous, with the human role at each level.

Figure 2: The L0–L4 autonomy ladder for AI in cloud operations

Promote individual runbooks on evidence, and demote them automatically after any AI-caused incident. Four rules keep this safe:
  • Tenant isolation: an agent for Client A never holds credentials that reach Client B.
  • Blast-radius limits: cap resources, cost and production access per action.
  • Runbooks, not improvisation: at L2 and above, AI uses tested runbooks and dry-runs first.
  • Platform-enforced freezes: a change freeze revokes the agent’s write access in IAM.
Write each client’s autonomy level into the SOW.

Security: treat every agent as a privileged user

In June 2025, researchers disclosed EchoLeak, a Microsoft 365 Copilot flaw where one crafted email could make the assistant leak internal data without a single click. Microsoft patched it, but the pattern applies to any AI that reads untrusted content and can reach sensitive data.

Risk
Guardrail

Over-privileged agents

One identity per agent, least privilege, short-lived credentials

Prompt injection

Treat retrieved content as untrusted; allow-list tools; approval for sensitive actions

Data leakage

PII redaction; approved endpoints only; no training on client data

Supply chain

Vetted registry of models, plugins and MCP servers; pinned versions



Use the OWASP Top 10 for LLM Applications and for Agentic Applications as your threat checklist.

The model is never the security boundary. A prompt that says “do not delete anything” is a hope. An IAM policy that makes deletion impossible is a control.

Flowchart: trigger, agent with its own identity, AI gateway, policy check, then a high-impact decision leading either to human approval or directly to runbook execution. Untrusted content enters the agent as data only, and every step writes to an audit log.
Figure 3: Every agent action passes through identity, gateway and policy checks before it runs

Make the safe path the fast path
  • Guardrails as code (OPA, SCPs, Azure Policy) in every pipeline.
  • A paved road: a pre-approved AI platform with logging and evaluation built in.
  • One AI gateway for authentication, cost caps, redaction and audit logs.
  • Proportionate review: only Tier 3 goes to the governance board.
  • Measured value: capture a baseline before go-live, then track hours saved and time to resolve.
Run AI like a production service

Monitor quality on sampled traffic, re-test after any model change, log every tool call and approver, and cap cost per agent. Watch for drift when providers update or retire models, and alert when cost per task jumps, because runaway agent loops get expensive quickly. Add AI incidents to your incident process: pull the kill switch, preserve logs, notify the client, and run a blameless review. Every agent needs a named human owner.

Who owns what

Leaders: approve an AI policy by risk tier, keep a live inventory with named owners, put autonomy levels into client contracts, and fund the paved road, not just pilots.

Senior engineers: design least-privilege identities, enforce freezes in IAM, version every prompt and permission, and test kill switches in game days.

A 90-day roadmap

Ownership first, guardrails second, scale last.

Three phases: Foundation (days 1 to 30), Guardrails (days 31 to 60), Scale (days 61 to 90), separated by two gates: every AI system has an owner, and Tier 3 passes evals.
Figure 4: The 90-day roadmap, with two gates between phases

Don’t move to the next phase until its gate is met. Scaling AI before owners exist simply scales the risk.

Conclusion

The teams that win with AI won’t have the most pilots. They’ll be the ones clients trust to let AI act in production, built on ownership, least privilege, tested runbooks and a kill switch that works. The Replit agent didn’t need to be smarter. It needed fewer permissions.
Over to you: where is your team on the autonomy ladder today?

The blog is written by Nitin Ghodke (Senior Manager - Technical Operations @ Cloud.in)

AWS Log Analysis With Amazon Athena From a SOC and Cloud Security Perspective

Introduction It’s 2 a.m., and the dashboard shows a sudden spike in 403 responses. Is it an attack, a misfiring WAF rule or a broken deploym...