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

Support Originating IP discovery in Access Logging #8734

Closed
mbhegde-orcl opened this issue May 8, 2024 · 2 comments
Closed

Support Originating IP discovery in Access Logging #8734

mbhegde-orcl opened this issue May 8, 2024 · 2 comments
Assignees
Labels
3.x Issues for 3.x version branch enhancement New feature or request logging P3 wontfix This will not be worked on
Projects

Comments

@mbhegde-orcl
Copy link

Environment Details

  • Helidon Version: 3.2.7
  • Helidon SE or Helidon MP: MP
  • JDK version: 17
  • OS: Does not matter, but Linux running on K8s
  • Docker version (if applicable): OCI OKE

Issue type

Feature request


Problem Description

%h directive in Helidon access log library, apparently does print the remote Peer IP address.

    // HostLogEntry class
    @Override
    protected String doApply(AccessLogContext context) {
        String remoteAddress = context.serverRequest().remotePeer().host();
        return (null == remoteAddress) ? NOT_AVAILABLE : remoteAddress;
    }

Ideally there should be a way to apply X-Forwarded-For discovery rules, and log the originating IP address as seen by the load balancer / proxy.

Misc:

Helidon server already has requested URI discovery, but apparently it does not inspect the X-Forwarded-For for originating IP, nor is it used by access logs. Is it possible to reuse the same logic to inspect X-Forwarded-For?

@github-actions github-actions bot added this to Triage in Backlog May 8, 2024
@barchetta barchetta added logging enhancement New feature or request P3 labels May 9, 2024
@tjquinno
Copy link
Member

tjquinno commented May 9, 2024

@mbhegde-orcl Thanks for the issue.

You mentioned in your description:

Helidon server already has requested URI discovery, but apparently it does not inspect the X-Forwarded-For for originating IP, nor is it used by access logs. Is it possible to reuse the same logic to inspect X-Forwarded-For?

Do you have a test case that shows the requested URI feature not working correctly with the X-Forwarded-* headers? If so, please share it.

Because of the security implications users need to set up the requested URI behavior (either programmatically or using configuration) for the feature to work. https://helidon.io/docs/v3/se/webserver#_requested_uri_discovery We have tests but there are also quite a few combinations and we might have missed some.

Or is your point only about the access log usage (or non-usage) of requested URI?

@m0mus m0mus added the 3.x Issues for 3.x version branch label May 23, 2024
@m0mus m0mus moved this from Triage to Normal priority in Backlog May 23, 2024
@m0mus m0mus moved this from Normal priority to Sprint Scope in Backlog May 23, 2024
@tjquinno
Copy link
Member

@mbhegde-orcl

We have not heard any clarification about whether you were asking about the request URI feature itself not working or just exposing the results of its processing in the access log.

For the access logging, you can already customize the access log formatting to include whatever headers you want. So you could add a formatting element like this

%{X-Forwarded-For}i

Because it seems you can accomplish what you want using this feature, we'll close this issue. Please reopen it if in fact you have a test case that shows the requested URI feature itself not working.

Backlog automation moved this from Sprint Scope to Closed May 23, 2024
@tjquinno tjquinno added the wontfix This will not be worked on label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issues for 3.x version branch enhancement New feature or request logging P3 wontfix This will not be worked on
Projects
Backlog
  
Closed
Development

No branches or pull requests

4 participants