1.
if a group of people close ranks , they work closely together to defend themselves, especially when they are being criticized :
It's not unusual for the police to close ranks when one of their officers is being investigated.
2.
if soldiers close ranks , they move closer together in order to defend themselves