Open SYNchroACK opened 1 year ago
@SamuelHassine if you agree, I could help on this work.
Hello @SYNchroACK,
We've already an on-going work https://github.com/OpenCTI-Platform/client-python/pull/288 for rewriting the whole connector base class with integrated test suit and more guided development guidelines.
The work has been started by @nor3th and we're taking over right now.
Kind regards, Samuel
Ok cool. Let me know if you need feedback.
Problems
Example
Using MISP connector as example, regarding
WORKDIR
,ENTRYPOINT
)env_file
)Suggestions
external-import/misp/src/config.yml.sample
should be removed..env.dist
file, which then will be easily copied to.env
file with the settings defined by the user. This.env
file would be also automatically used by thedocker-compose.yml
file with the service definition of the connector, which again, removes the need to also have the configuration parameters hard-coded in thedocker-compose.yml
(yet another file to keep up to date).set -a ; source .env
and thenpython misp.py
and everything will work. Also note that.env.dist
file always has a comment (prefixed by#
) where it starts with[Required]
or[Optional]
, followed by the description of the config parameter.requirements.txt
should be at same directory level ofsrc/
, not inside ofsrc/
.src/connector.py
.entrypoint.sh
is not necessary, should be removed and replaced with a genericENTRYPOINT
entry inDockerfile
Dockerfile
can have WORKDIR defined and can be generic like/opt/connector/
.Commit Example
I show exactly what I'm proposing on the following commit: https://github.com/SYNchroACK/opencti-connectors/commit/c7ae154dd30ccb980594889fe31a4fa37ad1fc95