aquasecurity / aquasecurity/linux-bench

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

Open
#72 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
188
Forks
65
PR merge metrics
No merged PRs in 30d

Description

### 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.

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

# after
[ -e /etc/inetd.* ] && grep -R "^chargen" /etc/inetd.*
```

Contributor guide

Open the contributing guide

Research direction

Start with ./linux-bench and trace the implementations of checks 2.1.1.a through 2.1.9.b, since no source files are named. Reproduce the grep errors on a system without inetd or xinetd configuration, then verify that the checks pass when the relevant files or directories are absent. Rerun ./linux-bench and inspect the complete 2.1 output to confirm all checks behave as requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.