in my Jeep I have a steel glovebox and steel center console. 2 of the best upgrades I ever did on my Jeep. I also have a portable safe that secures to the vehicle with a steel cable. So no, it does not need to be perm attached. I prefer it to be though.
Mine is. Don't know about the legality. If you don't have a place to secure it from theft such as a lockable trunk like in standard passenger cars, you might want to look into something mountable. Mine is secured with a cable and kept inside the trunk.
Keep in mind, if you don't have a CCDW, you need to store it in transporatable status (firearme secured in a case unloaded out of reach of the driver, ammo/magazine stored separately (i.e. glove compartment).