Exemplo n.º 1
0
 def test_record_transform(self):
     info = {
         "access_key_2_active": "false",
         "password_next_rotation": "2017-01-24T13:15:33+00:00",
         "access_key_2_last_rotated": "N/A",
         "mfa_active": "true",
         "cert_1_active": "false",
         "cert_1_last_rotated": "N/A",
         "access_key_1_last_used_date": "N/A",
         "arn": "arn:aws:iam::644160558196:user/anthony",
         "cert_2_active": "false",
         "password_enabled": "true",
         "access_key_2_last_used_region": "N/A",
         "password_last_changed": "2016-10-26T13:15:33+00:00",
         "access_key_1_last_rotated": "N/A",
         "user_creation_time": "2016-10-06T16:11:27+00:00",
         "access_key_1_last_used_service": "N/A",
         "user": "******",
         "password_last_used": "2016-10-26T13:14:37+00:00",
         "cert_2_last_rotated": "N/A",
         "access_key_2_last_used_date": "N/A",
         "access_key_2_last_used_service": "N/A",
         "access_key_1_last_used_region": "N/A",
         "access_key_1_active": "false",
     }
     credential = UserCredentialReport({}, None)
     credential.process_user_record(info)
     self.assertEqual(
         info,
         {
             "arn": "arn:aws:iam::644160558196:user/anthony",
             "mfa_active": True,
             "password_enabled": True,
             "password_last_changed": "2016-10-26T13:15:33+00:00",
             "password_last_used": "2016-10-26T13:14:37+00:00",
             "password_next_rotation": "2017-01-24T13:15:33+00:00",
             "user": "******",
             "user_creation_time": "2016-10-06T16:11:27+00:00",
         },
     )
Exemplo n.º 2
0
 def test_record_transform(self):
     info = {
         'access_key_2_active': 'false',
         'password_next_rotation': '2017-01-24T13:15:33+00:00',
         'access_key_2_last_rotated': 'N/A',
         'mfa_active': 'true',
         'cert_1_active': 'false',
         'cert_1_last_rotated': 'N/A',
         'access_key_1_last_used_date': 'N/A',
         'arn': 'arn:aws:iam::644160558196:user/anthony',
         'cert_2_active': 'false',
         'password_enabled': 'true',
         'access_key_2_last_used_region': 'N/A',
         'password_last_changed': '2016-10-26T13:15:33+00:00',
         'access_key_1_last_rotated': 'N/A',
         'user_creation_time': '2016-10-06T16:11:27+00:00',
         'access_key_1_last_used_service': 'N/A',
         'user': '******',
         'password_last_used': '2016-10-26T13:14:37+00:00',
         'cert_2_last_rotated': 'N/A',
         'access_key_2_last_used_date': 'N/A',
         'access_key_2_last_used_service': 'N/A',
         'access_key_1_last_used_region': 'N/A',
         'access_key_1_active': 'false'
     }
     credential = UserCredentialReport({}, None)
     credential.process_user_record(info)
     self.assertEqual(
         info, {
             'arn': 'arn:aws:iam::644160558196:user/anthony',
             'mfa_active': True,
             'password_enabled': True,
             'password_last_changed': '2016-10-26T13:15:33+00:00',
             'password_last_used': '2016-10-26T13:14:37+00:00',
             'password_next_rotation': '2017-01-24T13:15:33+00:00',
             'user': '******',
             'user_creation_time': '2016-10-06T16:11:27+00:00'
         })