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

test: [M3-8122] - Disable access to internet for Linodes created during Cypress tests #10633

Conversation

jdamore-linode
Copy link
Contributor

@jdamore-linode jdamore-linode commented Jul 1, 2024

Description 📝

This modifies our Cypress tests so that any Linodes created during the course of a test are created with no access to the internet. It does this by modifying the interceptCreateLinode util to mutate the outgoing request.

Note that this applies only to Linodes that are created via Cloud Manager during the tests -- Linodes created directly by Cypress via our JS SDK already have extra measures taken to secure them (see #10538).

Changes 🔄

  • Mutate outgoing Linode create requests to place Linodes behind VLAN and, more importantly, without access to the internet
  • Increase clone test timeout

How to test 🧪

  1. Confirm that tests continue to pass (we can do this via CI)
  2. Confirm that created Linodes are not connected to the internet
  • There are a couple ways to do this, but this is the easiest:
    1. Run a Linode create test, then sign into Cloud and find the Linode that was created
    2. Observe the IP address of the created Linode
    3. Run ping <IP address> and confirm that you cannot connect
    4. Run ssh root@<IP address> and confirm that you cannot connect
  • To be extra thorough, you can confirm that the Linode itself can't connect to the internet
    1. Run a Linode create test via yarn cy:debug with the Chrome dev tools open
    2. In the network tab, observe the outgoing Linode create request and make note of the root password
    3. Sign into Cloud, find the Linode that was created, and launch Glish/Weblish
    4. Sign into the root account using the root password you observed in step 2
    5. From the Linode, run ping 1.1.1.1 and confirm that there is no internet connectivity

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@jdamore-linode jdamore-linode self-assigned this Jul 1, 2024
@jdamore-linode jdamore-linode requested a review from a team as a code owner July 1, 2024 20:57
@jdamore-linode jdamore-linode requested review from cliu-akamai and removed request for a team July 1, 2024 20:57
@jdamore-linode jdamore-linode changed the title Place Linodes created by Cypress tests behind VLAN, increase Clone ti… test: [M3-8122] - Disable access to internet for Linodes created during Cypress tests Jul 1, 2024
Copy link

github-actions bot commented Jul 1, 2024

Coverage Report:
Base Coverage: 82.18%
Current Coverage: 82.18%

@jdamore-linode jdamore-linode requested a review from a team as a code owner July 2, 2024 15:38
@jdamore-linode jdamore-linode requested review from mjac0bs and AzureLatte and removed request for a team July 2, 2024 15:38
Copy link
Contributor

@AzureLatte AzureLatte left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Thanks for simple to follow testing steps! Confirmed the linodes created from these tests were unreachable via pinging. CI looks good. 🔒

Screenshot 2024-07-02 at 10 35 38 AM

@mjac0bs mjac0bs added Approved Multiple approvals and ready to merge! and removed Ready for Review labels Jul 2, 2024
@jdamore-linode jdamore-linode merged commit a678228 into linode:develop Jul 2, 2024
19 checks passed
nikhagra-akamai pushed a commit to nikhagra-akamai/manager that referenced this pull request Jul 3, 2024
…ng Cypress tests (linode#10633)

* Place Linodes created by Cypress tests behind VLAN, increase Clone timeout

* Add changeset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants