-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.yaml
9552 lines (9539 loc) · 346 KB
/
config.yaml
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
id: 'opencspm-darkbit-enterprise-controls'
title: 'Darkbit Enterprise Controls'
description: 'This checks custom things'
controls:
- id: darkbit-aws-4
title: RDS Clusters Should Span Multiple Availability Zones
description:
All RDS Clusters that serve as a critical component of the infrastructure
should be running in multiple availability-zones to maintain availability during
zone failures or underlying hardware failures.
remediation:
Convert all critical RDS Instances to span multiple availability zones. For
non-SQL Server or Amazon Aurora instance types, this can be performed online without
downtime, although performance degradation will occur during the process.
validation: |
Run `aws rds describe-db-clusters --region <region> --output json |
jq -r '.DBClusters[] | select(.Engine!="docdb") | "(.DBClusterArn) (.MultiAZ)"'`
and `aws rds describe-db-instances --region <region> --output json | jq -r '.DBInstances[]
| select(.Engine!="docdb") | "(.DBInstanceArn) (.MultiAZ)"'` and ensure that all
entries are `true`.
impact: 8
nodes:
- PLACEHOLDER
refs:
- text: RDS Multiple Availability Zones
url: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.MultiAZ.html
tags:
- aws-cfg:
- aws-cfg-rds-multi-az-support
- nist-csf:
- nist-csf-id
- nist-csf-id.be
- nist-csf-id.be-5
- nist-csf-pr
- nist-csf-pr.ds
- nist-csf-pr.ds-4
- nist-csf-pr.pt
- nist-csf-pr.pt-5
- nist-800-53-rev4:
- nist-800-53-rev4-CP-10
- nist-800-53-rev4-SC-5
- nist-800-53-rev4-SC-36
- nist-800-171:
- nist-800-171-3.13.2
- hipaa:
- hipaa-164.308(a)(1)(ii)(B)
- hipaa-164.308(a)(7)(i)
- fedramp-moderate:
- fedramp-moderate-CP-10
- fedramp-moderate-SC-5
- fedramp-low:
- fedramp-low-CP-10
- cmmc-level5:
- cmmc-level5-SC.3.180
- cmmc-level5-RE.5.140
- cmmc-level4:
- cmmc-level4-SC.3.180
- cmmc-level3:
- cmmc-level3-SC.3.180
- aws-wa-reliability:
- aws-wa-reliability-REL-10
- aws
- id: darkbit-aws-7
title: Custom IAM Policies Should Not Allow Escalation to Admin
description:
A custom IAM policy was created that allows administrative access or
specific permissions that allow escalation to administrative permissions. For
example, `iam:*`, `sts:AssumeRole` on `*` resources, or `iam:PassRole` in combination
with `ec2:runInstances` or `lambda:*`. This can indicate a misconfiguration that
accidentally overgrants highly privileged access.
remediation:
Review the IAM policy for accuracy and necessity. Refactor the policy
and avoid granting `iam:*` or `sts:AssumeRole` on `*` resources as it provides
a "sudo"-like ability to become the account administrator. Consider removing
the custom IAM policy and assigning the "AdministratorAccess" policy instead if
full permissions are absolutely necessary.
validation: N/A
impact: 8
nodes:
- PLACEHOLDER
refs:
- text: Administrator IAM
url: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html#jf_administrator
tags:
- nist-csf:
- nist-csf-pr
- nist-csf-pr.ac
- nist-csf-pr.ac-4
- aws
- id: darkbit-aws-14
title: Managed Streaming Kafka Instances Should Require Authentication
description:
Amazon Managed Streaming Kafka instances are not configured to require
authentication via client certificates. Access control is performed solely via
network level restrictions. In the event of a compromise, an attacker would have
direct access to these datastores from inside the VPC to be able to exfiltrate
sensitive contents or manipulate/disrupt their operation.
remediation:
Configure all Managed Streaming Kafka cluster instances with client
certificate authentication. Validate that all client software and libraries that
interface with these services have support for authentication, and implement the
necessary functionality, if possible. Reconfigure all deployments to leverage
these credentials.
validation:
Run `aws kafka list-clusters --region <region> --output json | jq -r
'.ClusterInfoList[] | "(.ClusterArn) (.ClientAuthentication.Tls.CertificateAuthorityArnList[])"'`
and ensure a CA ARN is listed for every cluster.
impact: 5
nodes:
- PLACEHOLDER
refs:
- text: Managed Streaming Kafka Authentication
url: https://docs.aws.amazon.com/msk/latest/developerguide/msk-authentication.html
tags:
- nist-csf:
- nist-csf-pr
- nist-csf-pr.ac
- nist-csf-pr.ac-6
- nist-csf-pr.ds
- nist-csf-pr.ds-5
- nist-csf-pr.ip
- nist-csf-pr.ip-1
- aws
- id: darkbit-aws-15
title: Users Should Not Have Unused Access Keys
description:
AWS Access Keys that have never been used represent an unnecessary
exposure of valid credentials and should be removed.
remediation:
Remove the access keys that have never been used, and inform users
that they can create access keys via the UI when necessary in the future.
validation:
Run `aws iam get-credential-report --output text | base64 -d | grep
-v "^<root_account>" | awk -F, '{print $1 " "$11 " "$16}' | grep " N/A N/A"` and
ensure no entries are present.
impact: 2
nodes:
- PLACEHOLDER
refs:
- text: AWS Access Keys
url: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html
tags:
- nist-csf:
- nist-csf-pr
- nist-csf-pr.ac
- nist-csf-pr.ac-1
- nist-csf-pr.ac-4
- aws
- id: darkbit-aws-16
title: Inline IAM Role Policies Should Not Allow Wildcard Actions
description:
AWS IAM Role policies attached to IAM roles should be scoped to least-privileged
access and avoid the use of wildcards to ensure the original intention of the
policy is not modified over time. Should AWS add a new action to an existing
API, the original policy will automatically grant access, and that might not be
desired.
remediation:
Review the IAM Policy and replace the wildcard entry with the specific
permissions desired.
validation: N/A
impact: 2
nodes:
- PLACEHOLDER
refs:
- text: IAM Access Control
url: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_controlling.html
- text: IAM Policy Actions and Resources
url: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_actions-resources-contextkeys.html
tags:
- nist-csf:
- nist-csf-pr
- nist-csf-pr.ac
- nist-csf-pr.ac-4
- aws
- id: darkbit-aws-19
title: Users Should Have Logged in Within the Past 90 Days
description:
Users inactive for the past three months are often an indication that
their account is no longer required and the risk of exposure of their credentials
is unnecessary.
remediation:
Consider disabling or removing user accounts that are no longer in
use.
validation:
Run `aws iam get-credential-report --output text | base64 -d | awk -F,
'{print $2 ", "$5", "$11", "$16", "$22}'` and review the dates listed for lack
of use in the past 90 days.
impact: 2
nodes:
- PLACEHOLDER
refs:
- text: AWS Unused Credentials
url: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_finding-unused.html
tags:
- nist-csf:
- nist-csf-pr
- nist-csf-pr.ac
- nist-csf-pr.ac-1
- aws
- id: darkbit-aws-21
title: Security Groups Should Not Allow All Ports From All Hosts
description:
Security Groups that all all ports from any CIDR range are effectively
disabling firewall protection to the attached service or system.
remediation:
For each security group, review the application needs for protocols
and ports, and reconfigure the security group to only grant access to those.
validation:
Run `aws ec2 describe-security-groups --region <region> --query 'SecurityGroups[*]'
--output json | jq -r '.[] | . as $group | .IpPermissions[] | select(.IpRanges[].CidrIp=="0.0.0.0/0"
or .Ipv6Ranges[].CidrIpv6=="::/0") | select(.IpProtocol=="-1" or (.FromPort==null
and (.ToPort==null or .ToPort==65535))) | "($group.GroupName)"'` and ensure no
entries are listed.
impact: 5
nodes:
- PLACEHOLDER
refs:
- text: VPC Security Groups
url: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html
tags:
- aws-cfg:
- aws-cfg-restricted-common-ports
- aws-cfg-vpc-sg-open-only-to-authorized-ports
- pci-dss-3.2.1:
- pci-dss-3.2.1-1.2.1
- pci-dss-3.2.1-1.3
- nist-csf:
- nist-csf-PR.AC-3
- nist-csf-PR.AC-5
- nist-csf-PR.PT-4
- nist-csf-DE.AE-1
- nist-800-53-rev4:
- nist-800-53-rev4-AC-4
- nist-800-53-rev4-CM-2
- nist-800-53-rev4-SC-7
- nist-800-53-rev4-SC-7(3)
- nist-800-171:
- nist-800-171-3.1.1
- nist-800-171-3.1.14
- nist-800-171-3.1.2
- nist-800-171-3.1.20
- nist-800-171-3.1.3
- nist-800-171-3.13.1
- nist-800-171-3.13.2
- nist-800-171-3.13.6
- nist-800-171-3.4.7
- hipaa:
- hipaa-164.308(a)(1)(ii)(B)
- hipaa-164.312(e)(1)
- fedramp-moderate:
- fedramp-moderate-AC-4
- fedramp-moderate-CM-2
- fedramp-moderate-SC-7
- fedramp-moderate-SC-7(3)
- cmmc-level5:
- cmmc-level5-AC.1.001
- cmmc-level5-AC.1.003
- cmmc-level5-SC.1.175
- cmmc-level5-AC.2.016
- cmmc-level5-CM.3.068
- cmmc-level5-SC.3.180
- cmmc-level5-AC.4.023
- cmmc-level5-RM.4.151
- cmmc-level5-SC.5.230
- cmmc-level5-SC.5.208
- cmmc-level4:
- cmmc-level4-AC.1.001
- cmmc-level4-AC.1.003
- cmmc-level4-SC.1.175
- cmmc-level4-AC.2.016
- cmmc-level4-CM.3.068
- cmmc-level4-SC.3.180
- cmmc-level4-AC.4.023
- cmmc-level4-RM.4.151
- cmmc-level3:
- cmmc-level3-AC.1.001
- cmmc-level3-AC.1.003
- cmmc-level3-SC.1.175
- cmmc-level3-AC.2.016
- cmmc-level3-CM.3.068
- cmmc-level3-SC.3.180
- cmmc-level2:
- cmmc-level2-AC.1.001
- cmmc-level2-AC.1.003
- cmmc-level2-SC.1.175
- cmmc-level2-AC.2.016
- cmmc-level1:
- cmmc-level1-AC.1.001
- cmmc-level1-AC.1.003
- cmmc-level1-SC.1.175
- aws-wa-security:
- aws-wa-security-SEC-5
- aws
- id: darkbit-aws-22
title: Security Groups Should Not Allow Access to Postgresql TCP/5432 From All Hosts
description:
Database systems commonly hold critical application data, credentials,
and other sensitive information, and network access control is a key part of a
defense in depth strategy. Access to database systems over the network should
be restricted to the application systems and a small list of administrative systems
to increase the attack cost of accessing that data in a compromise.
remediation:
For each security group, review the application needs for applications
and administrative systems that access the database, and reconfigure the security
group to only grant access to those.
validation:
Run `aws ec2 describe-security-groups --region <region> --query 'SecurityGroups[*]'
--output json | jq -r --arg PROTO tcp --arg PORT 5432 '.[] | . as $group | .IpPermissions[]
| select(.IpRanges[].CidrIp=="0.0.0.0/0" or .Ipv6Ranges[].CidrIpv6=="::/0" or
.IpRanges==[] or .Ipv6Ranges==[]) | select((.IpProtocol==$PROTO or .IpProtocol=="-1")
and ((.FromPort==null or .FromPort<=($PORT|tonumber)) and (.ToPort==null or .ToPort>=($PORT|tonumber)))
and (.UserIdGroupPairs==[])) | "($group.GroupId) ($group.GroupName)"'` and ensure
no entries are present.
impact: 5
nodes:
- PLACEHOLDER
refs:
- text: RDS Security Groups
url: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.RDSSecurityGroups.html
tags:
- aws-cfg:
- aws-cfg-restricted-common-ports
- aws-cfg-vpc-sg-open-only-to-authorized-ports
- pci-dss-3.2.1:
- pci-dss-3.2.1-1.2.1
- pci-dss-3.2.1-1.3
- nist-csf:
- nist-csf-PR.AC-3
- nist-csf-PR.AC-5
- nist-csf-PR.PT-4
- nist-csf-DE.AE-1
- nist-800-53-rev4:
- nist-800-53-rev4-AC-4
- nist-800-53-rev4-CM-2
- nist-800-53-rev4-SC-7
- nist-800-53-rev4-SC-7(3)
- nist-800-171:
- nist-800-171-3.1.1
- nist-800-171-3.1.14
- nist-800-171-3.1.2
- nist-800-171-3.1.20
- nist-800-171-3.1.3
- nist-800-171-3.13.1
- nist-800-171-3.13.2
- nist-800-171-3.13.6
- nist-800-171-3.4.7
- hipaa:
- hipaa-164.308(a)(1)(ii)(B)
- hipaa-164.312(e)(1)
- fedramp-moderate:
- fedramp-moderate-AC-4
- fedramp-moderate-CM-2
- fedramp-moderate-SC-7
- fedramp-moderate-SC-7(3)
- cmmc-level5:
- cmmc-level5-AC.1.001
- cmmc-level5-AC.1.003
- cmmc-level5-SC.1.175
- cmmc-level5-AC.2.016
- cmmc-level5-CM.3.068
- cmmc-level5-SC.3.180
- cmmc-level5-AC.4.023
- cmmc-level5-RM.4.151
- cmmc-level5-SC.5.230
- cmmc-level5-SC.5.208
- cmmc-level4:
- cmmc-level4-AC.1.001
- cmmc-level4-AC.1.003
- cmmc-level4-SC.1.175
- cmmc-level4-AC.2.016
- cmmc-level4-CM.3.068
- cmmc-level4-SC.3.180
- cmmc-level4-AC.4.023
- cmmc-level4-RM.4.151
- cmmc-level3:
- cmmc-level3-AC.1.001
- cmmc-level3-AC.1.003
- cmmc-level3-SC.1.175
- cmmc-level3-AC.2.016
- cmmc-level3-CM.3.068
- cmmc-level3-SC.3.180
- cmmc-level2:
- cmmc-level2-AC.1.001
- cmmc-level2-AC.1.003
- cmmc-level2-SC.1.175
- cmmc-level2-AC.2.016
- cmmc-level1:
- cmmc-level1-AC.1.001
- cmmc-level1-AC.1.003
- cmmc-level1-SC.1.175
- aws-wa-security:
- aws-wa-security-SEC-5
- aws
- id: darkbit-aws-24
title: Unused Security Groups Should Not Be Defined
description:
Unused security groups do not present an immediate risk, they can and
should be removed to avoid confusion.
remediation:
Verify that the security groups are no longer in use and delete them
via the AWS console or CLI.
validation:
'Run `for i in $(aws ec2 describe-security-groups --region <region>
--output json | jq -r ''.SecurityGroups[].GroupId''); do echo -n "$i: "; aws ec2
describe-network-interfaces --region <region> --filters "Name=group-id,Values=${i}"
--query "length(NetworkInterfaces)" --output text; done` in each region and ensure
all non-default security groups have at least one attachment.'
impact: 2
nodes:
- PLACEHOLDER
refs:
- text: VPC Security Groups
url: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html
tags:
- aws-cfg:
- aws-cfg-ec2-security-group-attached-to-eni
- pci-dss-3.2.1:
- pci-dss-3.2.1-2.4
- nist-csf:
- nist-csf-PR.DS-3
- nist-800-171:
- nist-800-171-3.4.1
- cmmc-level5:
- cmmc-level5-CM.2.061
- cmmc-level4:
- cmmc-level4-CM.2.061
- cmmc-level3:
- cmmc-level3-CM.2.061
- cmmc-level2:
- cmmc-level2-CM.2.061
- aws-wa-security:
- aws-wa-security-SEC-5
- aws
- id: darkbit-aws-25
title: Elastic Load Balancers Should Have Logging Enabled
description:
Enabling access logging on the Elastic Load Balancer is useful for
detecting and investigating potential attacks, malicious activity, or misuse of
backend resources. Both PCI and HIPAA compliance standards require network access
logging to environments containing sensitive data.
remediation:
For each load balancer protecting an administrative web service or
a service that does not have native request logging, edit the Elastic Load Balancer
to enable access logging and point those logs to a designated S3 bucket for further
review and/or processing.
validation: |-
For ELBs, run `for i in $(aws elb describe-load-balancers --region <region> --query 'LoadBalancerDescriptions[*].LoadBalancerName' --output text); do echo -n "$i: "; aws elb describe-load-balancer-attributes --region <region> --load-balancer-name $i --query 'LoadBalancerAttributes.AccessLog.Enabled'; done` for each region and ensure each returns `true`.
For ELBv2, run `for i in $(aws elbv2 describe-load-balancers --region <region> --query 'LoadBalancerDescriptions[*].LoadBalancerArn' --output text); do echo -n "$i: "; aws elbv2 describe-load-balancer-attributes --region <region> --load-balancer-arn $i --query Attributes[*] --output text|grep "^access_logs.s3.enabled"|cut -f2; done` for each region and ensure each returns `true`.
impact: 2
nodes:
- PLACEHOLDER
refs:
- text: Load Balancer Access Logging
url: http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html
tags:
- aws-cfg:
- aws-cfg-elb-logging-enabled
- pci-dss-3.2.1:
- pci-dss-3.2.1-10.3.1
- pci-dss-3.2.1-10.3.2
- pci-dss-3.2.1-10.3.3
- pci-dss-3.2.1-10.3.4
- pci-dss-3.2.1-10.3.5
- pci-dss-3.2.1-10.3.6
- nist-csf:
- nist-csf-ID.AM-3
- nist-csf-PR.DS-5
- nist-csf-PR.PT-1
- nist-csf-DE.AE-1
- nist-csf-DE.AE-3
- nist-csf-DE.AE-4
- nist-csf-DE.CM-1
- nist-csf-DE.CM-7
- nist-800-53-rev4:
- nist-800-53-rev4-AU-2(a)(d)
- nist-800-53-rev4-AU-3
- nist-800-53-rev4-AU-12(a)(c)
- nist-800-171:
- nist-800-171-3.1.12
- nist-800-171-3.13.1
- nist-800-171-3.14.6
- nist-800-171-3.14.7
- nist-800-171-3.3.1
- hipaa:
- hipaa-164.308(a)(1)(ii)(D)
- hipaa-164.308(a)(3)(ii)(A)
- hipaa-164.308(a)(6)(ii)
- hipaa-164.312(b)
- fedramp-moderate:
- fedramp-moderate-AU-2(a)(d)
- fedramp-moderate-AU-3
- fedramp-moderate-AU-12(a)(c)
- fedramp-low:
- fedramp-low-AU-2
- cmmc-level5:
- cmmc-level5-AU.2.041
- cmmc-level5-AU.2.042
- cmmc-level5-SI.2.217
- cmmc-level5-AU.5.055
- cmmc-level5-SI.5.223
- cmmc-level4:
- cmmc-level4-AU.2.041
- cmmc-level4-AU.2.042
- cmmc-level4-SI.2.217
- cmmc-level3:
- cmmc-level3-AU.2.041
- cmmc-level3-AU.2.042
- cmmc-level3-SI.2.217
- cmmc-level2:
- cmmc-level2-AU.2.041
- cmmc-level2-AU.2.042
- cmmc-level2-SI.2.217
- aws-wa-security:
- aws-wa-security-SEC-4
- aws
- id: darkbit-aws-26
title: Application Load Balancers Should Have Web Application Firewall (WAF) Enabled
description:
The AWS Web Application Firewall (WAF) service implements application-specific
rules that block common attack patterns that can affect application availability,
compromise security, or consume excessive resources.
remediation:
For each application load balancer protecting an administrative web
service, edit the Application Load Balancer to enable the Web Application Firewall
protection.
validation:
'Run `for i in $(aws wafv2 list-web-acls --region <region> --output
json | jq -r ''.WebACLs[] | "(.WebACLId)"''); do echo -n "$i: "; aws wafv2 get-web-acl
--region <region> --web-acl-id $i; done` in each region. Then, run `aws wafv2
list-resources-for-web-acl --web-acl-arn <acl_arn>` and verify it maps to an active
load balancer.'
impact: 5
nodes:
- PLACEHOLDER
refs:
- text: ALB Web Application Firewalls
url: https://aws.amazon.com/blogs/aws/aws-web-application-firewall-waf-for-application-load-balancers/
- text: WAF Security Automations
url: https://aws.amazon.com/solutions/aws-waf-security-automations/
tags:
- aws-cfg:
- aws-cfg-alb-waf-enabled
- nist-800-53-rev4:
- nist-800-53-rev4-SC-7
- nist-800-53-rev4-SI-4(a)(b)(c)
- nist-800-171:
- nist-800-171-3.13.1
- fedramp-moderate:
- fedramp-moderate-SC-7
- fedramp-moderate-SI-4(a)(b)(c)
- fedramp-low:
- fedramp-low-SC-7
- cmmc-level2:
- cmmc-level2-AC.1.003
- cmmc-level2-SI.2.216
- cmmc-level1:
- cmmc-level1-AC.1.003
- aws-wa-security:
- aws-wa-security-SEC-5
- nist-csf:
- nist-csf-pr
- nist-csf-pr.ds
- nist-csf-pr.ds-2
- nist-csf-pr.ds-5
- nist-csf-pr.pt
- nist-csf-pr.pt-4
- nist-csf-pr.pt-5
- aws
- id: darkbit-aws-27
title: Security Groups Should Not Allow Ingress From All Hosts
description:
AWS Security Groups that permit inbound/ingress access from any IP
address (0.0.0.0/0) should be reviewed for necessity to prevent unintended exposure
of services and systems protected by that security group.
remediation:
For each security group, assess whether the attached service requires
access from any IP address. If it doesn't, consider reducing the source IP ranges
to a specific set of subnets.
validation:
Run `aws ec2 describe-security-groups --region <region> --query 'SecurityGroups[*]'
--output json | jq -r '.[] | . as $group | .IpPermissions[] | select(.IpRanges[].CidrIp=="0.0.0.0/0"
or .Ipv6Ranges[].CidrIpv6=="::/0") | "($group.GroupName)"' | sort -u` and ensure
only the desired entries are listed.
impact: 2
nodes:
- PLACEHOLDER
refs:
- text: VPC Security Groups
url: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html
tags:
- aws-cfg:
- aws-cfg-restricted-common-ports
- pci-dss-3.2.1:
- pci-dss-3.2.1-1.2.1
- pci-dss-3.2.1-1.3
- nist-csf:
- nist-csf-PR.AC-3
- nist-csf-PR.AC-5
- nist-csf-PR.PT-4
- nist-csf-DE.AE-1
- nist-800-53-rev4:
- nist-800-53-rev4-AC-4
- nist-800-53-rev4-CM-2
- nist-800-53-rev4-SC-7
- nist-800-53-rev4-SC-7(3)
- nist-800-171:
- nist-800-171-3.1.1
- nist-800-171-3.1.14
- nist-800-171-3.1.2
- nist-800-171-3.1.20
- nist-800-171-3.1.3
- nist-800-171-3.13.1
- nist-800-171-3.13.2
- nist-800-171-3.13.6
- nist-800-171-3.4.7
- hipaa:
- hipaa-164.308(a)(1)(ii)(B)
- hipaa-164.312(e)(1)
- fedramp-moderate:
- fedramp-moderate-AC-4
- fedramp-moderate-CM-2
- fedramp-moderate-SC-7
- fedramp-moderate-SC-7(3)
- cmmc-level5:
- cmmc-level5-AC.1.001
- cmmc-level5-AC.1.003
- cmmc-level5-SC.1.175
- cmmc-level5-AC.2.016
- cmmc-level5-CM.3.068
- cmmc-level5-SC.3.180
- cmmc-level5-AC.4.023
- cmmc-level5-RM.4.151
- cmmc-level5-SC.5.230
- cmmc-level5-SC.5.208
- cmmc-level4:
- cmmc-level4-AC.1.001
- cmmc-level4-AC.1.003
- cmmc-level4-SC.1.175
- cmmc-level4-AC.2.016
- cmmc-level4-CM.3.068
- cmmc-level4-SC.3.180
- cmmc-level4-AC.4.023
- cmmc-level4-RM.4.151
- cmmc-level3:
- cmmc-level3-AC.1.001
- cmmc-level3-AC.1.003
- cmmc-level3-SC.1.175
- cmmc-level3-AC.2.016
- cmmc-level3-CM.3.068
- cmmc-level3-SC.3.180
- cmmc-level2:
- cmmc-level2-AC.1.001
- cmmc-level2-AC.1.003
- cmmc-level2-SC.1.175
- cmmc-level2-AC.2.016
- cmmc-level1:
- cmmc-level1-AC.1.001
- cmmc-level1-AC.1.003
- cmmc-level1-SC.1.175
- aws-wa-security:
- aws-wa-security-SEC-5
- aws
- id: darkbit-aws-33
title: EC2 Instances Should Not Be Older Than 365 Days
description:
EC2 instances that were created over a year ago tend to be managed
via manual processes, and that can often mean these instances have not been rebuilt
using newer operating system base images or are in need of security updates to
be applied.
remediation:
For each instance, review the operating system configuration to ensure
it is still receiving security updates, validate that all security updates are
applied, and consider using infrastructure-as-code practices to codify their creation
to remove manual management practices. Further, using autoscaling groups, even
for a single instance, can ensure that the correct number of systems are always
available and configured from a known, trusted state.
validation: |
Run `if date -v-365d > /dev/null 2>&1; then OLDDATE="$(date -v-365d
+%Y-%m-%d)"; else OLDDATE="$(date --date="-365 days" +%Y-%m-%d)"; fi; aws ec2
describe-instances --region <region> --query "Reservations[].Instances[?LaunchTime<=$OLDDATE][].{id:
InstanceId, launched: LaunchTime}" --output json | jq -r '.[] | "(.id) (.launched)"'`
and ensure no instances are listed.
impact: 5
nodes:
- AWS_EC2_INSTANCE
refs:
- text: AWS Supported Operating Systems Versions
url: https://docs.aws.amazon.com/systems-manager/latest/userguide/prereqs-operating-systems.html
tags:
- nist-csf:
- nist-csf-pr
- nist-csf-pr.ip
- nist-csf-pr.ip-2
- aws
- id: darkbit-aws-36
title: S3 Buckets Should Have Object Versioning and MFA Deletion Protection Enabled
description:
S3 Buckets that store sensitive data should have object versioning
enabled to help protect against the overwriting of objects or data loss in the
event of a compromise. A concrete example is an S3 bucket that receives audit/access
logs from CloudWatch or other services. Without object versioning, an attacker
might be able to delete evidence of their activities. With object versioning
enabled, they won't be able to remove the original version of the log data. To
add additional protection against disabling of versioning by an attacker, enable
the `mfa_delete` setting as the `root` account.
remediation:
Enable S3 object versioning on all buckets that store data that requires
integrity protection.
validation:
Run `for i in $(aws s3api list-buckets --query 'Buckets[*].Name' --output
text); do aws s3api get-bucket-versioning --bucket $i; done` and ensure each bucket
has a valid versioning configuration present.
impact: 5
nodes:
- PLACEHOLDER
refs:
- text: S3 Object Versioning
url: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectVersioning.html
tags:
- aws-cfg:
- aws-cfg-s3-bucket-default-lock-enabled
- aws-cfg-s3-bucket-versioning-enabled
- nist-csf:
- nist-csf-pr
- nist-csf-pr.ac
- nist-csf-pr.ac-4
- nist-csf-pr.ds
- nist-csf-pr.ds-1
- nist-csf-pr.ip
- nist-csf-pr.ip-4
- nist-800-53-rev4:
- nist-800-53-rev4-SC-28
- nist-800-171:
- nist-800-171-3.13.16
- nist-800-171-3.3.8
- hipaa:
- hipaa-164.308(a)(1)(ii)(B)
- hipaa-164.312(c)(1)
- hipaa-164.312(c)(2)
- fedramp-moderate:
- fedramp-moderate-SC-28
- cmmc-level5:
- cmmc-level5-AU.3.049
- cmmc-level4:
- cmmc-level4-AU.3.049
- cmmc-level3:
- cmmc-level3-AU.3.049
- aws-wa-security:
- aws-wa-security-SEC-8
- aws
- id: darkbit-aws-37
title: RDS Snapshot Encryption Should Be Enabled
description:
AWS provides encryption for RDS snapshots which should be enabled to
ensure that all data at-rest is encrypted. If the RDS Instance is encrypted,
its snapshots will be encrypted automatically.
remediation:
Enable RDS Instance encryption and automated backups to automatically
create encrypted snapshots. For manually created snapshots, ensure encryption
is used by specifying a KMS encryption key. For each existing unencrypted snapshot,
create a copy of that snapshot while specifying a KMS key and then delete the
unencrypted version.
validation:
Run `aws rds describe-db-snapshots --region <region> --output json |
jq -r '.DBSnapshots[] | "(.DBSnapshotArn) (.KmsKeyId)"' | grep "null$"` and ensure
no entries are listed.
impact: 5
nodes:
- PLACEHOLDER
refs:
- text: RDS Encryption
url: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Encryption.html
tags:
- aws-cfg:
- aws-cfg-rds-snapshot-encrypted
- nist-csf:
- nist-csf-pr
- nist-csf-pr.ds
- nist-csf-pr.ds-1
- nist-800-53-rev4:
- nist-800-53-rev4-SC-28
- nist-800-171:
- nist-800-171-3.13.16
- hipaa:
- hipaa-164.308(a)(1)(ii)(B)
- hipaa-164.312(a)(2)(iv)
- hipaa-164.312(e)(2)(ii)
- fedramp-moderate:
- fedramp-moderate-SC-28
- fedramp-low:
- fedramp-low-SC-13
- cmmc-level5:
- cmmc-level5-IA.2.081
- cmmc-level5-SC.3.191
- cmmc-level4:
- cmmc-level4-IA.2.081
- cmmc-level4-SC.3.191
- cmmc-level3:
- cmmc-level3-IA.2.081
- cmmc-level3-SC.3.191
- cmmc-level2:
- cmmc-level2-IA.2.081
- aws-wa-security:
- aws-wa-security-SEC-8
- aws
- id: darkbit-aws-38
title: SSM Non-Securestring Parameters Should Not Be Present
description:
AWS Systems Manager parameters should be encrypted. This allows their
values to be used by approved systems, while restricting access to other users
of the account.
remediation:
When creating a new Parameter or Advanced Parameter, specify a symmetric
KMS key to use to encrypt/decrypt the data stored. Existing parameters will need
to be recreated and an IAM Policy added to allow KMS encrypt/decrypt operations
for all clients that need access.
validation:
Run `aws ssm describe-parameters --region <region> --output json | jq
-r '.Parameters[] | select(.Type!="SecureString") | "(.Name)"'` for each region
and ensure no entries are present.
impact: 5
nodes:
- PLACEHOLDER
refs:
- text: Systems Manager Parameter Store
url: https://docs.aws.amazon.com/kms/latest/developerguide/services-parameter-store.html
tags:
- nist-csf:
- nist-csf-pr
- nist-csf-pr.ds
- nist-csf-pr.ds-1
- aws
- id: darkbit-aws-39
title: Amazon Elasticsearch Domains Should Enforce HTTPS
description:
By default, Amazon ES domains do not enforce HTTPS-only access to protect
communications in transit.
remediation:
Amazon ES domains cannot be modified to enable HTTPS-only access and
require being created with the feature configured on a new ES domain. For ES
domains that contain sensitive data, consider enabling encryption on the next
iteration of the application architecture.
validation:
Run `for i in $(aws es list-domain-names --region <region> --query 'DomainNames[*].DomainName'
--output text); do aws es describe-elasticsearch-domain --region <region> --domain-name
$i --output json | jq -r '.DomainStatus | "(.DomainName) (.DomainEndpointOptions.EnforceHTTPS)"'
; done` in each region and ensure all domains are listed as `true`.
impact: 5
nodes:
- PLACEHOLDER
refs:
- text: Elasticsearch Domain CLI
url: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html
tags:
- nist-csf:
- nist-csf-pr
- nist-csf-pr.ds
- nist-csf-pr.ds-2
- nist-csf-pr.pt
- nist-csf-pr.pt-4
- aws
- id: darkbit-aws-40
title: RDS Instance Storage Should Be Encrypted
description:
All RDS instances that store or could potentially store sensitive data
should have at-rest encryption enabled to ensure the integrity of data stored
within the database. When an RDS Instance is encrypted, all logs, backups, and
snapshots are also encrypted with the same KMS key.
remediation:
Evaluate each RDS database without encryption enabled for its potential
to store sensitive information, and consider rebuilding the instance to use at-rest
encryption backed by a KMS key. Because RDS encryption cannot be enabled on an
existing instance, a new RDS instance is needed. To expedite the process and
to preserve the data, an encrypted snapshot can be created from an unencrypted
instance, and a new instance can be started from that encrypted snapshot.
validation:
Run `aws rds describe-db-instances --region <region> --output json |
jq -r '.DBInstances[] | "(.DBInstanceArn) (.KmsKeyId)"'` and ensure all instances
have a KMS Key ID defined.
impact: 5
nodes:
- PLACEHOLDER
refs:
- text: RDS Snapshots
url: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html
- text: RDS Encryption
url: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Encryption.html#Overview.Encryption.Enabling
tags:
- aws-cfg:
- aws-cfg-rds-storage-encrypted
- pci-dss-3.2.1:
- pci-dss-3.2.1-3.4
- nist-csf:
- nist-csf-pr
- nist-csf-pr.ds
- nist-csf-pr.ds-1
- nist-800-53-rev4:
- nist-800-53-rev4-SC-13
- nist-800-53-rev4-SC-28
- nist-800-171:
- nist-800-171-3.13.16
- hipaa:
- hipaa-164.308(a)(1)(ii)(B)
- hipaa-164.312(a)(2)(iv)
- hipaa-164.312(e)(2)(ii)
- fedramp-moderate:
- fedramp-moderate-SC-28
- fedramp-low:
- fedramp-low-SC-13
- cmmc-level5:
- cmmc-level5-IA.2.081
- cmmc-level5-SC.3.191
- cmmc-level4:
- cmmc-level4-IA.2.081
- cmmc-level4-SC.3.191
- cmmc-level3:
- cmmc-level3-IA.2.081
- cmmc-level3-SC.3.191
- cmmc-level2:
- cmmc-level2-IA.2.081
- aws-wa-security:
- aws-wa-security-SEC-8
- aws
- id: darkbit-aws-41
title: SQS Queues Should Have KMS Encryption Enabled
description:
Messages sent to SQS queues can be encrypted using KMS server-side
encryption, and all SQS queues that handle sensitive data should have SQS encryption
enabled.
remediation:
Review the usage and data transiting each SQS queue, and consider enabling
KMS encryption on queues handling sensitive data. Existing queues can be modified
to add encryption with minimal overhead.
validation: |
'For each region, run `for i in $(aws sqs list-queues --region <region>
--query 'QueueUrls[*]' --output text); do OUT="$(aws sqs get-queue-attributes
--region <region> --queue-url $i --attribute-names KmsMasterKeyId --output json
| jq -r '.Attributes.KmsMasterKeyId')"; echo "$i: $OUT"; done` and verify each
entry lists a KMS Key Id.'
impact: 2
nodes:
- PLACEHOLDER
refs:
- text: SQS Server Side Encryption
url: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html
tags:
- nist-csf:
- nist-csf-pr
- nist-csf-pr.ds
- nist-csf-pr.ds-1
- aws
- id: darkbit-aws-44
title: Amazon Elasticsearch Domains Should Use Encryption at Rest
description:
Amazon Elasticsearch (ES) Domains do not configure at-rest encryption
by default. By enabling it, the indices, elasticsearch logs, swap files, data
in the application directory, and automated snapshots are encrypted using AES-256
via KMS keys.
remediation:
Amazon ES domains cannot be modified to enable encryption at rest and
require being created with the feature configured on a new ES domain. For ES
domains that contain sensitive data, consider enabling encryption on the next
iteration of the application architecture.
validation:
Run `for i in $(aws es list-domain-names --region <region> --query 'DomainNames[*].DomainName'
--output text); do aws es describe-elasticsearch-domain --region <region> --domain-name
$i --output json | jq -r '.DomainStatus | "(.DomainName) (.EncryptionAtRestOptions.Enabled)"'
; done` in each region and ensure all domains are listed as `true`.
impact: 2
nodes:
- PLACEHOLDER
refs:
- text: Elasticsearch Domain Encryption at Rest
url: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/encryption-at-rest.html
tags:
- aws-cfg:
- aws-cfg-elasticsearch-encrypted-at-rest
- pci-dss-3.2.1:
- pci-dss-3.2.1-3.4
- nist-csf:
- nist-csf-pr
- nist-csf-pr.ds
- nist-csf-pr.ds-1
- nist-800-53-rev4:
- nist-800-53-rev4-SC-13
- nist-800-53-rev4-SC-28
- nist-800-171:
- nist-800-171-3.13.16
- hipaa:
- hipaa-164.308(a)(1)(ii)(B)
- hipaa-164.312(a)(2)(iv)
- hipaa-164.312(e)(2)(ii)
- fedramp-moderate:
- fedramp-moderate-SC-28
- fedramp-low:
- fedramp-low-SC-13
- cmmc-level5:
- cmmc-level5-IA.2.081
- cmmc-level5-SC.3.191