Compare commits

...

3 Commits

Author SHA1 Message Date
d1bd1eb2e7 bump to 3.4-1 (#150) 2022-03-18 16:49:25 +01:00
ad5c71c3ce fix: allow passwd-, group- and shadow- debian default permissions (#149) 2022-03-18 16:41:49 +01:00
33964c0a3d Bump EndBug/add-and-commit from 8.0.2 to 9 (#148)
Bumps [EndBug/add-and-commit](https://github.com/EndBug/add-and-commit) from 8.0.2 to 9.
- [Release notes](https://github.com/EndBug/add-and-commit/releases)
- [Changelog](https://github.com/EndBug/add-and-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/EndBug/add-and-commit/compare/v8.0.2...v9)

---
updated-dependencies:
- dependency-name: EndBug/add-and-commit
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-14 15:36:48 +01:00
8 changed files with 34 additions and 4 deletions

View File

@ -10,7 +10,7 @@ jobs:
uses: actions/checkout@v3
- name: Produce debian man
run: 'docker run --rm --volume "`pwd`:/data" --user `id -u`:`id -g` pandoc/latex:2.6 MANUAL.md -s -t man > debian/cis-hardening.8'
- uses: EndBug/add-and-commit@v8.0.2
- uses: EndBug/add-and-commit@v9
with:
add: 'debian/cis-hardening.8'
message: 'Regenerate man pages (Github action)'

View File

@ -19,6 +19,7 @@ DESCRIPTION="Check 600 permissions and root:root ownership on /etc/passwd-"
FILE='/etc/passwd-'
PERMISSIONS='600'
PERMISSIONSOK='644 640 600'
USER='root'
GROUP='root'
@ -28,7 +29,7 @@ audit() {
if [ "$FNRET" != 0 ]; then
ok "$FILE does not exist"
else
has_file_correct_permissions "$FILE" "$PERMISSIONS"
has_file_one_of_permissions "$FILE" "$PERMISSIONSOK"
if [ "$FNRET" = 0 ]; then
ok "$FILE has correct permissions"
else

View File

@ -19,6 +19,7 @@ DESCRIPTION="Check 600 permissions and root:shadow ownership on /etc/shadow-"
FILE='/etc/shadow-'
PERMISSIONS='600'
PERMISSIONSOK='640 600'
USER='root'
GROUP='shadow'
@ -28,7 +29,7 @@ audit() {
if [ "$FNRET" != 0 ]; then
ok "$FILE does not exist"
else
has_file_correct_permissions "$FILE" "$PERMISSIONS"
has_file_one_of_permissions "$FILE" "$PERMISSIONSOK"
if [ "$FNRET" = 0 ]; then
ok "$FILE has correct permissions"
else

View File

@ -19,6 +19,7 @@ DESCRIPTION="Check 600 permissions and root:root ownership on /etc/group-"
FILE='/etc/group-'
PERMISSIONS='600'
PERMISSIONSOK='644 640 600'
USER='root'
GROUP='root'
@ -28,7 +29,7 @@ audit() {
if [ "$FNRET" != 0 ]; then
ok "$FILE does not exist"
else
has_file_correct_permissions "$FILE" "$PERMISSIONS"
has_file_one_of_permissions "$FILE" "$PERMISSIONSOK"
if [ "$FNRET" = 0 ]; then
ok "$FILE has correct permissions"
else

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
cis-hardening (3.4-1) unstable; urgency=medium
* fix: allow passwd-, group- and shadow- debian default permissions (#149)
-- Thibault Dewailly <thibault.dewailly@ovhcloud.com> Fri, 18 Mar 2022 15:43:24 +0000
cis-hardening (3.3-1) unstable; urgency=medium
* fix: missing shadowtools backup files is ok (#132)

View File

@ -10,6 +10,13 @@ test_audit() {
local test_user="testetcpasswd-user"
local test_file="/etc/passwd-"
describe Debian default right shall be accepted
chmod 644 "$test_file"
chown root:root "$test_file"
register_test retvalshouldbe 0
register_test contain "has correct permissions"
run resolved /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
describe Tests purposely failing
chmod 777 "$test_file"
register_test retvalshouldbe 1

View File

@ -10,6 +10,13 @@ test_audit() {
local test_user="testetcshadow-user"
local test_file="/etc/shadow-"
describe Debian default right shall be accepted
chmod 640 "$test_file"
chown root:shadow "$test_file"
register_test retvalshouldbe 0
register_test contain "has correct permissions"
run resolved /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
describe Tests purposely failing
chmod 777 "$test_file"
register_test retvalshouldbe 1

View File

@ -10,6 +10,13 @@ test_audit() {
local test_user="testetcgroup--user"
local test_file="/etc/group-"
describe Debian default right shall be accepted
chmod 644 "$test_file"
chown root:root "$test_file"
register_test retvalshouldbe 0
register_test contain "has correct permissions"
run resolved /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
describe Tests purposely failing
chmod 777 "$test_file"
register_test retvalshouldbe 1