Applying security principles to building automation