UNPKG

@fntio/infra-client

Version:

Self-hosted AWS access portal: credential vending, target-account trust, and grant-driven private networking as CDK stacks and constructs.

47 lines (46 loc) • 2.54 kB
import { Construct } from "constructs"; import * as acm from "aws-cdk-lib/aws-certificatemanager"; import * as iam from "aws-cdk-lib/aws-iam"; import * as kms from "aws-cdk-lib/aws-kms"; import * as s3 from "aws-cdk-lib/aws-s3"; export interface OidcIssuerProps { /** Route 53 zone owning `domainName` — holds the alias. */ readonly hostedZoneId: string; readonly zoneName: string; /** The stable issuer host — the issuer IDENTITY. Must never change once * target accounts trust it; must sit inside `zoneName`. */ readonly domainName: string; /** Key generations that EXIST — each is published in the JWKS so STS can * verify tokens from any of them. Rotation runbook: wiki Runbooks-Issuer. */ readonly keyVersions: number[]; /** Which version actively signs new tokens. Must appear in `keyVersions`. */ readonly signerVersion: number; /** The ONLY principal allowed kms:Sign on the active key — everything * else, IAM-policy self-grants included, is refused at the key. */ readonly signerRole: iam.IRole; /** Covers `domainName`. CloudFront accepts certificates from us-east-1 * only — WebCertStack mints it there. */ readonly certificate: acm.ICertificate; /** CloudFront-scope web ACL ARN (us-east-1) for the distribution * (Security Hub CloudFront.6) — WebCertStack's observe-only one, which * never blocks STS. Omit = no WAF. */ readonly webAclArn?: string; /** SET-ONCE resource prefix: names each key's alias, `alias/<prefix>-oidc-signing-v<N>`. */ readonly resourcePrefix: string; /** Production hardening: the signing keys RETAIN on teardown. */ readonly prod?: boolean; /** DataStack's log bucket: the issuer bucket's server-access logs and the distribution's standard logs. */ readonly accessLogsBucket?: s3.IBucket; } /** KMS signing key(s) plus the discovery document + JWKS as static objects: * a deploy-time custom resource writes them into a private bucket that * CloudFront serves on the stable custom domain. Nothing runs when STS * fetches them. The domain IS the issuer identity — recreating the * construct never changes it. */ export declare class OidcIssuer extends Construct { /** Signs the vended web-identity tokens. Grant kms:Sign to whoever mints. */ readonly signingKey: kms.Key; /** The public issuer URL — the `iss` claim of every minted token. Stable. */ readonly url: string; constructor(scope: Construct, id: string, props: OidcIssuerProps); }