Skip to content

Commit b773f2d

Browse files
committed
add http datasource
1 parent fb86358 commit b773f2d

1 file changed

Lines changed: 170 additions & 0 deletions

File tree

  • crowdsec-docs/docs/data_sources
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+
port: 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+
port: 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+
port: 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+
port: 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+
### `port`
72+
73+
The port to listen on.
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+
Required.
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+

0 commit comments

Comments
 (0)