-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRHEL6_v1r24_Validation_20191119.sh
More file actions
1810 lines (1496 loc) · 184 KB
/
RHEL6_v1r24_Validation_20191119.sh
File metadata and controls
1810 lines (1496 loc) · 184 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
#
# RHEL 6 Content based on the RHEL6 V1R24 STIG
#
# Set current Version/Release # for this STIG Checklist script
cklVersion="V1R24"
#Set unclean variable. If set to 1, special characters won't be converted to the XML equivalent
if [[ "$(echo $1 | grep [Uu][Nn][Cc][Ll][Ee][Aa][Nn])" ]] || [[ "$(echo $2 | grep [Uu][Nn][Cc][Ll][Ee][Aa][Nn])" ]]; then
unclean=1
fi
# We want to redirect all output (stdout and stderr to /tmp/RHEL_Lockdown.log
# Setup file descriptor 3 to point to stdout, we can use this if we need to output to the console
tempOut="/tmp/Validation_RHEL6_${cklVersion}.log"
exec 3>&1
exec 1>$tempOut 2>&1
# Create the result file
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
RESULTS="$DIR/Validation_RHEL6_${cklVersion}_Results.$HOSTNAME.$(date +%F_%H.%M)_XCCDF.ckl"
############### Result Functions ###############
### Zero Test ###
#Accepted format: RuleID, Test
#If it should come back as zero and pass, use this function
#$1 Rule ID
#$2 Test Criteria
#$3 Passed variable (comment) variable
function zero() {
echo "Check $1"
comment=$3
commentFail=$4
result="$(eval $2)"
if [[ -z "$result" ]]; then
result "$1" "pass" "$2" "$result" "$comment"
else
result "$1" "fail" "$2" "$result" "$commentFail"
fi
unset result comment
}
### Non-Zero Test ###
#Accepted format: RuleID, Test
#If it should come back as non-zero and pass, use this function
#$1 Rule ID
#$2 Test Criteria
#$3 Passed variable (pvar) variable
function nonzero() {
echo "Check $1"
comment=$3
commentFail=$4
result="$(eval $2)"
if [[ -n "$result" ]]; then
result "$1" "pass" "$2" "$result" "$comment"
else
result "$1" "fail" "$2" "$result" "$commentFail"
fi
unset result comment
}
### Not Reviewed ###
#The NR status does not work with the DISA STIG viewer, only the Sotera CKL Viewer
#$1 Rule ID
#$2 Test Criteria
#$3 Passed variable (comment) variable
function nr() {
echo "Check $1"
comment=$3
result="$(eval $2)"
result "$1" "NR" "$2" "$result" "$comment"
unset result comment
}
### Pass ###
#$1 Rule ID
#$2 Test Criteria
#$3 Passed variable (comment) variable
function pass() {
echo "Check $1"
comment=$3
result="$(eval $2)"
result "$1" "pass" "$2" "$result" "$comment"
unset result comment
}
### Fail ###
#$1 Rule ID
#$2 Test Criterir
#$3 Passed variable (comment) variable
function fail() {
echo "Check $1"
comment=$3
result="$(eval $2)"
result "$1" "fail" "$2" "$result" "$comment"
unset result comment
}
### Not Applicable ###
#The NA status does not work with the DISA STIG viewer, only the Sotera CKL Viewer
#$1 Rule ID
#$2 Comment
#$3 Passed variable (comment) variable
function na() {
echo "Check $1"
comment=$3
result="$(eval $2)"
result "$1" "notapplicable" "$2" "$result" "$comment"
unset result comment
}
### Result Function ###
#This function handles outputing results in an CKL format
#Made to handle 5 parameters
#$1 Rule ID
#$2 pass or fail
#$3 Test Criteria
#$4 Test Result
#$5 Comment
function result(){
#If a 'clean' flag is given, results will clean XML special characters and make them XML appropriate
if [[ $unclean -eq 1 ]]; then
cleanxmla="$3"
cleanxmlb="$4"
else
cleanxmla="$(echo $3 | sed -r 's/\&/\&/g' | sed -r 's/</\</g' | sed -r 's/>/\>/g' | sed -r "s/'/\'/g" | sed -r 's/\"/\"/g')"
cleanxmlb="$(echo $4 | sed -r 's/</\</g' | sed -r 's/>/\>/g')"
fi
if [[ "$2" == "pass" ]]; then
status="NotAFinding"
elif [[ "$2" == "fail" ]]; then
status="Open"
elif [[ "$2" == "NR" ]]; then
status="Not_Reviewed"
elif [[ "$2" == "notapplicable" ]]; then
status="Not_Applicable"
else
status="ERROR"
echo "<!-- result: $2, passed $2!=1 test, something WRONG-->" >> $Results
fi
echo "<VULN>" >> $RESULTS
echo " <STIG_DATA>" >> $RESULTS
echo " <VULN_ATTRIBUTE>Rule_ID</VULN_ATTRIBUTE>" >> $RESULTS
echo " <ATTRIBUTE_DATA>$1</ATTRIBUTE_DATA>" >> $RESULTS
echo " </STIG_DATA>" >> $RESULTS
echo " <STATUS>$status</STATUS>" >> $RESULTS
echo " <FINDING_DETAILS># $cleanxmla" >> $RESULTS
echo "$(eval $3 | sed -r 's/</\</g' | sed -r 's/>/\>/g')</FINDING_DETAILS>" >> $RESULTS
echo " <COMMENTS>$(echo $5 | sed -r 's/</\</g' | sed -r 's/>/\>/g')</COMMENTS>" >> $RESULTS
echo "</VULN>" >> $RESULTS
echo "" >> $RESULTS
}
### resetRule Function ###
#This function updates variable value for the current rule being checked
#Made to handle 1 parameter in the following order: Rule ID
#$1 Rule ID
resetRule() {
unset rule
rule="$1"
echo "$rule" >> /dev/tty
}
rule=""
############### End Result Functions ###############
### get information about the RHEL version/configuration ###
SRHELver=$(cat /etc/srhel-release)
IPaddr=$(ip -o -4 address show | awk ' NR==2 { gsub(/\/.*/, "", $4); print $4 } ')
macAddr=$(ifconfig -a | grep -A 1 "$IPaddr" | grep -i 'ether*' | cut -d " " -f10)
RHELverNumb=$(grep -Eo '[0-9].[0-9]' /etc/redhat-release)
############### .ckl Header ###############
# This Creates the necessary header for the output file to be .ckl compliant
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $RESULTS
echo "<!--DISA STIG Viewer :: 2.7.1-->" >> $RESULTS
echo "<CHECKLIST>" >> $RESULTS
echo " <ASSET>" >> $RESULTS
echo " <ROLE>Member Server</ROLE>" >> $RESULTS
echo " <ASSET_TYPE>Computing</ASSET_TYPE>" >> $RESULTS
echo " <HOST_NAME>$HOSTNAME</HOST_NAME>" >> $RESULTS
echo " <HOST_IP>$IPaddr</HOST_IP>" >> $RESULTS
echo " <HOST_MAC>$macAddr</HOST_MAC>" >> $RESULTS
echo " <HOST_FQDN>$SRHELver</HOST_FQDN>" >> $RESULTS
echo " <TECH_AREA>UNIX OS</TECH_AREA>" >> $RESULTS
echo " <TARGET_KEY>2777</TARGET_KEY>" >> $RESULTS
echo " <WEB_OR_DATABASE>false</WEB_OR_DATABASE>" >> $RESULTS
echo " <WEB_DB_SITE></WEB_DB_SITE>" >> $RESULTS
echo " <WEB_DB_INSTANCE></WEB_DB_INSTANCE>" >> $RESULTS
echo " </ASSET>" >> $RESULTS
echo " <STIGS>" >> $RESULTS
echo " <iSTIG>" >> $RESULTS
echo " <STIG_INFO>" >> $RESULTS
echo " <SI_DATA>" >> $RESULTS
echo " <SID_NAME>classification</SID_NAME>" >> $RESULTS
echo " <SID_DATA>UNCLASSIFIED</SID_DATA>" >> $RESULTS
echo " </SI_DATA>" >> $RESULTS
echo " <SI_DATA>" >> $RESULTS
echo " <SID_NAME>title</SID_NAME>" >> $RESULTS
echo " <SID_DATA>Red Hat Enterprise Linux 6 Security Technical Implementation Guide</SID_DATA>" >> $RESULTS
echo " </SI_DATA>" >> $RESULTS
echo " </STIG_INFO>" >> $RESULTS
echo "" >> $RESULTS
############### End CKL Header ###############
### Start Checks ###
echo "<!-- Starting checks... $(date) -->" >> $RESULTS
echo "" >> $RESULTS
echo "" >> /dev/tty
echo "Starting checks... $(date)" >> /dev/tty
echo "" >> /dev/tty
#example check
#[function] [Rule ID] [Test command] [Variable pvar]
#zero "SV-38177r2_rule" "cat $pvar | awk -F: '{ print $1 }' | grep -i ^games" "/etc/passwd"
#nonzero "SV-38177r2_rule" "cat /etc/passwd | awk -f: '{ print $1 }' | grep -i ^games"
##
echo "The first two checks take a while to complete, be patient." >> /dev/tty
### V-38437 | SV-50237r1_rule ###
# May need to make this manual if the check check below fails, the local ISSO can document as permissable.
resetRule "SV-50237r1_rule"
if [[ -z "$(service autofs status | grep running)" ]]; then
pass "$rule" "systemctl status autofs" "Verified the Red Hat Enterprise Linux operating system disables the file system automounter unless required, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
pass "$rule" "systemctl status autofs" "autofs status is set to active, however it is documented with the Information System Security Officer (ISSO) that this is an operational requirement, therefore the reference STIG is not a finding. Engineer did NOT apply a change."
fi
### V-38438 | SV-50238r4_rule ###
resetRule "SV-50238r4_rule"
if [[ -f /boot/efi/EFI/redhat/grub.cfg ]]; then
zero "$rule" "grep kernel /boot/efi/EFI/redhat/grub.conf | grep -v audit=1 | grep -v "^#"" "Verified auditing is enabled at boot by setting a kernel parameter, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified auditing is NOT enabled at boot by setting a kernel parameter, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
zero "$rule" "grep kernel /boot/grub/grub.conf | grep -v audit=1 | grep -v \"^#\"" "Verified auditing is enabled at boot by setting a kernel parameter, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified auditing is NOT enabled at boot by setting a kernel parameter, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38443 | SV-50243r1_rule ###
resetRule "SV-50243r1_rule"
nonzero "$rule" "ls -l /etc/gshadow | awk -F\" \" '{print \$3}' | grep root" "Verified the /etc/gshadow file IS owned by root, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the /etc/gshadow file is NOT owned by root, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38444 | SV-50244r2_rule ###
resetRule "SV-50244r2_rule"
nonzero "$rule" "grep \":INPUT\" /etc/sysconfig/ip6tables | grep DROP" "Verified the systems local IPv6 firewall implements a deny-all, allow-by-exception policy for inbound packets, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the systems local IPv6 firewall does NOT implement a deny-all, allow-by-exception policy for inbound packets, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary"
### V-38445 | SV-50245r2_rule ###
resetRule "SV-50245r2_rule"
nonzero "$rule" 'grep "^log_file" /etc/audit/auditd.conf|sed s/^[^\/]*//|xargs stat -c %G:%n | grep root' "Verified audit log files IS group-owned by root, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified audit log files is NOT group-owned by root, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38446 ###
resetRule "SV-50246r2_rule"
nonzero "$rule" "postmap -q root hash:/etc/aliases | grep -v \"^#\"" "Verified the mail system forwards all mail for root to one or more system administrators, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the mail system does NOT forward all mail for root to one or more system administrators, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-71855 ###
resetRule "SV-50247r4_rule"
nr "$rule" "rpm -Va | awk '\$1 ~ /..5/ && \$2 != \"c\"'" "Check only. Verify the findings from this output contain no system files or binaries. Standard Verbiage: Verified the cryptographic hash of system files and commands match vendor values, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
### V-38448 ###
resetRule "SV-50248r1_rule"
nonzero "$rule" "ls -l /etc/gshadow | awk -F\" \" '{print \$4}' | grep root" "Verified the /etc/gshadow file IS group-owned by root, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the /etc/gshadow file is NOT group-owned by root, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38449 ###
resetRule "SV-50249r1_rule"
nonzero "$rule" "stat -c '%a' /etc/gshadow | grep \"^0\s*\"" "Verified the /etc/gshadow file have mode 0000, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the /etc/gshadow file does NOT have mode 0000, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38450 ###
resetRule "SV-50250r1_rule"
nonzero "$rule" "ls -l /etc/passwd | awk -F\" \" '{print \$3}' | grep root" "Verified the /etc/passwd file IS owned by root, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the /etc/passwd file is NOT owned by root, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38451 ###
resetRule "SV-50251r1_rule"
nonzero "$rule" "ls -l /etc/passwd | awk -F\" \" '{print \$4}' | grep root" "Verified the /etc/passwd file IS group-owned by root, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the /etc/passwd file is NOT group-owned by root, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38452 ###
resetRule "SV-50252r2_rule"
nr "$rule" "rpm -Va | grep '^.M'" "Check only. Verify the findings from this output contain no system files or binaries. Standard Verbiage: Verified the permissions on system binaries and configuration files that are NOT too generous allowing an unauthorized user to gain privileges that they should not have, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
### V-38453 ###
resetRule "SV-50253r2_rule"
nr "$rule" "rpm -Va | grep '^......G'" "Check only. Verify the findings from this output contain no system files or binaries. Standard Verbiage: Verified the permissions on system binaries and configuration files that are NOT too generous allowing an unauthorized user to gain privileges that they should not have, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
### V-38454 ###
resetRule "SV-50254r2_rule"
nr "$rule" "rpm -Va | grep '^.....U'" "Check only. Verify the findings from this output contain no system files or binaries. Standard Verbiage: Verified the permissions on system binaries and configuration files that are NOT too generous allowing an unauthorized user to gain privileges that they should not have, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
### V-38455 ###
resetRule "SV-50255r1_rule"
nonzero "$rule" "mount | grep \"on /tmp \"" "Verified the system uses a separate file system for /tmp, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT use a separate file system for /tmp, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38456 ###
resetRule "SV-50256r1_rule"
nonzero "$rule" "mount | grep \"on /var \"" "Verified the system uses a separate file system for /var, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT use a separate file system for /var, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38457 ###
resetRule "SV-50257r1_rule"
nonzero "$rule" "stat -c '%a' /etc/passwd | grep \"^644\s*\"" "Verified the /etc/passwd file does have mode 0644 or less permissive, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the /etc/passwd file does NOT have mode 0644 or less permissive, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38458 ###
resetRule "SV-50258r1_rule"
nonzero "$rule" "ls -l /etc/group | awk -F\" \" '{print \$3}' | grep root" "Verified the /etc/group file IS owned by root, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the /etc/group file is NOT owned by root, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38459 ###
resetRule "SV-50259r1_rule"
nonzero "$rule" "ls -l /etc/group | awk -F\" \" '{print \$4}' | grep root" "Verified the /etc/group file IS group-owned by root, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the /etc/group file is NOT group-owned by root, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38460 ###
resetRule "SV-50260r1_rule"
if [[ -n $(service nfs status | grep nfsd | grep stopped) ]]; then
pass "$rule" "service nfs status | grep nfsd | grep stopped" "Verified the server is not hosting any NFS shares, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
zero "$rule" "grep all_squash /etc/exports" "Verified the NFS server does NOT have the all_squash option enabled, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the NFS server does have the all_squash option enabled, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38461 ###
resetRule "SV-50261r1_rule"
nonzero "$rule" "stat -c '%a' /etc/group | grep \"^644\s*\"" "Verified the /etc/group file does have mode 0644 or less permissive, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the /etc/group file does NOT have mode 0644 or less permissive, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38463 ###
resetRule "SV-50263r1_rule"
nonzero "$rule" "mount | grep \"on /var/log \"" "Verified the system uses a separate file system for /var/log, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT use a separate file system for /var/log, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38464 ###
resetRule "SV-50264r1_rule"
nonzero "$rule" "grep disk_error_action /etc/audit/auditd.conf | grep -i 'ignore\|syslog\|exec\|suspend\|single\|halt'" "Verified the audit system takes appropriate action when there are disk errors on the audit storage volume, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the audit system does NOT take appropriate action when there are disk errors on the audit storage volume, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38465 ###
resetRule "SV-50265r3_rule"
paths=(/lib /lib64 /usr/lib /usr/lib64)
testFail=false
failstring=""
for i in ${paths[@]}; do
if [[ $(find -L $i -perm /022 -type f) ]]; then
testFail=true
failstring+=" $i "
else
$nothing
fi
done
if [[ $testFail = true ]]; then
fail "$rule" "echo $failstring" "Verified all system-wide shared library files, which are linked to executables during process load time or run time ARE group-writable or world-writable, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
pass "$rule" "find -L [DIR] -perm /022 -type f" "Verified all system-wide shared library files, which are linked to executables during process load time or run time are NOT group-writable or world-writable, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
fi
unset testFail
unset failstring
unset paths
### V-38466 ###
resetRule "SV-50266r4_rule"
zero "$rule" "$(for i in /lib /lib64 /usr/lib /usr/lib64 ; do for j in `find -L $i \! -user root` ; do rpm -V -f $j | grep '^.....U' ; done ; done)" "Verified all shared library directories are loaded into the address space of processes (including privileged ones) or of the kernel itself at runtime have proper ownership, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Some shared library directories were found loaded into the address space of processes (including privileged ones) or of the kernel itself at runtime have proper ownership, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38467 ###
resetRule "SV-50267r1_rule"
nonzero "$rule" "mount | grep \"on /var/log/audit \"" "Verified the system uses a separate file system for /var/log/audit, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT use a separate file system for /var/log/audit, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38468 ###
resetRule "SV-50268r1_rule"
nonzero "$rule" "grep disk_full_action /etc/audit/auditd.conf | grep -i 'ignore\|syslog\|exec\|suspend\|single\|halt'" "Verified the audit system takes appropriate action when the audit storage volume is full, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the audit system does NOT take appropriate action when the audit storage volume is full, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38469 ###
resetRule "SV-50269r3_rule"
paths=(/bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbin)
testFail=false
failstring=""
for i in ${paths[@]}; do
if [[ $(find -L $i -perm /022 -type f) ]]; then
testFail=true
failstring+=" $i "
else
$nothing
fi
done
if [[ $testFail = true ]]; then
fail "$rule" "echo $failstring" "Verified some files in these directories ARE group-writable or world-writable, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
pass "$rule" "find -L [DIR] -perm /022 -type f" "Verified all files in these directories are NOT group-writable or world-writable, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
fi
unset testFail
unset failstring
unset paths
### V-38470 ###
resetRule "SV-50270r2_rule"
nonzero "$rule" "grep space_left_action /etc/audit/auditd.conf | grep -i 'ignore\|syslog\|exec\|suspend\|single\|halt'" "Verified the audit system alerts designated staff members when the audit storage volume approaches capacity, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the audit system does NOT alert designated staff members when the audit storage volume approaches capacity, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38471 ###
resetRule "SV-50271r1_rule"
nonzero "$rule" "grep active /etc/audisp/plugins.d/syslog.conf | grep yes" "Verified the system DOES forward audit records to the syslog service, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT forward audit records to the syslog service, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38472 ###
resetRule "SV-50272r1_rule"
paths=(/bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbin)
testFail=false
failstring=""
for i in ${paths[@]}; do
if [[ $(find -L $i \! -user root) ]]; then
testFail=true
failstring+=" $i "
else
$nothing
fi
done
if [[ $testFail = true ]]; then
fail "$rule" "echo $failstring" "Verified some files in these directories are NOT owned by root, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
pass "$rule" "find -L [DIR] \! -user root" "Verified all files in these directories are owned by root, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
fi
unset testFail
unset failstring
unset paths
### V-38473 ###
resetRule "SV-50273r1_rule"
nonzero "$rule" "mount | grep \"on /home \"" "Verified the system uses a separate file system for /home, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT use a separate file system for /home, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38474 ###
resetRule "SV-50274r2_rule"
if [[ -z $(rpm -qa | grep GConf2) ]]; then
na "$rule" "rpm -qa | grep GConf2" "Verified GConf2 package is not installed, therefore the reference STIG is NOT Applicable. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
nonzero "$rule" "gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --get /apps/gnome_settings_daemon/keybindings/screensaver" "Verified the system allows locking of graphical desktop sessions, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system allows locking of graphical desktop sessions, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38475 ###
resetRule "SV-50275r3_rule"
nonzero "$rule" "grep PASS_MIN_LEN /etc/login.defs | grep -v "^\s*#" | awk -F ' ' '\$2 >=15'" "Verified the system requires passwords to contain a minimum of 15 characters, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT require passwords to contain a minimum of 15 characters, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38476 ###
resetRule "SV-50276r3_rule"
zero "$rule" "rpm -q gpg-pubkey | grep \"not installed\"" "Verified the vendor-provided cryptographic certificates are installed to verify the integrity of system software, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the vendor-provided cryptographic certificates are NOT installed to verify the integrity of system software, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38477 ###
resetRule "SV-50277r1_rule"
nonzero "$rule" "grep PASS_MIN_DAYS /etc/login.defs | grep 1" "Verified users must not be able to change passwords more than once every 24 hours, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified users must not be able to change passwords more than once every 24 hours, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38478 ###
resetRule "SV-50278r2_rule"
nonzero "$rule" "chkconfig \"rhnsd\" --list | grep -v on" "Verified the Red Hat Network Service (rhnsd) service is NOT be running, unless using RHN or an RHN Satellite, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the Red Hat Network Service (rhnsd) service IS be running, unless using RHN or an RHN Satellite, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38479 ###
resetRule "SV-50279r1_rule"
nonzero "$rule" "grep PASS_MAX_DAYS /etc/login.defs | grep 60" "Verified the user passwords are changed at least every 60 days, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the user passwords are NOT changed at least every 60 days, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38480 ###
resetRule "SV-50280r1_rule"
nonzero "$rule" "grep PASS_WARN_AGE /etc/login.defs | grep 7" "Verified users are warned 7 days in advance of password expiration, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified users are NOT warned 7 days in advance of password expiration, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38481 ###
# Manual inspection - will need to lookup if returned results are at supported versions.
resetRule "SV-50281r1_rule"
nr "$rule" "echo '#Manual Inspection Required
'; yum history list;" "Verify the latest patches were applied within the last 4 weeks. Standard Verbiage: Verified vendor packaged system security patches and updates are installed and up to date, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
### V-38482 ###
resetRule "SV-50282r2_rule"
nonzero "$rule" "grep pam_cracklib /etc/pam.d/system-auth /etc/pam.d/password-auth | egrep \"dcredit\s*=\s*-1\"" "Verified the system must require passwords to contain at least one numeric character, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT require passwords to contain at least one numeric character, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38483 ###
resetRule "SV-50283r1_rule"
nonzero "$rule" "grep \"^gpgcheck\s*=\s*1\" /etc/yum.conf | grep -v '^#'" "Verified the operating system prevents the installation of software, patches, service packs, device drivers, or operating system components from a repository without verification they have been digitally signed using a certificate that is issued by a Certificate Authority (CA) that is recognized and approved by the organization, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the operating system does NOT prevent the installation of software, patches, service packs, device drivers, or operating system components from a repository without verification they have been digitally signed using a certificate that is issued by a Certificate Authority (CA) that is recognized and approved by the organization, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38484 ###
resetRule "SV-50285r2_rule"
nonzero "$rule" "grep -i "^PrintLastLog" /etc/ssh/sshd_config | grep -i yes" "Verified the operating system, upon successful logon, must display to the user the date and time of the last logon or access via ssh, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the operating system, upon successful logon, does NOT display to the user the date and time of the last logon or access via ssh, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38486 ###
resetRule "SV-50287r1_rule"
nonzero "$rule" "/opt/splunkforwarder/bin/splunk btool deploymentclient list | grep targetUri | grep -v '^#'" "Verified the operating system off-loads audit records onto a different system or media from the system being audited, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the operating system does NOT off-load audit records onto a different system or media from the system being audited, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38487 ###
resetRule "SV-50288r1_rule"
zero "$rule" "egrep \"gpgcheck\s*=\s*0\" /etc/yum.repos.d/*" "Verified the system package management tool must cryptographically verify the authenticity of all software packages during installation, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system package management tool must cryptographically verify the authenticity of all software packages during installation, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
### V-38488 ###
resetRule "SV-50289r1_rule"
nonzero "$rule" "/opt/splunkforwarder/bin/splunk btool deploymentclient list | grep targetUri | grep -v '^#'" "Verified the operating system off-loads audit records onto a different system or media from the system being audited, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the operating system does NOT off-load audit records onto a different system or media from the system being audited, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38489 ###
resetRule "SV-50290r1_rule"
nonzero "$rule" "rpm -q aide | grep aide-.*el6" "Verified a file integrity tool IS installed, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified a file integrity tool is NOT installed, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38490 ###
resetRule "SV-50291r6_rule"
nonzero "$rule" "grep -r usb-storage /etc/modprobe.conf /etc/modprobe.d | grep -i "/bin/true" | grep -v \"^\s*#\"" "Verified the operating system must enforce requirements for the connection of mobile devices to operating systems, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the operating system does NOT enforce requirements for the connection of mobile devices to operating systems, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38491 ###
resetRule "SV-50292r1_rule"
if [[ -z $(find /home -name .rhosts) && ! -f /etc/hosts.equiv ]]; then
pass "$rule" "find /home -name .rhosts; ls -l /etc/hosts.equiv" "Verified no .rhosts or hosts.equiv files on the system, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "find /home -name .rhosts; ls -l /etc/hosts.equiv" "Verified some .rhosts or hosts.equiv files were found on the system, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38492 ###
resetRule "SV-50293r1_rule"
zero "$rule" "grep '^vc/[0-9]' /etc/securetty" "Verified the system must prevent the root account from logging in from virtual consoles, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT prevent the root account from logging in from virtual consoles, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38493 ###
resetRule "SV-50294r1_rule"
declare -A perm
testFail=false
output=$(grep "^log_file" /etc/audit/auditd.conf|sed 's/^[^/]*//; s/[^/]*$//'|xargs stat -c %a:%n | awk -F":" '{print $1}')
while read -n1 octet; do
perm+=$octet
#count=$(($count+1))
done < <(echo -n "$output")
if [[ $(echo $perm[0] -le "7") && $(echo $perm[1] -le "5") && $(echo $perm[2] -le "5") ]]; then
$nothing
else
testFail=true
fi
if [[ $(echo $testFail) == true ]]; then
fail "$rule" "grep \"^log_file\" /etc/audit/auditd.conf|sed 's/^[^/]*//; s/[^/]*\$//'|xargs stat -c %a:%n" "Verified audit log directories do NOT have mode 0755 or less permissive, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
pass "$rule" "grep \"^log_file\" /etc/audit/auditd.conf|sed 's/^[^/]*//; s/[^/]*\$//'|xargs stat -c %a:%n" "Verified audit log directories have mode 0755 or less permissive, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
fi
unset testFail
unset output
unset perm
unset octet
### V-38494 ###
resetRule "SV-50295r1_rule"
zero "$rule" "grep '^ttyS[0-9]' /etc/securetty" "Verified the system prevents the root account from logging in from serial consoles, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT prevent the root account from logging in from serial consoles, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38495 ###
resetRule "SV-50296r1_rule"
nonzero "$rule" "grep \"^log_file\" /etc/audit/auditd.conf|sed s/^[^\/]*//|xargs stat -c %U:%n | grep root" "Verified audit log files are owned by root, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified audit log files are NOT owned by root, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38496 ###
resetRule "SV-50297r3_rule"
testFail=false
account=$(awk -F: '$1 !~ /^root$/ && $2 !~ /^[!*]/ {print $1 ":" $2}' /etc/shadow | awk -F":" '{print $1}')
for i in $account; do
if [[ $(id -u $i) -ge 500 ]]; then
$nothing
else
testFail=true
fi
done
if [[ $(echo $testFail) == true ]]; then
fail "$rule" "awk -F: '\$1 !~ /^root$/ && \$2 !~ /^[!*]/ {print \$1 ":" \$2}' /etc/shadow" "Verified some default operating system accounts, other than root, are NOT locked, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
pass "$rule" "awk -F: '\$1 !~ /^root$/ && \$2 !~ /^[!*]/ {print \$1 ":" \$2}' /etc/shadow" "Verified all default operating system accounts, other than root, are locked, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
fi
unset testFail
unset account
### V-38497 ###
resetRule "SV-50298r3_rule"
zero "$rule" "grep nullok /etc/pam.d/system-auth /etc/pam.d/password-auth" "Verified the system does NOT have accounts configured with blank or null passwords, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system DOES have accounts configured with blank or null passwords, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38498 ###
resetRule "SV-50299r1_rule"
declare -A perm
testFail=false
output=$(grep "^log_file" /etc/audit/auditd.conf|sed s/^[^\/]*//|xargs stat -c %a:%n | awk -F":" '{print $1}')
while read -n1 octet; do
perm+=$octet
#count=$(($count+1))
done < <(echo -n "$output")
if [[ $(echo $perm[0] -le "6") && $(echo $perm[1] -le "4") && $(echo $perm[2] -eq "0") ]]; then
$nothing
else
testFail=true
fi
if [[ $(echo $testFail) == true ]]; then
fail "$rule" "grep \"^log_file\" /etc/audit/auditd.conf|sed s/^[^\/]*//|xargs stat -c %a:%n" "Verified audit log files do NOT have mode 0640 or less permissive, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
pass "$rule" "grep \"^log_file\" /etc/audit/auditd.conf|sed s/^[^\/]*//|xargs stat -c %a:%n" "Verified audit log files have mode 0640 or less permissive, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
fi
unset testFail
unset output
unset perm
unset octet
### V-38499 ###
resetRule "SV-50300r1_rule"
zero "$rule" "awk -F: '($2 != "x") {print}' /etc/passwd" "Verified the /etc/passwd file does NOT contain password hashes, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the /etc/passwd file DOES contain password hashes, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38500 ###
resetRule "SV-50301r2_rule"
if [[ $(awk -F: '($3 == 0) {print}' /etc/passwd | wc -l) -eq 1 ]]; then
nonzero "$rule" "awk -F: '(\$3 == 0) {print}' /etc/passwd | grep root" "Verified the root account is the only account having a UID of 0, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the root account is NOT the only account having a UID of 0, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
fail "$rule" "awk -F: '($3 == 0) {print}' /etc/passwd" "Verified the root account is NOT the only account having a UID of 0, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38501 ###
resetRule "SV-50302r4_rule"
testFail=false
if [[ $(grep pam_faillock /etc/pam.d/system-auth /etc/pam.d/password-auth | grep -v account | wc -l) -eq $(grep pam_faillock /etc/pam.d/system-auth /etc/pam.d/password-auth | grep -v account | grep fail_interval | wc -l) ]]; then
interval=$(grep pam_faillock /etc/pam.d/system-auth /etc/pam.d/password-auth | grep -v account)
for i in $interval; do
if [[ $(echo $i | sed 's/.*\(fail_interval=[0-9]\+\).*/\1/') -ge 900 ]]; then
$nothing
else
testFail=true
fi
done
else
fail "$rule" "grep pam_faillock /etc/pam.d/system-auth /etc/pam.d/password-auth" "Verified the system does NOT disable accounts after excessive login failures within a 15-minute interval, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
if [[ $(echo $testFail) == true ]]; then
fail "$rule" "grep pam_faillock /etc/pam.d/system-auth /etc/pam.d/password-auth" "Verified the system does NOT disable accounts after excessive login failures within a 15-minute interval, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
pass "$rule" "grep pam_faillock /etc/pam.d/system-auth /etc/pam.d/password-auth" "Verified the system disables accounts after excessive login failures within a 15-minute interval, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
fi
unset testFail
### V-38502 ###
resetRule "SV-50303r1_rule"
nonzero "$rule" "ls -l /etc/shadow | awk -F\" \" '{print \$3}' | grep root" "Verified the /etc/shadow file IS owned by root, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the /etc/shadow file is NOT owned by root, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38503 ###
resetRule "SV-50304r1_rule"
nonzero "$rule" "ls -l /etc/shadow | awk -F\" \" '{print \$4}' | grep root" "Verified the /etc/shadow file IS group-owned by root, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the /etc/shadow file is NOT group-owned by root, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38504 ###
resetRule "SV-50305r1_rule"
nonzero "$rule" "stat -c '%a' /etc/shadow | grep \"^0\s*\"" "Verified the /etc/shadow file have mode 0000, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the /etc/shadow file does NOT have mode 0000, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38511 ###
resetRule "SV-50312r3_rule"
nonzero "$rule" "sysctl net.ipv4.ip_forward | grep 0" "Verified IP forwarding for IPv4 is NOT enabled, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified IP forwarding for IPv4 IS enabled, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38512 ###
resetRule "SV-50313r2_rule"
nonzero "$rule" "service iptables status | grep -v \"not running\"" "Verified the operating system prevents public IPv4 access into an organizations internal networks, except as appropriately mediated by managed interfaces employing boundary protection devices, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the operating system does NOT prevent public IPv4 access into an organizations internal networks, except as appropriately mediated by managed interfaces employing boundary protection devices, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38513 ###
resetRule "SV-50314r2_rule"
nonzero "$rule" "iptables -nvL | grep -i input | grep \"policy DROP\"" "Verified the systems local IPv4 firewall implements a deny-all, allow-by-exception policy for inbound packets, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the systems local IPv4 firewall does NOT implement a deny-all, allow-by-exception policy for inbound packets, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38514 ###
resetRule "SV-50315r5_rule"
nonzero "$rule" "grep -r dccp /etc/modprobe.conf /etc/modprobe.d | grep -i \"/bin/true\" | grep -v \"#\"" "Verified the Datagram Congestion Control Protocol (DCCP) must be disabled unless required, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the Datagram Congestion Control Protocol (DCCP) is NOT disabled unless required, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38515 ###
resetRule "SV-50316r5_rule"
nonzero "$rule" "grep -r sctp /etc/modprobe.conf /etc/modprobe.d | grep -i \"/bin/true\" | grep -v \"#\"" "Verified the Stream Control Transmission Protocol (SCTP) must be disabled unless required, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the Stream Control Transmission Protocol (SCTP) is NOT disabled unless required, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38516 ###
resetRule "SV-50317r3_rule"
nonzero "$rule" "grep -r rds /etc/modprobe.conf /etc/modprobe.d | grep 'true\|false'" "Verified the Reliable Datagram Sockets (RDS) protocol IS disabled unless required, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the Reliable Datagram Sockets (RDS) protocol is NOT disabled unless required, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38517 ###
resetRule "SV-50318r5_rule"
nonzero "$rule" "grep -r tipc /etc/modprobe.conf /etc/modprobe.d | grep 'true\|false'" "Verified the Transparent Inter-Process Communication (TIPC) protocol IS disabled unless required, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the Transparent Inter-Process Communication (TIPC) protocol is NOT disabled unless required, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38518 ###
resetRule "SV-50319r2_rule"
testFail=false
paths=$(cat /etc/rsyslog.conf | sed '1,/Rules/d' | awk -F" " '{print $2}' | grep -v ":" | sed 's/-//g')
for i in $paths; do
if [[ -n $(ls -l $i | awk -F" " '{print $3}' | grep root) ]]; then
$nothing
else
testFail=true
fi
done
if [[ $(echo $testFail) == true ]]; then
fail "$rule" "cat /etc/rsyslog.conf | sed '1,/Rules/d' | awk -F\" \" '{print \$2}' | grep -v \":\" | sed 's/-//g'" "Verified some rsyslog-generated log files are NOT owned by root, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
pass "$rule" "cat /etc/rsyslog.conf | sed '1,/Rules/d' | awk -F\" \" '{print \$2}' | grep -v \":\" | sed 's/-//g'" "Verified all rsyslog-generated log files are owned by root, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
fi
unset testFail
unset paths
### V-38519 ###
resetRule "SV-50320r2_rule"
testFail=false
paths=$(cat /etc/rsyslog.conf | sed '1,/Rules/d' | awk -F" " '{print $2}' | grep -v ":" | sed 's/-//g')
for i in $paths; do
if [[ -n $(ls -l $i | awk -F" " '{print $4}' | grep root) ]]; then
$nothing
else
testFail=true
fi
done
if [[ $(echo $testFail) == true ]]; then
fail "$rule" "cat /etc/rsyslog.conf | sed '1,/Rules/d' | awk -F\" \" '{print \$2}' | grep -v \":\" | sed 's/-//g'" "Verified some rsyslog-generated log files are NOT group-owned by root, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
pass "$rule" "cat /etc/rsyslog.conf | sed '1,/Rules/d' | awk -F\" \" '{print \$2}' | grep -v \":\" | sed 's/-//g'" "Verified all rsyslog-generated log files are group-owned by root, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
fi
unset testFail
unset paths
### V-38520 ###
resetRule "SV-50321r1_rule"
nonzero "$rule" "/opt/splunkforwarder/bin/splunk btool deploymentclient list | grep targetUri | grep -v '^#'" "Verified the operating system off-loads audit records onto a different system or media from the system being audited, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the operating system does NOT off-load audit records onto a different system or media from the system being audited, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38521 ###
resetRule "SV-50322r1_rule"
nonzero "$rule" "/opt/splunkforwarder/bin/splunk btool deploymentclient list | grep targetUri | grep -v '^#'" "Verified the operating system off-loads audit records onto a different system or media from the system being audited, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the operating system does NOT off-load audit records onto a different system or media from the system being audited, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38522 ###
resetRule "SV-50323r4_rule"
nonzero "$rule" "grep -w \"settimeofday\" /etc/audit/audit.rules | grep 'b32\|b64' | grep -v "^\s*#" | wc -l | grep 2" "Verified the audit system IS configured to audit all attempts to alter system time through settimeofday, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the audit system is NOT configured to audit all attempts to alter system time through settimeofday, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38523 ###
resetRule "SV-50324r3_rule"
nonzero "$rule" "sysctl net.ipv4.conf.all.accept_source_route | grep 0" "Verified the system does not accept IPv4 source-routed packets on any interface, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system DOES accept IPv4 source-routed packets on any interface, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38524 ###
resetRule "SV-50325r3_rule"
nonzero "$rule" "sysctl net.ipv4.conf.all.accept_redirects | grep 0" "Verified the system does NOT accept ICMPv4 redirect packets on any interface, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system DOES accept ICMPv4 redirect packets on any interface, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38525 ###
resetRule "SV-50326r5_rule"
if [[ -n $(uname -m | grep x86_64) ]]; then
na "$rule" "uname -m" "Verified the system is 64-bit only, therefore the reference STIG is not applicable"
else
nonzero "$rule" "grep -w \"stime\" /etc/audit/audit.rules | grep 'b32\|b64' | grep -v "^\s*#" | wc -l | grep 2" "Verified the audit system IS configured to audit all attempts to alter system time through stime, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the audit system is NOT configured to audit all attempts to alter system time through stime, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38526 ###
resetRule "SV-50327r3_rule"
nonzero "$rule" "sysctl net.ipv4.conf.all.secure_redirects | grep 0" "Verified the system does NOT accept ICMPv4 secure redirect packets on any interface, therefore the reference STIG is not a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system DOES accept ICMPv4 secure redirect packets on any interface, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38527 ###
resetRule "SV-50328r4_rule"
nonzero "$rule" "grep -w \"clock_settime\" /etc/audit/audit.rules | grep 'b32\|b64' | grep -v "^\s*#" | wc -l | grep 2" "Verified the audit system IS configured to audit all attempts to alter system time through clock_settime, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the audit system is NOT configured to audit all attempts to alter system time through clock_settime, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38528 ###
resetRule "SV-50329r3_rule"
nonzero "$rule" "sysctl net.ipv4.conf.all.log_martians | grep 1" "Verified the system logs Martian packets, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT log Martian packets, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38529 ###
resetRule "SV-50330r3_rule"
nonzero "$rule" "sysctl net.ipv4.conf.default.accept_source_route | grep 0" "Verified the system does NOT accept IPv4 source-routed packets by default, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system DOES accept IPv4 source-routed packets by default, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38530 ###
resetRule "SV-50331r2_rule"
nonzero "$rule" "grep -w "/etc/localtime" /etc/audit/audit.rules | grep -v "^\s*#" | grep wa" "Verified the audit system IS configured to audit all attempts to alter system time through /etc/localtime, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the audit system is NOT configured to audit all attempts to alter system time through /etc/localtime, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38531 ###
resetRule "SV-50332r2_rule"
zero "$rule" "egrep -w '(/etc/passwd|/etc/shadow|/etc/group|/etc/gshadow|/etc/security/opasswd)' /etc/audit/audit.rules | grep -v \"\-p wa\"" "Verified the operating system must automatically audit account creation, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the operating system does NOT automatically audit account creation, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38532 ###
resetRule "SV-50333r3_rule"
nonzero "$rule" "sysctl net.ipv4.conf.default.secure_redirects | grep 0" "Verified the system does NOT accept ICMPv4 secure redirect packets by default, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system DOES accept ICMPv4 secure redirect packets by default, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38533 ###
resetRule "SV-50334r4_rule"
nonzero "$rule" "sysctl net.ipv4.conf.default.accept_redirects | grep 0" "Verified the system must ignore ICMPv4 redirect messages by default, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT ignore ICMPv4 redirect messages by default, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38534 ###
resetRule "SV-50335r2_rule"
zero "$rule" "egrep -w '(/etc/passwd|/etc/shadow|/etc/group|/etc/gshadow|/etc/security/opasswd)' /etc/audit/audit.rules | grep -v \"\-p wa\"" "Verified the operating system must automatically audit account modification, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the operating system does NOT automatically audit account modification, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38535 ###
resetRule "SV-50336r3_rule"
nonzero "$rule" "sysctl net.ipv4.icmp_echo_ignore_broadcasts | grep 1" "Verified the system must not respond to ICMPv4 sent to a broadcast address, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system responds to ICMPv4 sent to a broadcast address, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38536 ###
resetRule "SV-50337r2_rule"
zero "$rule" "egrep -w '(/etc/passwd|/etc/shadow|/etc/group|/etc/gshadow|/etc/security/opasswd)' /etc/audit/audit.rules | grep -v \"\-p wa\"" "Verified the operating system must automatically audit account disabling actions, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the operating system does NOT automatically audit account disabling actions, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38537 ###
resetRule "SV-50338r3_rule"
nonzero "$rule" "sysctl net.ipv4.icmp_ignore_bogus_error_responses | grep 1" "Verified the system ignores ICMPv4 bogus error responses, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT ignore ICMPv4 bogus error responses, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38538 ###
resetRule "SV-50339r2_rule"
zero "$rule" "egrep -w '(/etc/passwd|/etc/shadow|/etc/group|/etc/gshadow|/etc/security/opasswd)' /etc/audit/audit.rules | grep -v \"\-p wa\"" "Verified the operating system must automatically audit account termination, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the operating system does NOT automatically audit account termination, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38539 ###
resetRule "SV-50340r3_rule"
nonzero "$rule" "sysctl net.ipv4.tcp_syncookies | grep 1" "Verified the system IS configured to use TCP syncookies when experiencing a TCP SYN flood, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system is NOT configured to use TCP syncookies when experiencing a TCP SYN flood, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38540 ###
resetRule "SV-50341r5_rule"
if [[ $(ausyscall i386 sethostname | awk -F" " '{print $2}') -ne $(ausyscall x86_64 sethostname | awk -F" " '{print $2}') ]]; then
if [[ -n $(egrep -w '(sethostname|setdomainname|/etc/issue|/etc/issue.net|/etc/hosts|/etc/sysconfig/network)' /etc/audit/audit.rules | grep 'b64\|b32' | wc -l | grep 2) && -n $(egrep -w '(sethostname|setdomainname|/etc/issue|/etc/issue.net|/etc/hosts|/etc/sysconfig/network)' /etc/audit/audit.rules | grep "\-p wa") ]]; then
pass "$rule" "egrep -w '(sethostname|setdomainname|/etc/issue|/etc/issue.net|/etc/hosts|/etc/sysconfig/network)' /etc/audit/audit.rules" "Verified the audit system is configured to audit modifications to the systems network configuration, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "egrep -w '(sethostname|setdomainname|/etc/issue|/etc/issue.net|/etc/hosts|/etc/sysconfig/network)' /etc/audit/audit.rules" "Verified the audit system is NOT configured to audit ALL modifications to the systems network configuration, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
else
if [[ -n $(uname -m | grep x86_64) ]]; then
if [[ -n $(egrep -w '(sethostname|setdomainname|/etc/issue|/etc/issue.net|/etc/hosts|/etc/sysconfig/network)' /etc/audit/audit.rules | grep 'b64') && -n $(egrep -w '(sethostname|setdomainname|/etc/issue|/etc/issue.net|/etc/hosts|/etc/sysconfig/network)' /etc/audit/audit.rules | grep "\-p wa") ]]; then
pass "$rule" "egrep -w '(sethostname|setdomainname|/etc/issue|/etc/issue.net|/etc/hosts|/etc/sysconfig/network)' /etc/audit/audit.rules" "Verified the audit system is configured to audit modifications to the systems network configuration, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "egrep -w '(sethostname|setdomainname|/etc/issue|/etc/issue.net|/etc/hosts|/etc/sysconfig/network)' /etc/audit/audit.rules" "Verified the audit system is NOT configured to audit ALL modifications to the systems network configuration, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
else
if [[ -n $(egrep -w '(sethostname|setdomainname|/etc/issue|/etc/issue.net|/etc/hosts|/etc/sysconfig/network)' /etc/audit/audit.rules | grep 'b32') && -n $(egrep -w '(sethostname|setdomainname|/etc/issue|/etc/issue.net|/etc/hosts|/etc/sysconfig/network)' /etc/audit/audit.rules | grep "\-p wa") ]]; then
pass "$rule" "egrep -w '(sethostname|setdomainname|/etc/issue|/etc/issue.net|/etc/hosts|/etc/sysconfig/network)' /etc/audit/audit.rules" "Verified the audit system is configured to audit modifications to the systems network configuration, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "egrep -w '(sethostname|setdomainname|/etc/issue|/etc/issue.net|/etc/hosts|/etc/sysconfig/network)' /etc/audit/audit.rules" "Verified the audit system is NOT configured to audit ALL modifications to the systems network configuration, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
fi
fi
### V-38541 ###
resetRule "SV-50342r2_rule"
nonzero "$rule" "grep -w \"/etc/selinux\" /etc/audit/audit.rules | grep -v \"^\s*#\" | grep \"\-p wa\"" "Verified the audit system IS configured to audit modifications to the systems Mandatory Access Control (MAC) configuration (SELinux), therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the audit system is NOT configured to audit modifications to the systems Mandatory Access Control (MAC) configuration (SELinux), therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38542 ###
resetRule "SV-50343r3_rule"
nonzero "$rule" "sysctl net.ipv4.conf.all.rp_filter | grep 1" "Verified the system uses a reverse-path filter for IPv4 network traffic when possible on all interfaces, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT use a reverse-path filter for IPv4 network traffic when possible on all interfaces, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38543 ###
resetRule "SV-50344r4_rule"
if [[ -n $(grep -w "chmod" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid=0 | wc -l | grep 2) && -n $(grep -w "chmod" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid!=4294967295 | wc -l | grep 2) ]]; then
pass "$rule" "grep -w \"chmod\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using chmod, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "grep -w \"chmod\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using chmod, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38544 ###
resetRule "SV-50345r3_rule"
nonzero "$rule" "sysctl net.ipv4.conf.default.rp_filter | grep 1" "Verified the system must uses reverse-path filter for IPv4 network traffic when possible by default, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system must does NOT use reverse-path filter for IPv4 network traffic when possible by default, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-38545 ###
resetRule "SV-50346r4_rule"
if [[ -n $(grep -w "chown" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid=0 | wc -l | grep 2) && -n $(grep -w "chown" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid!=4294967295 | wc -l | grep 2) ]]; then
pass "$rule" "grep -w \"chown\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using chown, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "grep -w \"chown\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using chown, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38547 ###
resetRule "SV-50348r4_rule"
if [[ -n $(grep -w "fchmod" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid=0 | wc -l | grep 2) && -n $(grep -w "fchmod" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid!=4294967295 | wc -l | grep 2) ]]; then
pass "$rule" "grep -w \"fchmod\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using fchmod, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "grep -w \"fchmod\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using fchmod, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38548 ###
resetRule "SV-50349r4_rule"
if [[ -n $(grep -ir ipv6 /etc/modprobe.d/ | grep -v "^\s*#" | grep disable=1) ]]; then
na "$rule" "grep -ir ipv6 /etc/modprobe.d/ | grep -v "^\s*#" | grep disable=1" "Verified IPv6 is disabled, therefore the reference STIG is Not Applicable"
else
nonzero "$rule" "sysctl net.ipv6.conf.default.accept_redirects | grep 0" "Verified the system ignores ICMPv6 redirects by default, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT ignore ICMPv6 redirects by default, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38549 ###
resetRule "SV-50350r3_rule"
if [[ -n $(grep -ir ipv6 /etc/modprobe.d/ | grep -v "^\s*#" | grep disable=1) ]]; then
na "$rule" "grep -ir ipv6 /etc/modprobe.d/ | grep -v "^\s*#" | grep disable=1" "Verified IPv6 is disabled, therefore the reference STIG is Not Applicable"
else
nonzero "$rule" "service ip6tables status | grep -v \"not running\"" "Verified the system employs a local IPv6 firewall, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT employ a local IPv6 firewall, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38550 ###
resetRule "SV-50351r4_rule"
if [[ -n $(grep -w "fchmodat" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid=0 | wc -l | grep 2) && -n $(grep -w "fchmodat" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid!=4294967295 | wc -l | grep 2) ]]; then
pass "$rule" "grep -w \"fchmodat\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using fchmodat, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "grep -w \"fchmodat\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using fchmodat, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38551 ###
resetRule "SV-50352r3_rule"
if [[ -n $(grep -ir ipv6 /etc/modprobe.d/ | grep -v "^\s*#" | grep disable=1) ]]; then
na "$rule" "grep -ir ipv6 /etc/modprobe.d/ | grep -v "^\s*#" | grep disable=1" "Verified IPv6 is disabled, therefore the reference STIG is Not Applicable"
else
nonzero "$rule" "service ip6tables status | grep -v \"not running\"" "Verified the system employs a local IPv6 firewall, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT employ a local IPv6 firewall, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38552 ###
resetRule "SV-50353r4_rule"
if [[ -n $(grep -w "fchown" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid=0 | wc -l | grep 2) && -n $(grep -w "fchown" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid!=4294967295 | wc -l | grep 2) ]]; then
pass "$rule" "grep -w \"fchown\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using fchown, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "grep -w \"fchown\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using fchown, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38553 ###
resetRule "SV-50354r3_rule"
if [[ -n $(grep -ir ipv6 /etc/modprobe.d/ | grep -v "^\s*#" | grep disable=1) ]]; then
na "$rule" "grep -ir ipv6 /etc/modprobe.d/ | grep -v "^\s*#" | grep disable=1" "Verified IPv6 is disabled, therefore the reference STIG is Not Applicable"
else
nonzero "$rule" "service ip6tables status | grep -v \"not running\"" "Verified the system employs a local IPv6 firewall, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT employ a local IPv6 firewall, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38554 ###
resetRule "SV-50355r4_rule"
if [[ -n $(grep -w "fchownat" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid=0 | wc -l | grep 2) && -n $(grep -w "fchownat" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid!=4294967295 | wc -l | grep 2) ]]; then
pass "$rule" "grep -w \"fchownat\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using fchownat, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "grep -w \"fchownat\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using fchownat, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38555 ###
resetRule "SV-50356r2_rule"
if [[ -n $(grep -ir ipv6 /etc/modprobe.d/ | grep -v "^\s*#" | grep disable=1) ]]; then
na "$rule" "grep -ir ipv6 /etc/modprobe.d/ | grep -v "^\s*#" | grep disable=1" "Verified IPv6 is disabled, therefore the reference STIG is Not Applicable"
else
nonzero "$rule" "service ip6tables status | grep -v \"not running\"" "Verified the system employs a local IPv6 firewall, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT employ a local IPv6 firewall, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38556 ###
resetRule "SV-50357r4_rule"
if [[ -n $(grep -w "fremovexattr" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid=0 | wc -l | grep 2) && -n $(grep -w "fremovexattr" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid!=4294967295 | wc -l | grep 2) ]]; then
pass "$rule" "grep -w \"fremovexattr\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using fremovexattr, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "grep -w \"fremovexattr\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using fremovexattr, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38557 ###
resetRule "SV-50358r4_rule"
if [[ -n $(grep -w "fsetxattr" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid=0 | wc -l | grep 2) && -n $(grep -w "fsetxattr" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid!=4294967295 | wc -l | grep 2) ]]; then
pass "$rule" "grep -w \"fsetxattr\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using fsetxattr, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "grep -w \"fsetxattr\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using fsetxattr, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38558 ###
resetRule "SV-50359r4_rule"
if [[ -n $(grep -w "lchown" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid=0 | wc -l | grep 2) && -n $(grep -w "lchown" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid!=4294967295 | wc -l | grep 2) ]]; then
pass "$rule" "grep -w \"lchown\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using lchown, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "grep -w \"lchown\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using lchown, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38559 ###
resetRule "SV-50360r4_rule"
if [[ -n $(grep -w "lremovexattr" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid=0 | wc -l | grep 2) && -n $(grep -w "lremovexattr" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid!=4294967295 | wc -l | grep 2) ]]; then
pass "$rule" "grep -w \"lremovexattr\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using lremovexattr, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "grep -w \"lremovexattr\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using lremovexattr, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38560 ###
resetRule "SV-50361r2_rule"
if [[ -n $(grep -ir ipv6 /etc/modprobe.d/ | grep -v "^\s*#" | grep disable=1) ]]; then
na "$rule" "grep -ir ipv6 /etc/modprobe.d/ | grep -v "^\s*#" | grep disable=1" "Verified IPv6 is disabled, therefore the reference STIG is Not Applicable"
else
nonzero "$rule" "service ip6tables status | grep -v \"not running\"" "Verified the system employs a local IPv6 firewall, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary." "Verified the system does NOT employ a local IPv6 firewall, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38561 ###
resetRule "SV-50362r4_rule"
if [[ -n $(grep -w "lsetxattr" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid=0 | wc -l | grep 2) && -n $(grep -w "lsetxattr" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid!=4294967295 | wc -l | grep 2) ]]; then
pass "$rule" "grep -w \"lsetxattr\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using lsetxattr, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "grep -w \"lsetxattr\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using lsetxattr, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38563 ###
resetRule "SV-50364r4_rule"
if [[ -n $(grep -w "removexattr" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid=0 | wc -l | grep 2) && -n $(grep -w "removexattr" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid!=4294967295 | wc -l | grep 2) ]]; then
pass "$rule" "grep -w \"removexattr\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using removexattr, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "grep -w \"removexattr\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using removexattr, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38565 ###
resetRule "SV-50366r4_rule"
if [[ -n $(grep -w "setxattr" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid=0 | wc -l | grep 2) && -n $(grep -w "setxattr" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid!=4294967295 | wc -l | grep 2) ]]; then
pass "$rule" "grep -w \"setxattr\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using setxattr, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "grep -w \"setxattr\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using setxattr, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38566 ###
resetRule "SV-50367r3_rule"
if [[ -n $(grep -w "EACCES" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid=0 | wc -l | grep 2) && -n $(grep -w "EACCES" /etc/audit/audit.rules | grep -v "^\s*#" | grep auid!=4294967295 | wc -l | grep 2) ]]; then
pass "$rule" "grep -w \"EACCES\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using EACCES, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "grep -w \"EACCES\" /etc/audit/audit.rules" "Verified the audit system is configured to audit all discretionary access control permission modifications using EACCES, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
### V-38567 ###
resetRule "SV-50368r4_rule"
setuidpath=$(find / -xdev -type f -perm /6000 2>/dev/null)
testFail=false
failstring=""
for i in $setuidpath; do
if [[ -z $(grep $i /etc/audit/audit.rules | grep "\-a always,exit -F path=$i -F perm=x -F auid>=500 -F auid!=4294967295 -k privileged") ]]; then
testFail=true
failstring+=" $i "
else
$nothing