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

tasks 6 and 7 for #345 #357

Merged
merged 3 commits into from
Jan 26, 2024
Merged

tasks 6 and 7 for #345 #357

merged 3 commits into from
Jan 26, 2024

Conversation

irshadaj
Copy link
Contributor

@irshadaj irshadaj commented Jan 26, 2024

  • IP address to not be read from X-Real-IP header as this is easy to spoof.
  • X-Forwarded-For returns a list of IPs, grab the originating IP (first one) from the list
  • Check that Audit Context Action conforms to the DB constraint (success or failure)

@irshadaj irshadaj changed the title tasks 6 and 7 tasks 6 and 7 for #345 Jan 26, 2024
@irshadaj irshadaj merged commit 3ac13c1 into populate-audit-log-fields Jan 26, 2024
2 of 3 checks passed
@irshadaj irshadaj deleted the tasks_6_7 branch January 26, 2024 20:53
@github-actions github-actions bot locked and limited conversation to collaborators Jan 26, 2024
} else if hostName := parsedUrl.Hostname(); hostName == "" {
return "", fmt.Errorf("hostname not found in URL: %s", parsedUrl.String())
} else {
return parsedUrl.Hostname(), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have the hostName var, but otherwise this logic seems good. I'd like to find out for sure if we need to attach any additional information on how the IP was derived for audit purposes, but that can be cleaned up in a follow up

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants