Commit Graph

99 Commits

Author SHA1 Message Date
xnoguer 6f1797fb59 Using grep -E 2023-04-23 17:38:21 -04:00
Thomas Sjögren 9819ac4023 allow unknown number of spaces in modprobe blacklists
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2021-10-26 10:53:33 +02:00
Michael Boelen 9ba09ac408
Update tests_networking 2021-07-29 14:52:29 +02:00
Zachary Lee Andrews 55cc7215ea
grep options change from gnu to posix
fix issue #1167
2021-07-23 22:44:36 -04:00
Michael Boelen da1c1eca10
Preparation for release 3.0.3 2021-01-07 15:22:19 +01:00
Stéphane 4cf9660185
Adding and improvement translated strings 2020-12-16 01:07:27 +01:00
Michael Boelen 701be9852b
Merge pull request #1060 from Varbin/solaris-netstat
[NETW-3012] Use netstat on Solaris to gather listening ports
2020-12-15 14:30:09 +01:00
Simon Biewald 0c686bb6ea Use the new status strings in tests
See-Also: HEAD^
Signed-off-by: Simon Biewald <simon@fam-biewald.de>
2020-11-14 20:34:43 +00:00
Michael Boelen 37631b0457
Merge pull request #1061 from Varbin/solaris-hostname
Simplify tr hostname checking expression
2020-11-09 14:12:39 +01:00
Simon Biewald 8895eccea2 Use correct character class
Signed-off-by: Simon Biewald <simon@fam-biewald.de>
2020-10-31 17:36:06 +00:00
Simon Biewald e917269d01 Reduce tr hostname checking expression
Solaris' tr does not support full regular expressions.
2020-10-25 20:25:31 +00:00
Simon Biewald 1a75d66ad9 Use netstat on Solaris to gather listening ports 2020-10-25 20:21:33 +00:00
Stéphane 67d04f2536
Add translate function for all sections
+ add EN and FR up to date languages files
2020-10-22 00:13:42 +02:00
Iain Cuthbertson 0b8c775a01 Adds uppercase option to the hostname validation regex 2020-06-02 15:33:32 +01:00
Michael Boelen 9da0665929
[NETW-2400] Improved logging 2020-04-04 15:56:00 +02:00
Michael Boelen 032bb6988e
Added new test NETW-2400 2020-04-04 15:28:04 +02:00
Michael Boelen 4680f94d11
[NETW-2706] allow usage of systemd-resolve and resolvectl, improved screen output and logging 2020-04-03 14:02:52 +02:00
Michael Boelen f25ffdbb1f
[NETW-2706] redirect errors to stderr 2020-04-03 09:40:30 +02:00
Michael Boelen 1e52ed0c0d
Added notes to NETW-3200 for future extending this test 2020-03-25 15:19:21 +01:00
Michael Boelen 04c969752a
[NETW-3200] corrected test 2020-03-25 15:15:42 +01:00
Michael Boelen 38310223a6
Updated date/year 2020-03-20 14:50:25 +01:00
Topi Miettinen 820d2ec607
Check DNSSEC status with resolvectl when available
'resolvectl statistics' shows if DNSSEC is supported by
systemd-resolved and upstream DNS servers.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2020-03-19 23:56:24 +02:00
Sascha Holzleiter 530ad1ef75 NETW-3014: Report correct promisc interface 2020-01-28 21:29:34 +01:00
Michael Boelen a7b48e40b0
[NETW-3015] check for promiscuity value that is higher than 0 instead of just 1 2020-01-11 11:31:40 +01:00
Michael Boelen 09f29a5e64
Code style improvement: quote argument 2019-12-18 12:17:46 +01:00
Michael Boelen 5c38a0bdb4
Tests using lsof may ignore threads (if supported) 2019-09-13 11:47:39 +02:00
Michael Boelen 4932ab8351
Disabled suggestion for now, as some people will just install a suggested tool to comply instead of determining if it really makes sense. So this suggestion requires more explanation before people turning it on. Also, promisc mode may be impacted, so users see a new issue show up while they just resolved another. 2019-08-28 15:43:10 +02:00
Michael Boelen d2deb63ebb
Added NETW-3200 2019-08-22 14:12:53 +02:00
Michael Boelen d3355937a4
Don't quote in for loop to prevent glueing individual lines together 2019-08-04 19:19:12 +02:00
Michael Boelen 17137408d2
Use IsRunning exit code instead of variable 2019-07-26 11:32:48 +02:00
Michael Boelen 9e56706aa6
Formatting and improved logging 2019-07-16 19:06:31 +02:00
Michael Boelen fa8bad20db
Use -n instead of ! -z 2019-07-16 13:20:30 +02:00
Michael Boelen 82b1c63341
[NETW-3032] small rewrite of test and extended with addrwatch 2019-07-14 08:28:49 +02:00
Michael Boelen ef89ee3fc9
[NETW-3012] make ss command output preferred for Linux system and changed output format 2019-06-24 13:39:30 +02:00
Michael Boelen 8e61275ff4
Move state recording to report section 2019-05-16 15:23:23 +02:00
Michael Boelen ea8c032ea9
[NETW-3015] added support for ip binary 2019-03-21 09:34:26 +01:00
dataking 76ec39176a Fix #638. (#640)
* fix for issue #453; simply add RPi/Raspian path to PAM_FILE_LOCATIONS

* Only use data before # to handle inline comments in /etc/resolv.conf.
2019-02-28 09:51:57 +01:00
Michael Boelen 66066ae226
Changed year and preparing for new release 2019-01-31 14:47:35 +01:00
Thomas Sjögren 8321da24c7 query DNS with FQDN (#555)
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2018-06-26 11:36:55 +02:00
Michael Boelen 170e427595
[NETW-2704] added support for local resolver used on Ubuntu 18.04 2018-05-01 19:57:23 +02:00
melak 0b2cd02f0d Fix/amend DHCP client detection (#513)
- dhcpd is a server; the client is dhcpcd

- While here, add udhcpc to the list of recognised DHCP clients
2018-01-21 12:29:49 +01:00
Michael Boelen 66f8cb2441
Changed year 2018-01-11 09:50:26 +01:00
Michael Boelen 94f656bf65
Add 127.0.1.1 to NETW-2704 test 2017-09-17 20:01:07 +02:00
Michael Boelen 3670e0c5c9
Minor changes to using local resolvers 2017-09-16 14:25:01 +02:00
Ben Abrams 192cc494ed [NETW-2705] This is related to #437 and resolvconf but is split up. (#459)
This specifically makes it so that when `/etc/resolv.conf` has one or more nameservers matching `127.0.[0-1].1` it should not warn as it is using local resolvers.

We are simply using `grep -c "127.0.[0-1].1" /etc/resolv.conf` to determine this.
2017-09-16 14:09:32 +02:00
Michael Boelen 49c1bf8d55
[NETW-3006] Updated detection of MAC addresses on Linux 2017-08-03 20:28:38 +02:00
Michael Boelen 4ecb9d4d05
[bulk change] cleaning up, code enhancements, initialization of variables, and new tests 2017-04-30 17:59:35 +02:00
Michael Boelen 70ea29483a
Code enhancements 2017-04-23 20:06:54 +02:00
hlein e054e9757c Lots of cleanups (#366)
* Description fix: SafePerms works on files not dirs.

All uses of SafePerms are on files (and indeed, it would reject
directories which would have +x set).

* Lots of whitespace cleanups.

Enforce everywhere(?) the same indentations for if/fi blocks.
The standard for the Lynis codebase is 4 spaces.  But sometimes
it's 1, sometimes 3, sometimes 8.

These patches standardize all(?) if blocks but _not_ else's (which
are usually indented 2, but sometimes zero); I was too lazy to
identify those (see below).

This diff is giant, but should not change code behavior at all;
diff -w shows no changes apart from whitespace.

FWIW I identified instances to check by using:

  perl -ne 'if ($oldfile ne $ARGV) { $.=1; $oldfile=$ARGV; }; chomp; if ($spaces) { next unless /^( *)([^ ]+)/; $newspaces=length($1); $firsttok = $2; next unless defined($firsttok); $offset = ($firsttok eq "elif" ? 0 : 4); if ($newspaces != $spaces + $offset) { print "$ARGV:$ifline\n$ARGV:$.:$_\n\n" }; $ifline=""; $spaces="";  } if (/^( *)if (?!.*[; ]fi)/) { $ifline = "$.:$_"; $spaces = length($1); }' $(find . -type f -print0 | xargs -0 file | egrep shell | cut -d: -f1)

Which produced output like:

  ./extras/build-lynis.sh:217:            if [ ${VERSION_IN_SPECFILE} = "" -o ! "${VERSION_IN_SPECFILE}" = "${LYNIS_VERSION}" ]; then
  ./extras/build-lynis.sh:218:               echo "[X] Version in specfile is outdated"

  ./plugins/plugin_pam_phase1:69:        if [ -d ${PAM_DIRECTORY} ]; then
  ./plugins/plugin_pam_phase1:70:                LogText "Result: /etc/pam.d exists"

...There's probably formal shellscript-beautification tools that
I'm oblivious about.

* More whitespace standardization.

* Fix a syntax error.

This looks like an if [ foo -o bar ]; was converted to if .. elif,
but incompletely.

* Add whitespace before closing ].

Without it, the shell thinks the ] is part of the last string, and
emits warnings like:

  .../lynis/include/tests_authentication: line 1028: [: missing `]'
2017-03-07 19:23:08 +00:00
hlein b595cc0fb5 Various cleanups (#363)
* Typo fix.

* Style change: always use $(), never ``.

The Lynis code already mostly used $(), but backticks were sprinkled
around.  Converted all of them.

* Lots of minor spelling/typo fixes.

FWIW these were found with:

  find . -type f -print0 | xargs -0 cat | aspell list | sort -u | egrep '^[a-z]+$' | less

And then reviewing the list to pick out things that looked like
misspelled words as opposed to variables, etc., and then manual
inspection of context to determine the intention.
2017-03-06 07:41:21 +00:00