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

Validate ip addresses #176

Merged
merged 3 commits into from
May 27, 2024
Merged

Validate ip addresses #176

merged 3 commits into from
May 27, 2024

Conversation

sameh-farouk
Copy link
Member

@sameh-farouk sameh-farouk commented May 22, 2024

What's Changed:

  • Now, GraphQL will reject IPs if they do not meet the following criteria:
    • IP addresses for the host and the gateway are valid
    • IP addresses are not the same
    • IP addresses are public
    • IP addresses are unicast addresses
    • Gateway IP address is in the same subnet as the host IP address
  • More logging

Related issues:

Here is a part from the logs showing the validation in work:

{"level":3,"time":1716403182512,"ns":"sqd:processor:mapping","msg":"One or both IP addresses are not unicast addresses. Public IP: 23.253.24.205/21, Gateway: 231.25.130.235"}
{"level":3,"time":1716403187418,"ns":"sqd:processor:mapping","msg":"The gateway is not in the same subnet as the host. Public IP: 22.21.21.204/25, Gateway: 132.2.204.11"}
{"level":3,"time":1716403187428,"ns":"sqd:processor:mapping","msg":"The gateway is not in the same subnet as the host. Public IP: 22.21.21.204/25, Gateway: 132.2.204.11"}
{"level":3,"time":1716403187428,"ns":"sqd:processor:mapping","msg":"The gateway is not in the same subnet as the host. Public IP: 2.201.221.20/31, Gateway: 141.252.125.243"}
{"level":3,"time":1716403187433,"ns":"sqd:processor:mapping","msg":"The gateway is not in the same subnet as the host. Public IP: 2.201.221.20/31, Gateway: 141.252.125.243"}
{"level":3,"time":1716403187446,"ns":"sqd:processor:mapping","msg":"The gateway is not in the same subnet as the host. Public IP: 20.231.203.202/23, Gateway: 15.23.135.10"}
{"level":3,"time":1716403192486,"ns":"sqd:processor:mapping","msg":"The gateway is not in the same subnet as the host. Public IP: 20.214.213.21/32, Gateway: 14.212.241.24"}
{"level":3,"time":1716403192511,"ns":"sqd:processor:mapping","msg":"The gateway is not in the same subnet as the host. Public IP: 20.214.213.21/32, Gateway: 14.212.241.24"}
{"level":3,"time":1716403192512,"ns":"sqd:processor:mapping","msg":"One or both IP addresses are not public. Public IP: 2.231.202.21/22, Gateway: 10.255.221.132"}

@sameh-farouk sameh-farouk requested a review from renauter as a code owner May 22, 2024 18:30
@sameh-farouk sameh-farouk merged commit b09a8d3 into master May 27, 2024
1 check passed
@sameh-farouk sameh-farouk deleted the master-validate-public-ips branch May 27, 2024 09:03
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