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] Support per-file allowed lists for the badfuncs inspection #805

Merged
merged 1 commit into from Jun 23, 2022

Conversation

dcantrell
Copy link
Collaborator

Some programs and libraries deliberately use functions that have been
deemed forbidden by policy. An example would be a library providing
runtime support for older software. In cases like this, you can
specify an allowed block listing path globs and the specific forbidden
functions they are allowed to use. It is adviseable to add a comment
idnicating why the forbidden function is allowed so future readers
will understand why the rpminspect.yaml file is configured that way.

The path specifications can be explicit paths (local path notation,
relative to /) or patterns that are compatible with fnmatch(3) and
glob(3).

For example:

---
badfuncs:
    allowed:
        /usr/sbin/somenetcmd:
            - inet_aton
            - gethostbyname
        /usr/lib*/libsomething.so.*:
            - inet_network

You can place this block in the package's rpminspect.yaml file to
further control how the badfuncs inspection works for your build.

Fixes: #573

Signed-off-by: David Cantrell dcantrell@redhat.com

Some programs and libraries deliberately use functions that have been
deemed forbidden by policy.  An example would be a library providing
runtime support for older software.  In cases like this, you can
specify an allowed block listing path globs and the specific forbidden
functions they are allowed to use.  It is adviseable to add a comment
idnicating why the forbidden function is allowed so future readers
will understand why the rpminspect.yaml file is configured that way.

The path specifications can be explicit paths (local path notation,
relative to /) or patterns that are compatible with fnmatch(3) and
glob(3).

For example:

    ---
    badfuncs:
        allowed:
            /usr/sbin/somenetcmd:
                - inet_aton
                - gethostbyname
            /usr/lib*/libsomething.so.*:
                - inet_network

You can place this block in the package's rpminspect.yaml file to
further control how the badfuncs inspection works for your build.

Fixes: rpminspect#573

Signed-off-by: David Cantrell <dcantrell@redhat.com>
@dcantrell dcantrell added this to the v1.10 milestone Jun 23, 2022
@dcantrell dcantrell requested a review from jimbair June 23, 2022 16:06
@dcantrell dcantrell self-assigned this Jun 23, 2022
@dcantrell dcantrell merged commit 478c33e into rpminspect:master Jun 23, 2022
@hroncok
Copy link
Contributor

hroncok commented Jul 18, 2022

Thank you. I'm finally trying this in https://src.fedoraproject.org/rpms/python3.11/pull-request/65 -- hoping the CI installs rpminspect from your copr.

@hroncok
Copy link
Contributor

hroncok commented Jul 18, 2022

It says "rpminspect version 1.10" but badfuncs fails. Am I doing it wrong?

@hroncok
Copy link
Contributor

hroncok commented Jul 19, 2022

It says "rpminspect version 1.10" but badfuncs fails. Am I doing it wrong?

I was doing it wrong. Trying again.

@hroncok
Copy link
Contributor

hroncok commented Jul 19, 2022

Same resuts.

DaanDeMeyer pushed a commit to DaanDeMeyer/python-rpm that referenced this pull request Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFE: badfuncs - ignore file(s) only for specific function(s)
3 participants