Istio Service-Mesh Policy
Scaffolds an Istio policy bundle for an HTTP workload on a service mesh: an AuthorizationPolicy that enforces JWT authentication, a RequestAuthentication that configures the JWT issuer + JWKs endpoint, an optional PeerAuthentication enforcing STRICT mTLS, and an optional VirtualService routing template. Designed to drop alongside any containerized service template (spring-boot-service, go-service, ts-service).
| Name | istio-policy |
| Version | 0.1.0 |
| Category | infrastructure |
| License | Apache-2.0 |
| Persona | engineering |
| Tags | istio, kubernetes, k8s, service-mesh, authorization, oidc, mtls, security |
| Source | templates/istio-policy |
Render it
Three front doors, one catalog. Pick whichever suits the caller.
# CLI
npx @nanohype/sdk render istio-policy --out ./my-app
# SDK
import { LocalSource, renderTemplate } from "@nanohype/sdk";
const result = await renderTemplate(source, "istio-policy", variables);
# MCP — from an agent
get_template({ name: "istio-policy" })Prerequisites
| Tool | Version | Why |
|---|---|---|
kubectl | — | Apply Istio policy manifests to the cluster |
istioctl (optional) | >=1.20 | Validate Istio resource manifests (`istioctl analyze`) before apply |
Variables
Required
ProjectNamestring- Kebab-case project name, used for resource names and selector labels Must be lowercase kebab-case starting with a letter.
OidcIssuerstring- OIDC issuer URL that signs inbound JWTs (e.g. https://auth.example.com)
JwksUristring- JWKs endpoint URL. For standard OIDC providers this is usually {issuer}/.well-known/jwks.json — override if your provider uses a different path.
AllowedAudiencestring- JWT `aud` claim value required for requests to this service
Optional
Namespacestring — defaults todefault- Kubernetes namespace the policy resources are applied to
ServiceHoststring — defaults to${ProjectName}.${Namespace}.svc.cluster.local- Fully-qualified service host for the VirtualService
GatewayNamestring — defaults tomesh- Istio Gateway resource name the VirtualService attaches to. Use "mesh" for internal-only (default) or the name of an external ingress gateway (e.g. "istio-system/public-gateway") for externally-reachable traffic.
IncludeMTlsbool — defaults tofalse- Include a PeerAuthentication resource enforcing STRICT mTLS
IncludeVirtualServicebool — defaults tofalse- Include a VirtualService routing template
What it produces
5 files. Placeholder names such as __APP_NAME__ are what the renderer substitutes into.
authorization-policy.yaml
peer-authentication.yaml
README.md
request-authentication.yaml
virtual-service.yamlComposes with
- Pairs with
spring-boot-service - Pairs with
go-service - Pairs with
ts-service - Pairs with
k8s-deploy - Nests inside
monorepo
Composites that use it
- Identity-Aware Spring Boot Microservice — Spring Boot 4 microservice on JDK 25 with identity enforced at both the service-mesh edge (Istio RequestAuthentication + AuthorizationPolicy) and the application boundary (Spring Security OAuth 2.0 resource server) — defense in depth against the same OIDC issuer.