Skip to content

Commit

Permalink
Fix rockcraft.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
weiiwang01 committed Dec 19, 2024
1 parent a8ab93c commit ecbc738
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions connector-template/rock/rockcraft.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parts:
mkdir -p $CRAFT_PART_INSTALL/opt
cd {{ constant_to_kebab(connector_type) }}/{{ connector_name }}
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-{{ connector_name }}
{{ generate_entrypoint }}
cat entrypoint.sh | grep opencti-connector-{{ connector_name }}
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
Expand Down
1 change: 1 addition & 0 deletions connectors/abuseipdb_ipblacklist/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parts:
mkdir -p $CRAFT_PART_INSTALL/opt
cd external-import/abuseipdb-ipblacklist
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-abuseipdb-ipblacklist
cat entrypoint.sh | grep opencti-connector-abuseipdb-ipblacklist
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
Expand Down
1 change: 1 addition & 0 deletions connectors/alienvault/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parts:
mkdir -p $CRAFT_PART_INSTALL/opt
cd external-import/alienvault
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-alienvault
cat entrypoint.sh | grep opencti-connector-alienvault
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
Expand Down
1 change: 1 addition & 0 deletions connectors/crowdstrike/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parts:
mkdir -p $CRAFT_PART_INSTALL/opt
cd external-import/crowdstrike
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-crowdstrike
cat entrypoint.sh | grep opencti-connector-crowdstrike
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
Expand Down
1 change: 1 addition & 0 deletions connectors/export_file_csv/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parts:
mkdir -p $CRAFT_PART_INSTALL/opt
cd internal-export-file/export-file-csv
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-export-file-csv
cat entrypoint.sh | grep opencti-connector-export-file-csv
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
Expand Down
1 change: 1 addition & 0 deletions connectors/export_file_stix/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parts:
mkdir -p $CRAFT_PART_INSTALL/opt
cd internal-export-file/export-file-stix
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-export-file-stix
cat entrypoint.sh | grep opencti-connector-export-file-stix
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
Expand Down
1 change: 1 addition & 0 deletions connectors/export_file_txt/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parts:
mkdir -p $CRAFT_PART_INSTALL/opt
cd internal-export-file/export-file-txt
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-export-file-txt
cat entrypoint.sh | grep opencti-connector-export-file-txt
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
Expand Down
1 change: 1 addition & 0 deletions connectors/import_document/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parts:
mkdir -p $CRAFT_PART_INSTALL/opt
cd internal-import-file/import-document
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-import-document
cat entrypoint.sh | grep opencti-connector-import-document
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
Expand Down
1 change: 1 addition & 0 deletions connectors/import_file_stix/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parts:
mkdir -p $CRAFT_PART_INSTALL/opt
cd internal-import-file/import-file-stix
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-import-file-stix
cat entrypoint.sh | grep opencti-connector-import-file-stix
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
Expand Down
1 change: 1 addition & 0 deletions connectors/misp_feed/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parts:
mkdir -p $CRAFT_PART_INSTALL/opt
cd external-import/misp-feed
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-misp-feed
cat entrypoint.sh | grep opencti-connector-misp-feed
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
Expand Down
1 change: 1 addition & 0 deletions connectors/mitre/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parts:
mkdir -p $CRAFT_PART_INSTALL/opt
cd external-import/mitre
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-mitre
cat entrypoint.sh | grep opencti-connector-mitre
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
Expand Down
1 change: 1 addition & 0 deletions connectors/sekoia/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parts:
mkdir -p $CRAFT_PART_INSTALL/opt
cd external-import/sekoia
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-sekoia
echo 'cd /opt/opencti-connector-sekoia; python3 sekoia.py' > entrypoint.sh
cat entrypoint.sh | grep opencti-connector-sekoia
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
Expand Down
1 change: 1 addition & 0 deletions connectors/urlscan/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parts:
mkdir -p $CRAFT_PART_INSTALL/opt
cd external-import/urlscan
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-urlscan
cat entrypoint.sh | grep opencti-connector-urlscan
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
Expand Down
1 change: 1 addition & 0 deletions connectors/urlscan_enrichment/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parts:
mkdir -p $CRAFT_PART_INSTALL/opt
cd internal-enrichment/urlscan-enrichment
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-urlscan-enrichment
cat entrypoint.sh | grep opencti-connector-urlscan-enrichment
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
Expand Down
1 change: 1 addition & 0 deletions connectors/vxvault/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ parts:
mkdir -p $CRAFT_PART_INSTALL/opt
cd external-import/vxvault
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-vxvault
cat entrypoint.sh | grep opencti-connector-vxvault
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
Expand Down
3 changes: 3 additions & 0 deletions scripts/gen_connector_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def render_template(
display_name,
config,
charm_override: str = "",
generate_entrypoint: str = "",
template_dir: pathlib.Path = pathlib.Path("connector-template"),
output_dir: pathlib.Path = pathlib.Path("connectors"),
):
Expand Down Expand Up @@ -168,6 +169,7 @@ def render_template(
{"config": {"options": sort_config(config)}}, width=99999, sort_keys=False
),
charm_override=charm_override,
generate_entrypoint=generate_entrypoint,
),
encoding="utf-8",
)
Expand Down Expand Up @@ -229,6 +231,7 @@ def _gen_env(self) -> dict[str, str]:
"default": True,
},
},
generate_entrypoint="echo 'cd /opt/opencti-connector-sekoia; python3 sekoia.py' > entrypoint.sh",
)
if connector == "" or connector == "all":
render_template(
Expand Down

0 comments on commit ecbc738

Please sign in to comment.