NCSC-NL / taranis3

Taranis
Other
59 stars 17 forks source link

Problem setting up a Twitter source #48

Closed JanaK989 closed 3 years ago

JanaK989 commented 3 years ago

I have a problem when setting up Twitter as a source. I created a developer account, generated tokens, and added them into config file. I set it like this: twitter_consumer_key - API key twitter_consumer_secret - API secret key twitter_access_token - access token twitter_access_token_secret - access token secret. I chose this URL: https://api.twitter.com/1.1/search/tweets.json?q=mykeyword&result_type=recent&count=100 and chose mykeyword to CVE. When I add this URL into browser, I get this error: {"errors":[{"code":215,"message":"Bad Authentication data."}]} Did I do something wrong? Also, am I setting the URL the right way? If I wanna follow @CVEnew, do I just add @CVEnew instead of a mykeyword in URL? Thank you

markov2 commented 3 years ago

Twitter has changed its authentication. Which version of Taranis are you running?

JanaK989 commented 3 years ago

my version is 3.7.4

markov2 commented 3 years ago

A patch was included in 3.7.5, which was released last week. It includes pull request https://github.com/NCSC-NL/taranis3/pull/44 (you may apply it by hand)

JanaK989 commented 3 years ago

I have changed config file and also ~/taranis-3.7.4/perl5/Taranis/Collector/Twitter.pm according to the guide you sent me. Now I am not able to get to the Taranis Sources on the website: [parsererror - SyntaxError: Unexpected end of JSON input (200)]. Do I need to change Twitter.pm file according to this link as well? https://github.com/NCSC-NL/taranis3/pull/44/commits/696704ad3e0fd644202cda543e6c98a4fa284811#diff-fe712fa580968d24641e7f00e79a095d2cf7c2814ef9a0b33d485f52ed227463 Thank you

markov2 commented 3 years ago

Yes.

JanaK989 commented 3 years ago

OK, thank you, Sources are accessible now. I do still have the same error as before. This is the message from Collector logs: Could not retrieve url https://api.twitter.com/CVEnew 404 Not Found.

markov2 commented 3 years ago

That's consistent with my browser ;-)

JanaK989 commented 3 years ago

Hello, I have sorted it out. Thank you for your help.

markov2 commented 3 years ago

Can you please share the solution, and then close this issue?

JanaK989 commented 3 years ago

I set Bearer token instead of the other ones, but didnt change Custom collector module to Twitter in the Collector option before so it wasn't working correctly. After I fixed that, it was OK.