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(AWS): Lightsail new service and checks #3919

Merged
merged 29 commits into from May 16, 2024

Conversation

puchy22
Copy link
Contributor

@puchy22 puchy22 commented May 3, 2024

Context

Include new AWS service Lightsail with checks:

  • lightsail_instance_public
  • lightsail_database_public
  • lightsail_instance_automated_snapshots
  • lightsail_static_ip_unused

Description

This PR add new services, checks and respective unit tests.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the provider/aws Issues/PRs related with the AWS provider label May 3, 2024
Copy link

codecov bot commented May 3, 2024

Codecov Report

Attention: Patch coverage is 96.42857% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 86.54%. Comparing base (4aedba7) to head (c31fb31).

Files Patch % Lines
...viders/aws/services/lightsail/lightsail_service.py 93.47% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3919      +/-   ##
==========================================
+ Coverage   86.47%   86.54%   +0.06%     
==========================================
  Files         771      777       +6     
  Lines       23971    24139     +168     
==========================================
+ Hits        20728    20890     +162     
- Misses       3243     3249       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sergargar sergargar linked an issue May 6, 2024 that may be closed by this pull request
@github-actions github-actions bot added the github_actions Pull requests that update GitHub Actions code label May 15, 2024
@puchy22 puchy22 marked this pull request as ready for review May 15, 2024 14:44
@puchy22 puchy22 requested review from a team as code owners May 15, 2024 14:44
):
report.status = "PASS"
report.status_extended = (
f"Instance '{instance.name}' has no public access"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
f"Instance '{instance.name}' has no public access"
f"Instance '{instance.name}' is not publicly exposed."

report.resource_arn = arn_instance
report.resource_tags = instance.tags
report.status = "FAIL"
report.status_extended = f"Instance '{instance.name}' has public access"
Copy link
Member

Choose a reason for hiding this comment

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

Can you put the ports that are opened?

report.status = "FAIL"
report.status_extended = f"Instance '{instance.name}' has public access"
if instance.public_ip == "" and not any(
port.access_type == "public" for port in instance.ports
Copy link
Member

Choose a reason for hiding this comment

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

I cannot see the attribute access_type in the Port class

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if static_ip.is_attached:
report.status = "PASS"
report.status_extended = (
f"Static IP '{static_ip.name}' is associated with any instance."
Copy link
Member

Choose a reason for hiding this comment

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

Can you put the instance that is attached to?

@sergargar sergargar self-requested a review May 16, 2024 12:31
@sergargar sergargar merged commit 5cf4b63 into prowler-cloud:master May 16, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github_actions Pull requests that update GitHub Actions code provider/aws Issues/PRs related with the AWS provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for AWS Lightsail resource
2 participants