def get_as_opinions(self) -> t.List[state.SignalOpinion]:
     opinions = [
         state.SignalOpinion(-1, _opinion_mapping(f.feedbackValue), f.tags)
         for f in self.feedbacks
     ]
     # implicitly, all records from StopNCII are from user-submitted cases
     opinions.append(
         state.SignalOpinion(
             0, state.SignalOpinionCategory.WORTH_INVESTIGATING, set()), )
     return opinions
Esempio n. 2
0
 def get_as_opinions(self) -> t.List[state.SignalOpinion]:
     return [
         state.SignalOpinion(
             member_id, state.SignalOpinionCategory.TRUE_POSITIVE, tags
         )
         for member_id, tags in self.member_entries.items()
     ]
 def report_false_positive(
     self,
     collab: FBThreatExchangeCollabConfig,
     s_type: t.Type[SignalType],
     signal: str,
     _metadata: FBThreatExchangeIndicatorRecord,
 ) -> None:
     self.report_opinion(
         collab,
         s_type,
         signal,
         state.SignalOpinion(
             owner=self.get_own_owner_id(collab),
             category=state.SignalOpinionCategory.FALSE_POSITIVE,
             tags=set(),
         ),
     )
 def report_true_positive(
     self,
     collab: FBThreatExchangeCollabConfig,
     s_type: t.Type[SignalType],
     signal: str,
     metadata: FBThreatExchangeIndicatorRecord,
 ) -> None:
     # TODO - this is supported by the API
     self.report_opinion(
         collab,
         s_type,
         signal,
         state.SignalOpinion(
             owner=self.get_own_owner_id(collab),
             category=state.SignalOpinionCategory.TRUE_POSITIVE,
             tags=set(),
         ),
     )
Esempio n. 5
0
    def report_false_positive(
        self,
        collab: TCollabConfig,
        s_type: t.Type[SignalType],
        signal: str,
        metadata: state.TFetchedSignalMetadata,
    ) -> None:
        """
        Report that a previously seen signal is a false positive.

        This is an optional API, and places that use it should catch
        the NotImplementError.
        """
        self.report_opinion(
            collab,
            s_type,
            signal,
            state.SignalOpinion(
                owner=self.get_own_owner_id(collab),
                category=state.SignalOpinionCategory.FALSE_POSITIVE,
                tags=set(),
            ),
        )