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): improve falco termination #2012

Merged
merged 1 commit into from
May 24, 2022

Conversation

Andreagit97
Copy link
Member

Signed-off-by: Andrea Terzolo andrea.terzolo@polito.it

What type of PR is this?

/kind cleanup

/kind feature

Any specific area of the project related to this PR?

/area engine

What this PR does / why we need it:

This PR adds new methods fatal, exit, and ok to run_result struct in order to simplify the Falco termination phase.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@jasondellaluce
Copy link
Contributor

jasondellaluce commented May 23, 2022

/test centos7

@FedeDP FedeDP mentioned this pull request May 24, 2022
53 tasks
jasondellaluce
jasondellaluce previously approved these changes May 24, 2022
Copy link
Contributor

@jasondellaluce jasondellaluce left a comment

Choose a reason for hiding this comment

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

Thanks Andrea! This actually fixes a couple of bugs that were hard to spot!

}
m_state->engine->list_fields(m_options.list_source_fields, m_options.verbose, m_options.names_only, m_options.markdown);

ret.proceed = false;
return run_result::exit();
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like to fix the case in which users use both the list-fields and list-syscall-events options! Just one of them is supposed to execute, but the code previously allowed running both.

}
printf("%sOk\n", prefix.c_str());
}
falco_logger::log(LOG_INFO, "Ok\n");
return run_result::exit();
Copy link
Contributor

Choose a reason for hiding this comment

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

This fixes the -V option. Apparently we didn't notice that Falco didn't terminate anymore on rule validation 😸

#ifndef MINIMAL_BUILD
std::bind(&application::start_grpc_server, this),
std::bind(&application::start_webserver, this),
#endif
std::bind(&application::open_inspector, this),
Copy link
Contributor

Choose a reason for hiding this comment

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

This is good. The inspector should be opened right before starting processing its event to prevent the drivers from dropping events at the first iterations due to the additional delay of launching the webservers.

@poiana
Copy link
Contributor

poiana commented May 24, 2022

LGTM label has been added.

Git tree hash: 43857c8ad38dc086598b79b5a20e9617316d24f1

@jasondellaluce jasondellaluce added this to the 0.32.0 milestone May 24, 2022
@Andreagit97
Copy link
Member Author

Thanks Andrea! This actually fixes a couple of bugs that were hard to spot!

Thank you @jasondellaluce for adding a little bit of context 😄

leogr
leogr previously approved these changes May 24, 2022
Copy link
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

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

🤩

/approve

Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
@Andreagit97
Copy link
Member Author

/hold

@Andreagit97
Copy link
Member Author

/unhold

Copy link
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

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

again

@poiana poiana added the lgtm label May 24, 2022
@poiana
Copy link
Contributor

poiana commented May 24, 2022

LGTM label has been added.

Git tree hash: 23e4def7bf1305e1be88fa4709ceb2b085d8bcaf

Copy link
Contributor

@jasondellaluce jasondellaluce 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 May 24, 2022

[APPROVALNOTIFIER] This PR is APPROVED

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

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:
  • OWNERS [jasondellaluce,leogr]

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

@leogr
Copy link
Member

leogr commented May 24, 2022

Closing and reopening to trigger the CI

/close

@poiana poiana closed this May 24, 2022
@poiana
Copy link
Contributor

poiana commented May 24, 2022

@leogr: Closed this PR.

In response to this:

Closing and reopening to trigger the CI

/close

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.

@leogr
Copy link
Member

leogr commented May 24, 2022

/reopen

@poiana poiana reopened this May 24, 2022
@poiana
Copy link
Contributor

poiana commented May 24, 2022

@leogr: Reopened this PR.

In response to this:

/reopen

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.

@poiana poiana merged commit d860472 into falcosecurity:master May 24, 2022
@Andreagit97 Andreagit97 deleted the run_result branch October 15, 2022 18:14
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