A person who helps you to plan something dishonest or unlawful is called your partner in crime.
(This expression can be used jokingly as in the example below.)
"Sam was my partner in crime. He hid my son's new bicycle until his birthday."
If a person perverts the course of justice, they tell a lie or prevent the police from finding out the truth about something.
"The suspect was accused of trying to pervert the course of justice."
poetic justice
Poetic justice is an ideal form of justice in which virtue is rewarded and evil punished, often in a particularly appropriate manner, by an ironic twist of fate.
"It is poetic justice that the country responsible for the ecological disaster should suffer most from its effects."
put one's house in order
If you tell someone to put their house in order, you are saying that they should organise their own affairs or take care of their own problems before giving advice to other people.
"You should put your house in order before telling me what to do!"
read someone the riot act
If you declare with force and authority that something must stop, and announce the consequences if it happens again, you read them the riot act.
"Dad read us the riot act when we messed up his tool-shed."
rough justice
Treatment or justice that does not seem fair, or is too severe, is called 'rough justice', especially if it is not legal.
"The way the player was treated by the media was very rough justice!"
sharp practice
Trying to achieve something by using underhand, deceitful or dishonourable means, that are barely within the law, is called sharp practice.
"That company is under investigation for sharp practice so it's better to avoid dealing with them."