Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

output: add nats streaming stan output #135

Merged
merged 1 commit into from
Dec 11, 2020

Conversation

cpanato
Copy link
Member

@cpanato cpanato commented Dec 9, 2020

What type of PR is this?
/kind feature

Any specific area of the project related to this PR?
/area outputs

What this PR does / why we need it:
Add nats streaming stan to the outputs

we can refactor both nats/stan maybe later if needed.

tested with a nats/stan server

then:

sending a falco sample message:

falcosidekick logs:

2020/12/09 12:49:35 [INFO]  : Enabled Outputs : STAN
2020/12/09 12:49:35 [INFO]  : Falco Sidekick is up and listening on port 2801
2020/12/09 12:49:35 [INFO]  : Debug mode : true
2020/12/09 13:02:55 [DEBUG] : Falco's payload : {"output":"This is a test from falcosidekick","priority":"Debug","rule":"Test rule","time":"2020-12-09T12:02:55Z","output_fields":null}
2020/12/09 13:02:55 [INFO]  : STAN - Publish OK
2020/12/09 13:02:56 [DEBUG] : Falco's payload : {"output":"This is a test from falcosidekick","priority":"Debug","rule":"Test rule","time":"2020-12-09T12:02:56Z","output_fields":null}
2020/12/09 13:02:57 [INFO]  : STAN - Publish OK

created a consumer app to read:

./stan-nats

Received a message: {"output":"This is a test from falcosidekick","priority":"Debug","rule":"Test rule","time":"2020-12-09T12:03:02Z","output_fields":null}

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

/assign @Issif

@poiana
Copy link

poiana commented Dec 9, 2020

@cpanato: The label(s) area/outputs cannot be applied, because the repository doesn't have them

In response to this:

What type of PR is this?
/kind feature

Any specific area of the project related to this PR?
/area outputs

What this PR does / why we need it:
Add nats streaming stan to the outputs

we can refactor both nats/stan maybe later if needed.

tested with a nats/stan server

then:

sending a falco sample message:

falcosidekick logs:

2020/12/09 12:49:35 [INFO]  : Enabled Outputs : STAN
2020/12/09 12:49:35 [INFO]  : Falco Sidekick is up and listening on port 2801
2020/12/09 12:49:35 [INFO]  : Debug mode : true
2020/12/09 13:02:55 [DEBUG] : Falco's payload : {"output":"This is a test from falcosidekick","priority":"Debug","rule":"Test rule","time":"2020-12-09T12:02:55Z","output_fields":null}
2020/12/09 13:02:55 [>>>>>>>] : STAN - stan / hello / nats://localhost:4222
2020/12/09 13:02:55 [INFO]  : STAN - Publish OK
2020/12/09 13:02:56 [DEBUG] : Falco's payload : {"output":"This is a test from falcosidekick","priority":"Debug","rule":"Test rule","time":"2020-12-09T12:02:56Z","output_fields":null}
2020/12/09 13:02:56 [>>>>>>>] : STAN - stan / hello / nats://localhost:4222
2020/12/09 13:02:57 [INFO]  : STAN - Publish OK

created a consumer app to read:

./stan-nats

Received a message: {"output":"This is a test from falcosidekick","priority":"Debug","rule":"Test rule","time":"2020-12-09T12:03:02Z","output_fields":null}

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

/assign @Issif

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@cpanato
Copy link
Member Author

cpanato commented Dec 9, 2020

/hold for some manual tests with multiple sidekicks

CHANGELOG.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
config.go Show resolved Hide resolved
handlers.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
types/types.go Outdated Show resolved Hide resolved
outputs/stan.go Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Member

@Issif Issif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@poiana poiana added the lgtm label Dec 11, 2020
@poiana
Copy link

poiana commented Dec 11, 2020

LGTM label has been added.

Git tree hash: f2e9b42c5dd5ec631ac19329a659d5d8a6f98a3c

@poiana
Copy link

poiana commented Dec 11, 2020

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Issif

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cpanato
Copy link
Member Author

cpanato commented Dec 11, 2020

/hold cancel

tests done using both config file and env vars

@poiana poiana merged commit a86ca9b into falcosecurity:master Dec 11, 2020
@cpanato cpanato deleted the add-stan-output branch December 11, 2020 11:30
@Issif Issif added this to the 2.20.0 milestone Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants