Period masturbation

Can you masturbate on your period?? If so, how without leaking and getting the bed all dirty??