CN emission lines are among the brightest, and have been observed in the last 20 years with single dish observations. With modern interferometers, we are now able to spatially resolve CN emission, which often shows ring-like structures. We investigate whether such structures trace the morphology of the disks, or if they have a chemical origin. By using the thermochemical code DALI, we conclude that CN formation is triggered by the existence of vibrationally excited H2*, produced by FUV pumping of H2. Herbig stars therefore generally have larger rings and higher CN fluxes than TTauri. Disks with higher masses and flaring also show stronger CN emission and larger rings. CN observations could in the future provide important constraints on some important disk physical parameters. The results of the models are well consistent with the spatially resolved CN observations to-date available.