V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 54s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 54s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -30,12 +30,12 @@ write_fstab() {
|
||||
|
||||
if [[ "${write_maps}" =~ ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}$ ]] || [[ "${write_maps}" =~ ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ ]]; then
|
||||
|
||||
printf "%-43s%-28s%-8s%-100s0 %s\n" "UUID=${write_maps}" "${write_path}" "${write_type}" "${write_opts}" "${write_pass}" >> "${TARGET}/etc/fstab"
|
||||
printf "%-43s%-28s%-18s%-100s0 %s\n" "UUID=${write_maps}" "${write_path}" "${write_type}" "${write_opts}" "${write_pass}" >> "${TARGET}/etc/fstab"
|
||||
do_log "info" "file_only" "4040() fstab entry generated: [UUID=${write_maps} ${write_path} ${write_type} ${write_opts} 0 ${write_pass}]."
|
||||
|
||||
elif [[ "${write_maps}" == /dev/mapper/* ]]; then
|
||||
|
||||
printf "%-43s%-28s%-8s%-100s0 %s\n" "${write_maps}" "${write_path}" "${write_type}" "${write_opts}" "${write_pass}" >> "${TARGET}/etc/fstab"
|
||||
printf "%-43s%-28s%-18s%-100s0 %s\n" "${write_maps}" "${write_path}" "${write_type}" "${write_opts}" "${write_pass}" >> "${TARGET}/etc/fstab"
|
||||
do_log "info" "file_only" "4040() fstab entry generated: [${write_maps} ${write_path} ${write_type} ${write_opts} 0 ${write_pass}]."
|
||||
|
||||
fi
|
||||
@@ -47,12 +47,12 @@ write_fstab() {
|
||||
# Generate target '/etc/fstab' entries.
|
||||
# Globals:
|
||||
# ARY_PATHS_SORTED
|
||||
# DIR_LOG
|
||||
# HMP_EPHEMERAL_ENCLABEL
|
||||
# HMP_FSTAB_MOUNT_FTYPE
|
||||
# HMP_FSTAB_MOUNT_OPTS
|
||||
# HMP_PATH_FSUUID
|
||||
# TARGET
|
||||
# VAR_VERSION
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
@@ -61,7 +61,6 @@ write_fstab() {
|
||||
generate_fstab() {
|
||||
### Declare Arrays, HashMaps, and Variables.
|
||||
declare var_path="" var_dmapper="" var_fs_uuid="" var_fs_path="" var_fs_type="" var_fs_opts="" var_fs_pass=""
|
||||
declare -i rc=0
|
||||
|
||||
### Generate '${TARGET}/etc/fstab' header.
|
||||
: >| "${TARGET}/etc/fstab"
|
||||
@@ -79,7 +78,9 @@ generate_fstab() {
|
||||
# SPDX-PackageName: CISS.debian.installer
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
# CISS.debian.installer ${VAR_VERSION}
|
||||
# /etc/fstab : Generated by CISS.debian.installer ${VAR_VERSION}
|
||||
# Architecture : ${VAR_ARCHITECTURE}
|
||||
# Distribution : ${VAR_CODENAME}
|
||||
|
||||
# Static file system information '/etc/fstab'.
|
||||
#
|
||||
@@ -89,7 +90,7 @@ generate_fstab() {
|
||||
# 'systemd' generates mount units based on this file. See systemd.mount(5). Please run 'systemctl daemon-reload' after making
|
||||
# changes here.
|
||||
#
|
||||
# <file system UUID> <mount point> <type> <options> <dump> <pass>
|
||||
# <file system UUID> <mount point> <type> <options> <dump> <pass>
|
||||
|
||||
EOF
|
||||
|
||||
@@ -168,26 +169,25 @@ EOF
|
||||
|
||||
cat << 'EOF' >> "${TARGET}/etc/fstab"
|
||||
|
||||
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
|
||||
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
|
||||
|
||||
EOF
|
||||
do_log "info" "file_only" "fstab entry generated: '/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0'."
|
||||
do_log "info" "file_only" "4040() fstab entry generated: '/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0'."
|
||||
|
||||
cat << 'EOF' >> "${TARGET}/etc/fstab"
|
||||
### Secure tmpfs mounts for a hardened system
|
||||
# Mount the 'proc' filesystem to provide process and kernel information.
|
||||
# Mount 'sysfs' to expose kernel device information to user space.
|
||||
# Mount the 'devpts' filesystem to enable pseudo-terminal support for user sessions.
|
||||
# Restrict '/dev/shm' to shared memory, limit size, prevent code execution.
|
||||
# System runtime directory in RAM. Do not set 'noexec' here for compatibility.
|
||||
proc /proc proc nodev,nosuid,noexec,hidepid=2 0 0
|
||||
sysfs /sys sysfs defaults 0 0
|
||||
devpts /dev/pts devpts gid=5,mode=620 0 0
|
||||
tmpfs /dev/shm tmpfs rw,nodev,noexec,nosuid,relatime,size=1G 0 0
|
||||
tmpfs /run tmpfs mode=0755,nodev,nosuid 0 0
|
||||
|
||||
# Mount the proc filesystem to provide process and kernel information
|
||||
proc /proc proc nodev,nosuid,noexec,hidepid=2 0 0
|
||||
# Mount sysfs to expose kernel device information to user space
|
||||
sysfs /sys sysfs defaults 0 0
|
||||
# Mount the devpts filesystem to enable pseudo-terminal support for user sessions
|
||||
devpts /dev/pts devpts gid=5,mode=620 0 0
|
||||
# Restrict /dev/shm to shared memory, limit size, prevent code execution
|
||||
tmpfs /dev/shm tmpfs rw,nodev,noexec,nosuid,relatime,size=1G 0 0
|
||||
# System runtime directory in RAM; do not set noexec here for compatibility
|
||||
tmpfs /run tmpfs mode=0755,nodev,nosuid 0 0
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=192 ft=sh
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=200 ft=sh
|
||||
EOF
|
||||
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user