|
| 1 | +static_resources: |
| 2 | + listeners: |
| 3 | + - name: http_connect |
| 4 | + address: |
| 5 | + socket_address: |
| 6 | + protocol: TCP |
| 7 | + address: 0.0.0.0 |
| 8 | + port_value: 80 |
| 9 | + filter_chains: |
| 10 | + - filters: |
| 11 | + - name: envoy.filters.network.http_connection_manager |
| 12 | + typed_config: |
| 13 | + "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager |
| 14 | + stat_prefix: ingress_http |
| 15 | + tracing: {} |
| 16 | + route_config: |
| 17 | + name: local_route |
| 18 | + virtual_hosts: |
| 19 | + - name: local_service |
| 20 | + domains: |
| 21 | + - "*" |
| 22 | + routes: |
| 23 | + - match: |
| 24 | + prefix: '/app1/' |
| 25 | + route: |
| 26 | + cluster: outbound_tls_proxy |
| 27 | + typed_per_filter_config: |
| 28 | + envoy.filters.http.dynamic_forward_proxy: |
| 29 | + "@type": type.googleapis.com/envoy.extensions.filters.http.dynamic_forward_proxy.v3.PerRouteConfig |
| 30 | + host_rewrite_literal: app1.${APP_DOMAIN} |
| 31 | + - match: |
| 32 | + prefix: '/app2/' |
| 33 | + route: |
| 34 | + cluster: outbound_tls_proxy |
| 35 | + typed_per_filter_config: |
| 36 | + envoy.filters.http.dynamic_forward_proxy: |
| 37 | + "@type": type.googleapis.com/envoy.extensions.filters.http.dynamic_forward_proxy.v3.PerRouteConfig |
| 38 | + host_rewrite_literal: app2.${APP_DOMAIN} |
| 39 | + - match: |
| 40 | + prefix: '/app3/' |
| 41 | + route: |
| 42 | + cluster: outbound_tls_proxy |
| 43 | + typed_per_filter_config: |
| 44 | + envoy.filters.http.dynamic_forward_proxy: |
| 45 | + "@type": type.googleapis.com/envoy.extensions.filters.http.dynamic_forward_proxy.v3.PerRouteConfig |
| 46 | + host_rewrite_literal: app3.${APP_DOMAIN} |
| 47 | + http_filters: |
| 48 | + - name: envoy.filters.http.health_check |
| 49 | + typed_config: |
| 50 | + "@type": type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck |
| 51 | + pass_through_mode: false |
| 52 | + headers: |
| 53 | + - exact_match: /health |
| 54 | + name: :path |
| 55 | + - name: envoy.filters.http.lua |
| 56 | + typed_config: |
| 57 | + "@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua |
| 58 | + default_source_code: |
| 59 | + inline_string: |
| 60 | + function envoy_on_request(request_handle) |
| 61 | + local headers = request_handle:headers() |
| 62 | + local prefix = "x-" |
| 63 | + local to_remove = {} |
| 64 | + for key, value in pairs(headers) do |
| 65 | + if ((key:find(prefix, 1, true) == 1) and (key ~= "x-forwarded-for") and (key ~= "x-envoy-internal") and (key ~= "x-amzn-trace-id") and (key ~= "x-forwarded-port") and (key ~= "x-forwarded-proto") and (key ~= "x-request-id")) then |
| 66 | + table.insert(to_remove, key) |
| 67 | + end |
| 68 | + end |
| 69 | + for _, value in pairs(to_remove) do |
| 70 | + request_handle:logInfo("removing header:"..value) |
| 71 | + headers:remove(value) |
| 72 | + end |
| 73 | + end |
| 74 | + - name: envoy.filters.http.jwt_authn |
| 75 | + typed_config: |
| 76 | + "@type": type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.JwtAuthentication |
| 77 | + providers: |
| 78 | + okta-jwt: |
| 79 | + issuer: ${JWT_ISSUER} |
| 80 | + claim_to_headers: |
| 81 | + - header_name: x-jwt-subject |
| 82 | + claim_name: sub |
| 83 | + audiences: |
| 84 | + - ${JWT_AUDIENCE} |
| 85 | + jwt_cache_config: |
| 86 | + jwt_cache_size: 100 |
| 87 | + remote_jwks: |
| 88 | + http_uri: |
| 89 | + uri: ${JWT_JWKS} |
| 90 | + cluster: jwks |
| 91 | + timeout: 1s |
| 92 | + async_fetch: |
| 93 | + fast_listener: false |
| 94 | + cache_duration: |
| 95 | + seconds: 300 |
| 96 | + from_headers: |
| 97 | + - name: Authorization |
| 98 | + value_prefix: "Bearer " |
| 99 | + payload_in_metadata: jwt_payload |
| 100 | + rules: |
| 101 | + - match: |
| 102 | + prefix: / |
| 103 | + requires: |
| 104 | + provider_name: okta-jwt |
| 105 | + - name: envoy.filters.http.lua |
| 106 | + typed_config: |
| 107 | + "@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua |
| 108 | + default_source_code: |
| 109 | + inline_string: |
| 110 | + function envoy_on_request(request_handle) |
| 111 | + local meta = request_handle:streamInfo():dynamicMetadata() |
| 112 | + for key, value in pairs(meta) do |
| 113 | + if(key == "envoy.filters.http.jwt_authn" and value.jwt_payload.scp ~= nil) then |
| 114 | + for _, value1 in pairs(value.jwt_payload.scp) do |
| 115 | + request_handle:headers():add("x-jwt-scope-" .. value1, "true") |
| 116 | + end |
| 117 | + break |
| 118 | + end |
| 119 | + end |
| 120 | + end |
| 121 | + - name: envoy.filters.http.dynamic_forward_proxy |
| 122 | + typed_config: |
| 123 | + "@type": type.googleapis.com/envoy.extensions.filters.http.dynamic_forward_proxy.v3.FilterConfig |
| 124 | + dns_cache_config: |
| 125 | + name: dynamic_forward_proxy_cache_config |
| 126 | + dns_lookup_family: V4_ONLY |
| 127 | + typed_dns_resolver_config: |
| 128 | + name: envoy.network.dns_resolver.cares |
| 129 | + typed_config: |
| 130 | + "@type": type.googleapis.com/envoy.extensions.network.dns_resolver.cares.v3.CaresDnsResolverConfig |
| 131 | + use_resolvers_as_fallback: true |
| 132 | + resolvers: |
| 133 | + - socket_address: |
| 134 | + address: "127.0.0.1" |
| 135 | + port_value: 53 |
| 136 | + dns_resolver_options: |
| 137 | + use_tcp_for_dns_lookups: true |
| 138 | + no_default_search_domain: true |
| 139 | + - name: envoy.filters.http.aws_request_signing |
| 140 | + typed_config: |
| 141 | + "@type": type.googleapis.com/envoy.extensions.filters.http.aws_request_signing.v3.AwsRequestSigning |
| 142 | + service_name: vpc-lattice-svcs |
| 143 | + region: ap-southeast-2 |
| 144 | + use_unsigned_payload: true |
| 145 | + match_excluded_headers: |
| 146 | + - prefix: x-envoy |
| 147 | + - prefix: x-forwarded |
| 148 | + - exact: x-amzn-trace-id |
| 149 | + - name: envoy.filters.http.router |
| 150 | + typed_config: |
| 151 | + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router |
| 152 | + clusters: |
| 153 | + - name: outbound_tls_proxy |
| 154 | + lb_policy: CLUSTER_PROVIDED |
| 155 | + cluster_type: |
| 156 | + name: envoy.clusters.dynamic_forward_proxy |
| 157 | + typed_config: |
| 158 | + "@type": type.googleapis.com/envoy.extensions.clusters.dynamic_forward_proxy.v3.ClusterConfig |
| 159 | + dns_cache_config: |
| 160 | + name: dynamic_forward_proxy_cache_config |
| 161 | + dns_lookup_family: V4_ONLY |
| 162 | + typed_dns_resolver_config: |
| 163 | + name: envoy.network.dns_resolver.cares |
| 164 | + typed_config: |
| 165 | + "@type": type.googleapis.com/envoy.extensions.network.dns_resolver.cares.v3.CaresDnsResolverConfig |
| 166 | + use_resolvers_as_fallback: true |
| 167 | + resolvers: |
| 168 | + - socket_address: |
| 169 | + address: "127.0.0.1" |
| 170 | + port_value: 53 |
| 171 | + dns_resolver_options: |
| 172 | + use_tcp_for_dns_lookups: true |
| 173 | + no_default_search_domain: true |
| 174 | + - name: jwks |
| 175 | + type: STRICT_DNS |
| 176 | + connect_timeout: 5s |
| 177 | + load_assignment: |
| 178 | + cluster_name: jwks |
| 179 | + endpoints: |
| 180 | + - lb_endpoints: |
| 181 | + - endpoint: |
| 182 | + address: |
| 183 | + socket_address: |
| 184 | + address: ${JWKS_HOST} |
| 185 | + port_value: 443 |
| 186 | + transport_socket: |
| 187 | + name: envoy.transport_sockets.tls |
| 188 | + typed_config: |
| 189 | + "@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext |
| 190 | +tracing: |
| 191 | + http: |
| 192 | + name: envoy.tracers.xray |
| 193 | + typed_config: |
| 194 | + "@type": type.googleapis.com/envoy.config.trace.v3.XRayConfig |
| 195 | + segment_name: "envoy-frontend" |
| 196 | + daemon_endpoint: |
| 197 | + protocol: UDP |
| 198 | + address: 127.0.0.1 |
| 199 | + port_value: 2000 |
| 200 | + sampling_rule_manifest: |
| 201 | + inline_string: | |
| 202 | + { |
| 203 | + "version": 2, |
| 204 | + "rules": [ |
| 205 | + { |
| 206 | + "description": "NoHealthChecks", |
| 207 | + "host": "*", |
| 208 | + "http_method": "*", |
| 209 | + "url_path": "/health", |
| 210 | + "fixed_target": 0, |
| 211 | + "rate": 0.0 |
| 212 | + } |
| 213 | + ], |
| 214 | + "default": { |
| 215 | + "fixed_target": 1, |
| 216 | + "rate": 0.05 |
| 217 | + } |
| 218 | + } |
0 commit comments