Secure external integrations
Design safe connections to partner APIs, webhooks and file exchanges using egress allow-lists, mutual TLS, signed webhooks and third-party risk controls, and verify signed webhooks with a runnable C# verifier.
Assumes: .NET 10 LTS (file-based apps) · AWS SDK for .NET v4 · 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:
- Classify an external integration by direction (outbound, inbound, file) and by what happens to the bank if it fails or is compromised.
- Design controlled egress from private subnets using an allow-list firewall, and decide when PrivateLink is better.
- Choose between API keys, OAuth client credentials and mutual TLS for partner authentication, and say where the certificates live.
- Verify an inbound webhook with an HMAC signature, a timestamp window, secret rotation and replay protection.
- Describe the third-party-risk controls a design authority expects: due diligence, concentration, exit plan, monitoring and incident contacts.
- Apply the 15-section template to a partner integration and mark every regulatory point as needing review.
Prerequisites
- Calling partner APIs and Webhooks
- Certificates, TLS and mTLS
- Segmentation and egress with Network Firewall
- Operational resilience and third-party risk
- Retry strategies
- Tools: .NET 10 SDK or Docker for the webhook verifier
Why this matters in banking
Harbourline's payment flow calls a sanctions-screening provider, a card processor and an identity-verification vendor, and receives webhooks from the settlement partner. Each connection is a door in the bank's wall. When one fails the bank may not be able to move money. When one is compromised the bank may leak customer data or accept forged payment confirmations.
Three real-world patterns cause most incidents:
- Open egress. A compromised container can send data to any address on the internet because the NAT gateway allows everything.
- Unverified webhooks. An endpoint accepts
payment.settledfrom anyone who guesses the URL. - Single dependency with no plan. The screening provider has an outage and nobody decided whether payments are held or released.
Educational content, not legal or regulatory advice
Outsourcing and third-party rules differ by jurisdiction and regulator (for example operational-resilience and ICT third-party regimes in the UK and EU) ⚠ VERIFY which apply to Harbourline-like firms. This lesson gives engineering controls and the questions to ask. Your risk, procurement, legal and compliance functions decide what is required.
The idea in plain language
Treat every external party as untrusted by default and critical by dependency. Both are true at once: you must defend against them and depend on them.
| Direction | Example | Main risks | Main controls |
|---|---|---|---|
| Outbound API | Call screening provider | Data leakage, SSRF, provider outage | Egress allow-list, mTLS or OAuth, timeouts, circuit breaker, minimal data |
| Inbound webhook | Settlement confirmation | Forgery, replay, flooding | Signature, timestamp, idempotency, throttling, WAF |
| Inbound API | Open Banking TPP calls | Over-broad access, abuse | OAuth scopes, mTLS, consent checks, rate limits |
| File exchange | Statements over SFTP | Tampering, malware, duplicates | Per-partner identity, hash check, quarantine (reconciliation) |
Analogy: a bank's cash-in-transit arrangement. The armoured van company is a vital supplier, but the vault door only opens for named, verified crew at agreed times, every handover is signed, and there is a plan if the van company fails to turn up.
What problem the AWS services solve
| Need | AWS option | Limits and sharp edges |
|---|---|---|
| Control outbound destinations | AWS Network Firewall with a domain allow-list (TLS SNI and HTTP host), behind a NAT gateway | Domain rules rely on SNI/Host, so they cannot see inside TLS; hourly endpoint cost ⚠ VERIFY |
| Private provider connectivity | AWS PrivateLink (endpoint to a provider's endpoint service) | The provider must offer it; you then avoid the internet path entirely |
| Inbound mTLS | API Gateway custom domain with a truststore in S3 | Needs a custom domain, and you disable the default execute-api endpoint so clients cannot bypass mTLS ⚠ VERIFY current setup |
| Outbound client certificates | AWS Secrets Manager or ACM Private CA for your own CA | Public ACM certificates do not export private keys; plan certificate issuance |
| Outbound webhooks | EventBridge API destinations with connections | Built-in rate limiting and retries; a destination invocation has a short timeout ⚠ VERIFY limits |
| Edge defence | AWS WAF, Shield | Rules need tuning to avoid blocking legitimate partners |
| Secret storage and rotation | Secrets Manager | Rotation needs a rotation function and a partner that accepts overlapping secrets |
Microsoft / Azure comparison
| You know (Microsoft/Azure) | AWS equivalent | What's different |
|---|---|---|
| Azure Firewall FQDN rules | Network Firewall domain lists | Same idea; you route traffic through firewall endpoints with route tables |
| Private Endpoint to partner service | PrivateLink | Provider-initiated endpoint service, consumer creates an interface endpoint |
| API Management client certificate validation | API Gateway mTLS truststore | Truststore is a PEM bundle in S3 |
| Key Vault certificates | Secrets Manager, ACM Private CA | Certificates and secrets are separate services |
| Event Grid webhooks with validation handshake | EventBridge API destinations; your own verifier for inbound | Inbound signature checking is code you own |
Architecture
Security-boundary view
Every arrow that crosses a boundary has an authentication mechanism and a log line. Inbound data is verified before it touches the application zone.
The 15-section design
The fictional integration: Harbourline's payment service calls an external sanctions-screening provider (outbound), and receives settlement webhooks from a scheme partner (inbound).
Sections 1 to 3: requirements
| Section | Content |
|---|---|
| 1 Business | Screen every payment before release; accept settlement confirmations reliably; remain able to explain every external call to regulators and to the board's risk committee |
| 2 Functional | F1 Call screening with a decision and reference. F2 Hold payments if screening cannot complete. F3 Accept only authentic, fresh, unique webhooks. F4 Rotate partner secrets without downtime. F5 Alert on partner failure. F6 Keep a record of every external call and verdict |
| 3 Non-functional | Screening call p99 under 1.5 s with 2 s timeout and 3 bounded retries. Webhook verification under 50 ms. 99.9% availability of the webhook endpoint. No outbound traffic to unlisted domains. Secret rotation every 90 days ⚠ VERIFY policy. Webhook replay window 5 minutes |
Section 5: service selection
| Choice | Why | Rejected alternative | Trade-off |
|---|---|---|---|
| Network Firewall allow-list | Central, auditable egress control | Open NAT gateway with security groups only | Cost and routing complexity |
| mTLS plus OAuth for screening | Strong client identity plus scoped tokens | API key alone | Certificate lifecycle to manage |
| HMAC signature on webhooks | Simple, partner-supported | IP allow-list only | Needs shared-secret rotation; IPs can change |
| SQS buffer after verification | Absorbs bursts, decouples from partner timing | Direct synchronous processing | Slight delay in processing |
| Fail closed on screening outage | Never release unscreened payments | Fail open | Customers see "pending" during outages |
Sections 6 and 7: network and security
- Network. Application subnets route
0.0.0.0/0to firewall endpoints, then to NAT. Firewall rules allow only named domains (for example.screening-provider.example.com) and drop everything else, logging drops. Use VPC endpoints for AWS services so that traffic never uses the firewall path. - Identity. Screening client certificate in Secrets Manager, readable only by the payments task role. Webhook secrets likewise. Two secrets are valid at once during rotation.
- Data minimisation. Send the screening provider only what it needs: name, country, date of birth where required, payment amount and currency. Never send account numbers or free-text notes unless the contract requires it ⚠ VERIFY with the data-protection officer, and record the legal basis and processor terms.
- Logging. Log provider name, endpoint, status, latency and correlation ID. Do not log request bodies containing personal data.
- Threat model (STRIDE highlights). Spoofing: forged webhook. Tampering: modified body. Repudiation: partner denies sending; keep signed payloads. Information disclosure: egress to attacker domain. Denial of service: webhook flood or provider slowness. Elevation: webhook triggers privileged action without checks.
Sections 8 to 10: API, data and flow
- API (inbound).
POST /partner/settlementswith headersX-Timestamp,X-Signature: v1=<hex>,X-Event-Id. Always respond fast (accept or reject) and do the work from the queue. Return2xxonly after the event is durably queued; partners retry on non-2xx. - Database. DynamoDB table
webhook_eventskeyed byeventId, with TTL longer than the partner's retry window, written with a conditionattribute_not_exists(eventId). - Data flow. (1) Partner sends. (2) WAF filters. (3) Verifier checks timestamp, signature and replay. (4) Event is queued. (5) Consumer updates payment status idempotently. (6) Audit event written.
Section 11: failure scenarios
| Failure | Detection | Automatic response | Impact | Manual step |
|---|---|---|---|---|
| Screening provider slow | Timeout at 2 s | Bounded retry then hold payment as screening | Payment pending | Operations clear queue after recovery |
| Provider hard down | Circuit breaker opens | Payments held; alarm | Pending payments | Business decision on second provider |
| Certificate expiry | Expiry alarm at 30 and 7 days | None if rotated early | Calls fail if missed | Rotate certificate |
| Forged webhook | Signature mismatch | Reject 401, count metric | None | Investigate source |
| Replay of old webhook | Duplicate eventId or stale timestamp | Reject or ignore | None | None |
| Webhook flood | WAF rate rule, API throttle | Throttle and shed | Possible delays | Review rules |
| Partner secret leaked | Partner notice or anomaly | Rotate secret; previous secret is revoked after cut-over | Brief risk window | Incident process |
| Egress to unlisted domain | Firewall drop log | Block and alert | None | Investigate compromised workload |
Sections 12 to 15
- Scalability. The verifier is stateless; the replay cache scales with DynamoDB. The first quota to check is API Gateway throttling, then Lambda concurrency ⚠ VERIFY current limits. Partner rate limits cap outbound throughput; queue and pace calls.
- Cost. Network Firewall endpoint hours and per-GB processing usually dominate; NAT gateway and data transfer follow. Estimate per-AZ endpoint count and GB per month ⚠ VERIFY prices. Reduce cost with VPC endpoints for AWS traffic.
- Implementation. Phase 1 egress allow-list in a non-production account. Phase 2 verifier with replay cache. Phase 3 secret rotation rehearsal. Phase 4 circuit breaker and fail-closed behaviour. Phase 5 game day: provider down, certificate expired, webhook flood.
- Compliance touchpoints.
| Area | Where it touches | Reviewing team | Evidence |
|---|---|---|---|
| Third-party and outsourcing risk ⚠ VERIFY | Provider onboarding, exit plan | Third-party risk, procurement | Due-diligence file, exit plan |
| Sanctions screening obligations ⚠ VERIFY | Hold policy, retries, record keeping | Financial-crime compliance | Signed hold policy, call records |
| Data protection (processor, transfers) | Fields sent, location of provider | Data protection officer | Data-processing agreement, transfer assessment |
| Operational resilience | Impact tolerance of payments | Operational resilience lead | Scenario test results |
| Security architecture | mTLS, egress, secrets | Security architecture | Control mapping |
Step-by-step implementation
Inventory every external call
List each provider, direction, data sent, authentication, timeout and owner. A call nobody can name is a finding.
Create the egress allow-list
Start in monitor mode: log all outbound domains for a week, review them with application owners, then enforce. Add domains by pull request.
Implement and test the webhook verifier
Verify the timestamp first (cheap), then the signature with a constant-time compare, then the replay cache. Test with tampered bodies, old timestamps and garbage signatures.
Plan secret rotation
Accept two secrets during rotation: the new and the previous. Rotate, watch metrics for traffic still using the old secret, then remove it.
Add timeouts, bounded retries and a circuit breaker
Set a call timeout below the caller's own deadline, retry only idempotent calls, and open the breaker after repeated failures so the bank stops hammering a failing provider (resilience patterns).
Write the exit plan
Document how to switch provider, what data must be exported, how long it takes, and who decides. Revisit yearly.
AWS Console instructions
- Console → VPC → Network Firewall → Firewall policies / Rule groups → Create rule group. Choose Stateful, Domain list, action Allow, add domains such as
.screening-provider.example.com. - Console → VPC → Network Firewall → Firewalls → Create firewall, select the VPC and one firewall subnet per Availability Zone, attach the policy, enable logging to CloudWatch Logs or S3.
- Console → API Gateway → Custom domain names → Create, enable Mutual TLS and give the S3 truststore URI. Then disable the default endpoint on the API.
- Console → Secrets Manager → Store a new secret for the webhook secret; enable rotation only when a rotation function exists.
AWS CLI
# List firewalls (read-only) to confirm what exists before designing changes.
aws network-firewall list-firewalls --profile learn-sandbox --region us-east-1
# Create a secret for the webhook signing key (fictional value; a real one is generated, never typed).
aws secretsmanager create-secret --name hl-m14/partner-webhook-secret \
--secret-string "$(openssl rand -hex 32)" \
--tags Key=Project,Value=cea-lab Key=Lab,Value=m14-l11 Key=Environment,Value=learn Key=Owner,Value=learner \
--profile learn-sandbox --region us-east-1
# Enable mutual TLS on an API Gateway custom domain (truststore is a PEM bundle in S3).
aws apigateway create-domain-name --domain-name api.harbourline.example \
--regional-certificate-arn <acm-certificate-arn> \
--endpoint-configuration types=REGIONAL \
--mutual-tls-authentication truststoreUri=s3://hl-m14-truststore/truststore.pem \
--profile learn-sandbox --region us-east-1The last command is design-only in the sandbox: it needs a domain you own and an ACM certificate. Check flags with aws apigateway create-domain-name help ⚠ VERIFY.
Infrastructure as Code
using Amazon.CDK;
using Amazon.CDK.AWS.NetworkFirewall;
using Amazon.CDK.AWS.SecretsManager;
using Constructs;
namespace Harbourline.Architecture.ExternalIntegrations;
public class ExternalIntegrationStack : Stack
{
public ExternalIntegrationStack(Construct scope, string id, IStackProps? props = null) : base(scope, id, props)
{
// Egress allow-list: only the screening provider's domains may be reached over TLS or HTTP.
new CfnRuleGroup(this, "EgressAllowList", new CfnRuleGroupProps
{
RuleGroupName = "hl-m14-egress-allow",
Type = "STATEFUL",
Capacity = 100,
RuleGroup = new CfnRuleGroup.RuleGroupProperty
{
RulesSource = new CfnRuleGroup.RulesSourceProperty
{
RulesSourceList = new CfnRuleGroup.RulesSourceListProperty
{
GeneratedRulesType = "ALLOWLIST",
TargetTypes = ["TLS_SNI", "HTTP_HOST"],
Targets = [".screening-provider.example.com"],
},
},
},
});
// Webhook signing secret: generated, never typed. Rotation needs a rotation function (not shown).
new Secret(this, "WebhookSecret", new SecretProps
{
SecretName = "hl-m14/partner-webhook-secret",
GenerateSecretString = new SecretStringGenerator
{
PasswordLength = 48,
ExcludePunctuation = true,
},
});
Amazon.CDK.Tags.Of(this).Add("Project", "cea-lab");
Amazon.CDK.Tags.Of(this).Add("Lab", "m14-l11");
Amazon.CDK.Tags.Of(this).Add("Environment", "learn");
Amazon.CDK.Tags.Of(this).Add("Owner", "learner");
}
}The rule group alone does nothing: a firewall policy, a firewall in dedicated subnets and route-table changes complete the path. Treat this as the policy fragment of a larger design.
Complete code
The verifier below accepts a webhook only if its timestamp is fresh, its HMAC matches one of the active secrets (current or previous), and the event ID has not been seen. It runs locally with no AWS dependency.
// Run with: dotnet run WebhookVerifier.cs
// Verifies signed webhooks: HMAC-SHA256 over "timestamp.body", a freshness window,
// secret rotation (two active secrets) and replay rejection.
using System.Security.Cryptography;
using System.Text;
var current = "demo-secret-2026-11-not-real"u8.ToArray();
var previous = "demo-secret-2026-10-not-real"u8.ToArray();
var now = DateTimeOffset.Parse("2026-11-18T10:00:00Z");
var verifier = new WebhookVerifier([current, previous], TimeSpan.FromMinutes(5), () => now);
var body = """{"eventId":"evt-001","type":"payment.settled","paymentId":"PAY-0001"}""";
var ts = now.AddSeconds(-30).ToUnixTimeSeconds().ToString();
Check("valid, current secret", verifier.Verify(ts, WebhookVerifier.Sign(current, ts, body), "evt-001", body));
Check("replay of same event ", verifier.Verify(ts, WebhookVerifier.Sign(current, ts, body), "evt-001", body));
Check("valid, old secret ", verifier.Verify(ts, WebhookVerifier.Sign(previous, ts, body), "evt-002", body));
Check("tampered body ", verifier.Verify(ts, WebhookVerifier.Sign(current, ts, body), "evt-003", body + " "));
var old = now.AddMinutes(-20).ToUnixTimeSeconds().ToString();
Check("stale timestamp ", verifier.Verify(old, WebhookVerifier.Sign(current, old, body), "evt-004", body));
Check("garbage signature ", verifier.Verify(ts, "v1=zzzz", "evt-005", body));
return 0;
static void Check(string label, Verdict v) => Console.WriteLine($"{label} -> {v}");
public enum Verdict { Accepted, BadSignature, Stale, Replay, Malformed }
public sealed class WebhookVerifier(IReadOnlyList<byte[]> secrets, TimeSpan tolerance, Func<DateTimeOffset> clock)
{
// In production this is a DynamoDB conditional put with a TTL, not process memory.
private readonly HashSet<string> _seen = [];
public static string Sign(byte[] secret, string timestamp, string body)
{
var mac = HMACSHA256.HashData(secret, Encoding.UTF8.GetBytes($"{timestamp}.{body}"));
return "v1=" + Convert.ToHexString(mac).ToLowerInvariant();
}
public Verdict Verify(string timestamp, string signatureHeader, string eventId, string body)
{
if (!long.TryParse(timestamp, out var seconds)) return Verdict.Malformed;
var age = clock() - DateTimeOffset.FromUnixTimeSeconds(seconds);
if (age > tolerance || age < -tolerance) return Verdict.Stale;
if (!signatureHeader.StartsWith("v1=", StringComparison.Ordinal)) return Verdict.Malformed;
byte[] provided;
try { provided = Convert.FromHexString(signatureHeader[3..]); }
catch (FormatException) { return Verdict.BadSignature; }
var ok = false;
foreach (var secret in secrets)
{
var expected = HMACSHA256.HashData(secret, Encoding.UTF8.GetBytes($"{timestamp}.{body}"));
ok |= CryptographicOperations.FixedTimeEquals(expected, provided); // no early exit
}
if (!ok) return Verdict.BadSignature;
return _seen.Add(eventId) ? Verdict.Accepted : Verdict.Replay;
}
}Expected output:
valid, current secret -> Accepted
replay of same event -> Replay
valid, old secret -> Accepted
tampered body -> BadSignature
stale timestamp -> Stale
garbage signature -> BadSignatureThe demo secrets are obviously fake. In production the secrets come from Secrets Manager at startup and are refreshed on a schedule.
Code explained line by line
- The primary constructor
WebhookVerifier(IReadOnlyList<byte[]> secrets, TimeSpan tolerance, Func<DateTimeOffset> clock)injects the clock, so tests can freeze time instead of waiting. Signcomputes HMAC-SHA256 over"{timestamp}.{body}". Binding the timestamp into the signed text stops an attacker reusing an old body with a new timestamp.Verifychecks the timestamp first, because it is cheap and rejects obviously stale traffic before any cryptography.- A signature that is not valid hex raises
FormatExceptionfromConvert.FromHexString. Catching it returnsBadSignaturerather than crashing the endpoint with a 500. CryptographicOperations.FixedTimeEqualscompares in constant time, so an attacker cannot learn the signature one byte at a time from response timing.- The loop over
secretsORs results without an early exit, so which secret matched is not observable from timing. This supports rotation: the partner switches to the new secret whenever ready. - The replay check runs last, only after a valid signature, so unauthenticated callers cannot fill the replay cache with junk IDs.
_seenis process memory for the demo. Across Lambda instances or containers you need a shared store: a DynamoDB conditional put with TTL.
Security considerations
⚠ Learning shortcut — not for production
The verifier keeps seen event IDs in memory and the lab embeds demo secrets in source. Production loads secrets from Secrets Manager, stores replay IDs in a shared table with TTL, logs rejected requests with a correlation ID (never the secret), and alerts on a spike in BadSignature.
- Verify the raw bytes. Compute the HMAC over the exact body bytes received. Parsing and re-serialising JSON changes whitespace and breaks signatures.
- Do not trust IP allow-lists alone. They help as a second layer but providers change addresses.
- Bound everything. Maximum body size, request rate and processing time. Reject early.
- SSRF. If your service fetches URLs supplied by partners, validate against an allow-list and block link-local metadata addresses.
- Certificates. Alarm on expiry at 30 and 7 days; keep private keys out of container images (secrets management).
- Logging. Record who called, what was decided and why. Do not log full bodies with personal data.
Banking use case
Harbourline's screening provider has a planned maintenance window that overruns by 40 minutes. Payments continue to arrive. The circuit breaker opens after repeated timeouts; new payments enter screening status and are held, not released. The customer app shows "processing". A dashboard shows the held count and age. When the provider returns, a controlled drain re-screens held payments in order at a paced rate. The post-incident review checks the held-payment SLA against the bank's impact tolerance for payment initiation ⚠ VERIFY, and decides whether a second provider is justified. The ADR from lesson 1 records "fail closed" as the decision.
Common mistakes
- Using
==to compare signatures. It leaks timing. Use a constant-time compare. - Skipping the timestamp. A captured valid request can then be replayed forever.
- Replying 200 before queuing. A crash loses the event and the partner will not retry.
- Retrying non-idempotent calls blindly. Provider calls may need idempotency keys.
- Allow-listing
*domains "temporarily". Temporary rules become permanent. - No exit plan. Concentration risk becomes visible only during an outage.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Legitimate webhooks rejected as BadSignature | Body re-serialised before verification, or wrong secret | Verify raw bytes; check the active secrets list |
Webhooks rejected as Stale | Server clock drift or tolerance too small | Fix time sync (use Amazon Time Sync Service); widen tolerance modestly |
| Outbound call times out after firewall deployment | Domain not in allow-list or missing route | Check firewall drop logs; confirm route table sends traffic via the firewall |
x509: certificate has expired | Client certificate lapsed | Rotate; add expiry alarms |
mTLS clients get 403 | Client certificate not chained to truststore | Add the issuing CA to the truststore and wait for propagation |
| Replay cache grows without bound | No TTL | Set TTL beyond the partner retry window |
Cost and cleanup
The C# verifier is free. Network Firewall endpoints bill hourly while they exist (and per GB processed) ⚠ VERIFY, so this lesson treats the firewall as design-only in the sandbox. If you deploy only the rule group and the secret, cost is a secret (a small monthly fee) and nothing for an unattached rule group.
# Delete the secret immediately (skip the default recovery window in the sandbox only).
aws secretsmanager delete-secret --secret-id hl-m14/partner-webhook-secret \
--force-delete-without-recovery --profile learn-sandbox --region us-east-1
# CDK or Terraform teardown.
cdk destroy --profile learn-sandbox
terraform destroy
# Confirm nothing tagged for the course remains.
aws resourcegroupstaggingapi get-resources --tag-filters Key=Project,Values=cea-lab \
--profile learn-sandbox --region us-east-1Exercises
- 🟢 Guided: run the verifier and change the tolerance to 10 seconds. Predict which lines of output change.
- 🟡 Challenge: add a
maxBodyBytescheck that returns a newTooLargeverdict, and justify the limit you chose. - 🔴 Live problem: the settlement partner says they rotated their webhook secret yesterday without telling you, and 30 percent of events are now rejected. Describe your immediate mitigation, the root-cause fix, and the contract clause you would ask procurement to add.
Assignment
Add architecture/external-integrations/ to your portfolio: an inventory table of every external call in a design of your choice, the 15-section document for one integration, a STRIDE table, a rotation runbook and the verifier with unit tests.
Solutions
Every request in the demo that uses ts is 30 seconds old, so with a 10-second tolerance all six lines print Stale, including the tampered body, the replay and the garbage signature. Why: freshness is evaluated first, so an old request never reaches the cryptography or the replay cache. That also shows why the order of checks changes which error an operator sees.
Add if (Encoding.UTF8.GetByteCount(body) > maxBodyBytes) return Verdict.TooLarge; as the first check, before the timestamp. Choose the limit from the largest legitimate event plus margin (for example 64 KiB). Why: bounding input first protects the HMAC computation from large-body denial-of-service.
Mitigation: add the partner's new secret (obtain it through the agreed secure channel) as a second active secret so both verify; do not disable verification. Root cause: no rotation protocol. Fix: contract clause requiring advance notice, overlapping validity of old and new secrets for a defined period, and a test endpoint. Also add an alert on rising BadSignature rate so the next occurrence is noticed in minutes.
Knowledge check
Answer: The HMAC proves who signed, not when. Without a freshness window, a captured valid request can be replayed indefinitely.
Answer: Data exfiltration and command-and-control by a compromised workload, because it can only reach named destinations.
Answer: It allows rotation without downtime: the partner can switch to the new secret while old in-flight requests still verify.
Answer: When the provider offers an endpoint service. Traffic stays on the AWS network and you avoid public exposure of the integration.
Answer: Releasing unscreened payments risks sanctions breaches. Holding payments has a customer cost but a lower, manageable risk.
Interview questions
- How do you secure a webhook endpoint? Signature over raw body and timestamp, constant-time compare, freshness window, replay store, throttling and WAF, 2xx only after durable queueing.
- How do you control what a workload can call out to? Private subnets, a firewall allow-list by domain, VPC endpoints for AWS services, and drop-logging with alerts.
- What belongs in an exit plan? Alternative providers, data export format and time, contractual notice and transition support, decision owner and test cadence.
- mTLS or API keys? mTLS ties calls to a certificate identity and resists key leakage in logs, at the price of certificate lifecycle management. Often combined with OAuth.
- What do you log for external calls? Destination, outcome, latency, correlation ID and decision, but not personal data payloads.
Certification practice
A payment service in private subnets must reach only two partner domains. Which design best enforces this?
A. Security groups allowing all outbound HTTPS. B. A NAT gateway with no further controls. C. A Network Firewall domain allow-list in the egress path, with drop logging. D. A public subnet with an elastic IP per task.
Answer: C. Security groups cannot filter by domain. A and B allow any destination; D increases exposure.
A partner calls your API with a client certificate. Which API Gateway feature validates it?
A. API keys. B. Mutual TLS with a truststore on a custom domain. C. CloudFront signed cookies. D. Resource policy on the usage plan.
Answer: B. Mutual TLS validates client certificates against a truststore. API keys identify but do not authenticate strongly; C and D address other concerns.
A bank depends on one external provider for a critical flow. Which action best reduces concentration risk without immediately paying for full duplication?
A. Ignore the risk because the provider has an SLA. B. Define an impact tolerance, fail-closed behaviour, a tested exit plan and a documented trigger for onboarding a second provider. C. Cache provider responses indefinitely. D. Move the provider into the same account.
Answer: B. It manages the risk with measurable tolerance and a plan. A is not a control, C is unsafe for screening decisions, D does not change dependency.
Completion checklist
- I can classify an integration by direction and failure impact
- I ran the verifier and understand every verdict
- I designed egress allow-listing and secret rotation
- I wrote the failure table with provider outage and forged webhook rows
- I ran the cleanup steps and confirmed nothing tagged
Project=cea-labremains
Key takeaways
- External parties are both untrusted and critical: authenticate, limit and plan for failure.
- Allow-list egress; prefer PrivateLink where offered.
- Verify webhooks by timestamp, constant-time HMAC and replay protection; return 2xx only after queuing.
- Support overlapping secrets so rotation causes no outage.
- Third-party risk, data-protection and regulatory points need specialist review.
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.
Reconciliation architecture
Design an automated reconciliation of Harbourline's internal ledger against partner and scheme files: idempotent file ingestion, control totals, a tiered matching engine, break handling with an audit trail, and a runnable C# matcher.
Core banking integration
Connect cloud-native services to a legacy core banking system over hybrid networking and MQ-style messaging, using an anti-corruption gateway, stand-in reads, a circuit breaker and safe handling of unknown outcomes.