-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSol11SPARC_v1r20_Validation_20200323.sh
More file actions
2346 lines (2075 loc) · 249 KB
/
Sol11SPARC_v1r20_Validation_20200323.sh
File metadata and controls
2346 lines (2075 loc) · 249 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
#
#
# Set current Version/Release # for this STIG Checklist script
cklVersion="V1R20"
#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_Sol11SPARC_${cklVersion}.log"
exec 3>&1
exec 1>$tempOut 2>&1
# Create the result file
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
RESULTS="$DIR/Validation_Sol11SPARC_${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
#$4 Failed variable (comment) variable
#$5 Visible Test Criteria
function zero() {
echo "Check $1"
comment=$3
commentFail=$4
result="$(eval $2)"
if [[ -z "$result" ]]; then
if [[ -z $5 ]]; then
result "$1" "pass" "$2" "$result" "$comment"
else
result "$1" "pass" "$5" "$result" "$comment"
fi
else
if [[ -z $5 ]]; then
result "$1" "fail" "$2" "$result" "$commentFail"
else
result "$1" "fail" "$5" "$result" "$commentFail"
fi
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 (comment) variable
#$4 Failed variable (commnet) variable
#$5 Visible Test Criteria
function nonzero() {
echo "Check $1"
comment=$3
commentFail=$4
result="$(eval $2)"
if [[ -n "$result" ]]; then
if [[ -z $5 ]]; then
result "$1" "pass" "$2" "$result" "$comment"
else
result "$1" "pass" "$5" "$result" "$comment"
fi
else
if [[ -z $5 ]]; then
result "$1" "fail" "$2" "$result" "$commentFail"
else
result "$1" "fail" "$5" "$result" "$commentFail"
fi
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 [[ "$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
printf " <FINDING_DETAILS># " >> $RESULTS
#If a 'clean' flag is given, results will clean XML special characters and make them XML appropriate
if [[ $unclean -eq 1 ]]; then
printf "$3\n" >> $RESULTS
echo "" >> $RESULTS
printf "$4\n" >> $RESULTS
else
printf "$3\n" | sed 's/\&/\&/g' | sed 's/</\</g' | sed 's/>/\>/g' | sed "s/'/\'/g" | sed 's/\"/\"/g' >> $RESULTS
echo "" >> $RESULTS
printf "$4\n" | sed 's/\&/\&/g' | sed 's/</\</g' | sed 's/>/\>/g' | sed "s/'/\'/g" | sed 's/\"/\"/g' >> $RESULTS
fi
echo " </FINDING_DETAILS>" >> $RESULTS
echo " <COMMENTS>$(echo $5 | sed 's/\&/\&/g' | sed 's/</\</g' | sed 's/>/\>/g' | sed "s/'/\'/g" | sed '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 SOLARIS version/configuration ###
SOLver=""
IPaddr=$(ifconfig -a | awk '($1=="inet"){print$2}' | awk -F. '($1!="0"&&$1!="127"&&$1!="addr:0"&&$1!="addr:127"){print$0}' | xargs -e"\n")
macAddr=$(echo $IPaddr | awk -F" " '{for(i=1;i<=NF;i++){print $i;}}' | xargs -i sh -c "netstat -pn | grep "{$1}" | grep SP | awk '{print\$5}'" | xargs -e"\n")
SOLverNumb=$(uname -v)
############### .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>$SOLver</HOST_FQDN>" >> $RESULTS
echo " <TECH_AREA>UNIX OS</TECH_AREA>" >> $RESULTS
echo " <TARGET_KEY>2107</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>Solaris 11 SPARC 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"
##
### V-47781 ###
resetRule "SV-60657r1_rule"
if [[ -n $(zonename | grep global) ]]; then
nonzero "$rule" "auditconfig -getcond | grep 'auditing'" "Verified the audit system must produce records containing sufficient information to establish the identity of any user/subject associated with the event, 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 produce records containing sufficient information to establish the identity of any user/subject associated with the event, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47783 ###
resetRule "SV-60659r1_rule"
if [[ -n $(zonename | grep global) ]]; then
nonzero "$rule" "auditconfig -getcond | grep 'auditing'" "Verified the audit system must support an audit reduction capability, 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 support an audit reduction capability, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47785 ###
resetRule "SV-60661r1_rule"
if [[ -n $(zonename | grep global) ]]; then
nonzero "$rule" "auditconfig -getcond | grep 'auditing'" "Verified the audit system records must be able to be used by a report generation capability, 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 records is NOT able to be used by a report generation capability, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47787 ###
resetRule "SV-60663r1_rule"
if [[ -n $(zonename | grep global) ]]; then
nonzero "$rule" "auditconfig -getcond | grep 'auditing'" "Verified the operating system must provide the capability to automatically process audit records for events of interest based upon selectable, event criteria, 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 provide the capability to automatically process audit records for events of interest based upon selectable, event criteria, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47789 ###
resetRule "SV-60665r1_rule"
if [[ -n $(zonename | grep global) ]]; then
nonzero "$rule" "auditconfig -getcond | grep 'auditing'" "Verified the audit records must provide data for all auditable events defined at the organizational level for the organization-defined information system components, 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 records does NOT provide data for all auditable events defined at the organizational level for the organization-defined information system components, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47791 ###
resetRule "SV-60667r1_rule"
if [[ -n $(zonename | grep global) ]]; then
nonzero "$rule" "auditconfig -getcond | grep 'auditing'" "Verified the operating system must generate audit records for the selected list of auditable events as defined in DoD list of events, 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 generate audit records for the selected list of auditable events as defined in DoD list of events, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47793 ###
resetRule "SV-60669r1_rule"
if [[ -n $(zonename | grep global) ]]; then
nonzero "$rule" "auditconfig -getcond | grep 'auditing'" "Verified the operating system must support the capability to compile audit records from multiple components within the system into a system-wide (logical or physical) audit trail that is time-correlated to within organization-defined level of tolerance, 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 support the capability to compile audit records from multiple components within the system into a system-wide (logical or physical) audit trail that is time-correlated to within organization-defined level of tolerance, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47795 ###
resetRule "SV-60671r1_rule"
if [[ -n $(zonename | grep global) ]]; then
nonzero "$rule" "auditconfig -getcond | grep 'auditing'" "Verified audit records must include what type of events occurred, 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 NOT, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47797 ###
resetRule "SV-60673r1_rule"
if [[ -n $(zonename | grep global) ]]; then
nonzero "$rule" "auditconfig -getcond | grep 'auditing'" "Verified audit records must include when (date and time) the events occurred, 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 records does NOT include when (date and time) the events occurred, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47799 ###
resetRule "SV-60675r1_rule"
if [[ -n $(zonename | grep global) ]]; then
nonzero "$rule" "auditconfig -getcond | grep 'auditing'" "Verified audit records must include where the events occurred, 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 records does NOT include where the events occurred, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47801 ###
resetRule "SV-60677r1_rule"
if [[ -n $(zonename | grep global) ]]; then
nonzero "$rule" "auditconfig -getcond | grep 'auditing'" "Verified audit records must include the sources of the events that occurred, 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 records does NOT include the sources of the events that occurred, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47803 ###
resetRule "SV-60679r1_rule"
if [[ -n $(zonename | grep global) ]]; then
nonzero "$rule" "auditconfig -getcond | grep 'auditing'" "Verified audit records must include the outcome (success or failure) of the events that occurred, 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 records does NOT include the outcome (success or failure) of the events that occurred, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47805 ###
resetRule "SV-60681r2_rule"
if [[ -n $(zonename | grep global) ]]; then
if [[ -n $(uname -v | awk -F'.' '$2>=1&&$2<=3') ]]; then
if [[ -n $(auditconfig -t -getflags | grep active | cut -f2 -d= | grep 'fd') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit file deletions (Flags:FD), 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" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit file deletions (Flags:FD), 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
elif [[ -n $(uname -v | awk -F'.' '$2>=4') ]]; then
if [[ -n $(auditconfig -t -getflags | cut -f2 -d= | grep 'fd') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -t -getflags; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit file deletions (Flags:FD), 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" "auditconfig -t -getflags; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit file deletions (Flags:FD), 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
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47807 ###
resetRule "SV-60683r2_rule"
if [[ -n $(zonename | grep global) ]]; then
if [[ -n $(uname -v | awk -F'.' '$2>=1&&$2<=3') ]]; then
if [[ -n $(auditconfig -t -getflags | grep active | cut -f2 -d= | grep 'ps') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit account creation (Flags:PS), 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" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit account creation (Flags:PS), 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
elif [[ -n $(uname -v | awk -F'.' '$2>=4') ]]; then
if [[ -n $(auditconfig -t -getflags | cut -f2 -d= | grep 'cusa') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -t -getflags; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit account creation (Flags:CUSA), 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" "auditconfig -t -getflags; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit account creation (Flags:CUSA), 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
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47809 ###
resetRule "SV-60685r2_rule"
if [[ -n $(zonename | grep global) ]]; then
if [[ -n $(uname -v | awk -F'.' '$2>=1&&$2<=3') ]]; then
if [[ -n $(auditconfig -t -getflags | grep active | cut -f2 -d= | grep 'ps') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit account modification (Flags:PS), 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" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit account modification (Flags:PS), 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
elif [[ -n $(uname -v | awk -F'.' '$2>=4') ]]; then
if [[ -n $(auditconfig -t -getflags | cut -f2 -d= | grep 'cusa') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -t -getflags; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit account modification (Flags:CUSA), 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" "auditconfig -t -getflags; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit account modification (Flags:CUSA), 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
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47811 ###
resetRule "SV-60687r2_rule"
if [[ -n $(zonename | grep global) ]]; then
if [[ -n $(uname -v | awk -F'.' '$2>=1&&$2<=3') ]]; then
if [[ -n $(auditconfig -t -getflags | grep active | cut -f2 -d= | grep 'ps') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit account disabling actions (Flags:PS), 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" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit account disabling actions (Flags:PS), 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
elif [[ -n $(uname -v | awk -F'.' '$2>=4') ]]; then
if [[ -n $(auditconfig -t -getflags | cut -f2 -d= | grep 'cusa') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -t -getflags; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit account disabling actions (Flags:CUSA), 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" "auditconfig -t -getflags; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit account disabling actions (Flags:CUSA), 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
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47813 ###
resetRule "SV-60689r2_rule"
if [[ -n $(zonename | grep global) ]]; then
if [[ -n $(uname -v | awk -F'.' '$2>=1&&$2<=3') ]]; then
if [[ -n $(auditconfig -t -getflags | grep active | cut -f2 -d= | grep 'ps') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit account termination (Flags:PS), 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" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit account termination (Flags:PS), 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
elif [[ -n $(uname -v | awk -F'.' '$2>=4') ]]; then
if [[ -n $(auditconfig -t -getflags | cut -f2 -d= | grep 'cusa') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -t -getflags; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit account termination (Flags:CUSA), 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" "auditconfig -t -getflags; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit account termination (Flags:CUSA), 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
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47815 ###
resetRule "SV-60691r2_rule"
if [[ -n $(zonename | grep global) ]]; then
if [[ -n $(uname -v | awk -F'.' '$2>=1&&$2<=3') ]]; then
if [[ -n $(auditconfig -t -getflags | grep active | cut -f2 -d= | grep 'as') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit security-relevant configuration changes (Flags:AS), 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" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit security-relevant configuration changes (Flags:AS), 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
elif [[ -n $(uname -v | awk -F'.' '$2>=4') ]]; then
if [[ -n $(auditconfig -t -getflags | cut -f2 -d= | grep 'cusa') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -t -getflags; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit security-relevant configuration changes (Flags:CUSA), 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" "auditconfig -t -getflags; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit security-relevant configuration changes (Flags:CUSA), 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
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47817 ###
resetRule "SV-60693r2_rule"
if [[ -n $(zonename | grep global) ]]; then
if [[ -n $(uname -v | awk -F'.' '$2>=1&&$2<=3') ]]; then
if [[ -n $(auditconfig -t -getflags | grep active | cut -f2 -d= | grep 'as') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit all administrative, privileged, and security actions (Flags:AS), 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" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit all administrative, privileged, and security actions (Flags:AS), 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
elif [[ -n $(uname -v | awk -F'.' '$2>=4') ]]; then
if [[ -n $(auditconfig -t -getflags | cut -f2 -d= | grep 'cusa') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit all administrative, privileged, and security actions (Flags:CUSA), 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" "auditconfig -getflags; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit all administrative, privileged, and security actions (Flags:CUSA), 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
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47819 ###
resetRule "SV-60695r2_rule"
if [[ -n $(zonename | grep global) ]]; then
if [[ -n $(uname -v | awk -F'.' '$2>=1&&$2<=3') ]]; then
if [[ -n $(auditconfig -getflags | grep active | cut -f2 -d= | grep 'lo') && -n $(auditconfig -getnaflags | grep active | cut -f2 -d= | grep 'na') && -n $(auditconfig -getnaflags | grep active | cut -f2 -d= | grep 'lo') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags | grep active; auditconfig -getnaflags | grep active; auditconfig -getpolicy | grep argv" "Verified the audit system IS configured to audit login, logout, and session initiation (Flags:LO NAFlags:LO,NA), 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" "auditconfig -getflags | grep active; auditconfig -getnaflags | grep active; auditconfig -getpolicy | grep argv" "Verified the audit system is NOT configured to audit login, logout, and session initiation (Flags:LO NAFlags:LO,NA), 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
elif [[ -n $(uname -v | awk -F'.' '$2>=4') ]]; then
if [[ -n $(auditconfig -t -getflags | cut -f2 -d= | grep 'cusa') && -n $(auditconfig -t -getnaflags | cut -f2 -d= | grep 'na') && -n $(auditconfig -t -getnaflags | cut -f2 -d= | egrep '(cusa|lo)') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags; auditconfig -getnaflags; auditconfig -getpolicy | grep active | grep argv" "Verified the audit system IS configured to audit login, logout, and session initiation (Flags:CUSA NAFlags:CUSA or LO,NA), 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" "auditconfig -getflags; auditconfig -getnaflags; auditconfig -getpolicy | grep active | grep argv" "Verified the audit system is NOT configured to audit login, logout, and session initiation (Flags:CUSA NAFlags:CUSA or LO,NA), 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
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47821 ###
resetRule "SV-60697r2_rule"
if [[ -n $(zonename | grep global) ]]; then
if [[ -n $(uname -v | awk -F'.' '$2>=1&&$2<=3') ]]; then
if [[ -n $(auditconfig -t -getflags | grep active | cut -f2 -d= | grep 'fm') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit all discretionary access control permission modifications (Flags:FM), 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" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit all discretionary access control permission modifications (Flags:FM), 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
elif [[ -n $(uname -v | awk -F'.' '$2>=4') ]]; then
if [[ -n $(auditconfig -t -getflags | cut -f2 -d= | grep 'fm') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit all discretionary access control permission modifications (Flags:FM), 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" "auditconfig -getflags; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit all discretionary access control permission modifications (Flags:FM), 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
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47823 ###
resetRule "SV-60699r2_rule"
if [[ -n $(zonename | grep global) ]]; then
if [[ -n $(uname -v | awk -F'.' '$2>=1&&$2<=3') ]]; then
if [[ -n $(auditconfig -t -getflags | grep active | cut -f2 -d= | grep 'as') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit loading and unloading of dynamic kernel modules (Flags:AS), 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" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit loading and unloading of dynamic kernel modules (Flags:AS), 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
elif [[ -n $(uname -v | awk -F'.' '$2>=4') ]]; then
if [[ -n $(auditconfig -t -getflags | cut -f2 -d= | grep 'cusa') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit loading and unloading of dynamic kernel modules (Flags:CUSA), 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" "auditconfig -getflags; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit loading and unloading of dynamic kernel modules (Flags:CUSA), 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
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47825 ###
resetRule "SV-60701r2_rule"
if [[ -n $(zonename | grep global) ]]; then
if [[ -n $(uname -v | awk -F'.' '$2>=1&&$2<=3') ]]; then
if [[ -n $(auditconfig -t -getflags | grep active | cut -f2 -d= | grep '-fa') && -n $(auditconfig -t -getflags | grep active | cut -f2 -d= | grep '-ps') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit failed attempts to access files and programs (Flags:-FA,-PS), 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" "auditconfig -getflags | grep active; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit failed attempts to access files and programs (Flags:-FA,-PS), 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
elif [[ -n $(uname -v | awk -F'.' '$2>=4') ]]; then
if [[ -n $(auditconfig -t -getflags | cut -f2 -d= | grep '-fa') && -n $(auditconfig -t -getflags | cut -f2 -d= | grep '-ex') && -n $(auditconfig -t -getflags | cut -f2 -d= | grep '-ps') && -n $(auditconfig -getpolicy | grep active | grep argv) ]]; then
pass "$rule" "auditconfig -getflags; auditconfig -getpolicy | grep argv" "Verified audit system IS configured to audit failed attempts to access files and programs (Flags:-FA,-EX,-PS), 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" "auditconfig -getflags; auditconfig -getpolicy | grep argv" "Verified audit system is NOT configured to audit failed attempts to access files and programs (Flags:-FA,-EX,-PS), 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
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47827 ###
resetRule "SV-60703r2_rule"
#syslog=$(svcs system-log | awk -F':' '{print $2}' | sed '/^\s*$/d')
if [[ -n $(zonename | grep global) ]]; then
if [[ -n $(auditconfig -getplugin | grep audit_syslog | grep '(active)') ]]; then
if [[ -n $(/etc/init.d/splunk status) ]]; then
pass "$rule" "auditconfig -getplugin | grep audit_syslog | grep '(active)'; /etc/init.d/splunk status" "Verified the operating system must protect against an individual falsely denying having performed a particular action. In order to do so the system must be configured to send audit records to a remote audit server. This server uses Splunkforwarder to accomplish this directive, 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."
elif [[ -n $(grep audit.notice /etc/syslog.conf | grep -v '^\s*#') ]]; then
pass "$rule" "auditconfig -getplugin | grep audit_syslog | grep '(active)'; grep audit.notice /etc/syslog.conf | grep -v '^\s*#'" "Verified the operating system must protect against an individual falsely denying having performed a particular action. In order to do so the system must be configured to send audit records to a remote audit server, 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" "auditconfig -getplugin | grep audit_syslog; /etc/init.d/splunk status; grep audit.notice /etc/syslog.conf | grep -v '^\s*#'" "Verified the operating system does NOT protect against an individual falsely denying having performed a particular action. In order to do so the system must be configured to send audit records to a remote audit server, 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
fail "$rule" "auditconfig -getplugin | grep audit_syslog; /etc/init.d/splunk status; grep audit.notice /etc/syslog.conf | grep -v '^\s*#'" "Verified the operating system does NOT protect against an individual falsely denying having performed a particular action. In order to do so the system must be configured to send audit records to a remote audit server, 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
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47831 ###
resetRule "SV-60705r1_rule"
zero "$rule" "logins -S files | awk '{print\$1}' | grep -v root | xargs -i userattr audit_flags {$1}" "Verified the auditing system does NOT define a different auditing level for specific users, 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." "Users listed had flags returned. Verified the auditing system defines a different auditing level for specific users, 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-47835 ###
resetRule "SV-60709r1_rule"
sendmailWarn=""
if [[ -n $(zonename | grep global) ]]; then
sendmailWarn=$(/usr/lib/sendmail -bv audit_warn 2>&1)
if [[ $sendmailWarn != "" ]]; then
nonzero "$rule" "echo \"$sendmailWarn\" | grep -v 'User unknown'" "Verified the audit system must alert the SA when the audit storage volume approaches its capacity, 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 the SA when the audit storage volume approaches its capacity, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "/usr/lib/sendmail -bv audit_warn"
else
fail "$rule" "/usr/lib/sendmail -bv audit_warn" "Verified the audit system does NOT alert the SA when the audit storage volume approaches its capacity, 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
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
# Using sendmailWarn in 60717 and 60719
#unset sendmailWarn
### V-47837 ###
resetRule "SV-60711r1_rule"
if [[ -n $(zonename | grep global) ]]; then
zero "$rule" "auditconfig -getpolicy | grep active | grep perzone" "Verified the audit system must maintain a central audit trail for all zones, 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 maintain a central audit trail for all zones, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47839 ###
resetRule "SV-60713r1_rule"
if [[ -n $(zonename | grep global) ]]; then
nonzero "$rule" "auditconfig -getpolicy | grep active | grep zonename" "Verified the audit system must identify in which zone an event occurred, 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 identify in which zone an event occurred, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47841 ###
resetRule "SV-60715r1_rule"
if [[ -n $(zonename | grep global) ]]; then
zero "$rule" "zoneadm list | grep -v global | xargs -i sh -c \"if [[ -n \"{$1}\" ]]; then zonecfg -z \"{$1}\" info | grep dev;fi\"" "Verified the systems physical devices must not be assigned to non-global zones, 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 physical devices IS assigned to non-global zones, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "zoneadm list | grep -v global"
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47843 ###
resetRule "SV-60717r1_rule"
#sendmailWarn carried over from 60709
#sendmailWarn=""
if [[ -n $(zonename | grep global) ]]; then
#sendmailWarn=$(/usr/lib/sendmail -bv audit_warn 2>&1)
if [[ $sendmailWarn != "" ]]; then
nonzero "$rule" "echo \"$sendmailWarn\" | grep -v 'User unknown'" "Verified the audit system must alert the SA if there is any type of audit failure, 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 the SA if there is any type of audit failure, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "/usr/lib/sendmail -bv audit_warn"
else
fail "$rule" "/usr/lib/sendmail -bv audit_warn" "Verified the audit system does NOT alert the SA if there is any type of audit failure, 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
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
#unset sendmailWarn
### V-47845 ###
resetRule "SV-60719r1_rule"
#sendmailWarn carried over from previous item
#sendmailWarn=""
if [[ -n $(zonename | grep global) ]]; then
#sendmailWarn=$(/usr/lib/sendmail -bv audit_warn 2>&1)
if [[ -n $(/usr/lib/sendmail -bv audit_warn) ]]; then
nonzero "$rule" "echo \"$sendmailWarn\" | grep -v 'User unknown'" "Verified the OS must alert designated organizational officials in the event of an audit processing failure, 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 OS does NOT alert designated organizational officials in the event of an audit processing failure, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "/usr/lib/sendmail -bv audit_warn"
else
fail "$rule" "/usr/lib/sendmail -bv audit_warn" "Verified the OS does NOT alert designated organizational officials in the event of an audit processing failure, 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
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
unset sendmailWarn
### V-47857 ###
resetRule "SV-60731r2_rule"
if [[ -n $(zonename | grep global) ]]; then
if [[ -n $(auditconfig -getplugin audit_binfile | awk -F';' '{print$4}' | awk -F'=' '{print$2}' | awk '$0>=2') ]]; then
if [[ -n $(zfs get -H compression,quota,reservation $(df -h $(auditconfig -getplugin audit_binfile | awk -F';' '{print $2}' | awk -F'=' '{print $2}') | awk -F' ' '{print $1}' | tail -1) | egrep '(compression'.'off|quota'.'none|reservation'.'none)') ]]; then
fail "$rule" "zfs get compression,quota,reservation $(df -h $(auditconfig -getplugin audit_binfile | awk -F';' '{print $2}' | awk -F'=' '{print $2}') | awk -F' ' '{print $1}' | tail -1)" "Verified the operating system does NOT allocate audit record storage capacity, 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" "zfs get compression,quota,reservation $(df -h $(auditconfig -getplugin audit_binfile | awk -F';' '{print $2}' | awk -F'=' '{print $2}') | awk -F' ' '{print $1}' | tail -1)" "Verified the operating system does allocate audit record storage capacity, 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
else
fail "$rule" "auditconfig -getplugin audit_binfile" "Verified the operating system does NOT allocate audit record storage capacity, 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
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47863 ###
resetRule "SV-60737r2_rule"
if [[ -n $(zonename | grep global) ]]; then
if [[ -n $(auditconfig -getpolicy | grep ahlt) && -z $(auditconfig -getpolicy | grep active | grep cnt) ]]; then
pass "$rule" "auditconfig -getpolicy | grep ahlt; auditconfig -getpolicy | grep active | grep cnt" "Verified the operating system must shut down by default upon audit failure (unless availability is an overriding concern), 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" "auditconfig -getpolicy | grep ahlt; auditconfig -getpolicy | grep active | grep cnt" "Verified the operating system does NOT shut down by default upon audit failure (unless availability is an overriding concern), 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
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47869 ###
resetRule "SV-60741r1_rule"
if [[ -n $(zonename | grep global) ]]; then
auditDir=$(readlink -f $(auditconfig -getplugin audit_binfile | awk -F';' '{print$2}' | awk -F'=' '{print$2}' | sed '/^\s*$/d'))
auditPerm=$(stat -c '%a' $auditDir)
nonzero "$rule" "ls -ld $auditDir | awk '(\$3==\"root\"&&\$4==\"root\"){print}' && echo \"$auditPerm\" | awk '\$0<=640'" "Verified the operating system must protect audit information from unauthorized read access, 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 protect audit information from unauthorized read access, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "ls -ld $auditDir"
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
#auditDir and auditPerm used in subsequent checks
#unset auditDir auditPerm
### V-47875 ###
resetRule "SV-60747r1_rule"
#auditDir and auditPerm from previous check used
if [[ -n $(zonename | grep global) ]]; then
nonzero "$rule" "ls -ld $auditDir | awk '(\$3==\"root\"&&\$4==\"root\"){print}' && echo \"$auditPerm\" | awk '\$0<=640'" "Verified the operating system must protect audit information from unauthorized modification, 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 protect audit information from unauthorized modification, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "ls -ld $auditDir"
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
#auditDir and auditPerm used in subsequent checks
### V-47879 ###
resetRule "SV-60751r1_rule"
#auditDir and auditPerm from previous check used
if [[ -n $(zonename | grep global) ]]; then
nonzero "$rule" "ls -ld $auditDir | awk '(\$3==\"root\"&&\$4==\"root\"){print}' && echo \"$auditPerm\" | awk '\$0<=640'" "Verified the operating system must protect audit information from unauthorized deletion, 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 protect audit information from unauthorized deletion, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "ls -ld $auditDir"
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
unset auditDir auditPerm
### V-47881 ###
resetRule "SV-60753r2_rule"
nonzero "$rule" "pkg update -n | grep \"No updates available for this image\"; beadm list" "Verified the System packages must be up to date with the most recent vendor updates and security fixes, 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 packages is NOT up to date with the most recent vendor updates and security fixes, 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-47883 ###
resetRule "SV-60755r1_rule"
nonzero "$rule" "pkg property | grep signature-policy | grep verify" "Verified the system must verify that package updates are digitally signed, 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 verify that package updates are digitally signed, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
### V-47885 ###
resetRule "SV-60757r1_rule"
pkgverErr=""
if [[ -n $(pkg property | grep signature-policy | grep -i verify) ]]; then
echo "Running PKG VERIFY, this may take a while" >> /dev/tty
pkgverErr=$(pkg verify 2>/dev/null | sed '/[Ee][Rr][Rr][Oo][Rr]/ {;N;s/\n.*/&\\n/;}')
zero "$rule" "$(echo \"$pkgverErr\")" "Verified the operating system protects audit tools from unauthorized access and is configured with the vendor-provided files, permissions, and ownerships, 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 protects audit tools from unauthorized access however, the system may not be configured with the vendor-provided files, permissions, and ownerships, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "pkg verify 2>/dev/null | grep -i Error"
else
fail "$rule" "pkg property | grep signature-policy | grep -i verify" "Verified the operating system does NOT protect audit tools from unauthorized access, 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-47887 ###
resetRule "SV-60759r1_rule"
if [[ -n $(pkg property | grep signature-policy | grep -i verify) ]]; then
zero "$rule" "$(echo \"$pkgverErr\")" "Verified the operating system protects audit tools from unauthorized modification and is configured with the vendor-provided files, permissions, and ownerships, 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 protects audit tools from unauthorized modification however, the system may not be configured with the vendor-provided files, permissions, and ownerships, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "pkg verify 2>/dev/null | grep -i Error"
else
fail "$rule" "pkg property | grep signature-policy | grep -i verify" "Verified the operating system does NOT protect audit tools from unauthorized access, 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-47889 ###
resetRule "SV-60761r1_rule"
if [[ -n $(pkg property | grep signature-policy | grep -i verify) ]]; then
zero "$rule" "$(echo \"$pkgverErr\")" "Verified the operating system protects audit tools from unauthorized deletion and is configured with the vendor-provided files, permissions, and ownerships, 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 protects audit tools from unauthorized deletion however, the system may not be configured with the vendor-provided files, permissions, and ownerships, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "pkg verify 2>/dev/null | grep -i Error"
else
fail "$rule" "pkg property | grep signature-policy | grep -i verify" "Verified the operating system does NOT protect audit tools from unauthorized access, 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-47891 ###
resetRule "SV-60763r1_rule"
if [[ -n $(pkg property | grep signature-policy | grep -i verify) ]]; then
zero "$rule" "$(echo \"$pkgverErr\")" "Verified the operating system is configured with the vendor-provided files, permissions, and ownerships, 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 may not be configured with the vendor-provided files, permissions, and ownerships, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "pkg verify 2>/dev/null | grep -i Error"
else
fail "$rule" "pkg property | grep signature-policy | grep -i verify" "Verified the operating system does NOT protect audit tools from unauthorized access, 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
unset pkgverErr
### V-47893 ###
resetRule "SV-60765r1_rule"
zero "$rule" "pkg list service/network/finger | grep '\d*'" "Verified the finger daemon package is NOT installed, 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 finger daemon package IS installed, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "pkg list service/network/finger"
### V-47895 ###
resetRule "SV-60767r3_rule"
testFail=false
output=""
if [[ -n $(zoneadm list | grep -v global) ]]; then
zones=$(zoneadm list | grep -v global)
for i in $zones; do
if [[ -z $(zoneadm list -cv | grep $i | grep solaris-kz) ]]; then
if [[ -n $(zonecfg -z $i info | grep limitpriv | grep default) ]]; then
$nothing
else
testFail=true
output+="$i ; "
fi
fi
done
if [[ $testFail = "true" ]]; then
fail "$rule" "$(echo $output); echo 'Zones listed have limitpriv not set to vendor defaults'" "Verified the limitpriv zone option is NOT set to the vendor default 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" "zoneadm list -vi | grep -v global" "Verified the limitpriv zone option IS set to the vendor default 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
else
pass "$rule" "zoneadm list -vi | grep -v global" "Verified non-global zones do not exist on the system, 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 output
### V-47897 ###
resetRule "SV-60769r1_rule"
zero "$rule" "pkg verify system/zones 2>/dev/null | grep -i Error" "Verified the /etc/zones directory, and its contents, have the vendor default owner, group, and permissions, 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/zones directory, and its contents, do NOT have the vendor default owner, group, and permissions, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "pkg verify system/zones"
### V-47899 ###
resetRule "SV-60771r1_rule"
pass "$rule" "cat /etc/project | awk -F: '{print$2}' | xargs -i prctl -P -i project {$1}" "Verified the operating system manages excess capacity, bandwidth, or other redundancy to limit the effects of information flooding types of denial of service attacks, 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-47901 ###
resetRule "SV-60773r1_rule"
zero "$rule" "pkg list service/network/legacy-remote-utilities | grep '\d*'" "Verified the legacy remote network access utilities daemons is NOT installed, 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 legacy remote network access utilities daemons IS installed, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "pkg list service/network/legacy-remote-utilities"
### V-47903 ###
resetRule "SV-60775r1_rule"
pass "$rule" "" "Verified the operating system identifies potentially security-relevant error conditions, 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-47905 ###
resetRule "SV-60777r1_rule"
zero "$rule" "pkg list service/network/nis | grep '\d*'" "Verified the NIS package is NOT installed, 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 NIS package IS installed, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "pkg list service/network/nis"
### V-47907 ###
resetRule "SV-60779r1_rule"
pass "$rule" "" "Verified the operating system verifies the correct operation of security functions in accordance with organization-defined conditions and in accordance with organization-defined frequency (if periodic verification), 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-47909 ###
resetRule "SV-60781r1_rule"
zero "$rule" "pkg list communication/im/pidgin | grep '\d*'" "Verified the pidgin IM client package is NOT installed, 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 pidgin IM client package IS installed, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "pkg list communication/im/pidgin"
### V-47911 ###
resetRule "SV-60783r1_rule"
zero "$rule" "pkg list service/network/ftp | grep '\d*'" "Verified the FTP daemon package is NOT installed, 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 FTP daemon package IS installed, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "pkg list service/network/ftp"
### V-47913 ###
resetRule "SV-60785r2_rule"
zero "$rule" "pkg list service/network/tftp | grep '\d*'" "Verified the tFTP daemon package is NOT installed, 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 tFTP daemon package IS installed, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "pkg list service/network/tftp"
### V-47915 ###
resetRule "SV-60787r2_rule"
zero "$rule" "pkg list service/network/telnet | grep '\d*'" "Verified the telnet service daemon package is NOT installed, 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 telnet service daemon package IS installed, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "pkg list service/network/telnet"
### V-47917 ###
resetRule "SV-60789r2_rule"
zero "$rule" "pkg list /service/network/uucp | grep '\d*'" "Verified the UUCP service daemon package is NOT installed, 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 UUCP service daemon package IS 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." "pkg list /service/network/uucp"
### V-47919 ###
resetRule "SV-60791r2_rule"
nonzero "$rule" "svcprop -p config/local_only network/rpc/bind | grep true" "Verified the rpcbind service IS configured for local only services unless organizationally defined, 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 rpcbind service is NOT configured for local only services unless organizationally defined, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "svcprop -p config/local_only network/rpc/bind"
### V-47921 ###
resetRule "SV-60793r1_rule"
zero "$rule" "pkg list x11/server/xvnc | grep '\d*'" "Verified the VNC server package is NOT installed, 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 VNC server package IS 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." "pkg list x11/server/xvnc"
### V-47923 ###
resetRule "SV-60795r1_rule"
if [[ -z $(pkg history -o finish,user,operation,command | grep '/usr/bin/packagemanager install') ]]; then
pass "$rule" "pkg history -o finish,user,operation,command | grep '/usr/bin/packagemanager install'" "Verified the operating system must employ automated mechanisms, per organization-defined frequency, to detect the addition of unauthorized components/devices into the operating system, therefore the reference STIG is NOT a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
nr "$rule" "pkg history -o finish,user,operation,command | grep '/usr/bin/packagemanager install' | awk '{print\$NF}'" "Verified the operating system must employ automated mechanisms, per organization-defined frequency, to detect the addition of unauthorized components/devices into the operating system. If any Packagemanager installed software packages are listed, verify software packages installed are authorized"
fi
### V-47925 ###
resetRule "SV-60797r1_rule"
nr "$rule" "pkg list" "Verified the operating system must be configured to provide essential capabilities. Verify all software packages installed are authorized."
### V-47927 ###
resetRule "SV-60799r1_rule"
nr "$rule" "pkg list" "Verified the operating system must be configured to provide essential capabilities. Verify all software packages installed are authorized."
### V-47929 ###
resetRule "SV-60801r1_rule"
zero "$rule" "svcprop -p options/tcp_listen svc:/application/x11/x11-server | grep true" "Verified the graphical login service either is disabled or doesn't exist, 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 graphical login service either is NOT disabled, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "svcprop -p options/tcp_listen svc:/application/x11/x11-server"
### V-47931 ###
resetRule "SV-60803r1_rule"
zero "$rule" "svcs -Ho state svc:/network/rpc/gss | grep online" "Verified generic Security Services (GSS) IS disabled, 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 generic Security Services (GSS) is NOT disabled, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "svcs -Ho state svc:/network/rpc/gss"
### V-47933 ###
resetRule "SV-60805r1_rule"
nr "$rule" "svcs -a | grep online" "Document all enabled services and disable any that are not required."
### V-47935 ###
resetRule "SV-60807r2_rule"
if [[ -n $(inetadm -p | grep tcp_wrappers | grep -i false) ]]; then
if [[ (-f /etc/hosts.deny && -n $(grep -v '^#' /etc/hosts.deny)) && (-f /etc/hosts.allow && -n $(grep -v '^#' /etc/hosts.allow)) ]]; then
fail "$rule" "inetadm -p | grep tcp_wrappers; egrep -v '\(^#|^\$|^\\s+\$\)' /etc/hosts.*" "Verified TCP Wrappers are NOT enabled and configured per site policy to only allow access by approved hosts and services. However hosts.allow and hosts.deny ARE configured correctly, 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" "inetadm -p | grep tcp_wrappers; egrep -v '\(^#|^\$|^\\s+\$\)' /etc/hosts.*" "Verified TCP Wrappers are NOT enabled and configured per site policy to only allow access by approved hosts and services, and hosts.allow and/or hosts.deny are NOT configured correctly, 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 [[ (-f /etc/hosts.deny && -n $(grep -v '^#' /etc/hosts.deny)) && (-f /etc/hosts.allow && -n $(grep -v '^#' /etc/hosts.allow)) ]]; then
pass "$rule" "inetadm -p | grep tcp_wrappers; egrep -v '\(^#|^\$|^\\s+\$\)' /etc/hosts.*" "Verified TCP Wrappers IS enabled and configured per site policy to only allow access by approved hosts and services, and hosts.allow and hosts.deny ARE configured correctly, 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" "inetadm -p | grep tcp_wrappers; egrep -v '\(^#|^\$|^\\s+\$\)' /etc/hosts.*" "Verified TCP Wrappers IS enabled and configured per site policy to only allow access by approved hosts and services. However, hosts.allow and/or hosts.deny are NOT configured correctly, 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
### V-47937 ###
resetRule "SV-60809r1_rule"
pass "$rule" "which pfedit" "Verified all manual editing of system-relevant files shall be done using the pfedit command, which logs changes made to the files, 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-47939 ###
resetRule "SV-60811r1_rule"
if [[ -n $(zonename | grep global) ]]; then
zero "$rule" "svcs -Ho state svc:/system/filesystem/rmvolmgr:default | grep online" "Verified the operating system must disable information system functionality that provides the capability for automatic execution of code on mobile devices without user direction, 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 disable information system functionality that provides the capability for automatic execution of code on mobile devices without user direction, the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "svcs -Ho state svc:/system/filesystem/rmvolmgr:default"
else
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47941 ###
resetRule "SV-60813r1_rule"
if [[ -n $(zonename | grep global) ]]; then
if [[ -n $(auditconfig -getplugin | grep audit_syslog | grep '(active)') ]]; then
if [[ -n $(/etc/init.d/splunk status) ]]; then
pass "$rule" "auditconfig -getplugin | grep audit_syslog; /opt/splunkforwarder/bin/splunk btool deploymentclient list | grep targetUri | grep -v '^#'" "Verified the OS backs up audit records at least every seven days onto a different system or system component other than the system or component being audited. Audit logs are archived via Splunkforwarder service, per NSO requirement. 'system-log' is sending messages to local filesystems and specific messages to remote server for Splunkforwarder constantly, 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."
elif [[ -n $(grep audit.notice /etc/syslog.conf | grep -v '^\s*#') ]]; then
pass "$rule" "auditconfig -getplugin | grep audit_syslog; grep audit.notice /etc/syslog.conf | grep -v '^\s*#'" "Verified the OS backs up audit records at least every seven days onto a different system or system component other than the system or component being audited. 'system-log' is sending messages to local filesystems and specific messages to a remote server constantly, 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" "auditconfig -getplugin | grep audit_syslog; /etc/init.d/splunk status; grep audit.notice /etc/syslog.conf | grep -v '^\s*#'" "Verified the OS does NOT backup audit records at least every seven days onto a different system or system component other than the system or component being audited. 'system-log' is NOT sending messages to local filesystems and specific messages to a remote server constantly, 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
fail "$rule" "auditconfig -getplugin | grep audit_syslog; /etc/init.d/splunk status; grep audit.notice /etc/syslog.conf | grep -v '^\s*#'" "Verified the operating system does NOT backup audit records at least every seven days onto a different system or system component other than the system or component being audited. 'system-log' is NOT sending messages to local filesystems and specific messages to a remote server constantly, 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
na "$rule" "zonename | grep global" "Zone is not global, therefore the reference STIG is Not Applicable"
fi
### V-47943 ###
resetRule "SV-60815r2_rule"
userString=$(logins -S files -ox | awk -F: '($1!="root"&&$8!="LK"&&$8!="NL"&&$11!="56"){print"User: "$1" Group: "$3" MaxDays: "$11}')
uinsString=$(echo "$userString" | awk '{print$2}' | xargs -i sh -c "if [[ -n \$(grep "{$1}" /etc/ssh/sshd_config | grep -v '^#') ]]; then echo \"User "{$1}" is allowed to login directly.\";fi")
ginsString=$(echo "$userString" | awk '{print$4}' | xargs -i sh -c "if [[ -n \$(grep "{$1}" /etc/ssh/sshd_config | grep -v '^#') ]]; then echo \"Group "{$1}" is allowed to login directly.\";fi")
if [[ $(grep '^MAXWEEKS=' /etc/default/passwd | awk -F'=' '{print$2}') -le 8 ]]; then
if [[ -z $uinsString && -z $ginsString ]]; then
pass "$rule" "grep \"^MAXWEEKS\" /etc/default/passwd; echo \"\$userString\"; echo \"\$uinsString\"; echo \"\$ginsString\" | uniq" "Verified user passwords must be changed at least every 56 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."
else
fail "$rule" "grep \"^MAXWEEKS\" /etc/default/passwd; echo \"\$userString\"; echo \"\$uinsString\"; echo \"\$ginsString\" | uniq" "Verified user passwords must be changed at least every 56 days, however User accounts listed are set other than 56 days; also listed are these users/groups that can login directly, therefore the reference STIG IS a finding. Please verify the user accounts listed, require to have an expiration other than 56 days and also whether they should be able to login directly. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
else
if [[ -z $uinsString && -z $ginsString ]]; then
fail "$rule" "grep \"^MAXWEEKS\" /etc/default/passwd; echo \"\$userString\"; echo \"\$uinsString\"; echo \"\$ginsString\" | uniq" "Verified user passwords are NOT required to be changed at least every 56 days, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was correct by default and/or no change was necessary."
else
fail "$rule" "grep \"^MAXWEEKS\" /etc/default/passwd; echo \"\$userString\"; echo \"\$uinsString\"; echo \"\$ginsString\" | uniq" "Verified user passwords are NOT required to be changed at least every 56 days, also User accounts listed are set other than 56 days; also listed are these users/groups that can login directly, therefore the reference STIG IS a finding. Please verify the user accounts listed, require to have an expiration other than 56 days and also whether they should be able to login directly. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
fi
fi
unset userString uinsString ginsString
### V-47945 ###
resetRule "SV-60817r1_rule"
na "$rule" "ls -l /opt/McAfee" "Verified a working McAfee HIPS is not available for Solaris 11, but we do install the other portions that are supported (CMA, ACCM, etc.), therefore the referenced STIG is Not Applicable"
### V-47947 ###
# Removed from Solaris 11 STIG V1R20
#resetRule "SV-60819r1_rule"
#na "$rule" "ls -l /opt/McAfee" "Verified a working McAfee HIPS is not available for Solaris 11, but we do install the other portions that are supported (CMA, ACCM, etc.), therefore the referenced STIG is Not Applicable"
### V-47949 ###
resetRule "SV-60821r1_rule"
nr "$rule" "logins -S files -aox |awk -F: '(\$14 == \"0\") {print}' | sed 's/&//g'" "Manually Verify the accounts listed are not temporary accounts. Verified the operating system automatically terminates temporary accounts within 72 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."
### V-47951 ###
resetRule "SV-60823r1_rule"
na "$rule" "ls -l /opt/McAfee" "Verified a working McAfee HIPS is not available for Solaris 11, but we do install the other portions that are supported (CMA, ACCM, etc.), therefore the referenced STIG is Not Applicable"
### V-47953 ###
resetRule "SV-60825r2_rule"
users=$(awk -F: '$4 < 1 {print $1}' /etc/shadow | grep -v 'nobody' | grep -v 'noaccess')
output=""
testFail=false
for i in $users; do
if [[ $(id -u $i) -ge 100 ]]; then
output+="$i ; "
testFail=true
else
$nothing
fi
done
if [[ $testFail = "true" ]]; then
fail "$rule" "$(grep ^MINWEEKS /etc/default/passwd | grep -v '^\s*#');\n\n$(echo $output)" "Users listed do not have minimum password lifetime restrictions. Verified the operating system does NOT enforce minimum password lifetime restrictions. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
else
nonzero "$rule" "grep ^MINWEEKS /etc/default/passwd | grep -v '^\s*#' | grep 1" "Verified the operating system must enforce minimum password lifetime restrictions, 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 minimum password lifetime restrictions, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary." "grep ^MINWEEKS /etc/default/passwd"
fi
unset testFail output users
### V-47955 ###
resetRule "SV-60827r3_rule"
if [[ -f /home/nso/uvscan/uvscan ]]; then
pass "$rule" "/home/nso/uvscan/uvscan --version" "Verified the operating system must have malicious code protection mechanisms at system entry and exit points to detect and eradicate malicious code transported by electronic mail, electronic mail attachments, web accesses, removable media, or other common means, 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."
elif [[ -f /usr/local/uvscan/uvscan ]]; then
pass "$rule" "/usr/local/uvscan/uvscan --version" "Verified the operating system must have malicious code protection mechanisms at system entry and exit points to detect and eradicate malicious code transported by electronic mail, electronic mail attachments, web accesses, removable media, or other common means, 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" "echo \"uvscan not found\"" "Verified the operating system does NOT have malicious code protection mechanisms at system entry and exit points to detect and eradicate malicious code transported by electronic mail, electronic mail attachments, web accesses, removable media, or other common means, 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-47957 ###
resetRule "SV-60829r1_rule"
nonzero "$rule" "grep ^PASSLENGTH /etc/default/passwd | grep -v '^\s*#' | awk -F'=' '\$2 >= 15'" "Verified user passwords ARE required to be at least 15 characters in length, 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 user passwords is NOT at least 15 characters in length, 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-47959 ###
resetRule "SV-60831r3_rule"
if [[ -f /home/nso/uvscan/uvscan ]]; then
nonzero "$rule" "find /home/nso/uvscan/ -name avv*.dat -mtime -7 -type f" "Verified uvscan is installed, dat files are NOT more then 10 days old and configured correctly, 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 uvscan is installed however dat files are more then 10 days old and therefore NOT configured correctly, therefore the reference STIG IS a finding. Engineer did NOT apply a change. Setting was incorrect by default and/or no change was necessary."
elif [[ -f /usr/local/uvscan/uvscan ]]; then
nonzero "$rule" "find /usr/local/uvscan/ -name avv*.dat -mtime -7 -type f" "Verified uvscan is installed, dat files are NOT more then 10 days old and configured correctly, 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 uvscan is installed however dat files are more then 10 days old and therefore NOT configured correctly, 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" "echo \"uvscan not found\"" "Verified the operating system does NOT have malicious code protection mechanisms at system entry and exit points to detect and eradicate malicious code transported by electronic mail, electronic mail attachments, web accesses, removable media, or other common means, 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-47961 ###
resetRule "SV-60833r1_rule"
nonzero "$rule" "grep ^HISTORY /etc/default/passwd | grep -v '^\s*#' | awk -F'=' '\$2 >= 5'" "Verified users must not reuse the last 5 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 users reuse the last 5 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." "grep ^HISTORY /etc/default/passwd"