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

Enriching x-forwarded-for field doesn't work in CloudFront Logs #423

Open
yoshiyama3 opened this issue Oct 25, 2023 · 0 comments
Open

Enriching x-forwarded-for field doesn't work in CloudFront Logs #423

yoshiyama3 opened this issue Oct 25, 2023 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@yoshiyama3
Copy link

yoshiyama3 commented Oct 25, 2023

Summary

v2.10.2 より clientip_xff によるエンリッチメント機能が追加されましたが、CloudFront ログに対応していないことを確認しました。

Details

  • cloudfront-realtimecloudfront-standard ログで clientip_xff が定義されていない
  • user.ini へ設定を追加したところ、エンリッチ対象のフィールドの値が不適切な状態になった
    • 例)source.ip の値が trusted_proxy.db に含まれている、かつ x_forwarded_for が 203.0.113.3 の場合
      • 想定:source.ip の値が 203.0.113.3 に置き換わる
      • 実際:source.ip の値が 0.0.0.3 に置き換わる(より正確には 3
        user.ini で追加した設定
clientip_xff = source.ip x_forwarded_for

Version

  • siem-es-loader v2.10.2a

Cause of error

恐らく以下の点が原因

  • ignore_malformed が true なため、不適な数値が入ってもそのまま取り込まれる
  • CloudFront アクセスログ の x-forwarded-for フィールドについて形式が siem/xff.py で想定している形式と異なる
    • CloudFront 側では以下のような形式で出力されるが es-loader 上では str として処理されている
      • 203.0.113.3
      • 203.0.113.3,203.0.113.4
@yoshiyama3 yoshiyama3 changed the title Enriching x-forwarded-for field doesn't work in CloudFlare Logs Enriching x-forwarded-for field doesn't work in CloudFront Logs Oct 25, 2023
@nakajiak nakajiak added the bug Something isn't working label Oct 26, 2023
@nakajiak nakajiak added this to the v2.10.3 milestone Oct 26, 2023
@nakajiak nakajiak modified the milestones: v2.10.3, v2.10.4 Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants