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

cleanup: replace banned.h with semgrep #2881

Merged

Conversation

LucaGuerra
Copy link
Contributor

What type of PR is this?

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

/kind cleanup

Any specific area of the project related to this PR?

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

/area engine

/area CI

What this PR does / why we need it:

We used to have a banned.h header file that prevents you from using specific functions. The problem with it is that we have to manually add it to any .cpp file that we ever write. This does not happen in practice unless there is a specific header that always needs to be included (falco_common.h seems to be it but really is not). In libs we have decided to use semgrep in CI instead.

The advantage of using Semgrep is that we don't have to modify the code or remember to include any extra header. The disadvantage is that you won't get compile time errors but only CI time errors. Let's do the same in Falco and in libs.

In addition, a file was using strncat. Replace it with strlcat.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Luca Guerra <luca@guerra.sh>
@github-actions
Copy link

This PR may bring feature or behavior changes in the Falco engine and may require the engine version to be bumped.

Please double check userspace/engine/falco_engine_version.h file. See versioning for FALCO_ENGINE_VERSION.

/hold

Signed-off-by: Luca Guerra <luca@guerra.sh>
Signed-off-by: Luca Guerra <luca@guerra.sh>
@LucaGuerra LucaGuerra force-pushed the update/replace-banned-with-semgrep branch from d436910 to 7ccfeb6 Compare October 19, 2023 08:19
@LucaGuerra
Copy link
Contributor Author

/unhold

version bump is not required

@LucaGuerra
Copy link
Contributor Author

/milestone 0.37.0

@poiana poiana added this to the 0.37.0 milestone Oct 19, 2023
Copy link
Contributor

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

poiana commented Oct 19, 2023

LGTM label has been added.

Git tree hash: 59b9a0000ded79a003f216371a159fa2e21cc81e

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

poiana commented Oct 19, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, 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:
  • OWNERS [Andreagit97,FedeDP,LucaGuerra]

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 3ff2bb5 into falcosecurity:master Oct 19, 2023
20 checks passed
@LucaGuerra LucaGuerra deleted the update/replace-banned-with-semgrep branch October 20, 2023 07:26
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.

None yet

4 participants