Coder Social home page Coder Social logo

Comments (6)

mgoffin avatar mgoffin commented on May 4, 2024 1

I don't believe so. I think this was related to my request to allow searching on the privacy_members field for the ID of the privacy group, so I could say "I'm a member of the Foo privacy group, show me all Descriptors shared out to the Foo privacy group".

I don't think anything came of that, but the thread was in the FB group if you can find it :)

from threatexchange.

mgoffin avatar mgoffin commented on May 4, 2024

You aren't doing anything wrong per-se :) With a recent update we will only return the contents of _default_fields:

https://github.com/facebook/ThreatExchange/blob/master/pytx/pytx/threat_descriptor.py#L36

With nothing to set to the attribute coming back from the server, it will be shown as None. You can adjust your query to look like this to get the full contents:

from pytx import ThreatDescriptor

results = ThreatDescriptor.objects(
    text='giz.exe',
    owner='1678314142420566', # me
    fields=ThreatDescriptor._fields
)

for result in results:
    print(result.to_dict())

This will force the fields ThreatExchange returns to be all of the available fields. Before the recent change I'm not sure if you'd get the privacy_type field either. You could check that by running a query in your browser. If it is returned by default, or if you feel like it would be really helpful to have this field returned all the time, we can update the _default_fields to include it!

from threatexchange.

lolnate avatar lolnate commented on May 4, 2024

Perfect, thanks! It looks like 'privacy_members' is still None, but the privacy_type is now set correctly.

It would be useful to know which privacy group specifically shared the descriptor. I might trust some groups more than others. I could also generate metrics for contributions to private groups. Is there another approach I could use to find that information?

from threatexchange.

mgoffin avatar mgoffin commented on May 4, 2024

I think that's something that I've asked about in the past, but related to searching for the privacy_group that shared the content. If you used _fields and privacy_members is still None, it's because ThreatExchange isn't returning it. So I suspect that data isn't provided, but hopefully someone else can answer whether that should be the case or not.

My gut feeling is that it's not shared because Privacy Groups have a members_can_see attribute, but I don't know, if that's set to False, if that means they can't see the actual Privacy Group and/or it in the privacy_members field.

from threatexchange.

jessek avatar jessek commented on May 4, 2024

@mgoffin is correct. A person can only see the name, description, and members if the members_can_see is field true and the person is a member of the group.

from threatexchange.

lolnate avatar lolnate commented on May 4, 2024

Thanks for the help. Is there a way to know if a particular ThreatDescriptor or other object is shared with a privacy group? members_can_see let's members view information about the privacy group, but it doesn't seem to show any attachment of a group to a descriptor. Some privacy groups might be more important to me than others, so it's a distinction I'd like to know.

If not, I suppose I could approach it a different way. For example, I could get a list of all members in a privacy group, then look for descriptors that have that member as the owner with a privacy type of HAS_PRIVACY_GROUP.

from threatexchange.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.