Optical sensors are unable to penetrate clouds leading to related incorrect reflectance values. Unlike Landsat images, Sentinel 2 datasets do not include thermal and Quality Assessment bands that simplify the detection of clouds avoiding erroneous classification. At the same time, clouds shadows on the ground lead to anomalous reflectance values which have to be taken into account during the image processing. The project aim is the coding of a specific module for GRASS GIS application which implements the procedure developed within my PhD research. The procedure allows to automatically identify clouds and their shadows in Sentinel 2 images applying some rules on reflectance values (values thresholds, comparisons between bands, etc.). These have been defined starting from rules found in literature and conveniently refined. Then the detection of shadows is improved using an adapted shape index. In order to increase the accuracy of the final results, a control check is implemented. Clouds and shadows are spatially intersected in order to remove misclassified areas. The final outputs are two different vector files (OGR standard formats), one for clouds and one for shadows.