Troubleshooting
Problem
A standard TCP connection is established by sending a SYN packet to the destination host. If the destination host is waiting for a connection on the specified port, it will respond with a SYN/ACK packet. The source host (the initial sender) then replies to the SYN/ACK with an ACK packet, and the connection is established.
Cause
Diagnosing The Problem
This situation can be detected by a flood of SYN packets that do not have accompanying responses. To illustrate, it is useful to simulate a SYN Flood attack, search the internet for “Kali Linux hping3 syn flood” for such methods to implement. Once you have simulated the attack, you can run `tcpdump` directly on the VSI terminal to selectively capture only SYN-ACK packets sent by the VSI.
sudo timeout 15 tcpdump -i ifXXXXXXXX -nnq 'tcp[13] = 0x12'

Or use below to only filter the connections to the public IP addresses.
tcpdump -i eth0 -nnq 'tcp[13] = 0x12 and not (net 10.0.0.0/8 or net 172.16.0.0/12 or net 192.168.0.0/16 or net 169.254.0.0/16 or net 127.0.0.0/8)'
Wireshark can then be used to help detect the simulated SYN Flood attacks:

As you can see attack has reaching 2500 packets/sec.
In network captures, you may notice numerous packets with identical sizes, often registering as 0-byte packets:




Authorize resources of type Flow Logs for VPC to use the Object Storage instance created

Creating a flow log collector
There are various ways to process flow logs for specific use cases, and all have specific advantages e.g.:
Following is a sample screenshot using LogDNA:

The following are alternative methods can also be used:
- Indexing and Searching VPC Flow Logs in IBM Cloud Databases for Elasticsearch
- Getting More Out of Your VPC Flow Logs with Kentik Network Observability Cloud
- Analytics Engine can also be used (use this Spark SQL tutorial as a guide).
Following is sample output using Data Engine:

You can check the “was_terminated” field to know the connection status. Additional fields of interest might include:
bytes_from_initiator, packets_from_initiator to know data sent from initiator to target
bytes_from_target, packets_from_target to know data sent from target to initiator.
Resolving The Problem
How do I help prevent a Syn Flood attack? Review and implement the following
Best Practice Guidelines:
- Network Access Control Lists (NACL) and Security Group (SG) Rules: Customers can use NACL rules to block at the subnet level or SG rules to block at the VSI level.
- Harden the VSI: Customers can enhance VSI security by implementing rate limiting, SYN cookies, IP tables, max connection counts, etc., at the OS or application level.
Several options are available to address this:
- Direct Link (Most Expensive): IBM provides private connectivity where traffic never touches the public internet. This can be achieved through direct peering with IBM or via any exchange provider that has colocation with IBM.
- VPN Connectivity (Less Expensive): IBM offers VPN connectivity for customers who prefer a less management-intensive solution. This includes site-to-site or client-server VPN options, with IBM managing the VPN and providing a High Availability (HA) option.
- Cloud Flare CIS: Another option that includes built-in DDOS protection, WAF, DNS LB, etc. However, it's essential to note that customer will only be opening ports between CIS and VSI on their FIP.
- VPC NLB Option: In VPC, an option is available for Network LB. NLB sits in front with static FIP per zone and customer VSI acts as a backend member pool with private IP. NLB forwards everything to VSI(s) and also protects it.
- Classic Environment with Floating IP: If the VSI has a floating IP and the Classic environment is considered more secure than VPC, customers can place their JUMP VSI in classic and connect seamlessly with their VPC side. This scenario is commonly used for migrating customers from classic to VPC.
- Virtual Firewall Appliance in Classic: Customers with workloads in Classic can deploy virtual firewall appliances by Juniper, PaloAlto, Fortinet, etc. This ensures they are fully protected by an industry-based security solution, and they can also run VPNs and create site-to-site tunnels. They can route all their traffic from firewall to VPC.
- VPC NFV Firewall Option: In VPC, an option is available for Network Function Virtualization (NFV) firewall. Customers can deploy their NFV firewall, which will be licensed and managed by the customer.
- Edge VPC with Transit Gateway (TGW) Option: Customers can opt for Transit Gateway where a separate EDGE VPC is created along with their ServerFarm VPC, and all traffic is routed via EDGE VPC to the SERVER FARM VPC. Edge VPC has all the security appliances/NFV firewalls.
- Custom Ingress Routing Table: Customers can add drop rules against IPs or network ranges at VPC routing level by creating a custom ingress routing table, acting as a NULL route scenario similar to Classic.
For better visibility
- Flow Logs: To gain better visibility and monitoring of VPC traffic, customers can add flow logs to observe network traffic connection logs.
By thoughtfully considering and implementing these options, you can strengthen the security of your infrastructure and safeguard against threats.
Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
30 January 2024
UID
ibm17112468