-
Notifications
You must be signed in to change notification settings - Fork 686
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4442 from mildas/disable_users_coredumps_tests
Add tests for disable_users_coredumps rule.
- Loading branch information
Showing
5 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
2 changes: 0 additions & 2 deletions
2
..._os/guide/system/permissions/restrictions/coredumps/disable_users_coredumps/bash/rhel6.sh
This file was deleted.
Oops, something went wrong.
10 changes: 8 additions & 2 deletions
10
...os/guide/system/permissions/restrictions/coredumps/disable_users_coredumps/bash/shared.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
10 changes: 10 additions & 0 deletions
10
...roup_restrictions/group_coredumps/rule_disable_users_coredumps/coredumps_disabled.pass.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
10 changes: 10 additions & 0 deletions
10
...group_restrictions/group_coredumps/rule_disable_users_coredumps/enabled_coredumps.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
4 changes: 4 additions & 0 deletions
4
...roup_restrictions/group_coredumps/rule_disable_users_coredumps/no_coredumps_limit.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |