Starfleet doesn't care about external or internal security at all.In a sense, the Borg got Starfleet better prepared for something like the Dominion.
If they were at all serious the Federation Council would have built hundreds of Sovereign Class starships and settled them around the Bajoran womhole with phasers locked and quantum torpedoes weapons hot at the slightest movement inside .
But! LOLNO. They were getting their asses handed to them and had to trick the Romulans to join in the war.
Evidence of the Borg made the Feds do fuck all for any defensive measures.
But they didn't. They could have infiltrated Starfleet or positions of powers for years without detection.For starters, the changelings could impersonate anybody.
Which means the Dominion are just as stupid as the Borg, Cardassians, Klingons and Romulans.
Thank God some of it was fixed for Picard S3.