yeti icon indicating copy to clipboard operation
yeti copied to clipboard

How to Create Custom Feed by using "File" as Source input

Open s-shubh opened this issue 6 years ago • 5 comments

Environment

Question Answer
OS version CentOS 7
Browser Chrome Latest

Hi Folks,

I am having a list of files; those contains blacklisted IP along with its category which I want to configure as feed source in Yeti. As per the documentation; Source can only be an HTTP request to download such kind of data. Could it be possible to use downloaded file or updated file as a Source. I have been customizing this file for my own purpose. Its threat sources would be different which also limits their API use.

This file will be set to update on daily bases but I could not parse it through YETI.

Find the format of file1 :


IP Category

OR

URL Category

Please let me know whether it could be possible and if yes then help to parse it through Yeti...!

Shubham Shah

s-shubh avatar Feb 19 '19 06:02 s-shubh

I saw your message on the mailing list, let's keep the discussion going here so that it's easily referenced.

You can create a feed with any kind of source as you want, as long as your python code can access it. Most of the time it's URLs, so we've created "helpers" that deal with common feed formats (CSV / XML, etc.), but you don't have to use them.

If the files are on your local server, then it's easy to create a feed to open the file and read stuff from it.

tomchop avatar Feb 19 '19 12:02 tomchop

Hey,

Thank you for an information.

I am little bit new to python. I was just taking a reference from your examples. Could you pleas help me in this ?

s-shubh avatar Feb 19 '19 17:02 s-shubh

You want to sync one file ? or directory ?

sebdraven avatar Apr 02 '19 13:04 sebdraven

I am little bit new in python, please suggest me how can get feeds from file rather than url. This file updates every day on the execution of some urls which i can not share in that yeti config.

On Tue 19 Feb, 2019, 6:26 PM Thomas Chopitea, [email protected] wrote:

I saw your message on the mailing list, let's keep the discussion going here so that it's easily referenced.

You can create a feed with any kind of source as you want, as long as your python code can access it. Most of the time it's URLs, so we've created "helpers" that deal with common feed formats (CSV / XML, etc.), but you don't have to use them.

If the files are on your local server, then it's easy to create a feed to open the file and read stuff from it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yeti-platform/yeti/issues/340#issuecomment-465118005, or mute the thread https://github.com/notifications/unsubscribe-auth/AYMDjjGidI6LX7b74VM20ujkBxrMLnD9ks5vO_R9gaJpZM4bCQSL .

s-shubh avatar Apr 09 '19 07:04 s-shubh

see any feed, and in

    def update(self):
        for line in open(path_to_your_file, "r").read():# or readlines, you know better how to handle your file 
            self.analyze(line)

doomedraven avatar May 20 '19 14:05 doomedraven