Cisco-Talos / clamav-safebrowsing

GNU General Public License v2.0
46 stars 6 forks source link

SAWarning: relationship 'SBHash.reflist' will copy column sbclient_v4_lists.id to column sbclient_v4_hashes.reflist_id #10

Closed guardiandigital closed 2 years ago

guardiandigital commented 2 years ago

I'm seeing the following warning/error when attempting to update the clamav safebrowsing data using clamsbwrite.py:

$ ./clamsbwrite.py --config /etc/clamd.d/safebrowsing.conf
./clamsbwrite.py:36: SAWarning: relationship 'SBPrefix.hashes' will copy column sbclient_v4_prefixes.reflist_id to column sbclient_v4_hashes.reflist_id, which conflicts with relationship(s): 'SBList.hashes' (copies sbclient_v4_lists.id to sbclient_v4_hashes.reflist_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="hashes"' to the 'SBPrefix.hashes' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
  lists = session.query(db.SBList).all()

./clamsbwrite.py:36: SAWarning: relationship 'SBHash.reflist' will copy column sbclient_v4_lists.id to column sbclient_v4_hashes.reflist_id, which conflicts with relationship(s): 'SBPrefix.hashes' (copies sbclient_v4_prefixes.reflist_id to sbclient_v4_hashes.reflist_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="hashes"' to the 'SBHash.reflist' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)

/etc/clamd.d/safebrowsing.conf

<safebrowsing>
    # Google's apikey for the safebrowsing datafeed
    apikey = AIzaSyBwvw...L44_fvY8WVaM

    ## MySQL database parameters
    db_host = havoc.example.com
    db_user = sbclient
    db_pw = pass
    db_name = sbclient

    ## outputdir is where the update python makes its safebrowsing.gdb
    outputdir = /var/lib/clamav/
</safebrowsing>

This is on fedora35 with python3-3.10.4-1.fc35.x86_64

micahsnyder commented 2 years ago

Hi @guardiandigital,

The primary developer for this tool is a former team member that no longer works with us. So ramping up on understanding and fixing this issue would take some time for whomever does it.

Can you tell me if this issue is fatal or if it is just a passing warning and you're able to still generate the safebrowsing.gdb database?

Regards, Micah

guardiandigital commented 2 years ago

Hi @micahsnyder - it doesn't appear that the hashes, lists, prefixes, and updates tables are being updated.

Last update appears to be more than six months ago?