Skip to content

Commit d0a8cc7

Browse files
committed
fix doc for http datasource
1 parent c277c8c commit d0a8cc7

File tree

6 files changed

+175
-2
lines changed

6 files changed

+175
-2
lines changed

crowdsec-docs/docs/data_sources/http.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Look at the `configuration parameters` to view all supported options.
7070

7171
### `listen_addr`
7272

73-
The address to listen on (e.g., `1270.0.1:8088`).
73+
The address to listen on (e.g., `127.0.0.1:8088`).
7474

7575
Required.
7676

crowdsec-docs/docs/data_sources/introduction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Name | Type | Stream | One-shot
1818
[AWS S3](/data_sources/s3.md)| read logs from a S3 bucket | yes | yes
1919
[docker](/data_sources/docker.md) | read logs from docker containers | yes | yes
2020
[file](/data_sources/file.md) | single files, glob expressions and .gz files | yes | yes
21+
[HTTP](/data_sources/http.md) | read logs from an HTTP endpoint | yes | no
2122
[journald](/data_sources/journald.md) | journald via filter | yes | yes
2223
[Kafka](/data_sources/kafka.md)| read logs from kafka topic | yes | no
2324
[Kubernetes Audit](/data_sources/kubernetes_audit.md) | expose a webhook to receive audit logs from a Kubernetes cluster | yes | no

crowdsec-docs/sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
"data_sources/s3",
132132
"data_sources/docker",
133133
"data_sources/file",
134+
"data_sources/http",
134135
"data_sources/journald",
135136
"data_sources/kafka",
136137
"data_sources/kubernetes_audit",
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
---
2+
id: http
3+
title: HTTP
4+
---
5+
6+
This module allows the `Security Engine` to acquire logs from an HTTP endpoint.
7+
8+
## Configuration examples
9+
10+
To receive logs from an HTTP endpoint with basic auth:
11+
```yaml
12+
source: http
13+
listen_addr: 127.0.0.1:8080
14+
path: /test
15+
auth_type: basic_auth
16+
basic_auth:
17+
username: test
18+
password: test
19+
labels:
20+
type: mytype
21+
```
22+
23+
To receive logs from an HTTP endpoint with headers:
24+
```yaml
25+
source: http
26+
listen_addr: 127.0.0.1:8080
27+
path: /test
28+
auth_type: headers
29+
headers:
30+
MyHeader: MyValue
31+
labels:
32+
type: mytype
33+
```
34+
35+
To receive logs from an HTTP endpoint with TLS and headers:
36+
37+
```yaml
38+
source: http
39+
listen_addr: 127.0.0.1:8080
40+
path: /test
41+
auth_type: headers
42+
headers:
43+
MyHeader: MyValue
44+
tls:
45+
server_cert: server.crt
46+
server_key: server.key
47+
labels:
48+
type: mytype
49+
```
50+
51+
To receive logs from an HTTP endpoint with mTLS:
52+
53+
```yaml
54+
source: http
55+
listen_addr: 127.0.0.1:8080
56+
path: /test
57+
auth_type: mtls
58+
tls:
59+
server_cert: server.crt
60+
server_key: server.key
61+
ca_cert: ca.crt
62+
labels:
63+
type: mytype
64+
```
65+
66+
Look at the `configuration parameters` to view all supported options.
67+
68+
## Parameters
69+
70+
71+
### `listen_addr`
72+
73+
The address to listen on (e.g., `127.0.0.1:8088`).
74+
75+
Required.
76+
77+
### `path`
78+
79+
The endpoint path to listen on.
80+
81+
:::info
82+
The request method is always `POST`.
83+
:::
84+
85+
Optional, default is `/`.
86+
87+
### `auth_type`
88+
89+
The authentication type to use.
90+
91+
Can be `basic_auth`, `headers`, or `mtls`.
92+
93+
Required.
94+
95+
### `basic_auth`
96+
97+
The basic auth credentials.
98+
99+
### `basic_auth.username`
100+
101+
The basic auth username.
102+
103+
Optional, to use when `auth_type` is `basic_auth`.
104+
105+
### `basic_auth.password`
106+
107+
The basic auth password.
108+
109+
Optional, to use when `auth_type` is `basic_auth`.
110+
111+
### `headers`
112+
113+
The headers to send.
114+
115+
Optional, to use when `auth_type` is `headers`.
116+
117+
### `tls`
118+
119+
TLS configuration.
120+
121+
### `tls.server_cert`
122+
123+
The server certificate path.
124+
125+
Optional, to use when `auth_type` is `mtls`.
126+
127+
### `tls.server_key`
128+
129+
The server key path.
130+
131+
Optional, to use when `auth_type` is `mtls`.
132+
133+
### `tls.ca_cert`
134+
135+
The CA certificate path.
136+
137+
Optional, to use when `auth_type` is `mtls`.
138+
139+
### `custom_status_code`
140+
141+
The custom status code to return.
142+
143+
Optional.
144+
145+
### `custom_headers`
146+
147+
The custom headers to return.
148+
149+
Optional.
150+
151+
### `max_body_size`
152+
153+
The maximum body size to accept.
154+
155+
Optional.
156+
157+
### `timeout`
158+
159+
The timeout to read the body.
160+
161+
:::info
162+
The timeout is in duration format, e.g., `5s`.
163+
:::
164+
165+
Optional.
166+
167+
## DSN and command-line
168+
169+
This datasource does not support acquisition from the command line.
170+

crowdsec-docs/versioned_docs/version-v1.6.0/data_sources/introduction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Name | Type | Stream | One-shot
1818
[AWS S3](/data_sources/s3.md)| read logs from a S3 bucket | yes | yes
1919
[docker](/data_sources/docker.md) | read logs from docker containers | yes | yes
2020
[file](/data_sources/file.md) | single files, glob expressions and .gz files | yes | yes
21+
[HTTP](/data_sources/http.md) | read logs from an HTTP endpoint | yes | no
2122
[journald](/data_sources/journald.md) | journald via filter | yes | yes
2223
[Kafka](/data_sources/kafka.md)| read logs from kafka topic | yes | no
2324
[Kubernetes Audit](/data_sources/kubernetes_audit.md) | expose a webhook to receive audit logs from a Kubernetes cluster | yes | no

crowdsec-docs/yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9180,4 +9180,4 @@ yocto-queue@^1.0.0:
91809180
zwitch@^2.0.0:
91819181
version "2.0.4"
91829182
resolved "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz"
9183-
integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==
9183+
integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==

0 commit comments

Comments
 (0)