# install deps
npm i
# start svc and bff
npm start -w @mstb/svc
npm start -w @mstb/bff
# run test
npm start -w @mstb/cli
# run netstat to check the socket state
netstat -aon | find "9090"FIN_WAIT_1 is a transient state at network/OS level. We'll need special utilities to mock it properly:
- iptable on Linux (not sure how to yet)
- clumsy on Windows
FIN_WAIT_2 would need java backend or net.server in nodeJS with allowHalfOpen set to true (index_net.js).
- In windows
FIN_WAIT_2/CLOSE_WAITwill be recycled by OS automatically after couple of minutes.
- Run step above to hit
/fin_wait_1endpoint. - After the 200 state prints, before the timeout is over, go to clumsy and start the blocking rule.
- Go to prompt and run
netstat -aon | find "9090"to we should see the expect incorrect state.- Rule
tcp.Ack==1 and tcp.SrcPort=9090will mockFIN_WAIT_1/ESTABLISHEDstate. - Rule
tcp.Fin==1 and tcp.DstPort==9090will mockFIN_WAIT_1/LAST_ACKstate.- It will be hard to get
FIN_WAIT_1/CLOSE_WAITstate asCLOSE_WAIT->LAST_ACKis done automatically by OOTB lib or OS.
- It will be hard to get
- For what is allowed in the tcp filter, see here.
- Rule