Skip to content

Commit

Permalink
Update connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
weiiwang01 committed Jan 8, 2025
1 parent d97b412 commit 397d070
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions connectors/cisa_kev/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ parts:
ls -lah
mkdir -p $CRAFT_PART_INSTALL/opt
cd external-import/cisa-known-exploited-vulnerabilities
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-cisa-kev
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-cisa-known-exploited-vulnerabilities
cat entrypoint.sh | grep opencti-connector-cisa-kev
cat entrypoint.sh | grep opencti-connector-cisa-known-exploited-vulnerabilities
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
--target $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages \
Expand Down
4 changes: 2 additions & 2 deletions connectors/cyber_campaign/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ parts:
ls -lah
mkdir -p $CRAFT_PART_INSTALL/opt
cd external-import/cyber-campaign-collection
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-cyber-campaign
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-cyber-campaign-collection
cat entrypoint.sh | grep opencti-connector-cyber-campaign
cat entrypoint.sh | grep opencti-connector-cyber-campaign-collection
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
--target $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages \
Expand Down
4 changes: 2 additions & 2 deletions connectors/malwarebazaar/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ parts:
ls -lah
mkdir -p $CRAFT_PART_INSTALL/opt
cd external-import/malwarebazaar-recent-additions
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-malwarebazaar
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-malwarebazaar-recent-additions
cat entrypoint.sh | grep opencti-connector-malwarebazaar
cat entrypoint.sh | grep opencti-connector-malwarebazaar-recent-additions
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
--target $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages \
Expand Down
4 changes: 2 additions & 2 deletions connectors/virustotal_livehunt/rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ parts:
ls -lah
mkdir -p $CRAFT_PART_INSTALL/opt
cd external-import/virustotal-livehunt-notifications
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-virustotal-livehunt
cp -rp src $CRAFT_PART_INSTALL/opt/opencti-connector-virustotal-livehunt-notifications
cat entrypoint.sh | grep opencti-connector-virustotal-livehunt
cat entrypoint.sh | grep opencti-connector-virustotal-livehunt-notifications
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages
pip install \
--target $CRAFT_PART_INSTALL/usr/local/lib/python3.12/dist-packages \
Expand Down
6 changes: 4 additions & 2 deletions scripts/gen_connector_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ def render_template(
):
if "_" in name or name.lower() != name:
raise ValueError(f"connector name should be in kebab case: {name}")
connector_name = connector_name or name
display_name_short = display_name_short or display_name
output_dir.mkdir(exist_ok=True)
for source in template_dir.glob("**/*"):
file = source.relative_to(template_dir)
Expand All @@ -159,7 +161,7 @@ def render_template(
output.write_text(
template.render(
name=name,
connector_name=name if connector_name is None else connector_name,
connector_name=connector_name,
connector_type=connector_type,
version=version,
display_name=display_name,
Expand All @@ -171,7 +173,7 @@ def render_template(
),
charm_override=charm_override,
install_location=(
install_location if install_location else f"opencti-connector-{name}"
install_location if install_location else f"opencti-connector-{connector_name}"
),
generate_entrypoint=generate_entrypoint,
),
Expand Down

0 comments on commit 397d070

Please sign in to comment.