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

Configure firewall rules #46

Merged
merged 4 commits into from
Jul 10, 2022
Merged

Configure firewall rules #46

merged 4 commits into from
Jul 10, 2022

Conversation

paseaf
Copy link
Owner

@paseaf paseaf commented Jul 8, 2022

Description

This PR will

  • close Configure firewall rules #5
  • add firewall rule naming convention action_source_to_destination_service/port
  • opened Prometheus to public for testing

Testing the PR

How do your team test if the PR is valid?

  1. terraform apply
  2. all monitor services should work. SSH to honeypot should work

Takeaways

  • GCP firewalls are stateful!
    So we don't need to allow both ways for a connection.

    When a connection is allowed through the firewall in either direction, return traffic matching this connection is also allowed. You cannot configure a firewall rule to deny associated response traffic.
    https://cloud.google.com/vpc/docs/firewalls#specifications

@paseaf paseaf self-assigned this Jul 8, 2022
- Other VMs SSHD: `22`

Audit:
Gateway VM:
Copy link
Owner Author

Choose a reason for hiding this comment

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

Grouping by VM might be more helpful for looking up opening ports.
The infra diagram can be used to look up available services

- cAdvisor: `8088`
- Node Exporter: `9100`
- ContainerSSH auth-config server: `8080`
- ContainerSSH metrics server(TBD): `9101`
Copy link
Owner Author

Choose a reason for hiding this comment

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

will be done in #45

- SSH: `2333`
- cAdvisor: `8088`
- Node Exporter: `9100`
- ContainerSSH auth-config server: `8080`
Copy link
Owner Author

Choose a reason for hiding this comment

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

removed auth-config from the infra diagram since it might be not very important to our project.

@@ -62,7 +62,7 @@ resource "google_compute_instance" "sacrificial_vm" {
resource "google_compute_instance" "logger_vm" {
name = "logger-vm"
machine_type = var.machine_type
tags = ["observer"]
tags = ["logger"]
Copy link
Owner Author

Choose a reason for hiding this comment

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

might be easier to identify

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, it makes sense, sorry for my bad naming sense xD

@paseaf paseaf marked this pull request as ready for review July 8, 2022 17:20
@paseaf paseaf linked an issue Jul 8, 2022 that may be closed by this pull request
@paseaf paseaf added documentation Improvements or additions to documentation security labels Jul 8, 2022
# open gateway-port 9100 and 9101, to our prometheus and metrics server
resource "google_compute_firewall" "firewall_gateway_nodeexport" {
name = "firewall-gateway-nodeexport"
resource "google_compute_firewall" "allow_all_to_logger_vm_prometheus" {
Copy link
Owner Author

Choose a reason for hiding this comment

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

still need it for testing metrics server later later.
could close it later

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok, i need it as well ^^v

Copy link
Collaborator

@bafread bafread left a comment

Choose a reason for hiding this comment

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

LGTM. :)

Base automatically changed from zl/refactor-scripts to main July 10, 2022 16:57
@paseaf paseaf merged commit cb6b53d into main Jul 10, 2022
@paseaf paseaf deleted the zl/configure-firewall-rules branch July 10, 2022 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configure firewall rules
2 participants