Skip to content

Commit

Permalink
Merge pull request nccgroup#1545 from ncc-akis/bugfix/fix_sqldb_ad_ad…
Browse files Browse the repository at this point in the history
…min_assessment

Ensure correct SQL DB AD Admin check
  • Loading branch information
fernando-gallego authored Jun 30, 2023
2 parents cb7299d + 7619c30 commit afecedf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ScoutSuite/providers/azure/facade/sqldatabase.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ async def get_database_replication_links(self, resource_group_name, server_name,
try:
client = self.get_client(subscription_id)
return await run_concurrently(
lambda: client.replication_links.list_by_database(
resource_group_name, server_name, database_name)
lambda: list(client.replication_links.list_by_database(
resource_group_name, server_name, database_name))
)
except Exception as e:
print_exception(f'Failed to retrieve database replication links: {e}')
Expand All @@ -67,7 +67,7 @@ async def get_server_azure_ad_administrators(self, resource_group_name, server_n
try:
client = self.get_client(subscription_id)
return await run_concurrently(
lambda: client.server_azure_ad_administrators.list_by_server(resource_group_name, server_name)
lambda: list(client.server_azure_ad_administrators.list_by_server(resource_group_name, server_name))
)
except Exception as e:
print_exception(f'Failed to retrieve server azure ad administrators: {e}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async def fetch_all(self):
self._parse_links(links)

def _parse_links(self, links):
links_count = len(list(links))
links_count = len(links)
self.update({
'replication_configured': links_count > 0
})
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"and",
[
"sqldatabase.subscriptions.id.servers.id.ad_admin",
"null",
"empty",
""
]
],
Expand Down

0 comments on commit afecedf

Please sign in to comment.