Skip to content
New issue

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

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

Already on GitHub? # to your account

fix grep string for check 1.4.11 and 1.4.12 #134

Merged
merged 5 commits into from
Jun 18, 2018
Merged

Conversation

hutr
Copy link
Contributor

@hutr hutr commented May 28, 2018

check 1.4.11 and 1.4.22 shows FAIL even when permissions is correct.

check 1.4.11 and 1.4.22 FAIL even when permissions is correct.
Copy link
Contributor

@lizrice lizrice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Couple of small changes please

tests:
test_items:
audit: ps -ef | grep $etcdbin | grep -- --data-dir | grep -v grep | sed 's%.*data-dir[= ]\([^ ]*\).*%\1%' | xargs stat -c %a
test_items:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is missing tests:?

audit: ps -ef | grep $etcdbin | grep -v grep | sed 's%.*data-dir[= ]\([^ ]*\).*%\1%' | xargs stat -c %a
tests:
test_items:
audit: ps -ef | grep $etcdbin | grep -- --data-dir | grep -v grep | sed 's%.*data-dir[= ]\([^ ]*\).*%\1%' | xargs stat -c %a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is any need for the grep -v grep step now that we are checking for --data-dir

@@ -960,7 +959,7 @@ groups:

- id: 1.4.12
text: "Ensure that the etcd data directory ownership is set to etcd:etcd (Scored)"
audit: ps -ef | grep $etcdbin | grep -v grep | sed 's%.*data-dir[= ]\(\S*\)%\1%' | xargs stat -c %U:%G
audit: ps -ef | grep $etcdbin | grep -- --data-dir | grep -v grep | sed 's%.*data-dir[= ]\(\S*\)%\1%' | xargs stat -c %U:%G
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think grep -v grep is now unnecessary here too

hutr added 2 commits June 7, 2018 16:08
added tests: for 1.4.11 and removed grep -v grep for both
@hutr hutr changed the title fix grep string for check 1.4.11 and 1.4.22 fix grep string for check 1.4.11 and 1.4.12 Jun 7, 2018
@hutr
Copy link
Contributor Author

hutr commented Jun 7, 2018

Thanks for the correction.

Added tests: for 1.4.11
Removed grep -v grep for 1.4.11 and 1.4.12
Also fixed sed string for 1.4.12 to fetch right --data-dir folder

Copy link
Contributor

@lizrice lizrice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lizrice lizrice merged commit 83704a7 into aquasecurity:master Jun 18, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants