Is there a way to use python and AI to compare thousands of files and detect the ones containing "unusual" content?
Those files are supposed to have "homogeneous" configuration types with different parameters, but sometimes some of them might contain "illegal" types of configurations. The issue is that there are too many ways to do homogenous and illegal configurations, so it is not possible to statically define them.
Here is one of too many bloc of configuration considered "correct": (the meaning doesn't matter)
vlan XXXX name XXX_NAME interface vxlan 1 vxlan vlan XXX vni YYYY router bgp YYYY vlan XXXX rd A.B.C.D:YYYY route-target both YYYY:YYYY redistribute learned
Thousands of files will contains such bloc of configuration (with different parameters, xxxx, yyyy...) But some might contain something else, example
Interface vlan AAAA ip address B.B.B.B/Z
Because it is in only a couple of files ("rare") it is more likely that it is not authorized configuration.
I could use simple regular expression to match what is considered legal or illegal, but there is too many of such blocs.
I am wondering if AI could help with this issue?