Complete Example
This is a complete example of Envoy and HUMAN Callout Enforcer.
We have the following test setup:
- Envoy listens on 10.0.0.1:8080
- HUMAN Callout Enforcer is on 10.0.0.1:50051
- A protected web server is
www.envoyproxy.io:443
- Complete Envoy configuration (
envoy.yamlfile):
static_resources:listeners:- name: listener_0address:socket_address:protocol: TCPaddress: 0.0.0.0port_value: 8080filter_chains:- filters:- name: envoy.filters.network.http_connection_managertyped_config:"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManagerscheme_header_transformation:scheme_to_overwrite: httpsstat_prefix: ingress_httproute_config:name: local_routevirtual_hosts:- name: local_servicedomains: ["*"]routes:- match:prefix: "/"route:host_rewrite_literal: www.envoyproxy.iocluster: service_envoyproxy_iohttp_filters:- name: envoy.filters.http.ext_proctyped_config:"@type": type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessorgrpc_service:envoy_grpc:cluster_name: px_callout_clustertimeout: 3sfailure_mode_allow: falseallow_mode_override: truemessage_timeout: 3sprocessing_mode:request_header_mode: "SEND"response_header_mode: "SEND"request_body_mode: "NONE"response_body_mode: "NONE"request_trailer_mode: "SKIP"response_trailer_mode: "SKIP"- name: envoy.filters.http.routertyped_config:"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Routerclusters:- name: service_envoyproxy_ioconnect_timeout: 30stype: LOGICAL_DNSdns_lookup_family: V4_ONLYlb_policy: ROUND_ROBINload_assignment:cluster_name: service_envoyproxy_ioendpoints:- lb_endpoints:- endpoint:address:socket_address:address: www.envoyproxy.ioport_value: 443transport_socket:name: envoy.transport_sockets.tlstyped_config:"@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContextsni: www.envoyproxy.io- name: px_callout_clustertype: STRICT_DNSlb_policy: ROUND_ROBINconnect_timeout: 1shttp2_protocol_options: {}load_assignment:cluster_name: px_callout_clusterendpoints:- lb_endpoints:- endpoint:address:socket_address:address: 10.0.0.2port_value: 50051health_checks:- timeout: 1sinterval: 1sunhealthy_threshold: 1healthy_threshold: 1reuse_connection: truetls_options:alpn_protocols: ["h2"]grpc_health_check:service_name: health_checktransport_socket:name: envoy.transport_sockets.tlstyped_config:"@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext
- Run Envoy:
docker run --rm \-p 8080:8080 \--mount type=bind,source="$(pwd)"/envoy.yaml,target=/etc/envoy/envoy.yaml \--config-path /etc/envoy/envoy.yaml \-l info \envoyproxy/envoy:v1.29-latest
- An example of HUMAN Callout Enforcer configuration (
pxconf.jsonfile):
{"px_appId": "--REPLACE--","px_cookie_secret": "--REPLACE--","px_auth_token": "--REPLACE--","px_whitelist_uri_full": ["/test", "/abc"],"px_block_enabled": true,"px_score_header_enabled": true,"px_score_header_name": "x-px-score"}
- Run HUMAN Callout Enforcer:
docker run --rm \-p 50051:50051--mount type=bind,source="$(pwd)"/pxconf.json,target=/etc/pxconf.json,readonly \perimeterx/px-callout-enforcer:latest
- To test the new setup, open
http://10.0.0.1:8080/address in a web browser (enable “PhantomJS” UA), you should see HUMAN Captcha page:
