1. A method comprising: uploading from a network that includes a plurality of network devices, data representing policy rules configured on the plurality of network devices; comparing the data representing the policy rules for similarities in order to group together policy rules based on their similarities; storing data representing a plurality of clusters, each cluster representing a group of policy rules that have been grouped together; and generating one or more configuration policies to be applied across the plurality of network devices using the data representing each of the plurality of clusters, while maintaining context of policy rule processing.