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

Feature/geolocate ip #123

Merged
merged 9 commits into from
Nov 4, 2023

Conversation

DaftFuzz
Copy link

@DaftFuzz DaftFuzz commented Nov 3, 2023

From this feature request.

  • Added new API route utils/geolocateIp. This calls the Maxmind API using env variables for authentication to return geolocation data for a given IP address
  • IP Address is displayed in the session card, and is clickable. On click, opens a modal and makes call to the new API endpoint, displays some basic geolocation info

image

fuzz added 6 commits October 25, 2023 16:23
needs work - currently just an api endpoint that will return geolocation data for a given IP.
ToDo:
- Display IP in session-card
- Clicking IP opens modal with geolocation info
Add row to session card with IP Address. Clickable, opens modal.

Modal WIP - displays general info about IP location (maybe can include a map within this modal?)
add padding to image
otherwise ends up on same line as subtitle info
@DaftFuzz DaftFuzz marked this pull request as ready for review November 3, 2023 13:03
@CyferShepard
Copy link
Owner

Hey @DaftFuzz , im having some issues testing this build, can you help me with this, i created an account on maxmind, got my api key and account id, set all those up, but i get a Error Bad Request Response. is there any additional setup that needs to be done?

@DaftFuzz
Copy link
Author

DaftFuzz commented Nov 3, 2023

Hey, so the account ID is set up as GEOLITE_ACCOUNT_ID env variable, and api key as GEOLITE_LICENSE_KEY? At what point are you getting the Bad Request response? From the geolite API, or from the frontend?

@CyferShepard
Copy link
Owner

CyferShepard commented Nov 3, 2023

Okay so I managed to find the issue, the option to trace the ip is still available for local/private ips. but when its sent through the API its rejected as data: { code: 'IP_ADDRESS_RESERVED', error: "The IP address 'xxx.xxx.xxx.xxx' is a reserved IP address (private, multicast, etc.)." }. So youl probably need to add a check for this to make the IP non clickable if its a private/lan IP. Also to prevent some confusion can you add a check in the frontend to see if these ENVs are set, if they are not, the user shouldn't be able to open up the modal

@DaftFuzz
Copy link
Author

DaftFuzz commented Nov 3, 2023

Ah, gotcha, yeah I did my testing with remote IPs only so missed that. Will make those changes 👍

- filter out local ip addresses
- do not show modal for local ip addresses, only remote
- tooltip to show local/remote
@DaftFuzz
Copy link
Author

DaftFuzz commented Nov 3, 2023

Should be resolved with the latest commit

fuzz and others added 2 commits November 3, 2023 18:01
more consistent with stream info modal from activity table
Removed Tooltip as it was unnecessary
Also added a check in the frontend. if the env variables where not set for the GEOLITE API, it would disable the option entirely
@CyferShepard
Copy link
Owner

Looks all good on my side for now @DaftFuzz besides the 1 small change i added

@CyferShepard CyferShepard merged commit db3b354 into CyferShepard:unstable Nov 4, 2023
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