@@ -258,6 +258,7 @@ def enable_account_securityhub(account_id: str, regions: list, configuration_rol
258
258
standards_user_input ["SecurityBestPracticesVersion" ],
259
259
standards_user_input ["CISVersion" ],
260
260
standards_user_input ["PCIVersion" ],
261
+ standards_user_input ["NISTVersion" ],
261
262
)
262
263
securityhub_client : SecurityHubClient = account_session .client ("securityhub" , region , config = BOTO3_CONFIG )
263
264
@@ -333,13 +334,22 @@ def configure_member_account(account_id: str, configuration_role_name: str, regi
333
334
standards_user_input ["SecurityBestPracticesVersion" ],
334
335
standards_user_input ["CISVersion" ],
335
336
standards_user_input ["PCIVersion" ],
337
+ standards_user_input ["NISTVersion" ],
336
338
)
337
339
config_client : ConfigServiceClient = account_session .client ("config" , region , config = BOTO3_CONFIG )
338
340
if is_config_enabled (config_client ):
339
341
process_standards (securityhub_client , standard_dict , standards_user_input ["StandardsToEnable" ])
340
342
341
343
342
- def get_standard_dictionary (account_id : str , region : str , aws_partition : str , sbp_version : str , cis_version : str , pci_version : str ) -> dict :
344
+ def get_standard_dictionary (
345
+ account_id : str ,
346
+ region : str ,
347
+ aws_partition : str ,
348
+ sbp_version : str ,
349
+ cis_version : str ,
350
+ pci_version : str ,
351
+ nist_version : str ,
352
+ ) -> dict :
343
353
"""Get Standard ARNs.
344
354
345
355
Args:
@@ -349,6 +359,7 @@ def get_standard_dictionary(account_id: str, region: str, aws_partition: str, sb
349
359
sbp_version: AWS Security Best Practices Standard Version
350
360
cis_version: CIS Standard Version
351
361
pci_version: PCI Standard Version
362
+ nist_version: NIST Standard
352
363
353
364
Returns:
354
365
Standard ARN Dictionary
@@ -370,6 +381,12 @@ def get_standard_dictionary(account_id: str, region: str, aws_partition: str, sb
370
381
"standard_arn" : f"arn:{ aws_partition } :securityhub:{ region } ::standards/pci-dss/v/{ pci_version } " ,
371
382
"subscription_arn" : f"arn:{ aws_partition } :securityhub:{ region } :{ account_id } :subscription/pci-dss/v/{ pci_version } " ,
372
383
},
384
+ "nist" : {
385
+ "name" : "National Institute of Standards and Technology (NIST) SP 800-53 Rev. 5" ,
386
+ "enabled" : False ,
387
+ "standard_arn" : f"arn:{ aws_partition } :securityhub:{ region } ::standards/nist-800-53/v/{ nist_version } " ,
388
+ "subscription_arn" : f"arn:{ aws_partition } :securityhub:{ region } :{ account_id } :subscription/nist-800-53/v/{ nist_version } " ,
389
+ },
373
390
"sbp" : {
374
391
"name" : "AWS Foundational Security Best Practices Standard" ,
375
392
"enabled" : False ,
@@ -437,7 +454,8 @@ def get_current_enabled_standards(securityhub_client: SecurityHubClient, standar
437
454
standard_dict ["cis" ]["enabled" ] = True
438
455
if standard_dict ["pci" ]["standard_arn" ] == item ["StandardsArn" ]:
439
456
standard_dict ["pci" ]["enabled" ] = True
440
-
457
+ if standard_dict ["nist" ]["standard_arn" ] == item ["StandardsArn" ]:
458
+ standard_dict ["nist" ]["enabled" ] = True
441
459
return standard_dict
442
460
443
461
@@ -510,7 +528,7 @@ def process_standard(securityhub_client: SecurityHubClient, standards_to_enable:
510
528
else :
511
529
LOGGER .info (f"{ standard_definition ['name' ]} is already disabled" )
512
530
except securityhub_client .exceptions .InvalidInputException :
513
- LOGGER .error ("Retry after the standard is no longer in pending state. " )
531
+ LOGGER .error ("InvalidInputException while enabling or disabling standard " )
514
532
return True
515
533
516
534
0 commit comments