Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement Compute Security Policies Crawler #308

Merged

Conversation

shravankshenoy
Copy link
Contributor

Description

Issue #247 . Added support for Compute/securitypolicies resource

Changes Made

  • Created a new crawler factory in the crawler package : cloud_security_policies_crawler.py
  • In the scanner.py file, included the crawler in the crawl loop and updated the crawl_client_map.
  • Modified example.config
  • Added unit tests in test_unit.py
  • Left blank compute_security_policies file for test output check

Testing

App ran successfully during local testing

…trap script. Add compute securit config in example config
Copy link
Collaborator

@mshudrak mshudrak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with two minor nits. Once you fix it, we can push the commit. Thanks again for implementing it.

except Exception:
logging.info("Failed to enumerate compute security policies in the %s", project_name)
logging.info(sys.exc_info())
return security_policies_list
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls add new line at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this with new commit

# update default rule to deny all traffic (default rule has priority 2147483647)
gcloud compute security-policies rules update 2147483647 \
--security-policy test-security-policy \
--action "deny-404"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New line pls

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this with new commit

@mshudrak mshudrak merged commit e79b3f8 into google:main Dec 27, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants