intelowlproject / go-intelowl Goto Github PK
View Code? Open in Web Editor NEWIntelOwl's client library/SDK in golang.
Home Page: https://pkg.go.dev/github.com/intelowlproject/go-intelowl
License: GNU Affero General Public License v3.0
IntelOwl's client library/SDK in golang.
Home Page: https://pkg.go.dev/github.com/intelowlproject/go-intelowl
License: GNU Affero General Public License v3.0
Since we are using Go's httptest
to simulate our IntelOwl
server through by creating a mock test server from httptest.Server
and using httptest.ServeMux
as a router to implement our mock responses on the specified endpoint
Right now we need are initializing the test server with every test. By using gorilla/mux we can implement a request method-based router from which we only need to set up the test server once and keep using that for every test!
To implement a common setup and teardown we can use TestMain
. For more information, you can read about it here.
Divide the project into a proper structure like pyintelowl. In this structure we will have the following:
this directory will hold the service objects such Tags.go
, Jobs.go
this directory will hold the unit tests of each service
this directory will hold a basic example and an advanced example on how to effectively use go-intel
this directory will hold all of the documentation related to the project. Inspiration will be taken from pydragonfly
This will hold the github actions for CI-CD
This file will hold all the dependencies needed for project if any are required.
Implement error handling by dividing the errors into a struct called intelOwlError
It will implement the go error interface so it's a proper Go error
Add up a Pull Request template similar to the one present in intelOwl
Description:
Playbooks could be high-level abstraction to an IntelOwl analysis. Pre-written playbooks that define a flow like:
given an IoC -> run these particular analyzers -> run these particular connectors, etc.
More at: intelowlproject/IntelOwl#628
Useful reference: https://golang.org/doc/tutorial/create-module
IntelOwlClient
struct and it's functions which can be published to https://pkg.go.dev/.Can this be made an enum? Let's create an issue for this.
Originally posted by @sp35 in #36 (comment)
Currently in gointelowl_test.go the API token are exposed, it is desired to store them in a .env
file and then use
Right now, Go-IntelOwl has only basic features. Are there any plans to turn it into a proper CLI? This would help us mature the library further as we go as we ourselves would come across multiple use cases related to this. I would love to help work this out if there are any plans.
While I am at it, I would also set up pre-commit for this project like there exists for IntelOwl and PyIntelOwl.
Since while accessing any property of a package, the client will write the package name, so there is no need to include package name in the content name.
e.g. in the file client.go, we have a struct named IntelOwlClientOptions. Whenever the client needs to access it, he/she writes :-
gointelowl.IntelOwlClientOptions{}
Here, the word IntelOwl is repeating 2 times! Instead, we can write :-
gointelowl.ClientOptions{}
The names of the contents of the package must be renamed to follow the conventions and avoid unneccessary long names.
We should try to follow the same workflow of all the other projects:
Separate the API endpoints to their specific resource and make a service object in separate files. Furthermore, provide optional struct parameters.
Add proper documentation. It will consist of the following:
Implement the builder pattern for making the requests in the Go Client!
I don't like approach of just appending functions to the IntelOwlClient
struct.
This SDK should be created following the approach given in this blog-post, especially the "Service Objects" heading.
This approach is very similar to how we (at Certego) wrote pydragonfly recently using the django-rest-client framework (also written by us).
Better handling of mocks for service tests
Originally posted by @sp35 in #35 (comment)
Separate the API endpoints to their specific resource and make a service object in separate files. Furthermore, provide optional struct parameters.
Add github actions for linting code and running the tests.
Like in Java we have Constants
classes to keep all of your constants such as
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.