sail close to the wind
sail close to the wind {v. phr.}
To be on the borderline between legality and illegality.
The wealthy tycoon sailed close to the wind during Prohibition.
Categories:
Source: A Dictionary of American Idioms