## T1 default deny: actor f-deny has no EgressPolicy
actor "f-deny" in atespace "lab-f" has no egress policy
### [11:23:14.347] t1-resolv
$ cat /etc/resolv.conf; ip -4 addr 2>/dev/null | grep inet; ip route 2>/dev/null; ls -la /run/ate/egress-trust-bundle/; grep -c BEGIN /run/ate/egress-trust-bundle/trust-bundle.pem
exit=0
nameserver 169.254.17.1
search ate-demo-egress.svc.cluster.local svc.cluster.local cluster.local
options ndots:5
    inet 127.0.0.1/8 scope host dynamic lo
    inet 169.254.17.2/30 scope global dynamic eth0
::1 dev lo scope link 
fe80::/64 dev eth0 scope link 
169.254.17.0/30 dev eth0 scope link 
127.0.0.0/8 dev lo scope link 
default via 169.254.17.1 dev eth0 scope link 
total 226
drwxr-xr-x    2 root     root          4096 Nov 12 10:45 .
drwxr-xr-x    3 root     root          4096 Nov 12 10:45 ..
-rw-r--r--    1 root     root        222672 Nov 12 10:45 trust-bundle.pem
149


### [11:23:14.767] t1-dns-incluster
$ dig +time=2 +tries=1 +noall +comments +answer whoami.egress-target.svc.cluster.local | grep -E 'status|IN'
exit=0
;; WARNING: .local is reserved for Multicast DNS
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 45178


### [11:23:15.229] t1-dns-public
$ dig +time=2 +tries=1 +noall +comments +answer example.com | grep -E 'status|IN'; curl -sS -m 6 -o /dev/null -w 'code=%{http_code}\n' http://example.com/
exit=6 error=exit status 6
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 39099
code=000

stderr: curl: (6) Could not resolve host: example.com


### [11:23:17.565] t1-dns-other-server
$ dig @8.8.8.8 +time=2 +tries=1 example.com | grep -E 'status|timed out|refused|unreachable' ; echo rc=$?
exit=0
;; communications error to 8.8.8.8#53: timed out
rc=0


### [11:23:17.822] t1-http-direct-ip
$ curl -sS -m 8 -i http://10.96.213.47/ | head -12
exit=0
HTTP/1.1 403 Forbidden
content-type: text/plain
content-length: 26
date: Thu, 12 Nov 2026 11:23:17 GMT

actor egress policy denied

### [11:23:18.049] t1-https-direct-ip
$ curl -sS -k -m 8 -o /dev/null -w 'code=%{http_code}\n' https://1.1.1.1/
exit=35 error=exit status 35
code=000

stderr: curl: (35) TLS connect error: error:0A000126:SSL routines::unexpected eof while reading


### [11:23:18.234] t1-tcp-other
$ (echo hello | nc -w 3 10.96.213.47 80 | head -3); echo nc_rc=$?
exit=0
nc_rc=0


## T2 allowed host: f-main with P1
### [11:23:18.467] policy update f-main <- P1.yaml
ATESPACE   ACTOR    RULES   VERSION   AGE
lab-f      f-main   1       27        37m
### [11:23:31.302] t2-dns-allowed
$ dig +time=2 +tries=1 +noall +comments +answer whoami.egress-target.svc.cluster.local | grep -E 'status|IN'
exit=0
;; WARNING: .local is reserved for Multicast DNS
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11567
;; WARNING: recursion requested but not available
whoami.egress-target.svc.cluster.local.	30 IN A	10.96.213.47


### [11:23:31.557] t2-http-allowed
$ curl -sS -m 8 -i http://whoami.egress-target.svc.cluster.local/ | head -24
exit=0
HTTP/1.1 200 OK
Date: Thu, 12 Nov 2026 11:23:31 GMT
Content-Length: 234
Content-Type: text/plain; charset=utf-8

Hostname: whoami-5bdb4584f6-w4j5d
IP: 127.0.0.1
IP: ::1
IP: 10.244.0.46
IP: fe80::186a:92ff:fe6c:afdb
RemoteAddr: 10.244.0.44:54740
GET / HTTP/1.1
Host: whoami.egress-target.svc.cluster.local
User-Agent: curl/8.14.1
Accept: */*



### [11:23:31.781] t2-http-ip-not-in-policy
$ curl -sS -m 8 -i http://10.96.213.47/ | head -8
exit=0
HTTP/1.1 403 Forbidden
content-type: text/plain
content-length: 26
date: Thu, 12 Nov 2026 11:23:31 GMT

actor egress policy denied

### [11:23:32.355] t2-dns-not-allowed
$ dig +time=2 +tries=1 +noall +comments +answer drip.egress-target.svc.cluster.local | grep -E 'status|IN'; curl -sS -m 6 -o /dev/null -w 'code=%{http_code}\n' 'http://drip.egress-target.svc.cluster.local/drip?n=1'
exit=6 error=exit status 6
;; WARNING: .local is reserved for Multicast DNS
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 14268
code=000

stderr: curl: (6) Could not resolve host: drip.egress-target.svc.cluster.local


### [11:23:32.580] t2-other-ip-direct
$ curl -sS -m 8 -i 'http://10.96.80.60/drip?n=1' | head -8
exit=0
HTTP/1.1 403 Forbidden
content-type: text/plain
content-length: 26
date: Thu, 12 Nov 2026 11:23:32 GMT

actor egress policy denied

### [11:23:32.799] t2-host-header-spoof
$ curl -sS -m 8 -i -H 'Host: whoami.egress-target.svc.cluster.local' 'http://10.96.80.60/drip?n=1' | head -14
exit=0
HTTP/1.1 200 OK
Date: Thu, 12 Nov 2026 11:23:32 GMT
Content-Length: 242
Content-Type: text/plain; charset=utf-8

Hostname: whoami-5bdb4584f6-w4j5d
IP: 127.0.0.1
IP: ::1
IP: 10.244.0.46
IP: fe80::186a:92ff:fe6c:afdb
RemoteAddr: 10.244.0.44:54740
GET /drip?n=1 HTTP/1.1
Host: whoami.egress-target.svc.cluster.local
User-Agent: curl/8.14.1


## T3 https interception against tls_passthrough: P2
### [11:23:33.040] policy update f-main <- P2.yaml
ATESPACE   ACTOR    RULES   VERSION   AGE
lab-f      f-main   3       28        37m
### [11:23:46.163] t3-https-default-store
$ curl -sS -m 15 -o /dev/null -w 'code=%{http_code} verify=%{ssl_verify_result}\n' https://example.com/
exit=60 error=exit status 60
code=000 verify=19

stderr: curl: (60) SSL certificate problem: self-signed certificate in certificate chain
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the webpage mentioned above.


### [11:23:47.056] t3-https-trust-bundle
$ curl -sS -m 15 -o /dev/null -w 'code=%{http_code} verify=%{ssl_verify_result} http=%{http_version}\n' --cacert /run/ate/egress-trust-bundle/trust-bundle.pem https://example.com/
exit=0
code=200 verify=0 http=2


### [11:23:48.170] t3-https-cert-seen
$ echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -issuer -subject -dates -ext subjectAltName 2>&1
exit=0
issuer=CN=U7ICLCR3N66DBMBSAQNS5JHTHI
subject=CN=example.com
notBefore=Jan  1 00:00:00 1975 GMT
notAfter=Jan  1 00:00:00 4096 GMT
X509v3 Subject Alternative Name: 
    DNS:example.com


### [11:23:48.872] t3-passthrough-default-store
$ curl -sS -m 15 -o /dev/null -w 'code=%{http_code} verify=%{ssl_verify_result} http=%{http_version}\n' https://example.org/
exit=0
code=200 verify=0 http=2


### [11:23:50.165] t3-passthrough-cert-seen
$ echo | openssl s_client -connect example.org:443 -servername example.org 2>/dev/null | openssl x509 -noout -issuer -subject -dates 2>&1
exit=0
issuer=C=US, O=SSL Corporation, CN=Cloudflare TLS Issuing ECC CA 3
subject=CN=example.org
notBefore=Sep 26 22:05:05 2026 GMT
notAfter=Dec 25 22:13:27 2026 GMT


### [11:23:51.258] t3-sni-unlisted
$ IP=$(dig +short example.com | head -1); echo ip=$IP; curl -sS -m 10 -o /dev/null -w 'code=%{http_code}\n' --resolve www.iana.org:443:$IP https://www.iana.org/
exit=35 error=exit status 35
ip=104.20.23.154
code=000

stderr: curl: (35) TLS connect error: error:0A000126:SSL routines::unexpected eof while reading


### [11:23:52.368] t3-trust-bundle-subjects
$ grep -c BEGIN /run/ate/egress-trust-bundle/trust-bundle.pem; openssl crl2pkcs7 -nocrl -certfile /run/ate/egress-trust-bundle/trust-bundle.pem | openssl pkcs7 -print_certs -noout | grep -i -E 'ate|substrate|egress|mitm' | head -5
exit=0
149
subject=C=US, O=Microsoft Corporation, CN=Microsoft ECC Root Certificate Authority 2017
issuer=C=US, O=Microsoft Corporation, CN=Microsoft ECC Root Certificate Authority 2017
subject=C=US, ST=Arizona, L=Scottsdale, O=Starfield Technologies, Inc., CN=Starfield Services Root Certificate Authority - G2
issuer=C=US, ST=Arizona, L=Scottsdale, O=Starfield Technologies, Inc., CN=Starfield Services Root Certificate Authority - G2
subject=C=US, O=Microsoft Corporation, CN=Microsoft RSA Root Certificate Authority 2017


### [11:23:52.655] t3-websocket
$ curl -sS -m 8 -i -H 'Connection: Upgrade' -H 'Upgrade: websocket' -H 'Sec-WebSocket-Version: 13' -H 'Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==' http://whoami.egress-target.svc.cluster.local/ | head -6
exit=0
HTTP/1.1 403 Forbidden
content-type: text/plain
content-length: 33
date: Thu, 12 Nov 2026 11:23:52 GMT

WebSocket egress is not supported

## T4 policy change against open connections: P3 then back to P1
### [11:23:52.872] policy update f-main <- P3.yaml
ATESPACE   ACTOR    RULES   VERSION   AGE
lab-f      f-main   2       29        37m
### [11:24:07.512] t4-pre-drip
$ curl -sS -m 6 'http://drip.egress-target.svc.cluster.local/drip?n=2'
exit=0
chunk 1 11:24:05
chunk 2 11:24:06


### [11:24:12.753] policy update f-main <- P1.yaml
ATESPACE   ACTOR    RULES   VERSION   AGE
lab-f      f-main   1       30        38m
### [11:24:33.665] t4-bg-http-stream
$ curl -sS -N -m 75 'http://drip.egress-target.svc.cluster.local/drip?n=45' | tee /tmp/drip.out | wc -l; head -1 /tmp/drip.out; tail -1 /tmp/drip.out
exit=0
2


### [11:24:33.764] t4-bg-passthrough-one-conn
$ (printf 'GET / HTTP/1.1\r\nHost: example.org\r\n\r\n'; sleep 22; printf 'GET / HTTP/1.1\r\nHost: example.org\r\nConnection: close\r\n\r\n'; sleep 4) | openssl s_client -quiet -connect example.org:443 -servername example.org 2>&1 | grep -a -c '^HTTP/1.1 200'
exit=0
2


### [11:24:12.526] +5s policy changed to P1 (drip and example.org removed)
[11:24:15.196] +8s new requests: ["code=000\nstatus: NXDOMAIN\n0\n","curl: (6) Could not resolve host: drip.egress-target.svc.cluster.local\n"]
[11:24:20.500] +13s new requests: ["code=000\nstatus: NXDOMAIN\n0\n","curl: (6) Could not resolve host: drip.egress-target.svc.cluster.local\n"]
[11:24:27.241] +20s new requests: ["code=000\nstatus: NXDOMAIN\n0\n","curl: (6) Could not resolve host: drip.egress-target.svc.cluster.local\n"]
[11:24:37.051] +30s new requests: ["code=000\nstatus: NXDOMAIN\n0\n","curl: (6) Could not resolve host: drip.egress-target.svc.cluster.local\n"]
[11:24:38.155] +31s background jobs done
## T5 credential placeholder swap: P4
### [11:24:38.516] policy update f-main <- P4.yaml
ATESPACE   ACTOR    RULES   VERSION   AGE
lab-f      f-main   1       31        38m
### [11:24:51.207] t5-with-placeholder
$ curl -sS -m 8 -i -H 'Authorization: placeholder-from-actor' http://whoami.egress-target.svc.cluster.local/ | grep -i -E 'HTTP/|authorization|x-forwarded|RemoteAddr|egress'
exit=0
HTTP/1.1 200 OK
RemoteAddr: 10.244.0.44:54740
GET / HTTP/1.1
Host: whoami.egress-target.svc.cluster.local
Authorization: Bearer lab-granted-marker-1794480266


### [11:24:51.456] t5-without-header
$ curl -sS -m 8 -i http://whoami.egress-target.svc.cluster.local/ | grep -i -E 'HTTP/|authorization'
exit=0
HTTP/1.1 200 OK
GET / HTTP/1.1


### [11:24:51.672] t5-not-granted-namespace
$ curl -sS -m 8 -i -H 'X-Other-Token: placeholder' http://whoami.egress-target.svc.cluster.local/ | head -12
exit=0
HTTP/1.1 403 Forbidden
content-type: text/plain
content-length: 26
date: Thu, 12 Nov 2026 11:24:51 GMT

actor egress policy denied

### [11:24:51.953] t5-missing-secret
$ curl -sS -m 8 -i -H 'X-Missing-Token: placeholder' http://whoami.egress-target.svc.cluster.local/ | head -12
exit=0
HTTP/1.1 403 Forbidden
content-type: text/plain
content-length: 26
date: Thu, 12 Nov 2026 11:24:51 GMT

actor egress policy denied

### [11:24:52.848] t5-actor-env
$ env | sort | cut -c1-80; grep -r -l 'marker' /run /etc /tmp 2>/dev/null | head -3; echo grep_done
exit=0
HOME=/root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PORT=80
PWD=/
SHLVL=1
grep_done


## end state
ATESPACE   NAME     TEMPLATE      STATE                 WORKER POD                               WORKER IPS    VERSION   AGE
lab-f      f-deny   lab-f/shell   ACTOR_STATE_RUNNING   ate-demo-egress/egress-67f89fdb4-lg2r2   10.244.0.29   3         39m
lab-f      f-main   lab-f/shell   ACTOR_STATE_RUNNING   ate-demo-egress/egress-67f89fdb4-9ttd8   10.244.0.28   3         39m
## marker (the real credential value) occurrences in logs
31-log-atenet-egress-agentgateway.log granted=0 ungranted=0 placeholder=0 lines=6477
31-log-k8s-credential-provider-k8s-credential-provider.log granted=0 ungranted=0 placeholder=0 lines=23
