diff --git a/prowler/providers/github/services/repository/repository_service.py b/prowler/providers/github/services/repository/repository_service.py index b074414d4d..11f76e74f2 100644 --- a/prowler/providers/github/services/repository/repository_service.py +++ b/prowler/providers/github/services/repository/repository_service.py @@ -17,7 +17,15 @@ class Repository(GithubService): try: for repo in self.client.get_user().get_repos(): try: - securitymd_exists = repo.get_contents("SECURITY.md") is not None + securitymd_exists = False + contents = repo.get_contents("") + while contents: + file_content = contents.pop(0) + if file_content.type == "dir": + contents.extend(repo.get_contents(file_content.path)) + elif file_content.path.endswith("SECURITY.md"): + securitymd_exists = True + break except Exception: securitymd_exists = False repos[repo.id] = Repo(