Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Most of 2.1 "inetd Services" checks fail even if inetd is not installed #72

Open
oke-py opened this issue Dec 23, 2020 · 1 comment
Open

Comments

@oke-py
Copy link
Contributor

oke-py commented Dec 23, 2020

Problem

2.1.1 - 2.1.9 fail even if inetd is not installed.

Now

./linux-bench | grep -e '^2.1' -e '] 2.1'
[INFO] 2.1 inetd Services
[FAIL] 2.1.1.a Ensure chargen services are not enabled
[FAIL] 2.1.1.b Ensure chargen services are not enabled
[FAIL] 2.1.2.a Ensure daytime services are not enabled
[FAIL] 2.1.2.b Ensure daytime services are not enabled
[FAIL] 2.1.3.a Ensure discard services are not enabled
[FAIL] 2.1.3.b Ensure discard services are not enabled
[FAIL] 2.1.4.a Ensure echo services are not enabled
[FAIL] 2.1.4.b Ensure echo services are not enabled
[FAIL] 2.1.5.a Ensure time services are not enabled
[FAIL] 2.1.5.b Ensure time services are not enabled
[FAIL] 2.1.6.a Ensure rsh server is not enabled
[FAIL] 2.1.6.b Ensure rsh server is not enabled
[FAIL] 2.1.7.a Ensure talk server is not enabled
[FAIL] 2.1.7.b Ensure talk server is not enabled
[FAIL] 2.1.8.a Ensure telnet server is not enabled
[FAIL] 2.1.8.b Ensure telnet server is not enabled
[FAIL] 2.1.9.a Ensure tftp server is not enabled
[FAIL] 2.1.9.b Ensure tftp server is not enabled
[PASS] 2.1.10 Ensure xinetd service is not enabled
2.1.1.a grep: /etc/inetd.*: No such file or directory
2.1.1.b grep: /etc/xinetd.conf: No such file or directory
2.1.2.a grep: /etc/inetd.*: No such file or directory
2.1.2.b grep: /etc/xinetd.conf: No such file or directory
2.1.3.a grep: /etc/inetd.*: No such file or directory
2.1.3.b grep: /etc/xinetd.conf: No such file or directory
2.1.4.a grep: /etc/inetd.*: No such file or directory
2.1.4.b grep: /etc/xinetd.conf: No such file or directory
2.1.5.a grep: /etc/inetd.*: No such file or directory
2.1.5.b grep: /etc/xinetd.conf: No such file or directory
2.1.6.a grep: /etc/inetd.*: No such file or directory
2.1.6.b grep: /etc/xinetd.*: No such file or directory
2.1.7.a grep: /etc/inetd.*: No such file or directory
2.1.7.b grep: /etc/xinetd.*: No such file or directory
2.1.8.a grep: /etc/inetd.*: No such file or directory
2.1.8.b grep: /etc/xinetd.*: No such file or directory
2.1.9.a grep: /etc/inetd.*: No such file or directory
2.1.9.b grep: /etc/xinetd.*: No such file or directory

Want

All 2.1 checks should pass when there isn't inetd/xinetd file or directory.

Resolution

How about checking the existence of file or directory. The sample of 2.1.1.a is as below.

# before
grep -R "^chargen" /etc/inetd.*

# after
[ -e /etc/inetd.* ] && grep -R "^chargen" /etc/inetd.*
@yoavrotems
Copy link
Contributor

Hey thank you for the issue report and the suggestion, I think it will be easier to use -s flag in grep command so if file not exist it will return nothing instead of "No such file or directory" message,
I think this Yaml could be refreshed and update more tests but it will take much more time so for now we will fix this issue and later on will approve the tests. (For example unite 2.1.1.a and 2.1.1.b with using the regex flag)

yoavrotems added a commit that referenced this issue Mar 14, 2021
deven0t pushed a commit to deven0t/linux-bench that referenced this issue Jan 24, 2023
deven0t pushed a commit to deven0t/linux-bench that referenced this issue Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants