da667 / Autosnort

Repo for autosnort scripts.
MIT License
157 stars 89 forks source link

Fix CentOS 7 OS check #32

Closed signus closed 9 years ago

signus commented 9 years ago

When using awk in CentOS 7, the number is the 4th item instead of the 3rd. To remediate this instead use a regular expression to match on the whole string and ensure a period doesn't precede 6 or 7. However implementing the Perl regex engine with grep -P to use a negative lookbehind to make sure we don't match against 6 or 7 if it is preceded by a period.

Does match: CentOS Linux release 6.6.8 CentOS Linux release 7.0.1406 CentOS Linux 6.4

Doesn't match: CentOS Linux release 5.7 CentOS Linux 5.6.8

da667 commented 9 years ago

Signus, I utilized your suggestions for the latest autosnort build, and accredited you in the README/updates section. Thank you for your help