YES it is illegal. but, there is a application in MOI (Gharafa) allowing for you to work with any company or employer, buy paying a certain amount. No idea about what they called it.

good luck