Update telegraf script

Signed-off-by: reyesj2 <94730068+reyesj2@users.noreply.github.com>
This commit is contained in:
reyesj2
2024-01-18 16:48:16 -05:00
parent caf4036dbf
commit 07602076f1
2 changed files with 8 additions and 2 deletions

View File

@@ -80,10 +80,13 @@ def main():
proc = subprocess.run(['id', '-u'], stdout=subprocess.PIPE, encoding="utf-8")
if proc.stdout.strip() != "0":
fail("This program must be run as root")
# Ensure that umask is 0022 so that files created by this script have rw-r-r permissions
org_umask = os.umask(0o022)
check_needs_restarted()
check_for_fips()
check_for_luks()
# Restore umask to whatever value was set before this script was run. STIG sets to 0077 rw---
os.umask(org_umask)
if __name__ == "__main__":
main()

View File

@@ -7,8 +7,11 @@
if [[ ! "`pidof -x $(basename $0) -o %PPID`" ]]; then
cat /var/log/sostatus/features-check.log
FIPS_ENABLED=$(cat /var/log/sostatus/fips_enabled)
LUKS_ENABLED=$(cat /var/log/sostatus/luks_enabled)
echo "features fips=$FIPS_ENABLED"
echo "features luks=$LUKS_ENABLED"
fi
exit 0