Cloud masking Sentinel 2 Level 2A

automatic cloud masks are stored in L2A products and you can use them to mask the image: Cloud and water mask out

You can also perform Idepix analysis to detect clouds with it: Cloud shadow detection problem