You have a legal duty to pay your taxes on time.
legal duty
idiomA duty prescribed by the law, to act or forbear from acting.
The contract clearly outlines your legal duty to maintain the property in good condition throughout the lease.
As a corporate director, she understood that her legal duty to the shareholders required her to act with complete transparency and care.