Hi,
you might calculate the offset from the cube to the entity, rotate it the inverse rotation of the cube and check if it is inside the unrotated cube bounds.

Salud!