When the tenant owes money or breaks lease, do you keep full amount?
If they owe rent or damages, itemize it from the security deposit. There is no question that they owe prorated rent through their mov eout date. If you charge them for damages or cleaning, you need to actually incur the costs, not have it be needed but deferred. Keep receipts. If the rental agreement has a clause about penalties for leaving early it is easier to keep additional funds, but you cannot charge overlapping rent to two different tenants. In general charge them until a new tenant is found, if there is not a prolonged time to get the unit rent ready again. Make sure to check with the utility companes to make sure they paid their final bills if you are ultimately responsible. You can pay them off from the deposit if needed.
If your lease specifically states they forfeit the deposit, then you can keep it. I can't guarantee that would hold up in court, though.
The better option is to follow the intent of the law, which is to apply the security deposit towards cleaning, repairs, and unpaid balances.
Market the property and find a replacement tenant. Once that tenant takes over, the previous tenant is released from all liability. Charge them for rent, utilities, or other charges up until that day.