-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from deepfence/sensor-plugin-output
sensor: Add a posssibility to output directly to plugins
- Loading branch information
Showing
16 changed files
with
233 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,6 @@ input: | |
address: 0.0.0.0 | ||
port: 8081 | ||
output: | ||
file: | ||
path: /dev/null | ||
plugins: | ||
s3: | ||
region: eu-west-1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
output: | ||
plugins: | ||
s3: | ||
region: eu-west-1 | ||
bucket: foo-pcap | ||
totalFileSize: 10MB | ||
uploadChunkSize: 5MB | ||
uploadTimeout: 1m | ||
cannedACL: bucket-owner-full-control | ||
pcapMode: all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Plugins | ||
|
||
This documentation section is about plugins which allow to stream packets to | ||
various external storage services. | ||
|
||
Plugins can be used both from: | ||
|
||
- **sensor** - in that case, locally captured packets are streamed through the | ||
plugin | ||
- **receiver** - all packets retrieved from (potentially multiple) sensors are | ||
streamed through the plugin | ||
|
||
Currently the plugins are: | ||
|
||
- [S3](./s3.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# S3 | ||
|
||
The S3 plugins allows to stream packets to the given S3 buckets. | ||
|
||
## Configuration | ||
|
||
### AWS credentials | ||
|
||
Before running PacketStreamer, AWS credentials need to be configured by one of | ||
the following ways: | ||
|
||
- `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables | ||
- `~/.aws/config` file - it can be created by `aws configure` | ||
|
||
The first way might be more convenient when running as root (required when | ||
running a sensor). | ||
|
||
### Configuration scheme | ||
|
||
S3 plugin configuration has the following syntax: | ||
|
||
```yaml | ||
output: | ||
plugins: # optional | ||
s3: | ||
bucket: _string_ | ||
region: _string_ | ||
totalFileSize: _file_size_ # optional; default: 10 MB | ||
uploadChunkSize: _file_size_ # optional; default: 5 MB | ||
uploadTimeout: _timeout_ # optional; default: 1m | ||
cannedACL: _acl_ # optional; default: Bucket owner enforced | ||
``` | ||
### Sensor configuration | ||
If you want to stream locally captured packets from sensor to S3, you can use | ||
the following example configuration from | ||
[contrib/config/sensor-s3.yaml](https://raw.githubusercontent.com/deepfence/PacketStreamer/main/contrib/config/sensor-s3.yaml): | ||
```yaml | ||
{{#rustdoc_include ../../../contrib/config/sensor-s3.yaml}} | ||
``` | ||
|
||
And run PacketStreamer with it: | ||
|
||
```bash | ||
sudo packetstreamer sensor --config ./contrib/config/sensor-s3.yaml | ||
``` | ||
|
||
### Receiver configuration | ||
|
||
If you want to stream packets from receiver to S3, you can use the following | ||
example configuration from | ||
[contrib/config/receiver-s3.yaml] | ||
|
||
```yaml | ||
{{#rustdoc_include ../../../contrib/config/receiver-s3.yaml}} | ||
``` | ||
|
||
```bash | ||
packetstreamer receiver --config ./contrib/config/receiver-s3.yaml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.