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

new(falco): add more version fields to --support and --version #2325

Merged

Conversation

LucaGuerra
Copy link
Contributor

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area engine

What this PR does / why we need it:

Since a few Falco versions we have fields indicating libs, drivers, plugin APIs and so forth. These should be reflected into the --support option of Falco. In addition, the --version command should contain the engine version as well in my opinion since users may want to easily check whether a rule file is compatible with their version of Falco without necessarily running against it.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

new(falco): add more version fields to --support and --version

@leogr
Copy link
Member

leogr commented Dec 16, 2022

/milestone 0.34.0

👍

@poiana poiana added this to the 0.34.0 milestone Dec 16, 2022
Comment on lines +53 to +65
auto driver_api_version = s->get_scap_api_version();
unsigned long driver_api_major = PPM_API_VERSION_MAJOR(driver_api_version);
unsigned long driver_api_minor = PPM_API_VERSION_MINOR(driver_api_version);
unsigned long driver_api_patch = PPM_API_VERSION_PATCH(driver_api_version);
snprintf(driver_api_version_string, sizeof(driver_api_version_string), "%lu.%lu.%lu", driver_api_major, driver_api_minor, driver_api_patch);

support["driver_api_version"] = driver_api_version_string;

auto driver_schema_version = s->get_scap_schema_version();
unsigned long driver_schema_major = PPM_API_VERSION_MAJOR(driver_schema_version);
unsigned long driver_schema_minor = PPM_API_VERSION_MINOR(driver_schema_version);
unsigned long driver_schema_patch = PPM_API_VERSION_PATCH(driver_schema_version);
snprintf(driver_schema_version_string, sizeof(driver_schema_version_string), "%lu.%lu.%lu", driver_schema_major, driver_schema_minor, driver_schema_patch);
Copy link
Member

Choose a reason for hiding this comment

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

it would be amazing if we had a sinsp API to do that instead of using low levels macro, but we can do that in a next step :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Completely agree, since I wrote this when libs 0.10.0 was already about to be released I didn't want to add an API dependency right now, as harmless as it may be.

Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

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

/approve

@poiana
Copy link
Contributor

poiana commented Dec 16, 2022

LGTM label has been added.

Git tree hash: f606f033c6631b6a5dab27791331e04dde0ca990

@poiana
Copy link
Contributor

poiana commented Dec 16, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, leogr, LucaGuerra

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 merged commit 6ea233d into falcosecurity:master Dec 16, 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