Is there a way to control which directory DumpRequest() dumps into?

オープン
#4,830 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
49/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go, kubernetes

調査の方向性

Start by reading the AppSec hooks documentation linked in the issue and locating the Go implementation of DumpRequest().ToJSON(). Check whether the dump directory and filename can be configured, and how those options are exposed. Done means the supported controls are documented there, or the request is clarified if implementation changes are needed.

索引モデルが issue の本文から書いたものです。

説明

needs/kind needs/triage

Right now, using the crowdsec docker container through the provided helm chart, whenever you use DumpRequest() as described in the docs it dumps a json file in your /tmp directory:

In order to make DumpRequest write your request to a file, you have to call DumpRequest().ToJSON(), which will create a file in the OS temporary directory (eg, /tmp on Linux) with the following format: crowdsec_req_dump_<RANDOM_PART>.json.

I would like to change where that goes, so I can mount a directory where all containers dump their requests, as when running multiple appsec pods, finding which /tmp dir on which pod is a little tedious. Is there a way to change which directory these dumps end up in? If so, can we please have that documented somewhere in the appsec hooks doc I linked?

A final quick question: is there anyway to change the file name? Knowing what request is associated with what alert would be very helpful for troubleshooting.

Thanks so much for any help you can provide!

Kind regards,
Jesse

主要言語
Go
スター
15.1k
フォーク
726
平均マージ
4日 23時間
マージ済み PR(30日)
27

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

crowdsecurity/crowdsec のほかの issue

crowdsecurity/crowdsec の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。