Bug 255397 - security/suricata: suricata-update is failing to find certain python modules when trying to update rules.
Summary: security/suricata: suricata-update is failing to find certain python modules ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Kevin Bowling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-25 18:21 UTC by Ian Dickens
Modified: 2021-06-15 18:10 UTC (History)
2 users (show)

See Also:
linimon: maintainer-feedback? (franco)


Attachments
fix plist for suircata-update (1.48 KB, patch)
2021-05-23 18:52 UTC, Franco Fichtner
franco: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Dickens 2021-04-25 18:21:52 UTC
this used to work with suricata 5.x but now, with having FreeBSD 13.0 RELEASE installed, suricata builds fine but suricata-update fails:

root@sunspot-thin:/usr/local/bin # ./suricata-update
Traceback (most recent call last):
  File "./suricata-update", line 32, in <module>
    from suricata.update import main
  File "./../lib/python3.7/site-packages/suricata/update/main.py", line 50, in <module>
    from suricata.update import (
  File "./../lib/python3.7/site-packages/suricata/update/commands/__init__.py", line 17, in <module>
    from suricata.update.commands import addsource
  File "./../lib/python3.7/site-packages/suricata/update/commands/addsource.py", line 22, in <module>
    from suricata.update import sources
  File "./../lib/python3.7/site-packages/suricata/update/sources.py", line 28, in <module>
    from suricata.update import net
  File "./../lib/python3.7/site-packages/suricata/update/net.py", line 38, in <module>
    from suricata.update import osinfo
ImportError: cannot import name 'osinfo' from 'suricata.update' (./../lib/python3.7/site-packages/suricata/update/__init__.py)
root@sunspot-thin:/usr/local/bin # uname -a
FreeBSD sunspot-thin.south-border.com 13.0-RELEASE FreeBSD 13.0-RELEASE #1 r369322M: Sat Apr 24 07:18:54 EDT 2021     root@sunspot-thin.south-border.com:/usr/obj/usr/12.2-RELEASE/amd64.amd64/sys/NEWSOUTH2  amd64
root@sunspot-thin:/usr/local/bin # pkg info | egrep suricata
suricata-6.0.2                 High Performance Network IDS, IPS and Security Monitoring engine

I tried installing py-pip and adding the modules but that didn't work for me.  Oh, I should say that the custom kernel config really just builds pf modules into it as compiled in .  Nothing more that then really.

Thanks,

Ian
Comment 1 Ian Dickens 2021-05-16 16:38:07 UTC
So, I was able to finally fix this for myself by downloading the parsers.py and matchers.py from https://fossies.org/linux/suricata/suricata-update/suricata/update and placing them in /usr/local/lib/python3.8/site-packages/suricata/update/

https://fossies.org/linux/suricata/suricata-update/suricata/update/matchers.py

https://fossies.org/linux/suricata/suricata-update/suricata/update/parsers.py

After that suricata-update worked fine.
Comment 2 Franco Fichtner 2021-05-23 18:52:52 UTC
Created attachment 225204 [details]
fix plist for suircata-update

Hi,

Sorry for the delay.  Attached patch fixes the issue, but we need to wait for a committer to pick this up.


Cheers,
Franco
Comment 3 commit-hook freebsd_committer freebsd_triage 2021-06-15 15:12:20 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b0e101ec785b9a445e5beca3a5c8351a1537e810

commit b0e101ec785b9a445e5beca3a5c8351a1537e810
Author:     Franco Fichtner <franco@opnsense.org>
AuthorDate: 2021-06-15 15:09:35 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2021-06-15 15:09:35 +0000

    security/suricata: Fix plist issues

    suricata-update is failing to find certain python modules when trying
    to update rules.

    PR:             255397
    Reported by:    Ian Dickens <ian@south-border.com>
    Approved by:    maintainer
    MFH:            2021Q2

 security/suricata/Makefile  | 2 +-
 security/suricata/pkg-plist | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-06-15 15:13:21 UTC
A commit in branch 2021Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=52617d7bda4f806b6f26e03506182411dcc8b877

commit 52617d7bda4f806b6f26e03506182411dcc8b877
Author:     Franco Fichtner <franco@opnsense.org>
AuthorDate: 2021-06-15 15:09:35 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2021-06-15 15:12:45 +0000

    security/suricata: Fix plist issues

    suricata-update is failing to find certain python modules when trying
    to update rules.

    PR:             255397
    Reported by:    Ian Dickens <ian@south-border.com>
    Approved by:    maintainer
    MFH:            2021Q2

    (cherry picked from commit b0e101ec785b9a445e5beca3a5c8351a1537e810)

 security/suricata/Makefile  | 1 +
 security/suricata/pkg-plist | 6 ++++++
 2 files changed, 7 insertions(+)
Comment 5 Kevin Bowling freebsd_committer freebsd_triage 2021-06-15 15:13:44 UTC
Thanks for your contributions!
Comment 6 Franco Fichtner 2021-06-15 18:10:36 UTC
Yay, thanks!