Request security controls
- Follow proxy admission and the identity, role, channel/IP and payload decisions protecting an OBRH request.
Select a component to trace its direct connections. Drag to pan · Ctrl + wheel or pinch to zoom.
Reading
- Envoy can reject excess arrivals before the Direct JVM receives them.
- A verified token identifies the caller. RBAC checks the requested activity, while channel ABAC evaluates the trusted address.
- The payload policy applies to the body. All required checks must permit dispatch.
Decisions on a Direct request
Decisions on a Direct request
Which policy decides?
| Decision | Input | Effect |
|---|---|---|
| Arrival rate | The matched Envoy route and its local token bucket | An empty bucket can return 429 before the application receives the request. |
| Authentication | A signed JWT and the token policy for the route | A valid signature and accepted claims establish the caller for the authorization check. |
| Role-based access (RBAC) | Verified identity, assigned roles and requested activity | A valid token can still lack the grant required for the operation. |
| Attribute-based access (ABAC) | Channel, consumer/service mapping and trusted source IP | The channel policy checks the resolved address against its configured allowlist. |
| Payload policy | Consumer/service policy mapping and inbound body | A configured literal match blocks dispatch. A clean body clears this check only. |
Channel and address must agree
- Resolve the effective peer address at the trusted ingress/proxy boundary. Forwarded-address information needs an explicitly trusted proxy chain.
- Select the channel and API from their configured association. Apply the channel’s exact-address or configured subnet policy to that request.
- Treat unavailable policy data separately from a valid deny decision. A configuration change can reach different JVM caches at different times.
Work through the decisions
- Read the fixture one row at a time. Each rejection changes one input from the admitted case.
- An expired token stops the identity-dependent RBAC decision. A channel/address mismatch denies a request even with the correct activity grant.
- For a body-policy match, record the policy, consumer/service identity and correlation ID according to the audit contract.
- An exhausted rate budget has its own outcome. The runtime performs business-policy checks on requests that reach it.
Direct request decision casesjson
{
"purpose": "Illustrative Direct API decision cases. Result describes whether this request can reach route dispatch.",
"examplePolicy": {
"apiActivity": "offer.read",
"roleGrant": {"role": "inquiry-reader", "activity": "offer.read"},
"channelRule": {"channel": "internal-inquiry", "consumer": "sample-consumer", "service": "sample-inquiry", "allowedSourceNetwork": "192.0.2.0/24"},
"payloadRule": {"consumer": "sample-consumer", "service": "sample-inquiry", "policy": "standard-body"}
},
"baseline": {
"rateBudget": "available",
"token": "valid-for-this-api",
"roleAllowsActivity": true,
"channelAllowsTrustedClientIP": true,
"payloadPolicy": "scan",
"literalMatch": false
},
"cases": [
{"case": "All required checks pass", "change": {}, "decision": "dispatch"},
{"case": "Proxy budget exhausted", "change": {"rateBudget": "empty"}, "decision": "local-rate-rejection", "reachesDirect": false},
{"case": "Expired token", "change": {"token": "expired"}, "decision": "authentication-denied", "trustedPrincipal": false},
{"case": "Valid principal without activity grant", "change": {"roleAllowsActivity": false}, "decision": "authorization-denied"},
{"case": "Known caller from a disallowed channel address", "change": {"channelAllowsTrustedClientIP": false}, "decision": "channel-policy-denied"},
{"case": "Mapped scanner finds a blocked literal", "change": {"literalMatch": true}, "decision": "payload-policy-denied"}
]
}
Where authentication and authorization run
How the specialized API path changed
| Architecture | Where the request is checked | Operational consequence |
|---|---|---|
| APIGW calls SMS | APIGW handles the request and asks SMS to authorize the activity. | This authorization decision depends on the remote service and its response time. |
| APIGW embeds RBAC | APIGW authenticates the caller and calls local role/activity logic for the selected dispatch path. Gateway channel/IP policy also applies to its configured routes. | The selected path can authorize locally. Other gateway operations still call SMS. |
| OBRH handles Direct requests | Direct performs JWT/JWS verification and SMS-style RBAC in its own runtime. Channel/IP and payload policies also protect the middleware dispatch path. | The designated checks run before provider work. Each replica needs compatible policy data and correctly wired handlers. |
Which traffic still goes through the product gateway?
- Product routes still have their own topology. APIGW Router/Zuul calls SMS and can offload work to APIGW code, which makes its own SMS calls.
- The token-service route can still involve Keycloak. The middleware’s token-validation decision and the identity provider’s issuance decision have separate owners.
- The arrival-rate bucket belongs to the configured proxy. Gateway responsibility migration concerns application authentication, authorization and request handling.
A change in code ownership
- Current Direct has local security implementations. The proposed build packages shared SMS/APIGW dependencies with Direct integration adapters.
- Test the assembled release against role denials, channel/address mismatches, invalid tokens and payload blocks. Configure and verify the proxy budget separately.
- During a mixed-version rollout, check policy/cache compatibility across both generations before retiring the previous release.
Identity and authorization
- Product routing and identity responsibilities belong to the established gateway/product owners. The names APIGW Router, Zuul and APIGW do not independently prove multiple deployed hops.
- Direct/IL composition includes selected verification functionality. Packaging a capability does not establish one universal filter order, every enabled authentication mode, or the absence of state lookups.
- Token generation is a Direct use case that reaches Keycloak through OBRH. It is not a third Token Direct flavour. A separately deployed instance of the same flavour is an isolation option, not an asserted Current topology.
- Keycloak public-key material supports local JWS validation. Public-key delivery/rotation is a control dependency, not a Key service or a mandatory Keycloak call on every business request.
- Retain explicit principal binding, issuer/audience/scope validation, expiry and policy freshness across both flavour assemblies. Test the assembled runtimes rather than assuming library presence guarantees enforcement.
- Asymmetric verification can use public material. Symmetric verification secrets can also grant signing capability; resolve credential custody before selecting a local mode. No private-key distribution or token-format migration is implied by the architecture.
- Versioned key/policy snapshots can reduce repeated lookups, but need bounded stale age, rotation overlap and rejection of unsupported generations. Authoritative state reads retain freshness at the cost of DB/dependency latency and availability.
- Product lifecycle operations and configuration remain with their real owners. Local request capabilities do not absorb every product API or privilege.
- Bind authorization to the authenticated subject, tenant, operation and relevant resource context. Keep complete decision inputs and policy generation in eligible cache keys.
- Define publication/versioning, maximum stale age and revocation behavior. A successful policy write does not prove that all enforcement JVMs have adopted it.
- Fence invalidation/load races so an old read cannot resurrect a superseded allow decision. Choose authoritative evaluation for operations whose freshness contract cannot tolerate cached authorization.
- Distinguish a policy denial from inability to evaluate, even if the public response deliberately reveals little.
Illustrative JWT validation and authorizationyaml
# Optional Proposed L7 guard; NOT existing SMS/APIGW security configuration.
# security v1beta1 example; verify support on the installed Istio/CRD release.
# Only works where this sidecar can actually decode the inbound HTTP request.
apiVersion: security.istio.io/v1beta1
kind: RequestAuthentication
metadata:
name: example-consumer-jwt
namespace: obrh-example
spec:
selector:
matchLabels:
app: obrh-direct-example
jwtRules:
- issuer: https://identity.example.com
jwksUri: https://identity.example.com/.well-known/jwks.json
audiences: [obrh-example]
forwardOriginalToken: true # Keep only if downstream application requires it.
---
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: example-require-jwt-for-dispatch
namespace: obrh-example
spec:
selector:
matchLabels:
app: obrh-direct-example
action: ALLOW
rules:
- from:
- source:
requestPrincipals: ['*'] # Validated JWT principal, not mesh source.principal.
to:
- operation:
methods: [POST]
paths: [/obrh/route/dispatch] # Replace with actual sidecar-visible context/path.
when:
- key: request.auth.claims[roles]
values: [obrh.invoke] # Illustrative signed claim, not actual SMS role names.
# An ALLOW policy makes unmatched inbound traffic denied for this selector.
# This is deliberately NOT a deployable whole-workload policy: inventory other routes,
# authenticated restricted diagnostics, and probe capture before composing exceptions.
# Never add a public /health* wildcard allowance just to make probes green.
Payload blacklisting: request and outcome
follow the complete lifecycle
Read the map in three bands: prepare policy data and scanners; inspect each request; refresh the cached policy state. Select a box for its configuration or behavior. This is body-keyword inspection before downstream processing, separate from JWT revocation and business authorization. The version label identifies the supplied design document; it is not a deployed application version.
Enter with the body and canonical API identity
The interceptor resolves SERVICE_CONSUMER and CONSUMER_SERVICE, then checks the mapping cache for that pair. It scans the entire supplied body as text without JSON, XML or multipart field selection. A positive cache entry selects a policy; a cached Optional.empty() selects the configured default. A cache miss queries the mapping repository and stores either result. The default is a policy choice, not an empty scanner.
Choose the scanner or explicit bypass
| Resolution | Next action |
|---|---|
| Explicit policy mapping | Use that policy’s compiled scanner. |
| No mapping | Use the configured default scanner. |
Explicit NO_POLICY |
Skip scanning and continue downstream. |
| Mapped scanner not built yet | Fall back to the configured default scanner. |
| Required default scanner absent | The V2 guide’s flow fails the request. |
Only one policy is intended for an API; there is no stack of policies to combine. DEFAULT_POLICY expresses the fallback in the guide, while DEFAULT_GLOBAL_BLACKLIST appears as a name in its cache illustration. They are not interchangeable configuration keys. Verify the selected default and its scanner.
Continue, reject, and identify what happened
The first accepted keyword match rejects the request. If no accepted match exists, scanning allows onward processing; NO_POLICY reaches the same downstream path without scanning. “Allowed” here means this component did not block the body, not that the request passed every other security control.
The documented blocked-event audit carries matched keyword, policy name, service consumer, consumer service, and request/correlation ID. These fields identify the decision without persisting the full body. Audit durability and the final response contract are separate implementation concerns.
The bounded Direct source observation found an enabled-by-property handler for /route/dispatch and a malicious result mapped to HTTP 400. It also found scanner exceptions logged as “Defaulting to SAFE” and returned as non-malicious. That source observation must not be generalized into IL/APIGW coverage or a blanket fail-closed promise. See the failure table in Inspection coverage and errors.
Policy and mapping data
configure a reusable policy
CZ_SECURITY_POLICY_MASTER owns the keyword set and scanner flags. The configuration is processed when a trie is built; a request uses the resulting scanner rather than reparsing the policy.
| Field | Documented type | Role |
|---|---|---|
POLICY_NAME |
VARCHAR2(100 BYTE) |
Named policy; documented primary key. |
POLICY_DESCRIPTION |
VARCHAR2(1000 BYTE) |
Policy intent. |
BLOCK_PATTERNS |
CLOB |
Literal keywords or phrases separated by the configured delimiter. |
DELIMITER |
VARCHAR2(10 BYTE) |
Separates patterns; select it so needed literal characters remain in patterns. |
WHOLE_WORD_MATCH |
VARCHAR2(1 BYTE) |
Y/N alphabetic-boundary check. |
CASE_SENSITIVE |
VARCHAR2(1 BYTE) |
Y/N case-sensitive matching. |
The guide also describes maker–checker/approval fields and active-policy loading. It does not supply complete deployable DDL or defaults for omitted flags. Do not assume these fields are optional or infer SQL insert statements from this table.
Bind the API identity to that policy
CZ_SERVICE_CONSUMER_SECURITY_POLICY_MAPPING associates an API with a policy.
| Field | Documented type | Role |
|---|---|---|
SERVICE_CONSUMER |
VARCHAR2(250 BYTE) |
Consumer name linked to CMC_RH_CONSUMER_APP. |
SERVICE_CONSUMER_ID |
VARCHAR2(36 BYTE) |
Consumer ID used with the service link. |
CONSUMER_SERVICE |
VARCHAR2(250 BYTE) |
Service name linked to CMC_RH_CONSUMER_APP_SERVICE. |
POLICY_NAME |
VARCHAR2(100 BYTE) |
Selected policy, including deliberate NO_POLICY bypass. |
POLICY_COD_STATUS |
VARCHAR2(1 BYTE) |
Linked policy approval/status value. |
The described foreign keys include (POLICY_NAME, POLICY_COD_STATUS) to policy identity/status and (SERVICE_CONSUMER_ID, CONSUMER_SERVICE) to the consumer-service table. The documented mapping primary key is (SERVICE_CONSUMER, CONSUMER_SERVICE, POLICY_NAME). That three-column key alone does not enforce the intended one-policy-per-pair rule; the full schema or writer must supply that invariant. Stacking or conflict precedence is not defined.
Hard deletes are described. Integration with soft-deleted kernel consumer/service records is only partial; the guide suggests joined-view filtering of RECORD_STAT != 'C'. Do not assume soft-deleting a kernel record already removes its effective mapping.
Worked policy choice: a name containing Union
Illustrative records adapted from the guide, with case-insensitive matching and whole-word matching enabled for this example:
| Policy | Literal pattern set | Use |
|---|---|---|
CUSTOM_POLICY_1 |
select, update, drop table, union |
APIs where any occurrence of the word Union is intended to block. |
| Configured default | drop table, select, <script |
APIs that accept ordinary text containing Union. |
Map the strict API explicitly to CUSTOM_POLICY_1. A text-entry API using the default can accept 123 Union Street, while Union Select 1 still contains the blocked select keyword. This illustrates reuse and reduced false positives, not a guarantee that benign text or attacks are classified correctly. The same policy can serve many API mappings.
A mapping edit can change the intended policy without a code deployment, but its effective scanner can remain the old/default choice until refresh. NO_POLICY is a deliberate bypass requiring trusted API identity and controlled configuration; it is not a request-time fallback for scanner trouble.
Startup, caches and refresh
build before serving scans
BlacklistScannerManager participates in startup as a SmartInitializingBean. It loads active policy definitions, splits each pattern list with that policy’s delimiter, applies the case/boundary configuration and builds one Aho–Corasick scanner per policy. It then loads active consumer/service mappings. Parsing and trie construction stay outside ordinary request scanning.
| Cache | Key and value | Job |
|---|---|---|
czSecurityPolicyMasterCache |
Policy identity → active definition | Spring cache of policy data used to build scanners. |
czSecurityPolicyMappingCache |
Consumer/service pair → mapping or Optional.empty() |
Spring cache for API policy resolution. |
policyTrieJVMCache |
POLICY_NAME → compiled scanner |
In-process JVM scanner lookup. |
These are different stores with different responsibilities. A cached mapping is not a built scanner, and an in-process trie is not evidence of simultaneous publication in every JVM.
A miss and a negative hit are different
On a mapping-cache miss, the repository is queried and either the mapping or an empty result is cached. On a negative hit, Optional.empty() already says no mapping was found; the request uses the default without another database query until refresh.
The guide justifies negative caching using controlled platform consumer/service identifiers. That depends on the actual interception and identity-validation boundary. The document alone cannot prove externally supplied headers are unable to introduce arbitrary keys or select a weaker policy.
Scheduled refresh replaces compiled state
- Evict and repopulate the policy-definition cache from the database.
- Overwrite mapping entries; convert removed mappings to negative entries.
- Build a replacement trie map separately from the active one.
- Atomically replace the active trie-map reference.
The atomic operation covers the trie reference. The guide does not describe one atomic generation containing both mapping updates and scanner publication, nor a cluster-wide barrier. It does not specify a refresh interval, maximum stale age or failed-refresh retention contract.
Two requests during a new-policy rollout
| Request/cache state before the next refresh | What the request observes |
|---|---|
| API has never been looked up | Cache miss finds the new mapping in the DB; its new scanner is absent, so the configured default scanner is used. |
| API already has a negative entry | The cached empty result bypasses the DB; the configured default continues to be used. |
| Replacement state has been published | The request can use the new mapping/scanner as available in that JVM. |
The temporary gap is documented behavior. “Policy saved” or “mapping updated” does not mean every request is enforcing the new keyword set. Compare the selected policy, available scanner and refresh outcome per owning JVM when validating a change.
Literal matching and flags
one compiled multi-pattern scanner
Aho–Corasick represents the configured literal patterns in a trie with failure transitions. The body advances through that automaton once; a mismatch follows the appropriate fallback rather than starting a separate whole-body search for every keyword. Candidate matches are checked against configured boundary rules, and the scan can stop at the first accepted match.
Construction depends on total pattern length; scanning is linear in input plus match-output processing. The document’s shorthand O(n) describes the single-pass traversal, not zero cost for arbitrarily many emitted matches. It provides no measured throughput or payload-size limit.
This avoids the repeated per-pattern scans of naive substring or single-pattern Boyer–Moore/Horspool approaches. It also avoids regex backtracking and hash-collision checks in this literal matcher. Those are selection reasons for this requirement, not claims that every regex or hash algorithm is unsuitable in general.
Flags change which candidate is accepted
DELIMITER splits BLOCK_PATTERNS; CASE_SENSITIVE controls case handling; WHOLE_WORD_MATCH enables the neighbor-character test shown below. These choices belong to the compiled policy. The matcher checks the character before and after a candidate match using Character.isAlphabetic.
“Whole word” here means alphabetic characters cannot touch the keyword. Digits, punctuation and underscores are not automatically excluded. This is not a SQL lexer or a general natural-language word-boundary definition.
Exact whole-word boundary implementationjava
private boolean isPartialMatch(CharSequence searchText, PayloadEmit<T> emit) {
return emit.getStart() != 0 && Character.isAlphabetic(searchText.charAt(emit.getStart() - 1))
|| emit.getEnd() + 1 != searchText.length() && Character.isAlphabetic(searchText.charAt(emit.getEnd() + 1));
}
Work through the boundary examples
| Keyword | Body fragment | Accepted match with whole-word enabled? |
|---|---|---|
select |
select, (select), select,update |
Yes: no touching alphabetic neighbor. |
select |
selection, myselectquery, preselect |
No: an adjacent character is alphabetic. |
= |
1=1, (=), == |
Yes: digits and punctuation pass the boundary test. |
= |
a=b, value=, =true |
No: an alphabetic character touches the match. |
The library also offers onlyWholeWordsWhiteSpaceSeparated, requiring whitespace boundaries. The guide explicitly says that stricter mode is not exposed by this policy configuration. Do not present it as another supported database flag.
Inspection coverage and errors
the scanner sees literal body text
There is no JSON/XML/multipart parser, field-level inclusion/exclusion or automatic decoding stage. Query parameters, headers, path variables and cookies are outside the described body scan unless separately passed through the same mechanism. A matching keyword can therefore appear in harmless body content as well as malicious input.
| Body content | Policy consequence |
|---|---|
| A blocked literal in a free-text note | A valid business request may be refused. Scope the policy to the relevant operation. |
| Structured or encoded fields | Use format-aware validation for these fields. A literal scanner examines the body text it receives. |
| A missing or unavailable scanner | Distinguish a policy configuration error from an accepted match in the audit record. |
Test the actual body representation at the interceptor and record which policy selected the scanner.
Keep rejection, missing state and execution errors separate
| Condition | Behavior |
|---|---|
| Accepted keyword match | Reject the body and emit the policy decision and correlation ID. |
Explicit NO_POLICY |
Continue to the next handler. |
| Mapped scanner absent | Resolve the configured default. |
| Default scanner unavailable | The policy contract specifies failure. |
| Exception during scanning | The Direct scan service can log the exception and return SAFE. Alert on this path and verify the intended error policy. |
Direct enables this interceptor on its dispatch route through application configuration. Verify missing-policy and scanner-error handling separately for each deployed handler.
What remains outside this component
Parameterized database calls, structural input validation, authorization and other security layers still own their jobs. Literal body blocking is not a semantic SQL/XSS detector or a full WAF. Policy refinement reduces selected false positives but cannot eliminate them.
The source documents temporary new-policy gaps, but no refresh interval, cluster-wide convergence bound, maximum body bytes, scanning CPU budget, stale-policy deadline or failed-refresh contract. Those require implementation/runtime evidence before claiming operational guarantees. Validate policy selection, scanner readiness, rejected-event fields and error paths per protected API and owning JVM.
Consumer transport
- Current uses the established Cisco L7 and Istio request path without mTLS. Existing provider TLS is server-authenticated transport; it must not be relabeled mutual TLS. Sidecar presence does not imply an active mesh-mTLS policy. Business JWT/JWS, SMS RBAC and blacklist checks remain application responsibilities.
- The consumer verifies the ingress server identity and presents its approved client certificate. Every ingress replica carries the selected server identity and trust bundle. Cisco chooses an eligible worker gateway target without decrypting or rewriting HTTP. Ingress decrypts the request, then applies its HTTP routing. Pod Envoy sees the forwarded HTTP request and can enforce local HTTP controls.
- Gateway-to-workload mesh mTLS, if separately enabled, creates another session using workload identities; it does not extend the original consumer TLS session into the JVM.
- The gateway authenticates the actual consumer in this design, not an LB client certificate. A verified certificate still needs mapping to allowed consumers; it does not replace business authorization. Strip caller-controlled identity headers before using any trusted certificate-derived identity downstream. JWT principal, certificate identity and mesh principal are different inputs.
- Gateway Service and worker-local exposure: LoadBalancer, retained NodePort and externalTrafficPolicy: Local; the class name belongs to the compatible Cisco integration.
Worker-local gateway Serviceyaml
# Proposed Service contract; merge into the existing gateway chart.
# Example identifiers. A compatible controller must implement this class.
# The Service resource alone does not configure a Cisco appliance.
apiVersion: v1
kind: Service
metadata:
name: obrh-ingress
namespace: istio-iut
spec:
type: LoadBalancer
loadBalancerClass: networking.example.com/cisco # Replace with actual adapter class.
externalTrafficPolicy: Local # Only ready gateway endpoints on the targeted worker.
selector:
istio: istio-ingressgateway # Must match the worker gateway DaemonSet labels.
ports:
- name: https-consumer
protocol: TCP
port: 443
targetPort: 8443 # Verify effective gateway listener binding in the selected chart.
nodePort: 31265 # Retained example port; coordinate with existing Cisco targets.
# Eligible workers each run a ready gateway. Reconcile membership, then enable it.
# healthCheckNodePort and gateway /healthz/ready are not OBRH DB health checks.
# Do not expose a second plaintext business listener as an mTLS bypass.
Consumer mTLS listener and HTTP routeyaml
# Selected external session: consumer -> L4 passthrough LB -> Istio gateway.
# Example values only; provision credentials through the approved PKI mechanism.
apiVersion: v1
kind: Secret
metadata:
name: obrh-consumer-ingress
namespace: istio-iut
type: Opaque
stringData:
tls.crt: |
<INGRESS_SERVER_CERTIFICATE_AND_CHAIN_PEM>
tls.key: |
<INGRESS_SERVER_PRIVATE_KEY_PEM>
ca.crt: |
<APPROVED_CONSUMER_CA_BUNDLE_PEM>
---
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: obrh-consumer-mtls
namespace: istio-iut
spec:
selector:
istio: istio-ingressgateway
servers:
- port:
number: 443
name: https-consumer
protocol: HTTPS
hosts: [api.bank.example]
tls:
mode: MUTUAL # Gateway verifies the consumer, not an LB certificate.
credentialName: obrh-consumer-ingress
subjectAltNames: [consumer.bank.example] # Replace with approved consumer identities.
---
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: obrh-consumer-entry
namespace: obrh-example
spec:
hosts: [api.bank.example]
gateways: [istio-iut/obrh-consumer-mtls]
http:
- name: direct-example
match:
- uri:
prefix: /direct/
route:
- destination:
host: obrh-direct.obrh-example.svc.cluster.local
port:
number: 8080
retries:
attempts: 0 # Business retry safety is not implied by mTLS.
- name: il-example
match:
- uri:
prefix: /il/
route:
- destination:
host: obrh-il.obrh-example.svc.cluster.local
port:
number: 8080
retries:
attempts: 0
# Prefixes/services illustrate separate flavours; preserve real route rewrites.
# TLS server certificate must contain the ingress hostname's SAN.
# Internal mesh mTLS, when selected, is a separate workload-identity contract.
Provider TLS ownership
- Provider calls originate from CMC-OBRH product/runtime functionality and use its owned pool and TLS resources.
- There is no separate provider-client actor; Current sidecar presence does not establish partner TLS origination or HA egress.
- The JVM opens the provider TLS session using its client identity and provider trust. Its HTTP pool, application circuit breaker and retry policy remain the execution owners. Envoy cannot apply HTTP routing/retries to an opaque JVM HTTPS stream; outbound bypass must be deliberate. One shared client/pool should be reused within the approved ownership scope, not constructed per request.
- Complete Java 17 client loads PKCS12 identity/trust stores, requires one client private-key entry, enables endpoint identification, bounds connect time and disables automatic redirects. It does not disable hostname validation or trust every certificate. This factory returns a JDK HttpClient; Apache HttpClient manager settings are not plug-in settings for that object.
- Apply the independent request deadline, response cleanup, pool and operation-bulkhead contracts in the implementation guide.
- The JVM sends an unencrypted request to a narrowly selected intercepted provider destination; Pod Envoy opens the provider mTLS connection. The provider private key and trusted server CA must be available to that proxy, and the actual DNS/IP SAN must be verified. Sending JVM HTTPS through another TLS origination policy would create nested encryption, not transfer ownership.
- Complete IP-based sidecar example carries the application protocol as TCP and uses explicit IP SANs. That example does not supply HTTP method/header retries. The HTTP-visible provider-control example is a different profile, with ServiceEntry HTTP, finite upstream pools, outlier ejection and narrowly scoped retry rules.
- Select the profile that matches the provider addressing/protocol rather than combining incompatible fragments.
- Both approaches require measured connection/latency budgets, credential rotation and failure behavior. There is no demonstrated latency winner in this documentation. Ambient is a separate mode comparison, not an OBRH deployment or selected replacement.
Java 17 provider mTLS clientjava
import java.io.IOException;
import java.io.InputStream;
import java.net.http.HttpClient;
import java.nio.file.Files;
import java.nio.file.Path;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.time.Duration;
import java.util.Collections;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.TrustManagerFactory;
public final class PpMtlsClient {
private PpMtlsClient() {}
public static HttpClient create(
Path identityPath, char[] storePassword, char[] keyPassword,
Path trustPath, char[] trustPassword, Duration connectTimeout)
throws IOException, GeneralSecurityException {
KeyStore identity = load(identityPath, storePassword);
int identities = 0;
for (String alias : Collections.list(identity.aliases())) {
if (identity.entryInstanceOf(alias, KeyStore.PrivateKeyEntry.class)) {
identities++;
}
}
if (identities != 1) {
throw new GeneralSecurityException(
"Expected exactly one client PrivateKeyEntry");
}
KeyManagerFactory kmf = KeyManagerFactory.getInstance(
KeyManagerFactory.getDefaultAlgorithm());
kmf.init(identity, keyPassword);
TrustManagerFactory tmf = TrustManagerFactory.getInstance(
TrustManagerFactory.getDefaultAlgorithm());
tmf.init(load(trustPath, trustPassword));
SSLContext context = SSLContext.getInstance("TLS");
context.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
SSLParameters parameters = new SSLParameters();
parameters.setProtocols(new String[] {"TLSv1.3", "TLSv1.2"});
parameters.setEndpointIdentificationAlgorithm("HTTPS");
return HttpClient.newBuilder().sslContext(context)
.sslParameters(parameters).connectTimeout(connectTimeout)
.followRedirects(HttpClient.Redirect.NEVER).build();
}
private static KeyStore load(Path path, char[] password)
throws IOException, GeneralSecurityException {
KeyStore store = KeyStore.getInstance("PKCS12");
try (InputStream input = Files.newInputStream(path)) {
store.load(input, password);
}
return store;
}
}
IP-based sidecar mTLSyaml
# Provider approach B: local sidecar origination; no egress gateway.
# IP-only examples; replace addresses/ports with the actual processor endpoints.
# Apply the Pod capture/exclusion and credential mounts shown in the page.
# HTTP is carried as opaque TCP here; no HTTP Host routing or HTTP retries.
# ServiceEntry IP:port matching supplies the direct route; no VirtualService needed.
apiVersion: v1
kind: Secret
metadata:
name: pp-client
namespace: obrh-example
type: Opaque
stringData:
tls.crt: |
<DOMAIN_CLIENT_CERTIFICATE_AND_CHAIN_PEM>
tls.key: |
<DOMAIN_CLIENT_PRIVATE_KEY_PEM>
ca.crt: |
<PRODUCT_PROCESSOR_SERVER_CA_BUNDLE_PEM>
---
apiVersion: networking.istio.io/v1beta1
kind: ServiceEntry
metadata:
name: pp-a
namespace: obrh-example
spec:
exportTo: ["."]
# Registry identifier only. No DNS lookup is required.
hosts: ["pp-a.external.invalid"]
addresses: ["192.0.2.10"]
location: MESH_EXTERNAL
resolution: STATIC
ports:
- number: 8443
name: tcp-pp-a
protocol: TCP
endpoints:
- address: 192.0.2.10
ports:
tcp-pp-a: 8443
---
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: pp-a-mtls
namespace: obrh-example
spec:
exportTo: ["."]
host: pp-a.external.invalid
workloadSelector:
matchLabels:
mtls-path: sidecar
trafficPolicy:
portLevelSettings:
- port:
number: 8443
tls:
mode: MUTUAL
clientCertificate: /etc/obrh/pp-client/tls.crt
privateKey: /etc/obrh/pp-client/tls.key
caCertificates: /etc/obrh/pp-client/ca.crt
subjectAltNames: ["192.0.2.10"]
# Provider certificate requires this IP SAN.
# No external SNI: processor must accept TLS without DNS SNI.
---
apiVersion: networking.istio.io/v1beta1
kind: ServiceEntry
metadata:
name: pp-b
namespace: obrh-example
spec:
exportTo: ["."]
# Registry identifier only. No DNS lookup is required.
hosts: ["pp-b.external.invalid"]
addresses: ["192.0.2.20"]
location: MESH_EXTERNAL
resolution: STATIC
ports:
- number: 9443
name: tcp-pp-b
protocol: TCP
endpoints:
- address: 192.0.2.20
ports:
tcp-pp-b: 9443
---
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: pp-b-mtls
namespace: obrh-example
spec:
exportTo: ["."]
host: pp-b.external.invalid
workloadSelector:
matchLabels:
mtls-path: sidecar
trafficPolicy:
portLevelSettings:
- port:
number: 9443
tls:
mode: MUTUAL
clientCertificate: /etc/obrh/pp-client/tls.crt
privateKey: /etc/obrh/pp-client/tls.key
caCertificates: /etc/obrh/pp-client/ca.crt
subjectAltNames: ["192.0.2.20"]
# Provider certificate requires this IP SAN.
# No external SNI: processor must accept TLS without DNS SNI.
HTTP-visible intercepted provider controlsyaml
# ALTERNATIVE provider-owner example; only if sidecar sees plaintext HTTP before TLS.
# Not effective for excluded outbound capture or opaque JVM-originated HTTPS.
# No egress gateway. Names/domains and every numeric value are illustrative.
apiVersion: networking.istio.io/v1beta1
kind: ServiceEntry
metadata:
name: example-provider
namespace: obrh-example
spec:
hosts: [provider.example.com]
location: MESH_EXTERNAL
resolution: DNS
ports:
- number: 80
name: http-provider
protocol: HTTP
targetPort: 443 # Sidecar originates server-authenticated TLS to this port.
---
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: example-provider-capacity
namespace: obrh-example
spec:
host: provider.example.com
workloadSelector:
matchLabels:
app: obrh-direct-example
trafficPolicy:
connectionPool:
tcp:
maxConnections: 20
connectTimeout: 500ms
http:
http2MaxRequests: 20
http1MaxPendingRequests: 5
maxRetries: 2 # Simultaneously outstanding retries; not retry attempts/request.
outlierDetection:
consecutive5xxErrors: 5
interval: 5s
baseEjectionTime: 30s
maxEjectionPercent: 50
minHealthPercent: 0 # Keep detection active even with few healthy endpoints.
tls:
mode: SIMPLE # Not partner mTLS; credential custody requires separate design.
sni: provider.example.com
subjectAltNames: [provider.example.com]
---
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: example-provider-read-only-retry
namespace: obrh-example
spec:
hosts: [provider.example.com]
gateways: [mesh]
http:
- name: read-only-example
match:
- method:
exact: GET
uri:
prefix: /reference-data/
timeout: 3s # Includes original attempt and retries.
retries:
attempts: 1 # One retry after the original attempt: at most two attempts.
perTryTimeout: 1s
retryOn: connect-failure,reset # Even reset can be an ambiguous execution result.
route:
- destination:
host: provider.example.com
port:
number: 80
- name: all-other-operations-no-retry
timeout: 3s
retries:
attempts: 0 # Explicitly suppress inherited/default retry behavior.
route:
- destination:
host: provider.example.com
port:
number: 80
Certificate and trust lifecycle
- Provision identity and approved trust to every owning replica. Reload and retirement of existing connections are separate operations.
Public client CA ConfigMapyaml
# One ConfigMap, one PEM bundle. Replace placeholders with approved CA certificates.
apiVersion: v1
kind: ConfigMap
metadata:
name: ingress-client-trust
namespace: istio-iut
data:
ca.crt: |
-----BEGIN CERTIFICATE-----
<APPROVED_ISSUER_CA_1_BASE64>
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
<APPROVED_ISSUER_CA_2_BASE64>
-----END CERTIFICATE-----
Gateway CA mountyaml
# Merge once into the existing istio-ingressgateway Deployment/DaemonSet Pod template.
# This is a targeted patch, not a complete workload manifest.
spec:
template:
spec:
containers:
- name: istio-proxy
volumeMounts:
- name: ingress-client-trust
mountPath: /etc/istio/client-trust
readOnly: true
volumes:
- name: ingress-client-trust
configMap:
name: ingress-client-trust
items:
- key: ca.crt
path: ca.crt
File-backed gateway client trustyaml
# Istio 1.22.x file-based Gateway pattern.
# Merge into the existing Gateway; preserve other listeners and identity restrictions.
# Substitute the existing resource name, ingress hostname and server identity file paths.
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: <EXISTING_GATEWAY_RESOURCE_NAME>
namespace: istio-iut
spec:
selector:
istio: istio-ingressgateway
servers:
- port:
number: 443
name: https-mtls
protocol: HTTPS
hosts: ["<INGRESS_HOSTNAME>"]
tls:
mode: MUTUAL
# Existing platform-managed identity, already readable by the gateway proxy.
serverCertificate: <EXISTING_SERVER_CERTIFICATE_FILE>
privateKey: <EXISTING_SERVER_PRIVATE_KEY_FILE>
caCertificates: /etc/istio/client-trust/ca.crt
# Do not combine this file-based configuration with credentialName.