The way I see it, aside from things like CMEs and asteroid / space junk collisions, the two threats to an orbiting Asgardian habitat are:
- Extraterrestrial - little green men, tall greys, face hugging xenomorphs, or any other horror that can be imagined coming from the depths of space. It seems highly unlikely that we may encounter a hostile extraterrestrial race, but if it happens, logic would suggest that there would not be much we could do to repel it. Think about it - a species that has developed the capability and technology to deploy a military force over interstellar distances isn't going to come at us with sharp sticks. We would also be at a distinct disadvantage because of the likelihood that they would be using technology, materiel and weaponry we had never seen before as well as knowing next to nothing about their physiology and tactics. The solution - hope we never encounter a hostile extraterrestrial species.
- Terrestrial - which is the exact reverse of the extraterrestrial situation: we would be aware of likely weapons, technology, tactics, and materiel that would be used, but the risk of hostile action from Earth would be many orders of magnitude higher than hostilities from an extraterrestrial source.
So, in the first instance, we would have to minimise the risk of Asgardia being the target of armed aggression. This would have to start with clear statements of neutrality and non-aggression towards Earth nations as well as initiating / developing good diplomatic relations with Earth nations. There would also be a need for full transparency in the operation of Asgardia so questions like "Are they operating a chemical weapons facility and selling warheads to the highest bidder" are never asked, or if they are asked, they are quickly dismissed as tin foil hat conspiracy theories. If Asgardia does get into the space minerals, space energy, technology, etc business, it will need to take great care that it is not perceived as being an exploitative monopoly - history tells that many countries have gone to war over just threats to the supply of and access to resources.
Then, we need to have a plan and means for defense should all of that fail. This is where it gets really tricky. If Asgardia becomes a space fortress, bristling with rockets, kinetic rounds, rail guns and (gasp) nuclear weapons, it will automatically be perceived as a military threat to Earth nations, regardless of what we say to the contrary. The irony here is that anything used for defense, even if it has the slightest chance of being used in an offensive capacity, will diminish Asgardia's security.
But all is not lost. There are ways and means to effectively defend a space habitat from military threats, be they manned or non manned. For example: EMP mines to fry the electronics of incoming ships rendering them dead in the water, or an earth facing rocky debris field that would be impossible for a missile to successfully navigate, or swarms of small robotic drones specifically designed to compromise the hull of any incoming ship. There would be many, many other solutions that a smarter (and more diabolical) mind than mine could think up that would provide a highly effective defense, but not even scratch the surface of the Earth if used in an offensive capacity.
And then, once your defense is effective enough so that:
- You make the cost (in terms of money, resources and lives) of an attack far exceed any likely benefit from the success of the attack,
- You make the likelihood of a successful attack almost zero,
all you have to worry about the lunatic despots with the technological and military capability to launch a strike on an orbiting station - fortunately there are not too many of those about at the moment.