4. East-West
Test cases 2 and 7: traffic between PROD and QA is inspected through send-via, and access follows AWS tags.
What you will see
-
A denied flow from PROD to QA, logged on FortiAnalyzer.
-
A tag that opens the flow, with no policy change.
-
A member terminated under a running TCP flow, and the flow continuing.
-
An inter-region flow opened by tag and inspected in eu-west-1.
4.1 Launch two demo instances
A demo instance is a canary without its tags, so no policy admits it. Its launch template fixes the subnet: the canary subnet of PROD or QA, in one AZ of your region. A launch cannot change it. The AZ does not decide which member inspects a flow: the GWLB balances across all AZs.
-
In CloudShell, launch one instance in PROD and one in QA:
aws ec2 run-instances --launch-template LaunchTemplateName=$PREFIX-prod-demo --query 'Instances[0].InstanceId' --output text aws ec2 run-instances --launch-template LaunchTemplateName=$PREFIX-qa-demo --query 'Instances[0].InstanceId' --output text -
In CloudShell, keep their IDs and list their addresses. Run this block again after CloudShell restarts:
PROD_ID=$(aws ec2 describe-instances --filters Name=tag:Name,Values=$PREFIX-prod-demo Name=instance-state-name,Values=pending,running --query 'Reservations[].Instances[].InstanceId' --output text) QA_ID=$(aws ec2 describe-instances --filters Name=tag:Name,Values=$PREFIX-qa-demo Name=instance-state-name,Values=pending,running --query 'Reservations[].Instances[].InstanceId' --output text) aws ec2 describe-instances --instance-ids $PROD_ID $QA_ID \ --query 'Reservations[].Instances[].[Tags[?Key==`Name`]|[0].Value,InstanceId,PrivateIpAddress,Placement.AvailabilityZone]' \ --output tableNote the QA address,
<qa-ip>, and the PROD address,<prod-ip>. -
In EC2, Instances, open a Session Manager session on each: select the instance, Connect, Session Manager, Connect. These are your PROD session and QA session.
-
In each session, start bash. In the PROD session, also set the QA address:
bashQA_IP=<qa-ip>
Each instance serves HTTP on port 80.
4.2 A denied flow
-
In the PROD session, probe QA once a second:
while true; do printf '%s ' "$(date +%T)"; curl -s -o /dev/null -m 2 -w '%{http_code}\n' http://$QA_IP/; sleep 1; doneEach line ends in
000: no answer. -
On FortiAnalyzer, Log View, FortiGate, Traffic, filter on
dstip=<qa-ip>: the flow is denied by policy 0, the implicit deny.
Leave the probe running.
4.3 Open it by tag
-
In CloudShell, tag the PROD instance:
aws ec2 create-tags --resources $PROD_ID --tags Key=Allow-To-QA,Value=local -
In the PROD session, the lines end in
200within about a minute. -
On FortiAnalyzer, the flow is now accepted by the policy
<prefix>-ew-to-qa. -
On FortiManager, Policy & Objects, open the East-West package. The source of that policy is the dynamic address
<prefix>-allow-to-qa, with the filterTag.Allow-To-QA=local | Tag.Allow-To-QA=all. Nothing in the policy changed.
The FortiGates read the tags through their AWS SDN connector every 60 s.
4.4 Terminate a member under a running flow
FGSP copies each firewall session to the other members, and the GWLB moves the flows of a failed member to a healthy one.
-
In the PROD session, stop the probe with Ctrl+C.
-
In the QA session, replace the HTTP listener with one that prints what it receives:
sudo systemctl stop canary-http sudo python3 -c 'import socket;s=socket.socket();s.setsockopt(1,2,1);s.bind(("",80));s.listen();c,_=s.accept();[print(l.decode().strip(),flush=True) for l in c.makefile("rb")]' -
In the PROD session, open one TCP connection and send the time every second:
exec 3<>/dev/tcp/$QA_IP/80; while date +%T >&3; do date +%T; sleep 1; doneThe QA session prints the same times. This is one flow.
-
In CloudShell, list the East-West members:
aws ec2 describe-instances --filters Name=tag:Name,Values=$PREFIX-ew-fgt Name=instance-state-name,Values=running \ --query 'Reservations[].Instances[].[InstanceId,PublicIpAddress,Placement.AvailabilityZone]' --output table -
On your laptop, open SSH to each member,
ssh admin@<member-address>, and look for the flow:diagnose sys session filter clear diagnose sys session filter dst <qa-ip> diagnose sys session filter dport 80 diagnose sys session listThe owner shows the firewall session with the flag
synced; the other members hold a copy flaggedsyn_ses. The owner's instance ID is<member-id>in the table. -
In CloudShell, terminate the owner:
aws ec2 terminate-instances --instance-ids <member-id> -
In the QA session, the times continue. Another member now carries the flow.
-
In EC2, Auto Scaling groups,
<prefix>-ew-fgt, Activity, the group launches a replacement. It turns healthy in the target group about 6 minutes later, once FortiManager has installed its configuration. -
In both sessions, stop the flow with Ctrl+C. Then restore the listener in the QA session:
sudo systemd-run --unit=canary-http python3 -m http.server 80 --directory /srv
4.5 Inter-region
The eu-west-1 East-West cluster inspects traffic between the two regions, in both directions. Work with the other attendee.
-
In CloudShell, tag your PROD instance:
aws ec2 create-tags --resources $PROD_ID --tags Key=Allow-To-Prod,Value=remote -
Exchange PROD addresses with the other attendee. In the PROD session, probe theirs:
curl -s -o /dev/null -m 2 -w '%{http_code}\n' http://<their-prod-ip>/The answer is
200within about a minute of your tag. The tag on the source decides; their instance needs none. -
On the eu-west-1 FortiAnalyzer, Log View, FortiGate, Traffic, the eu-west-1 East-West members log both directions on the inter-region policies.
Check
-
The probe turned from
000to200on a tag, with no policy change. -
The flow continued across the termination of its member.
-
The replacement member joined with no action from you.
Limits
-
A ping loses 1 to 13 replies when its member is terminated; a TCP flow continues.
-
A flow that already moved once can end at a second loss.
-
Traffic between the regions stops while the eu-west-1 East-West cluster is down. Nothing moves to the other region on its own.
-
The policies trust the tags: who may tag an instance is an IAM decision.
Where to look
| What | Where |
|---|---|
| Allowed and denied flows | FortiAnalyzer, Log View, FortiGate, Traffic |
| Policies and dynamic addresses | FortiManager, Policy & Objects |
| Replacement | EC2, Auto Scaling groups, <prefix>-ew-fgt, Activity |
| Target health | EC2, Target groups, <prefix>-ew, Targets |
| Send-via | Network Manager, Core network, Policy versions |
| Background probes | CloudWatch, dashboard CloudCanaries-Region-<region> |