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

update(userspace/falco): make plugin init config optional and add --plugin-info CLI option #2059

Merged
merged 3 commits into from
Jun 14, 2022

Conversation

jasondellaluce
Copy link
Contributor

What type of PR is this?

/kind feature

Any specific area of the project related to this PR?

/area engine

What this PR does / why we need it:

This PR brings two main contributions:

  1. Make the plugin's init_config field optional in falco.yaml. If not specified, Falco assumes an empty string to be passed as an empty configuration, which is what is used most commonly so far and also makes the config parsing process more robust
  2. Add a new CLI option --plugin-info that prints detailed information regarding one individual plugin loaded through the Falco config. This allows printing info such as the init config schema or a list of suggested open parameters.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Example usage of the --plugin-info option (assuming the k8saudit plugin is loaded):

# falco --plugin-info=k8saudit
Fri Jun 10 12:24:25 2022: Falco version 0.31.1-248+10e6e61 (driver version 075da069af359954122ed7b8a9fc98bc7bcf3116)
Fri Jun 10 12:24:25 2022: Falco initialized with configuration file /etc/falco/falco.yaml
Name: k8saudit
Description: Read Kubernetes Audit Events and monitor Kubernetes Clusters
Contact: github.com/falcosecurity/plugins
Version: 0.2.1
Capabilities: 
  - Event Sourcing (ID=1, source='k8s_audit')
  - Field Extraction

Init config schema type: JSON
{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/Plugin","definitions":{"Plugin":{"properties":{"Config":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PluginConfig"}},"additionalProperties":true,"type":"object"},"PluginConfig":{"properties":{"sslCertificate":{"type":"string","description":"The SSL Certificate to be used with the HTTPS Webhook endpoint (Default: /etc/falco/falco.pem)"},"useAsync":{"type":"boolean","description":"If true then async extraction optimization is enabled (Default: true)"},"maxEventSize":{"type":"integer","description":"Maximum size of single audit event (Default: 262144)"},"webhookMaxBatchSize":{"type":"integer","description":"Maximum size of incoming webhook POST request bodies (Default: 12582912)"}},"additionalProperties":true,"type":"object"}}}

No suggested open params available: plugin has not been configured, or it does not implement the open params suggestion functionality

Does this PR introduce a user-facing change?:

update(userspace/falco): make plugin init config optional and add --plugin-info CLI option

@poiana
Copy link
Contributor

poiana commented Jun 10, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jasondellaluce

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

@poiana poiana requested review from leodido and mfdii June 10, 2022 12:36
Signed-off-by: Jason Dellaluce <[email protected]>
@poiana
Copy link
Contributor

poiana commented Jun 10, 2022

LGTM label has been added.

Git tree hash: 781aecebf09433bbb7ee46d9b4f80664c5dca4a0

@jasondellaluce
Copy link
Contributor Author

/milestone 0.33.0

@poiana poiana added this to the 0.33.0 milestone Jun 11, 2022
@leogr
Copy link
Member

leogr commented Jun 13, 2022

/cc @mstemm

@poiana poiana requested a review from mstemm June 13, 2022 07:41
@poiana poiana merged commit 1e5ef91 into master Jun 14, 2022
@poiana poiana deleted the chore/plugin-ux branch June 14, 2022 20:13
@jasondellaluce jasondellaluce modified the milestones: 0.33.0, 0.32.1 Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants