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

Đang mở
#4,830 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 4 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
49/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, kubernetes
Lĩnh vực
backend, documentation

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Go
Star
15.1k
Fork
726
Merge trung bình
4 ngày 23 giờ
Pull request đã merge (30 ngày)
27

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của crowdsecurity/crowdsec

Tất cả issue của crowdsecurity/crowdsec

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.