Imperial computer security (indeed, just about every kind of security) is much more advanced and more widely-deployed than in the Federation -- Federation networks have so many security holes that aliens who've never even seen a Federation starship before are able to beam aboard and take control of them with surprising ease and frequency. I have remarked upon this before, while hacking Federation systems on the
uss_murgatroid and
starbase668.
In the Empire, people are taught how to use the specific tools and consoles that their jobs require; but all information about the underlying structures and operation system are extremely classified and controlled. They do not even teach the language in which the operating system was written to any but a select few, and documentation is non-existent. People able to work out such a complex system by themselves and hack it are exceptionally rare, and are either co-opted into the intelligence or security branches, or summarily executed.
There are armed guards at all key points on a starship, and a security officer on the bridge without whose knowledge and/or approval even the captain and chief engineer cannot do everything. There are other physical security measures in places as well.
It is very rare that alien invaders survive more than fifteen minutes upon entry into an Imperial starship.