Indeed. One would think that the sort of system we saw in "Tears of the Prophets" could intercept thousands of long range torpedoes just as easily as it intercepts hundreds of point-blank starships. A Cardassian Dreadnought wouldn't have a prayer. And perhaps there could also be some sort of a gadget that stops warp
torpedoes and warp
ramming attacks, forcing the intruder to sublight. But we've never heard of such a gadget, although there are various ways of forcing things out of warp.
But that's only when guarding a planet. Guarding the central star against a single trilithium torpedo would be nigh-impossible...
That is, assuming that somebody knew how to build a trilithium torpedo. The techniques used for making a star flare, such as in the DS9 7th season opener arc, would be easier to defend against - the Dominion forces nearly defeated Worf and Martok's attempt there. And we haven't heard of anybody else besides Soran possessing the knowhow for creating a rapidly working starkiller.