If you no longer need a security group, you can delete it. Once a security group is deleted, all rules within it are also deleted.
Before deleting a security group, you must remove all associated CVM instances. Otherwise, the operation will fail. For details, refer to Removing From Security Group.