Enforcer

an enforcer is any person that enforces a rule or social standard.

an enforcer is the person who punishes a transgressor

This could be a police officer or it could be a Mafia enforcer or it could be a teacher enforcing the rules on the playground.

Enforcer is a social role.

a guard is also a type of enforcer

police, military, judges, secret agents