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

fix(userspace): handle exceptions for process_k8s_audit_event #1617

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

fntlnz
Copy link
Contributor

@fntlnz fntlnz commented Apr 13, 2021

This fix has two major points in it:

  • when std::stoll is used in parse_as_int64 handle all the exceptions it
    can throw (https://en.cppreference.com/w/cpp/string/basic_string/stol)
  • when process_k8s_audit_event an eventual exception in it does not
    stop the webserver process. This is done by doing a catch all handle
    outside it and by logging an error message to the caller as well as in
    stderr

Signed-off-by: Lorenzo Fontana lo@linux.com

What type of PR is this?

/kind bug

Any specific area of the project related to this PR?

/area engine

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #1575

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

fix: do not stop the webserver for k8s audit logs when invalid data is coming in the event to be processed

leogr
leogr previously approved these changes Apr 13, 2021
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.

LGTM

@poiana
Copy link

poiana commented Apr 13, 2021

LGTM label has been added.

Git tree hash: c40a9a670db0c63db0fdefeecd2c7eee207b7b65

@leodido
Copy link
Member

leodido commented Apr 14, 2021

/milestone 0.28.1

leodido
leodido previously approved these changes Apr 15, 2021
@leogr
Copy link
Member

leogr commented Apr 19, 2021

Closing and reopening to trigger the CI again
/close

@poiana poiana closed this Apr 19, 2021
@poiana
Copy link

poiana commented Apr 19, 2021

@leogr: Closed this PR.

In response to this:

Closing and reopening to trigger the CI again
/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 Apr 19, 2021

/reopen

@poiana poiana reopened this Apr 19, 2021
@poiana
Copy link

poiana commented Apr 19, 2021

@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.

This fix has two major points in it:

- when `std::stoll` is used in parse_as_int64 handle all the exceptions it
can throw (https://en.cppreference.com/w/cpp/string/basic_string/stol)
- when `process_k8s_audit_event` an eventual exception in it does not
stop the webserver process. This is done by doing a catch all handle
outside it and by logging an error message to the caller as well as in
stderr

Signed-off-by: Lorenzo Fontana <lo@linux.com>
@poiana
Copy link

poiana commented Apr 19, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: leodido, 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:

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 46425b3 into master Apr 19, 2021
@poiana poiana deleted the lf/fix/1575 branch April 19, 2021 10:32
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.

Falco throwing 'std::out_of_range' when 'falco-gke-audit-bridge' is also executed
4 participants