This does come up in legal philosophy, when it comes to distinguishing between the particular laws of some society, and the overall moral law which is more universal. The Western tradition has been greatly influenced by Aristotle in the Nicomachean Ethics book 5 (same as the Eudemian Ethics book 4), who contrasts following the rules of society against behaving ethically according to a neutral notion of fairness. In 5.7 he states something very close to what you are looking for:
Political Justice is of two kinds, one natural, the other conventional. A rule of justice is natural that has the same validity everywhere, and does not depend on our accepting it or not. A rule is conventional that in the first instance may be settled in one way or the other indifferently, though having once been settled it is not indifferent: for example, that the ransom for a prisoner shall be a mina, that a sacrifice shall consist of a goat and not of two sheep; and any regulations enacted for particular cases, for instance the sacrifice in honor of Brasidas, and ordinances in the nature of special decrees.
(trans. H. Rackham; Harvard U.P., 1934)
Natural justice here uses the Greek "φυσικόν", and conventional justice is "νομικόν", so this is expressing a difference between what is just intrinsically, and what is just because of the laws (νόμοι). Aristotle elsewhere explores mechanisms by which the laws come about, how they can be made to conform to moral principles, and what duties citizens have to obey the laws of their society. Later thinkers have done similarly, including both ancient writers like Cicero, and modern ones who are alive today.
In the scholastic tradition of the Christian era, additional nuances were explored in the relationships between the divine will, laws of nature, moral precepts, and the powers of Church or State. These consciously extended the classical categories of Aristotle. For legality, an exemplar is Gratian, who famously begins his treatise on law (the Decretum, c. 1140) by observing:
Humankind is ruled by two things, namely natural law and custom.
Humanum genus duobus regitur, naturali uidelicet iure et moribus.
He considers natural law to encompass the moral principles of the Christian gospel, which he says are universally accepted and determined by nature. It contrasts with mos ("custom", "usages", etc.), which includes both written statutes and community practices, but which in any case consists of principles established by human rather than divine authority. Custom can vary in different polities. It is also capable of prohibiting something which the natural law would allow.
At various times, the Latin words ius, lex and mos have been understood differently, so it's not necessarily possible to say that one or another word definitively refers to abstract justice, and another to statute law. For example, lex can mean a specific law, or the body of all law, or justice in general. I do not think there is a generally accepted phrasing involving bonum as the counterpart to malum. If we wanted to make something up then perhaps we would want the split to be "good according to natural justice" versus "good by convention". Something like bonum propter ius naturale and bonum propter mores might do the trick. But this is a case of finding fancy Latin words to match the concept, rather than identifying terms which a reader would naturally understand.