V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 53s

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-09-05 21:35:38 +02:00
parent 72a84b7925
commit d0b363d7d4
19 changed files with 237 additions and 123 deletions

View File

@@ -0,0 +1,58 @@
#!/bin/bash
# SPDX-Version: 3.0
# SPDX-CreationInfo: 2025-06-17; WEIDNER, Marc S.; <msw@coresecret.dev>
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.installer.git
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
# SPDX-FileCopyrightText: 2024-2025; WEIDNER, Marc S.; <msw@coresecret.dev>
# SPDX-FileType: SOURCE
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
# SPDX-PackageName: CISS.debian.installer
# SPDX-Security-Contact: security@coresecret.eu
set -Ceuo pipefail
#######################################
# Password expiration hook to run inside chroot.
# Globals:
# ary_users_to_update
# var_max_days
# var_user
# Arguments:
# None
# Returns:
# 0: on success
#######################################
main() {
### Declare Arrays, HashMaps, and Variables.
declare -a ary_users_to_update=()
declare -i var_max_days=16384
declare var_user=""
printf "Chroot hook: [%s] starting ... \n" "${0}"
# shellcheck disable=SC2312
mapfile -t ary_users_to_update < <( awk -F: '$2 !~ /^[!*]/ { print $1 }' /etc/shadow )
if [[ ${#ary_users_to_update[@]} -eq 0 ]]; then
printf "No enabled-login accounts found in [/etc/shadow]. Exiting hook ... \n"
printf "Chroot hook: [%s] applied successfully. \n" "${0}"
exit 0
fi
for var_user in "${ary_users_to_update[@]}"; do
printf "Setting max password age for user: [%s] to: [%s] days. \n" "${var_user}" "${var_max_days}"
chage --maxdays "${var_max_days}" "${var_user}"
done
unset var_max_days var_user ary_users_to_update
awk -F: '$2 !~ /^\$[0-9]/ && length($2)==13 { print $1,$2 }' /etc/shadow
printf "All applicable accounts have been updated. \n"
printf "Chroot hook: [%s] applied successfully. \n" "${0}"
exit 0
}
main "$@"
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh

View File

@@ -72,4 +72,4 @@ enforce_for_root
### Skip testing the password quality for users that are not present in the '/etc/passwd' file. Enabled if the option is present.
local_users_only
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=conf

View File

@@ -119,7 +119,7 @@ source ${ZSH}/oh-my-zsh.sh
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
### Added by CISS.debian.hardening-Installer ###
### Added by CISS.debian.installer ###
trap ' "${SHELL}" "${HOME}/.ciss/clean_logout.sh" ' EXIT
. "${HOME}/.ciss/alias"
. "${HOME}/.ciss/shortcuts"
@@ -182,7 +182,7 @@ else
export USER_COLOR="%F{002}"
fi
### CISS.debian.hardening Prompt
### CISS.debian.installer Prompt
PROMPT='${USER_COLOR}%D%f|${USER_COLOR}%n%f@%F{005}%M%f:%F{006}%d%f/>>%(?.%F{002}%?.%F{001}%?)%f|~%#> '
RPROMPT='%h|[${USER_COLOR}%*%f]'
@@ -191,9 +191,9 @@ printf "\n"
printf "%b🔐 Coresecret Channel Established. %b%b" "${CRED}" "${CRES}" "${NL}"
printf "%b✅ Welcome back %b " "${CGRE}" "${CRES}"
printf "%b'%b'%b" "${CMAG}" "${USER}" "${CRES}"
printf "%b! Type%b " "${CGRE}" "${CRES}"
printf "%b'celp'%b " "${CMAG}" "${CRES}"
printf "%bfor shortcuts. %b%b" "${CGRE}" "${CRES}" "${NL}"
printf "%b! Type%b" "${CGRE}" "${CRES}"
printf "%b 'celp'%b" "${CMAG}" "${CRES}"
printf "%b for shortcuts. %b%b" "${CGRE}" "${CRES}" "${NL}"
printf "\n"
printf "\n"