Kosty 3: One Scan Engine for AWS Security, Exposure, GenAI and Cost
Kosty, my open-source AWS audit CLI, registers 151 checks across 32 services in one plugin engine. What each audit domain checks, what the GenAI checks can and cannot see, and how far the findings go as evidence.
Security posture, cloud cost and the inventory of AI workloads are usually reviewed with different tools, on different schedules, by different teams. The findings that matter most to an architecture review often sit where those views meet: a public resource that is also idle, or a role with model access that nobody approved, and joining separate reports by hand is slow.
I built Kosty to produce those views in one scan, with findings in one format that can be joined on the resource. It is an open-source Python command-line tool under the MIT licence. Version 3, released in October 2026, rebuilt it around a plugin engine; at the time of writing the current release is v3.6.1, tagged on 19 October.
One engine covers five audit domains
In v3.6.1, 151 checks across 32 service modules, one of them the cross-service exposure scan, register themselves with a single engine. The full audit and every per-service command run through that engine, and checks marked as global, such as the IAM and S3 checks, run once per account instead of once per region.
| Domain | What it checks | Examples |
|---|---|---|
| Security posture | IAM, security groups, KMS, WAF, GuardDuty, CloudTrail, Config, Secrets Manager, ACM and other services | Users without MFA, KMS keys without rotation, CloudTrail gaps |
| IAM privilege escalation | 21 known escalation patterns, run only by kosty iam check-privilege-escalation --deep, which confirms each path through iam:SimulatePrincipalPolicy | Principals able to grant themselves wider rights |
| External attack surface | 15 internet-facing resource types, from load balancers, S3 and CloudFront to Lambda function URLs, EKS and public snapshots | Each resource classed as exposed and unprotected, partially protected, or protected |
| Generative AI workloads | Amazon Bedrock (12 checks) and SageMaker (8 checks) | No invocation logging, no guardrail in a region, AI roles without an approval tag, idle endpoints |
| FinOps | Idle, stopped and oversized resources | Unused NAT gateways, orphaned volumes and stopped instances, some with an estimated monthly saving |
Source: Kosty v3.6.1 source code and README (kosty-cloud/kosty, tag v3.6.1, 19 October 2026). Counts taken from the registered checks.
Running it takes one command per question
pip install kosty # Python 3.10+
# Full audit: cost and security across 32 services
kosty audit --output all
# External attack surface
kosty public-exposure --output console
# AI/ML audit: Bedrock and SageMaker
kosty ai audit
# IAM privilege escalation, confirmed by simulation
kosty iam check-privilege-escalation --deep
# Organization-wide scan
kosty audit --organization --max-workers 20 --output all
A container image is published at ghcr.io/kosty-cloud/kosty, and the README shows it run with the AWS configuration mounted read-only. The documentation’s minimum policy contains read actions plus iam:SimulatePrincipalPolicy, which --deep uses. It omits a few actions that some checks call, for CloudFront, Budgets and CloudWatch Logs Insights, and those checks then fail on permissions. It also grants s3:Get*, which includes reading object contents, so I would narrow it before using it on an account with sensitive data.
The GenAI checks ask three questions, each with a known limit
Generative AI tends to arrive in an AWS estate through a proof of concept that stays: a team enables Bedrock, someone deploys a SageMaker endpoint for a demonstration, and both remain after the project ends. Three of Kosty’s AI checks address that pattern, and each is narrower than its name suggests.
Is there a guardrail? kosty ai bedrock check-no-guardrails raises a high-severity finding when a region has no Bedrock guardrail at all. A guardrail that exists may still not be applied to any call, and the check does not read the account- and organization-level guardrail enforcement that Bedrock has offered since April 2026. A clean result therefore means only that at least one guardrail exists in the region.
Is the use approved? kosty ai bedrock check-shadow-ai lists IAM roles whose attached policy names or inline policy actions mention Bedrock or SageMaker, and flags those without one of the approval tag keys ai-project, ai_project, ml-project, ml_project or genai. It is a heuristic over policy text. It misses wildcard actions, managed policies whose names do not mention either service, and IAM users, and in v3.6.1 it runs once per region, so a multi-region scan reports the same role several times.
Is anyone using it? kosty ai sagemaker check-idle-endpoints flags endpoints with zero invocations over a window of seven days by default. It names the instance type, but its risk text quotes the same $500 to $5,000 a month for every endpoint, and it reads only the first page of the endpoint list. Two of the twelve Bedrock checks, which analyze CloudWatch Logs, run only with --deep on their own commands, so kosty ai audit runs the other ten.
Those limits do not make the checks less useful as a first pass. They decide how I read the output: a finding is a lead to confirm in the console or the bill. A clean result describes only what the check reads, and Kosty logs most API errors other than permission errors without raising a finding, so a failed call can also look clean.
Findings are packaged as evidence
Each finding carries a check ID, a service, a resource, a region, an account, a severity and a type, cost or security. Some cost findings also carry an estimated monthly saving, based on fixed list prices in the code; those figures are approximations to check against the bill before they reach a business case. A kosty.yaml file can exclude accounts, regions, services, ARNs and, for the checks that support it, tagged resources, and define profiles. Output goes to the console, JSON or CSV, or all three for the full audit. A report written to the working directory by default gets a .sha256 sidecar that sha256sum -c can check; it detects a damaged file, and shows tampering only if the hash travels separately from the report. A single-file HTML dashboard, with no build step, turns a JSON report into filterable views of security and cost.
Organization-specific controls are a plugin
Each check is a Python function that registers itself with a decorator, under kosty/providers/aws/services/, so a control specific to one organization is a small, reviewable file. Through the Python API the engine can load more than one plugin directory. An opt-in strict mode refuses plugin files missing from the plugins.sha256 manifest; the manifest is unsigned and sits in the same directory, so it catches stray files, and file permissions remain the control against someone with write access. Contributions are welcome on GitHub.