To act of conducting oneself according to the rule of law that is considered right and legal is called abiding

Example:
For example, when you buy an insurance policy and you sign the document you are agreeing to the terms and conditions of the policy. This is called abiding and the parties can be held accountable legally if you do not follow these terms.