If during the term of imprisonment a prisoner commits an offense or violates the rules of the correctional facility, all or part of the prisoner's good time may be forfeited under regulations adopted by the commissioner of corrections. The amount of good time forfeited shall be related to the severity of the offense or rule violation.