Zero-trust principles and AWS Verified Access (overview)
Replace 'inside the network means trusted' with per-request decisions based on identity, device posture and context, and see how AWS Verified Access gives Harbourline staff VPN-less access to internal banking tools.
Assumes: .NET 10 LTS · AWS SDK for .NET v4 · AWS CLI v2 · CDK v2 (Amazon.CDK.Lib 2.277.0) · Terraform AWS provider v6 · Region us-east-1. Verified against official sources on 2026-11-18.
Learning objectives
By the end of this lesson you can:
- Explain the core zero-trust principles (verify explicitly, least privilege, assume breach) and why "on the corporate network" is no longer a security decision for a bank.
- Describe the building blocks of AWS Verified Access: instances, trust providers (user and device), groups, endpoints and Cedar access policies.
- Write Cedar policies that combine IAM Identity Center group membership, verified email and device posture.
- Verify the signed
x-amzn-ava-user-contextheader inside an ASP.NET Core application, so the app trusts identity claims only when Verified Access really sent them. - Compare Verified Access with Client VPN, Microsoft Entra Private Access / Application Proxy and Systems Manager Session Manager, and pick the right tool per use case.
- Estimate the cost of a Verified Access deployment and run it as a deploy-and-destroy exercise, or complete the free design-only alternative.
Prerequisites
- Segmentation, private endpoints and egress filtering — security groups, private subnets, internal load balancers
- AWS WAF and AWS Shield — web ACLs (Verified Access can carry one)
- IAM Identity Center, MFA and temporary credentials — groups, users and the identity store
- Tools: AWS CLI v2 (
learn-sandboxprofile), .NET 10 SDK, optionally the CDK CLI or Terraform 1.14
Why this matters in banking
Picture Harbourline's back-office. Operations staff use an internal Payments Exceptions web app to release payments stuck in sanctions screening. Today it sits behind the corporate VPN: once a laptop is connected, it can reach the app, the database subnet's load balancer, a dozen admin consoles and the legacy Core Banking jump host. Three real-world failure patterns follow from that design:
- A phished VPN credential is a master key. The attacker connects, and the network treats them as an employee. Every internal app that relies on "only staff can reach this" is now exposed. Several high-profile breaches in financial services started exactly this way.
- Unmanaged devices. A contractor connects from a personal laptop with an out-of-date browser and a keylogger. The VPN checked a password and an MFA code — it never asked whether the device was healthy.
- No per-application evidence. The auditor asks "who accessed the payments-release tool last quarter, from which device?" The VPN logs show IP addresses and session times, not application decisions.
Regulators increasingly expect controls that don't depend on network location. The UK's operational-resilience and outsourcing expectations, PCI DSS requirements for MFA into the cardholder data environment, and the general direction of NCSC zero-trust guidance all point the same way: authenticate and authorise each access to each application, using the strongest signals you have. (Mapping those expectations to specific controls is your compliance team's job; this lesson gives you the technical building blocks.)
The idea in plain language
Zero trust is a design philosophy, not a product. It says: never grant access just because a request comes from a particular network. Instead, every request is evaluated using:
- Who is asking (a strongly authenticated identity, with MFA),
- What they are using (the device — is it managed, encrypted, patched, free of malware?),
- What they want (this one application, maybe this one action),
- Context (time, location, risk signals),
and the answer is the least access needed, re-checked continuously. It also assumes that a breach has already happened somewhere, so every component should limit the blast radius.
NIST SP 800-207 describes the pattern with three roles: a policy decision point (decides), a policy enforcement point (sits in the traffic path and enforces) and policy information points (identity provider, device management, threat intelligence).
AWS Verified Access is AWS's managed policy enforcement and decision point for workforce access to applications. You put your internal app (behind an internal load balancer or on a network interface) behind a Verified Access endpoint. A user browses to https://payments-exceptions.corp.harbourline.example; Verified Access redirects them to your identity provider, collects device signals from a browser extension if configured, evaluates a Cedar policy, and only then proxies the request to the app. No VPN client, and the app is never reachable from the internet directly.
Analogy: The old model is a bank building where your staff pass gets you through the front door and then every internal door is propped open. Zero trust puts a guard at every door. Verified Access is the guard at the door of each application: it checks your pass (identity), looks at what you are carrying (device posture), checks the access list for that specific room (policy), and writes everything in the visitor book (logs).
What problem the AWS service solves
| Concept | What it is | Notes (checked 2026-11-18) |
|---|---|---|
| Verified Access instance | The top-level container in a Region; trust providers attach to it | Logging is configured at instance level (CloudWatch Logs, S3 or Firehose) |
| Trust provider — user | Identity source: IAM Identity Center or any OIDC IdP (Entra ID, Okta, Ping…) | policy-reference-name decides the name used in policies, e.g. context.idc |
| Trust provider — device | Device posture from a partner: Jamf, CrowdStrike, JumpCloud | Requires the browser extension on the client for HTTP apps ⚠ VERIFY the current partner list |
| Verified Access group | A set of endpoints sharing a group policy | Typical: one group per business domain (payments ops, risk, HR) |
| Endpoint | The application front door | Types: load-balancer (internal ALB/NLB), network-interface, and — for non-HTTP(S) — rds and cidr |
| Access policy | Cedar permit / forbid statements on group and endpoint | Group and endpoint policies must both allow |
| Signed user claims | Header x-amzn-ava-user-context, a JWT signed with ES384 | The app should verify it before trusting any claim |
| WAF integration | Attach an AWS WAF web ACL to the instance | Same rule groups as in the WAF lesson |
| Non-HTTP access | TCP, SSH, RDP to EC2, RDS or CIDR ranges | GA since February 2025; users need the AWS Verified Access Connectivity Client |
Honest limitations:
- Verified Access is for workforce access to your applications. It is not a customer-facing identity solution (that is Cognito or your CIAM) and not a general internet proxy or secure web gateway.
- Policies are evaluated per request for HTTP apps, but they can only use the signals the trust providers supply. If your IdP doesn't enforce phishing-resistant MFA, Verified Access can't add it.
- It costs money per application per hour, even when idle (see Cost). For a small number of rarely used admin tools, Session Manager port forwarding may be cheaper.
- Device trust providers require a supported management product and the browser extension; unmanaged-device scenarios need a separate decision (deny, or a reduced-risk policy).
- It does not make an application secure. The app still needs authorisation for actions (who may release a £2m payment) — Verified Access decides who may reach the app.
Microsoft / Azure comparison
| You know (Microsoft/Azure) | AWS equivalent | What's different |
|---|---|---|
| Microsoft Entra Private Access (Global Secure Access) | AWS Verified Access | Verified Access is per-Region and per-application; policies are written in Cedar rather than configured as Conditional Access policies |
| Entra Application Proxy | Verified Access HTTP endpoint on an internal ALB | No connector VM to run; Verified Access sits in your VPC via the endpoint |
| Entra Conditional Access (device compliance, sign-in risk) | Cedar policies using user + device trust data | You can still keep Conditional Access in Entra when Entra is the OIDC trust provider — both layers apply |
| Intune compliance state | Jamf / CrowdStrike / JumpCloud device trust providers | Intune is not a built-in Verified Access device provider ⚠ VERIFY; a common pattern is to enforce device compliance in Entra Conditional Access instead |
| Azure Bastion (RDP/SSH via browser) | Systems Manager Session Manager, or Verified Access TCP endpoints | Session Manager needs no inbound ports and is free; Verified Access TCP adds identity + device policy |
| Point-to-site VPN Gateway | AWS Client VPN | Network-level access; zero-trust guidance treats this as a fallback |
ASP.NET Core [Authorize(Policy = "...")] | Cedar policy at the edge plus your app's own authorisation | Keep both: edge decides reachability, app decides actions |
Architecture
Trust boundaries: the app and its load balancer live only in private subnets; the load balancer's security group accepts traffic only from the Verified Access endpoint's security group. The identity provider is the source of identity truth, the device manager is the source of device truth, and the policy is versioned code. Every allow and deny is logged to the log-archive account (see CloudTrail for banks for the same pattern applied to API audit logs).
Request flow
Step-by-step implementation
Inventory internal applications and classify them
List every internal app currently reached over VPN. For each one note the users, data classification (from data classification), protocol (HTTP or TCP) and whether it already has its own authentication. For Harbourline's first wave: Payments Exceptions (HTTPS, restricted data), Reconciliation dashboard (HTTPS, confidential), and the Core Banking batch-console jump host (SSH, restricted).
Choose the identity source
If staff already sign in through Entra ID, either federate Entra ID into IAM Identity Center (one identity plane for AWS console and apps) or register Entra ID directly as an OIDC trust provider. Use group IDs, not display names, in policies; names change, IDs don't. Make sure MFA is enforced by the IdP.
Decide on device posture
Agree with end-user computing which device signals exist (Jamf for Macs, CrowdStrike Falcon on Windows) and which minimum is acceptable for each data classification. Restricted apps: managed device and low risk score. Confidential: managed device. Document what happens to unmanaged devices (usually: deny).
Create the instance and attach trust providers
Create a Verified Access instance, a user trust provider (policy reference name idc) and, optionally, a device trust provider (jamf or crwd), and attach them to the instance. Turn on logging immediately, with trust-context logging if your privacy review allows (see Security considerations).
Create groups with coarse policies
One group per business domain, with a group policy such as "must be in the Harbourline-Staff group with a verified email". Groups let a security team own a baseline while application teams add stricter endpoint policies.
Create endpoints with fine-grained policies
For each app: a public-trust TLS certificate in ACM for the application domain, an endpoint of type load-balancer pointing at the internal ALB, a security group, and an endpoint policy such as "Payments-Ops-Releasers group and device risk LOW".
Lock the origin
Change the ALB security group so it accepts traffic only from the Verified Access endpoint's security group, and remove VPN routes to that subnet. In the app, verify the signed header and use sub / user_id for audit — never a client-supplied header.
Run in parallel, then retire VPN access per app
Publish the new DNS name, run both paths for a short period, compare logs, then remove VPN reachability one application at a time. Keep a break-glass path documented and tested.
AWS Console instructions
Verified Access lives in the VPC console:
- Console → VPC → Verified Access trust providers → Create Verified Access trust provider. Policy reference name
idc; trust provider type User trust provider; user trust provider type IAM Identity Center. Add tags (Project=cea-lab,Lab=m05-l16,Environment=learn,Owner=<you>). - Console → VPC → Verified Access instances → Create Verified Access instance. Select the trust provider you just created.
- Select the instance → Actions → Modify Verified Access instance logging configuration. Enable CloudWatch Logs to a log group named
/hl/m05/verified-accesswith 7-day retention. - Console → VPC → Verified Access groups → Create Verified Access group. Choose the instance, paste the group policy, enable the policy.
- Console → VPC → Verified Access endpoints → Create Verified Access endpoint. Group, application domain, ACM certificate, endpoint type Load balancer, protocol HTTPS, port 443, the internal ALB ARN, private subnets, security group, endpoint domain prefix
hl, and the endpoint policy. - In Route 53 (or your DNS provider), create a CNAME from the application domain to the endpoint domain shown on the endpoint's detail page.
- In IAM Identity Center → Applications, assign the relevant users or groups to the Verified Access application that was created automatically ⚠ VERIFY the exact assignment step in the current console.
AWS CLI
PROFILE=learn-sandbox
TAGS='Tags=[{Key=Project,Value=cea-lab},{Key=Lab,Value=m05-l16},{Key=Environment,Value=learn},{Key=Owner,Value=you}]'
# 1. User trust provider backed by IAM Identity Center; policies will refer to it as "idc"
TP_ID=$(aws ec2 create-verified-access-trust-provider \
--trust-provider-type user \
--user-trust-provider-type iam-identity-center \
--policy-reference-name idc \
--description "Harbourline workforce identity" \
--tag-specifications "ResourceType=verified-access-trust-provider,$TAGS" \
--query VerifiedAccessTrustProvider.VerifiedAccessTrustProviderId --output text \
--profile $PROFILE)
# 2. Instance, then attach the trust provider
INST_ID=$(aws ec2 create-verified-access-instance \
--description "hl-m05 verified access" \
--tag-specifications "ResourceType=verified-access-instance,$TAGS" \
--query VerifiedAccessInstance.VerifiedAccessInstanceId --output text --profile $PROFILE)
aws ec2 attach-verified-access-trust-provider \
--verified-access-instance-id $INST_ID \
--verified-access-trust-provider-id $TP_ID --profile $PROFILE
# 3. Logging: every allow/deny decision to CloudWatch Logs (create the log group first)
aws logs create-log-group --log-group-name /hl/m05/verified-access --profile $PROFILE
aws logs put-retention-policy --log-group-name /hl/m05/verified-access --retention-in-days 7 --profile $PROFILE
aws ec2 modify-verified-access-instance-logging-configuration \
--verified-access-instance-id $INST_ID \
--access-logs '{"CloudWatchLogs":{"Enabled":true,"LogGroup":"/hl/m05/verified-access"}}' \
--profile $PROFILE
# 4. Group with a baseline policy (Cedar, read from a file)
GROUP_ID=$(aws ec2 create-verified-access-group \
--verified-access-instance-id $INST_ID \
--policy-document file://group-policy.cedar \
--tag-specifications "ResourceType=verified-access-group,$TAGS" \
--query VerifiedAccessGroup.VerifiedAccessGroupId --output text --profile $PROFILE)
# 5. Endpoint in front of an internal ALB (ARN, subnets, SG and cert from your Module 2/3 labs)
aws ec2 create-verified-access-endpoint \
--verified-access-group-id $GROUP_ID \
--endpoint-type load-balancer \
--attachment-type vpc \
--domain-certificate-arn arn:aws:acm:us-east-1:111122223333:certificate/EXAMPLE \
--application-domain payments-exceptions.corp.harbourline.example \
--endpoint-domain-prefix hl \
--security-group-ids sg-0123456789abcdef0 \
--load-balancer-options 'LoadBalancerArn=arn:aws:elasticloadbalancing:us-east-1:111122223333:loadbalancer/app/hl-m05-internal/abc123,Port=443,Protocol=https,SubnetIds=[subnet-aaa,subnet-bbb]' \
--policy-document file://endpoint-policy.cedar \
--tag-specifications "ResourceType=verified-access-endpoint,$TAGS" \
--profile $PROFILE
# Inspect what you built
aws ec2 describe-verified-access-endpoints --verified-access-group-id $GROUP_ID \
--query "VerifiedAccessEndpoints[].{Id:VerifiedAccessEndpointId,Domain:EndpointDomain,Status:Status.Code}" \
--profile $PROFILEThe two policy files:
// Baseline for every payments-ops app: Harbourline staff with a verified email address.
permit(principal, action, resource)
when {
context.idc.groups has "9a1b2c3d-1111-2222-3333-444455556666" // Harbourline-Staff group ID
&& context.idc.user.email.verified == true
};// Payments Exceptions: only the releasers group.
permit(principal, action, resource)
when {
context.idc.groups has "5e6f7a8b-aaaa-bbbb-cccc-ddddeeeeffff" // Payments-Ops-Releasers group ID
};
// Never from this known-bad test range, even for releasers (forbid always wins).
forbid(principal, action, resource)
when {
ip(context.http_request.client_ip).isInRange(ip("198.51.100.0/24"))
};How group and endpoint policies combine: the request must be permitted by the group policy and by the endpoint policy (if the endpoint has one). Within a policy document, Cedar's rule is the same as IAM's: an explicit forbid beats any permit, and no permit means deny.
Infrastructure as Code
using Amazon.CDK;
using Amazon.CDK.AWS.EC2;
using Amazon.CDK.AWS.Logs;
using Constructs;
namespace Harbourline.Security.Infra;
public sealed class VerifiedAccessStackProps : StackProps
{
public required string InternalAlbArn { get; init; }
public required string[] PrivateSubnetIds { get; init; }
public required string VpcId { get; init; }
public required string CertificateArn { get; init; }
public required string ApplicationDomain { get; init; }
public required string StaffGroupId { get; init; }
public required string ReleasersGroupId { get; init; }
}
public sealed class VerifiedAccessStack : Stack
{
public VerifiedAccessStack(Construct scope, string id, VerifiedAccessStackProps props) : base(scope, id, props)
{
Tags.SetTag("Project", "cea-lab");
Tags.SetTag("Lab", "m05-l16");
Tags.SetTag("Environment", "learn");
var logGroup = new LogGroup(this, "AccessLogs", new LogGroupProps
{
LogGroupName = "/hl/m05/verified-access",
Retention = RetentionDays.ONE_WEEK,
RemovalPolicy = RemovalPolicy.DESTROY, // learning shortcut: production keeps logs
});
var trustProvider = new CfnVerifiedAccessTrustProvider(this, "IdcTrustProvider", new CfnVerifiedAccessTrustProviderProps
{
TrustProviderType = "user",
UserTrustProviderType = "iam-identity-center",
PolicyReferenceName = "idc",
Description = "Harbourline workforce identity",
});
var instance = new CfnVerifiedAccessInstance(this, "Instance", new CfnVerifiedAccessInstanceProps
{
Description = "hl-m05 verified access",
VerifiedAccessTrustProviderIds = [trustProvider.AttrVerifiedAccessTrustProviderId],
LoggingConfigurations = new CfnVerifiedAccessInstance.VerifiedAccessLogsProperty
{
CloudWatchLogs = new CfnVerifiedAccessInstance.CloudWatchLogsProperty
{
Enabled = true,
LogGroup = logGroup.LogGroupName,
},
},
});
var group = new CfnVerifiedAccessGroup(this, "PaymentsOpsGroup", new CfnVerifiedAccessGroupProps
{
VerifiedAccessInstanceId = instance.AttrVerifiedAccessInstanceId,
PolicyEnabled = true,
PolicyDocument = $$"""
permit(principal, action, resource)
when {
context.idc.groups has "{{props.StaffGroupId}}"
&& context.idc.user.email.verified == true
};
""",
});
var vpc = Vpc.FromLookup(this, "Vpc", new VpcLookupOptions { VpcId = props.VpcId });
var endpointSg = new SecurityGroup(this, "EndpointSg", new SecurityGroupProps
{
Vpc = vpc,
Description = "Verified Access endpoint for payments-exceptions",
AllowAllOutbound = false,
});
endpointSg.AddEgressRule(Peer.Ipv4(vpc.VpcCidrBlock), Port.Tcp(443), "To internal ALB only");
_ = new CfnVerifiedAccessEndpoint(this, "PaymentsExceptions", new CfnVerifiedAccessEndpointProps
{
VerifiedAccessGroupId = group.AttrVerifiedAccessGroupId,
EndpointType = "load-balancer",
AttachmentType = "vpc",
ApplicationDomain = props.ApplicationDomain,
DomainCertificateArn = props.CertificateArn,
EndpointDomainPrefix = "hl",
SecurityGroupIds = [endpointSg.SecurityGroupId],
LoadBalancerOptions = new CfnVerifiedAccessEndpoint.LoadBalancerOptionsProperty
{
LoadBalancerArn = props.InternalAlbArn,
Port = 443,
Protocol = "https",
SubnetIds = props.PrivateSubnetIds,
},
PolicyEnabled = true,
PolicyDocument = $$"""
permit(principal, action, resource)
when { context.idc.groups has "{{props.ReleasersGroupId}}" };
""",
});
_ = new CfnOutput(this, "EndpointSecurityGroupId", new CfnOutputProps
{
Value = endpointSg.SecurityGroupId,
Description = "Allow ONLY this SG on the internal ALB's listener port",
});
}
}Both stacks assume an existing internal ALB and private subnets from earlier modules, an ACM certificate for the application domain, and IAM Identity Center enabled in the account. ⚠ VERIFY: the Terraform provider's argument names for Verified Access resources have changed across provider releases; run terraform validate against your pinned v6 provider.
Complete code
Verified Access forwards the user's claims to your application in the x-amzn-ava-user-context header as a JWT signed with ES384. The header name is not secret: if anything else can reach your app (a misconfigured security group, a forgotten VPN route), an attacker can send a forged header. The app must therefore check that the token was signed by the Verified Access public key and that the signer field is your instance ARN.
This ASP.NET Core minimal API does exactly that with no third-party JWT library — only System.Security.Cryptography. The verifier is a separate class so you can unit-test it offline with a locally generated key.
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<RootNamespace>Harbourline.Payments.Exceptions</RootNamespace>
</PropertyGroup>
</Project>using System.Collections.Concurrent;
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
namespace Harbourline.Payments.Exceptions;
public sealed record VerifiedAccessUser(string Subject, string? Email, bool EmailVerified);
public interface IPublicKeySource
{
Task<string> GetPemAsync(string keyId, CancellationToken ct);
}
// Fetches PEM public keys from the regional Verified Access endpoint and caches them.
public sealed class HttpPublicKeySource(HttpClient http, string region) : IPublicKeySource
{
private readonly ConcurrentDictionary<string, string> _cache = new();
public async Task<string> GetPemAsync(string keyId, CancellationToken ct)
{
if (!Guid.TryParse(keyId, out _))
throw new SecurityException("Key ID is not a GUID"); // stops URL injection via kid
if (_cache.TryGetValue(keyId, out var pem)) return pem;
var url = $"https://public-keys.prod.verified-access.{region}.amazonaws.com/{keyId}";
pem = await http.GetStringAsync(url, ct);
_cache[keyId] = pem;
return pem;
}
}
public sealed class SecurityException(string message) : Exception(message);
public sealed class VerifiedAccessTokenVerifier(
IPublicKeySource keys, string expectedSignerArn, TimeProvider clock)
{
public async Task<VerifiedAccessUser> VerifyAsync(string jwt, CancellationToken ct = default)
{
var parts = jwt.Split('.');
if (parts.Length != 3) throw new SecurityException("Malformed token");
using var header = JsonDocument.Parse(Base64UrlDecode(parts[0]));
var h = header.RootElement;
if (h.GetProperty("alg").GetString() != "ES384")
throw new SecurityException("Unexpected algorithm");
if (h.GetProperty("signer").GetString() != expectedSignerArn)
throw new SecurityException("Token not signed by our Verified Access instance");
if (h.TryGetProperty("exp", out var expEl) && expEl.ValueKind == JsonValueKind.Number)
{
var exp = DateTimeOffset.FromUnixTimeSeconds(expEl.GetInt64());
if (clock.GetUtcNow() > exp.AddSeconds(30)) // small clock-skew allowance
throw new SecurityException("Token expired");
}
var kid = h.GetProperty("kid").GetString() ?? throw new SecurityException("Missing kid");
var pem = await keys.GetPemAsync(kid, ct);
using var ecdsa = ECDsa.Create();
ecdsa.ImportFromPem(pem);
var signedData = Encoding.ASCII.GetBytes($"{parts[0]}.{parts[1]}");
var signature = Base64UrlDecode(parts[2]);
// JWT ES384 signatures are raw r||s (IEEE P1363), which is .NET's default format.
if (!ecdsa.VerifyData(signedData, signature, HashAlgorithmName.SHA384))
throw new SecurityException("Bad signature");
using var payload = JsonDocument.Parse(Base64UrlDecode(parts[1]));
return ParseUser(payload.RootElement);
}
// Handles both shapes: IAM Identity Center ("user": {...}) and OIDC (flat claims).
private static VerifiedAccessUser ParseUser(JsonElement p)
{
if (p.TryGetProperty("user", out var u))
{
var id = u.GetProperty("user_id").GetString()!;
string? email = null; var verified = false;
if (u.TryGetProperty("email", out var e))
{
email = e.TryGetProperty("address", out var a) ? a.GetString() : null;
verified = e.TryGetProperty("verified", out var v) && v.GetBoolean();
}
return new VerifiedAccessUser(id, email, verified);
}
return new VerifiedAccessUser(
p.GetProperty("sub").GetString()!,
p.TryGetProperty("email", out var em) ? em.GetString() : null,
p.TryGetProperty("email_verified", out var ev) && ev.GetBoolean());
}
public static byte[] Base64UrlDecode(string s)
{
var b = s.Replace('-', '+').Replace('_', '/');
b = b.PadRight(b.Length + (4 - b.Length % 4) % 4, '=');
return Convert.FromBase64String(b);
}
}using Harbourline.Payments.Exceptions;
var builder = WebApplication.CreateBuilder(args);
var signerArn = builder.Configuration["VerifiedAccess:InstanceArn"]
?? throw new InvalidOperationException("Set VerifiedAccess:InstanceArn");
var region = builder.Configuration["VerifiedAccess:Region"] ?? "us-east-1";
builder.Services.AddHttpClient();
builder.Services.AddSingleton<IPublicKeySource>(sp =>
new HttpPublicKeySource(sp.GetRequiredService<IHttpClientFactory>().CreateClient(), region));
builder.Services.AddSingleton(sp =>
new VerifiedAccessTokenVerifier(sp.GetRequiredService<IPublicKeySource>(), signerArn, TimeProvider.System));
builder.Services.AddProblemDetails();
var app = builder.Build();
// Every request must carry a valid Verified Access token; otherwise 401 ProblemDetails.
app.Use(async (ctx, next) =>
{
if (ctx.Request.Path == "/healthz") { await next(); return; } // ALB health checks
var token = ctx.Request.Headers["x-amzn-ava-user-context"].ToString();
if (string.IsNullOrEmpty(token))
{
await Results.Problem(statusCode: 401, title: "Missing Verified Access context").ExecuteAsync(ctx);
return;
}
try
{
var verifier = ctx.RequestServices.GetRequiredService<VerifiedAccessTokenVerifier>();
var user = await verifier.VerifyAsync(token, ctx.RequestAborted);
ctx.Items["va-user"] = user;
await next();
}
catch (SecurityException ex)
{
app.Logger.LogWarning("Rejected Verified Access token: {Reason}", ex.Message);
await Results.Problem(statusCode: 401, title: "Invalid Verified Access context").ExecuteAsync(ctx);
}
});
app.MapGet("/healthz", () => Results.Ok("ok"));
app.MapGet("/whoami", (HttpContext ctx) =>
{
var user = (VerifiedAccessUser)ctx.Items["va-user"]!;
// Log the stable subject for audit, never the raw token.
app.Logger.LogInformation("Exceptions queue viewed by {Subject}", user.Subject);
return Results.Ok(new { user.Subject, user.Email, user.EmailVerified });
});
app.Run();To test the verifier offline, generate a P-384 key, sign a token yourself and verify it with a fake key source:
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
using Harbourline.Payments.Exceptions;
using Xunit;
public sealed class VerifierTests
{
private const string Signer = "arn:aws:ec2:us-east-1:111122223333:verified-access-instance/vai-0abc123";
private sealed class FakeKeys(string pem) : IPublicKeySource
{
public Task<string> GetPemAsync(string keyId, CancellationToken ct) => Task.FromResult(pem);
}
private static string B64(byte[] b) => Convert.ToBase64String(b).TrimEnd('=').Replace('+', '-').Replace('/', '_');
private static string MakeToken(ECDsa key, string signer)
{
var header = B64(JsonSerializer.SerializeToUtf8Bytes(new
{
alg = "ES384", kid = Guid.NewGuid().ToString(), signer,
exp = DateTimeOffset.UtcNow.AddMinutes(2).ToUnixTimeSeconds(),
}));
var payload = B64(JsonSerializer.SerializeToUtf8Bytes(new
{
user = new { user_id = "u-123", user_name = "ops.analyst", email = new { address = "ops.analyst@example.com", verified = true } },
}));
var sig = key.SignData(Encoding.ASCII.GetBytes($"{header}.{payload}"), HashAlgorithmName.SHA384);
return $"{header}.{payload}.{B64(sig)}";
}
[Fact]
public async Task Accepts_valid_token()
{
using var key = ECDsa.Create(ECCurve.NamedCurves.nistP384);
var verifier = new VerifiedAccessTokenVerifier(new FakeKeys(key.ExportSubjectPublicKeyInfoPem()), Signer, TimeProvider.System);
var user = await verifier.VerifyAsync(MakeToken(key, Signer), TestContext.Current.CancellationToken);
Assert.Equal("u-123", user.Subject);
Assert.True(user.EmailVerified);
}
[Fact]
public async Task Rejects_wrong_signer()
{
using var key = ECDsa.Create(ECCurve.NamedCurves.nistP384);
var verifier = new VerifiedAccessTokenVerifier(new FakeKeys(key.ExportSubjectPublicKeyInfoPem()), Signer, TimeProvider.System);
var forged = MakeToken(key, Signer.Replace("vai-0abc123", "vai-attacker"));
await Assert.ThrowsAsync<SecurityException>(() => verifier.VerifyAsync(forged, TestContext.Current.CancellationToken));
}
[Fact]
public async Task Rejects_token_signed_by_another_key()
{
using var real = ECDsa.Create(ECCurve.NamedCurves.nistP384);
using var attacker = ECDsa.Create(ECCurve.NamedCurves.nistP384);
var verifier = new VerifiedAccessTokenVerifier(new FakeKeys(real.ExportSubjectPublicKeyInfoPem()), Signer, TimeProvider.System);
await Assert.ThrowsAsync<SecurityException>(() => verifier.VerifyAsync(MakeToken(attacker, Signer), TestContext.Current.CancellationToken));
}
}The test project follows the standard pattern (xUnit v3 4.0.3 on Microsoft.Testing.Platform, <OutputType>Exe</OutputType>, a project reference to PaymentsExceptions).
Code explained line by line
Microsoft.NET.Sdk.Web— the app is a normal ASP.NET Core service; Verified Access needs no AWS SDK in the app.HttpPublicKeySource— builds the documented regional URLhttps://public-keys.prod.verified-access.<region>.amazonaws.com/<kid>and caches each PEM key, because keys are reused across many requests.Guid.TryParse(keyId, ...)— thekidcomes from an untrusted header. Rejecting anything that isn't a GUID stops an attacker from steering your HTTP client to another path (a simple SSRF guard).h.GetProperty("alg") != "ES384"— pinning the algorithm prevents "algorithm confusion" attacks such asalg: none.signer != expectedSignerArn— the most important check. Another AWS customer's Verified Access instance also produces validly signed tokens; only the signer ARN proves it is yours.- The
expcheck with 30 seconds of skew — Verified Access tokens are short-lived (around two minutes per the documentation); rejecting old ones limits replay. ecdsa.ImportFromPem(pem)— the key endpoint returns PEM text, which .NET imports directly.VerifyData(..., HashAlgorithmName.SHA384)— JWS signs the ASCII bytes ofbase64url(header).base64url(payload). .NET's default ECDSA signature format is IEEE P1363 (r||s), which is what JWS uses, so no DER conversion is needed.ParseUser— IAM Identity Center tokens nest identity underuser(user_id,email.address,email.verified); OIDC tokens use flat claims (sub,email,email_verified). The code supports both.Base64UrlDecode— JWT segments are base64url without padding; the method converts back to standard base64 and re-pads.- The middleware in
Program.csruns on every request except/healthz(the ALB health check does not pass through Verified Access, so it has no header). Results.Problem(statusCode: 401, ...)— returns RFC 9457 ProblemDetails, matching the platform's error convention.ctx.Items["va-user"]— stores the verified user for the rest of the pipeline; endpoints never read the raw header again.- Logging
user.Subject— a stable, non-reassignable identifier is the right audit key; emails can change and are personal data. - In the tests,
ExportSubjectPublicKeyInfoPem()produces the same PEM shape the AWS endpoint serves, so the production code path is exercised exactly.
Security considerations
⚠ Learning shortcut — not for production
The lab uses a single Verified Access instance in a sandbox account, a CloudWatch log group with 7-day retention and RemovalPolicy.DESTROY, IAM Identity Center groups without device trust, and an application domain on a test certificate. In production: access logs delivered to S3 in the log-archive account with retention set by records management, a device trust provider for restricted apps, policies stored in Git with peer review and automated tests, an AWS WAF web ACL on the instance, and DNS plus certificates managed through change control.
- Close the side doors. Verified Access is only zero trust if it is the only path. The ALB security group must allow only the endpoint security group, and VPN or peering routes into the subnet must be removed or restricted.
- Verify the header in the app. Always check signature, algorithm and
signer. Don't trustX-Forwarded-User-style headers from anywhere. - Use group IDs. A renamed group must not silently grant or remove access.
- Prefer explicit forbids for hard rules. For example: forbid all access from outside approved countries for restricted apps, regardless of other permits.
- Trust-context logging is personal data. Verified Access can include trust data (claims, device data) in logs. That helps investigations but contains employee personal data; agree retention and access with your DPO and HR, and document it in the record of processing.
- Break-glass. If the IdP is down, nobody gets in. Keep a tested, audited emergency path (for example Session Manager with a break-glass role) and alert on every use.
- Least privilege after the door. Verified Access proves "this person may reach Payments Exceptions". Whether they may release a specific payment is still the app's job — combine edge policy with in-app authorisation and four-eyes approval for high-value actions.
- Non-HTTP endpoints (SSH/RDP/database) still need host-level controls: no shared accounts, session recording where policy requires it.
Banking use case
Harbourline's end-user computing team has two problems: 600 operations staff connect through a VPN concentrator due for replacement, and an internal audit finding says "access to the payments-release tool is controlled only by network location".
The security architecture review agrees a three-phase plan:
| Phase | Applications | Policy | Result |
|---|---|---|---|
| 1 | Payments Exceptions, Reconciliation dashboard (HTTPS) | Staff group + releasers/recon group; device must be Jamf- or CrowdStrike-managed with low risk | VPN routes to these subnets removed; audit finding closed with Verified Access logs as evidence |
| 2 | Internal admin consoles for Notifications Service and Partner Gateway | Engineering group; access only during on-call or with an approved change ⚠ the time-window rule is implemented with a dedicated IdP group that the change tool adds people to, not in Cedar | Standing access to admin consoles removed |
| 3 | Core Banking batch console (SSH) | TCP endpoint; Connectivity Client; restricted group | Jump host's public route removed; Session Manager kept as break-glass |
Cost estimate for phase 1 (us-east-1, fictional usage): 2 HTTP apps × 730 hours × USD 0.27 ≈ USD 394 per month, plus about 150 GB processed × USD 0.02 = USD 3. That is compared with the VPN concentrator's licence and support costs. The decision record notes that the price per application makes Verified Access best suited to sensitive, frequently used apps; rarely used admin tools stay on Session Manager.
The compliance team, not the engineers, decides whether this satisfies the bank's internal policy for privileged access and the relevant PCI DSS requirements for any app inside the cardholder data environment.
Common mistakes
- Leaving the VPN route in place → attackers bypass the policy → remove network paths once Verified Access is live; test from a VPN-connected laptop that the app is no longer reachable.
- Using group display names in Cedar → renaming "Payments Ops" silently breaks or broadens access → use group IDs from the identity store.
- Forgetting that both group and endpoint policies must allow → users get 403 even though the endpoint policy looks right → check the group policy too.
- Health checks failing after locking the ALB → the ALB health check never had the header → exclude
/healthzfrom header verification, and keep health checks internal. - Trusting the header without verifying
signer→ another account's Verified Access could be pointed at your app → always compare the signer ARN. - Expecting Verified Access to protect customer-facing APIs → it's a workforce access service → use Cognito/your CIAM, WAF and API Gateway for customers.
- Rolling out device trust without an exception process → contractors locked out on day one → define the unmanaged-device policy before go-live.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Browser shows a Verified Access 403 after sign-in | Group or endpoint policy did not permit; wrong group ID; policy disabled | Read the access log entry for the request; check PolicyEnabled and the group ID in the identity store |
| Endless redirect to the sign-in page | User not assigned to the Verified Access application in IAM Identity Center, or third-party cookies blocked | Assign the user or group; test in a clean browser profile |
| 502 / 504 from the endpoint | Endpoint security group cannot reach the ALB, or the ALB listener doesn't match protocol/port | Allow egress from the endpoint SG and ingress on the ALB SG from it; match Port/Protocol |
| Certificate warning on the app domain | ACM certificate doesn't cover the application domain or isn't issued | Request a certificate for the exact domain; wait for ISSUED |
| App returns 401 "Invalid Verified Access context" | Wrong VerifiedAccess:InstanceArn configured, or clock skew | Compare with the instance ARN; check the container's clock |
context.jamf.risk never matches | Device trust provider not attached, browser extension missing, or wrong policy reference name | Attach the provider; install the extension; use the reference name you chose |
| TCP endpoint unreachable | Connectivity Client not installed or not configured with the client config file | Export the client configuration and install it on the device ⚠ VERIFY current client setup steps |
Cost and cleanup
| Item (checked 2026-11-18) | Price | Lab exposure |
|---|---|---|
| HTTP(S) application hours | USD 0.27 per application per hour (partial hours billed as full hours); lower rate at very high volume | 1 app × 2 hours ≈ USD 0.54 |
| Data processed | USD 0.02 per GB | Negligible |
| Non-HTTP(S) endpoint hours | USD 0.20 per endpoint per hour, with 100 free connections per endpoint per hour, then USD 0.001 per connection-hour | Not used in the lab |
| Internal ALB from earlier labs | About USD 0.0225 per hour + LCUs | 2 hours ≈ USD 0.05 |
| ACM public certificate | Free | — |
| CloudWatch Logs | Standard ingestion pricing | Cents |
Deploy-and-destroy budget: under USD 1 if you tear down within two hours. Free alternative: do the design-only exercise below (write the Cedar policies, the trust-boundary diagram and the .NET verifier with its offline tests) without deploying anything.
PROFILE=learn-sandbox
# Delete in reverse order: endpoint -> group -> detach provider -> instance -> provider -> logs
aws ec2 delete-verified-access-endpoint --verified-access-endpoint-id vae-0123456789abcdef0 --profile $PROFILE
# wait until the endpoint is gone before deleting the group
aws ec2 describe-verified-access-endpoints --verified-access-group-id $GROUP_ID --profile $PROFILE
aws ec2 delete-verified-access-group --verified-access-group-id $GROUP_ID --profile $PROFILE
aws ec2 detach-verified-access-trust-provider --verified-access-instance-id $INST_ID \
--verified-access-trust-provider-id $TP_ID --profile $PROFILE
aws ec2 delete-verified-access-instance --verified-access-instance-id $INST_ID --profile $PROFILE
aws ec2 delete-verified-access-trust-provider --verified-access-trust-provider-id $TP_ID --profile $PROFILE
aws logs delete-log-group --log-group-name /hl/m05/verified-access --profile $PROFILE
# CDK / Terraform users
cdk destroy --profile learn-sandbox # or: terraform destroy
# Confirm nothing tagged for the lab remains
aws resourcegroupstaggingapi get-resources --tag-filters Key=Project,Values=cea-lab \
--query "ResourceTagMappingList[].ResourceARN" --profile $PROFILE
aws ec2 describe-verified-access-instances --query "VerifiedAccessInstances[].VerifiedAccessInstanceId" --profile $PROFILEExercises
- 🟢 Guided: Write group and endpoint Cedar policies for the Reconciliation dashboard: Harbourline staff with verified email, members of the
Recon-Analystsgroup, and never from203.0.113.0/24. Then run theVerifierTestsand add a fourth test proving that a token withalgset toHS256is rejected. - 🟡 Challenge: Extend the endpoint policy so that members of
Recon-Analystsneed a CrowdStrike overall assessment above 70, while members ofRecon-Supervisorsneed above 50. Explain why you wrote it as twopermitstatements instead of one with||. - 🔴 Live problem: Tuesday 09:10. Twelve operations staff in the Leeds office report 403s on Payments Exceptions since 08:30. Nobody changed the Verified Access policies. Investigate and decide what you would check, in what order, and how you'd communicate while you investigate.
Assignment
Produce a "zero-trust access design" for three Harbourline internal apps in your portfolio repository: a trust-boundary diagram (Mermaid), the Cedar policies for each group and endpoint in separate .cedar files, a table mapping each app to its data classification and required signals, the cost estimate, the break-glass procedure, and the VerifiedAccessTokenVerifier with passing tests.
Solutions
// group-policy.cedar (shared baseline)
permit(principal, action, resource)
when {
context.idc.groups has "9a1b2c3d-1111-2222-3333-444455556666" // Harbourline-Staff
&& context.idc.user.email.verified == true
};
// endpoint-policy.cedar (Reconciliation dashboard)
permit(principal, action, resource)
when { context.idc.groups has "0f1e2d3c-1234-5678-9abc-def012345678" }; // Recon-Analysts
forbid(principal, action, resource)
when { ip(context.http_request.client_ip).isInRange(ip("203.0.113.0/24")) };The extra test:
[Fact]
public async Task Rejects_hs256()
{
var header = B64(JsonSerializer.SerializeToUtf8Bytes(new { alg = "HS256", kid = Guid.NewGuid().ToString(), signer = Signer }));
var payload = B64("""{"sub":"x"}"""u8.ToArray());
using var key = ECDsa.Create(ECCurve.NamedCurves.nistP384);
var verifier = new VerifiedAccessTokenVerifier(new FakeKeys(key.ExportSubjectPublicKeyInfoPem()), Signer, TimeProvider.System);
await Assert.ThrowsAsync<SecurityException>(() => verifier.VerifyAsync($"{header}.{payload}.AAAA", TestContext.Current.CancellationToken));
}Why: the baseline lives at group level so every app inherits it; the endpoint adds the business rule. The forbid wins over every permit, so even an analyst on that range is denied. The algorithm check must happen before any key handling, otherwise an attacker could try to make you verify with the wrong primitive.
permit(principal, action, resource)
when {
context.idc.groups has "0f1e2d3c-1234-5678-9abc-def012345678" // Recon-Analysts
&& context.crwd.assessment.overall > 70
};
permit(principal, action, resource)
when {
context.idc.groups has "7a6b5c4d-9999-8888-7777-666655554444" // Recon-Supervisors
&& context.crwd.assessment.overall > 50
};Why two statements: each permit reads as one complete business rule that a reviewer can approve or reject on its own, and policy diffs in Git stay small. A combined (A && x > 70) || (B && x > 50) is equivalent but easier to get wrong when someone edits the parentheses later. This assumes a CrowdStrike device trust provider attached with policy reference name crwd.
- Scope the impact: only Leeds? only Payments Exceptions? Ask one affected user for the time of a failed attempt.
- Read the Verified Access access logs for those users around 08:30. The log shows the decision and, if trust-context logging is on, the claims and device data evaluated.
- Likely causes, in order of probability: (a) the device trust provider reports a changed posture — for example a CrowdStrike sensor update lowered scores or Jamf marked devices as non-compliant after an OS update; (b) group membership changed — an HR/IdP sync job removed people from
Payments-Ops-Releasers; (c) the office's egress IP changed into a range covered by aforbidrule; (d) the IdP is reportingemail.verified = falseafter a directory change. - Do not loosen the policy as a first move. If business impact is severe, the duty manager can authorise a time-boxed exception (for example temporarily adding a group without the device condition), recorded as a change with an expiry.
- Communicate: acknowledge to the service desk within 15 minutes, give updates every 30 minutes, and record root cause and fix in the problem ticket.
The underlying lesson: in zero trust, "nothing changed in the policy" doesn't mean nothing changed. The policy's inputs (identity and device signals) are live data.
Knowledge check
Answer: Policy decision point, policy enforcement point and policy information points. Verified Access acts as both decision point (evaluates Cedar) and enforcement point (proxies or blocks), consuming information from trust providers (IdP and device management).
Answer: Denied. When both a group policy and an endpoint policy exist, both must allow the request.
Answer: The signature only proves that some Verified Access instance signed it. The signer field ties the token to your instance ARN, so tokens from another account's instance — or a forged header from a path that bypasses Verified Access — are rejected.
Answer: rds and cidr (plus network-interface and load-balancer with TCP). Users need the AWS Verified Access Connectivity Client.
Answer: Application hours — about USD 0.27 per app per hour, billed whether or not anyone uses the app — plus a small per-GB data-processing charge.
Interview questions
- "What does zero trust mean to you, practically?" — No implicit trust from network location; every access to every application is authenticated, authorised and logged using identity, device and context; least privilege; and assume breach, so segment and monitor. It's a programme of changes, not a product purchase.
- "How would you replace a bank's VPN for internal web apps on AWS?" — Inventory apps; federate the corporate IdP; put each app behind Verified Access endpoints with Cedar policies using group IDs and device posture; lock origin security groups to the endpoint; verify the signed header in apps; migrate app by app; keep a tested break-glass path.
- "Where does Verified Access stop and application authorisation start?" — Verified Access decides reachability per request. Business authorisation (amount limits, four-eyes approval, data-level access) remains in the application, using the verified identity from the signed header.
- "What are the risks of device-posture checks?" — Signal outages or vendor changes can lock out staff; posture data is employee personal data; the unmanaged-device path must be designed; and posture is only as good as the device management estate.
Certification practice
A financial services company wants employees to reach an internal HTTPS application hosted behind an internal Application Load Balancer without a VPN. Access must depend on membership of an IAM Identity Center group and on the device being managed by the company's endpoint management tool. Every access decision must be logged. Which solution meets the requirements with the LEAST operational overhead?
- A. Make the ALB internet-facing and add an AWS WAF rule that allows only the corporate IP ranges
- B. Create an AWS Verified Access instance with an IAM Identity Center user trust provider and a device trust provider, an endpoint for the internal ALB with a Cedar policy, and enable access logging
- C. Deploy AWS Client VPN with certificate-based authentication and security groups
- D. Put Amazon Cognito in front of the ALB using the ALB
authenticate-cognitoaction
Answer: B. Verified Access evaluates identity and device posture per request and logs every decision, without a VPN. A relies on network location and exposes the app. C is a VPN and does not check device posture per application. D authenticates users but provides no device-posture signal and makes the ALB internet-facing.
A Verified Access group policy permits users in group Staff. An endpoint in that group has a policy that permits users in group Releasers and forbids requests from 198.51.100.0/24. A user in both groups connects from 198.51.100.20. What is the result?
- A. Allowed, because two permits outweigh one forbid
- B. Allowed, because the group policy is evaluated first
- C. Denied, because an explicit forbid overrides any permit
- D. Denied, because users may belong to only one group
Answer: C. Cedar, like IAM, gives explicit forbid precedence. A — permits are not counted. B — both policies must allow; order doesn't create an override. D is invented.
A company must give 300 support staff access to an internal web admin tool. The security team wants per-request authorisation based on corporate identity, no inbound internet exposure of the application, and no client VPN software. Which AWS service fits best?
- A. AWS Site-to-Site VPN
- B. AWS Verified Access
- C. AWS Direct Connect
- D. Amazon VPC peering
Answer: B. It's the only option that provides identity-aware, VPN-less application access. A and C connect networks, not users. D connects VPCs.
An application behind AWS Verified Access reads the user's email from the x-amzn-ava-user-context header. A security review flags this. What should the developer do?
- A. Nothing — only Verified Access can set this header
- B. Decode the JWT and use the email without verification, because HTTPS is used
- C. Verify the ES384 signature with the public key for the token's key ID and confirm the
signermatches the expected Verified Access instance ARN before using any claim - D. Encrypt the header with KMS
Answer: C. Header values are only trustworthy after signature and signer validation. A fails if any other path reaches the app. B — HTTPS protects transport, not origin. D — the app can't change how Verified Access sends the header.
Completion checklist
- I can explain zero trust in two sentences without naming a product
- I can draw the Verified Access components and say how group and endpoint policies combine
- I wrote Cedar policies using group IDs, email verification and an IP
forbid - My .NET verifier checks algorithm, signer, expiry and signature, and its tests pass
- I either deployed and destroyed a Verified Access endpoint or completed the design-only alternative
- I confirmed no Verified Access instance or tagged resource remains
Key takeaways
- Zero trust removes network location as a trust signal: each request to each app is decided on identity, device and context, with least privilege and full logging.
- AWS Verified Access implements this for workforce apps: instances, user/device trust providers, groups, endpoints and Cedar policies, where group and endpoint policies must allow and
forbidalways wins. - The app must verify the signed
x-amzn-ava-user-contextJWT (ES384,signer= your instance ARN) and must not be reachable by any other path. - Verified Access controls reachability, not business authorisation; keep in-app checks and four-eyes controls.
- It is priced per application hour (about USD 0.27 per HTTP app-hour), so use it for sensitive, frequently used apps and keep a cheaper path, such as Session Manager, for rare admin access and break-glass.
Further reading
Independent learning resource — not affiliated with, endorsed or sponsored by Amazon Web Services. AWS and related marks are trademarks of Amazon.com, Inc. or its affiliates. All banking data in examples is fictional. Sample architectures are for learning and are not automatically compliant with GDPR, PCI DSS or any banking regulation.
AWS WAF and AWS Shield
Protect Harbourline's public banking APIs with AWS WAF managed rules, rate limiting and safe logging, and understand what Shield Standard gives you free and when Shield Advanced is worth USD 3,000 a month.
CloudTrail for banks: organisation trail, integrity validation and an immutable log archive
Build the audit trail a bank can defend in front of an auditor: an organisation-wide CloudTrail trail delivered to a locked-down log-archive account, KMS-encrypted, protected with S3 Object Lock, and provably untampered thanks to log file integrity validation.