Skip to content

Commit

Permalink
Merge pull request #4442 from mildas/disable_users_coredumps_tests
Browse files Browse the repository at this point in the history
Add tests for disable_users_coredumps rule.
  • Loading branch information
jan-cerny committed Jun 25, 2019
2 parents 40597c4 + 42a12c5 commit e7d0302
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# platform = Red Hat Enterprise Linux 7,Red Hat Enterprise Linux 8
echo "* hard core 0" >> /etc/security/limits.conf
# platform = multi_platform_rhel
SECURITY_LIMITS_FILE="/etc/security/limits.conf"

if grep -qE '\*\s+hard\s+core' $SECURITY_LIMITS_FILE; then
sed -ri 's/(hard\s+core\s+)[[:digit:]]+/\1 0/' $SECURITY_LIMITS_FILE
else
echo "* hard core 0" >> $SECURITY_LIMITS_FILE
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# profiles = xccdf_org.ssgproject.content_profile_ospp

SECURITY_LIMITS_FILE="/etc/security/limits.conf"

if grep -qE '\s*\*\s+hard\s+core' $SECURITY_LIMITS_FILE; then
sed -ir 's/(hard\s+core\s+)[[:digit:]]+/\1 0/' $SECURITY_LIMITS_FILE
else
sed -i '$ a * hard core 0' $SECURITY_LIMITS_FILE
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# profiles = xccdf_org.ssgproject.content_profile_ospp

SECURITY_LIMITS_FILE="/etc/security/limits.conf"

if grep -q '\s*\*\s+hard\s+core' $SECURITY_LIMITS_FILE; then
sed -ir 's/(hard\s+core\s+)[[:digit:]]+/\1 1/' $SECURITY_LIMITS_FILE
else
sed -i '$ a * hard core 1' $SECURITY_LIMITS_FILE
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
# profiles = xccdf_org.ssgproject.content_profile_ospp

sed -ir '/\*\s+hard\s+core/d' /etc/security/limits.conf

0 comments on commit e7d0302

Please sign in to comment.