Skip to content

Commit

Permalink
feat(integration): Register missing integrations
Browse files Browse the repository at this point in the history
Cloudtrail and emailrep
  • Loading branch information
topher-lo committed Apr 25, 2024
1 parent 48c03f7 commit eaae997
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 32 deletions.
64 changes: 53 additions & 11 deletions frontend/src/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,21 +143,46 @@ export const Integrations: Record<
IntegrationPlatform,
(props: IconProps) => JSX.Element
> = {
sublime_security: (props: IconProps) => (
aws_cloudtrail: (props: IconProps) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="150"
height="100"
viewBox="0 0 34 23"
fill="none"
width="100%"
height="100%"
viewBox="0 0 80 80"
version="1.1"
{...props}
>
<path
<defs>
<linearGradient
x1="0%"
y1="100%"
x2="100%"
y2="0%"
id="linearGradient-1"
>
<stop stop-color="#B0084D" offset="0%" />
<stop stop-color="#FF4F8B" offset="100%" />
</linearGradient>
</defs>
<g
id="Icon-Architecture/64/Arch_AWS-Cloud-Trail_64"
stroke="none"
stroke-width="1"
fill="none"
fill-rule="evenodd"
clip-rule="evenodd"
d="M0.0997772 11.5L8.34994 19.6435C12.8838 24.1188 20.3157 24.1188 24.8496 19.6435L29.436 15.1163L28.5201 14.2122L27.6043 13.3082L25.7724 11.5L23.0397 8.80266L21.186 6.97293C18.6742 4.49361 14.5253 4.49361 12.0136 6.97293L11.0908 7.88375L12.9227 9.69178L13.8454 8.78111C15.3458 7.29999 17.8537 7.29999 19.3541 8.78111L19.5341 8.95872L21.2078 10.6108L22.1087 11.5L23.9405 13.3082L25.7724 15.1163L23.0179 17.8353C19.4949 21.3126 13.7045 21.3126 10.1816 17.8353L5.59527 13.3082L3.76341 11.5L1.93167 9.69178L0.0997772 11.5ZM7.42719 7.88375L9.25906 9.69178L11.0908 11.5L11.5522 11.9553L13.3839 13.7635L13.8454 14.2189C15.3458 15.7001 17.8537 15.7001 19.3541 14.2189L20.2769 13.3082L22.1087 15.1163L21.186 16.0271C18.6742 18.5064 14.5253 18.5064 12.0136 16.0271L9.72027 13.7635L7.42719 11.5L5.59527 9.69178L4.23987 8.35405L3.76341 7.88375L8.34994 3.35648C12.8838 -1.11883 20.3157 -1.11883 24.8496 3.35648L33.0998 11.5L31.2679 13.3082L29.436 11.5L27.7385 9.82443L23.0179 5.16469C19.4949 1.68739 13.7045 1.68739 10.1816 5.16469L7.42719 7.88375ZM14.7546 11.5L15.6772 12.4108C16.1666 12.8938 17.0329 12.8938 17.5224 12.4108L18.445 11.5L17.5224 10.5892C17.0329 10.1062 16.1666 10.1062 15.6772 10.5892L14.7546 11.5Z"
fill="#00C292"
fill-opacity="0.8"
/>
>
<g
id="Icon-Architecture-BG/64/Management-Governance"
fill="url(#linearGradient-1)"
>
<rect id="Rectangle" x="0" y="0" width="80" height="80" />
</g>
<path
d="M25,52.996052 L29,52.996052 L29,50.994078 L25,50.994078 L25,52.996052 Z M59.971,38.1634268 C59.746,35.1264322 58.261,32.8902273 55.902,32.1004485 C54.003,31.4668238 51.911,31.914265 50.318,33.2125451 C49.352,31.3076668 47.9,29.4418271 46.702,28.2596615 C42.406,24.0194805 37.668,22.9384146 32.616,25.0454922 C28.106,26.9223428 24,33.0874217 24,37.9812471 L24,38.1714347 C21.293,39.0863368 19.109,41.0742969 18.074,43.608796 L19.926,44.3655422 C21.245,41.1353571 24.332,40.1223583 25.247,39.8891283 C25.69,39.7760168 26,39.376623 26,38.9191719 L26,37.9812471 C26,33.9362587 29.657,28.444844 33.385,26.8933142 C37.68,25.1025485 41.578,26.0114447 45.298,29.6850669 C46.88,31.2456057 48.427,33.5608886 49.06,35.3176207 C49.184,35.6639622 49.488,35.913208 49.852,35.9682623 C50.212,36.0233166 50.577,35.8741695 50.799,35.5798793 C51.904,34.1104304 53.696,33.4738027 55.269,33.9993209 C57.004,34.5808943 58,36.3966847 58,38.9822341 C58,39.4717168 58.354,39.8891283 58.836,39.9692073 C59.569,40.0913277 66,41.3515703 66,47.9911171 C66,54.8678977 59.281,54.996024 59,54.998026 L36,54.998026 L36,57 L59.002,57 C62.114,56.9939941 68,55.1041306 68,47.9911171 C68,41.7839967 63.279,38.989241 59.971,38.1634268 L59.971,38.1634268 Z M31,52.996052 L45,52.996052 L45,50.994078 L31,50.994078 L31,52.996052 Z M27,57 L33,57 L33,54.998026 L27,54.998026 L27,57 Z M12,57 L15,57 L15,54.998026 L12,54.998026 L12,57 Z M15,48.9921041 L24,48.9921041 L24,46.9901301 L15,46.9901301 L15,48.9921041 Z M13,52.996052 L23,52.996052 L23,50.994078 L13,50.994078 L13,52.996052 Z M27,48.9921041 L34,48.9921041 L34,46.9901301 L27,46.9901301 L27,48.9921041 Z M17,57 L25,57 L25,54.998026 L17,54.998026 L17,57 Z"
id="AWS-Cloud-Trail_Icon_64_Squid"
fill="#FFFFFF"
/>
</g>
</svg>
),
datadog: (props: IconProps) => (
Expand All @@ -177,6 +202,23 @@ export const Integrations: Record<
<path d="m670.38 608.27-71.24-46.99-59.43 99.27-69.12-20.21-60.86 92.89 3.12 29.24 330.9-60.97-19.22-206.75-54.15 113.52zm-308.59-89.14 53.09-7.3c8.59 3.86 14.57 5.33 24.87 7.95 16.04 4.18 34.61 8.19 62.11-5.67 6.4-3.17 19.73-15.36 25.12-22.31l217.52-39.46 22.19 268.56-372.65 67.16-32.25-268.93zm404.06-96.77-21.47 4.09L703.13.27.27 81.77l86.59 702.68 82.27-11.94c-6.57-9.38-16.8-20.73-34.27-35.26-24.23-20.13-15.66-54.32-1.37-75.91 18.91-36.48 116.34-82.84 110.82-141.15-1.98-21.2-5.35-48.8-25.03-67.71-.74 7.85.59 15.41.59 15.41s-8.08-10.31-12.11-24.37c-4-5.39-7.14-7.11-11.39-14.31-3.03 8.33-2.63 17.99-2.63 17.99s-6.61-15.62-7.68-28.8c-3.92 5.9-4.91 17.11-4.91 17.11s-8.59-24.62-6.63-37.88c-3.92-11.54-15.54-34.44-12.25-86.49 21.45 15.03 68.67 11.46 87.07-15.66 6.11-8.98 10.29-33.5-3.05-81.81-8.57-30.98-29.79-77.11-38.06-94.61l-.99.71c4.36 14.1 13.35 43.66 16.8 57.99 10.44 43.47 13.24 58.6 8.34 78.64-4.17 17.42-14.17 28.82-39.52 41.56-25.35 12.78-58.99-18.32-61.12-20.04-24.63-19.62-43.68-51.63-45.81-67.18-2.21-17.02 9.81-27.24 15.87-41.16-8.67 2.48-18.34 6.88-18.34 6.88s11.54-11.94 25.77-22.27c5.89-3.9 9.35-6.38 15.56-11.54-8.99-.15-16.29.11-16.29.11s14.99-8.1 30.53-14c-11.37-.5-22.25-.08-22.25-.08s33.45-14.96 59.87-25.94c18.17-7.45 35.92-5.25 45.89 9.17 13.09 18.89 26.84 29.15 55.98 35.51 17.89-7.93 23.33-12.01 45.81-18.13 19.79-21.76 35.33-24.58 35.33-24.58s-7.71 7.07-9.77 18.18c11.22-8.84 23.52-16.22 23.52-16.22s-4.76 5.88-9.2 15.22l1.03 1.53c13.09-7.85 28.48-14.04 28.48-14.04s-4.4 5.56-9.56 12.76c9.87-.08 29.89.42 37.66 1.3 45.87 1.01 55.39-48.99 72.99-55.26 22.04-7.87 31.89-12.63 69.45 24.26 32.23 31.67 57.41 88.36 44.91 101.06-10.48 10.54-31.16-4.11-54.08-32.68-12.11-15.13-21.27-33.01-25.56-55.74-3.62-19.18-17.71-30.31-17.71-30.31S520 92.95 520 109.01c0 8.77 1.1 41.56 15.16 59.96-1.39 2.69-2.04 13.31-3.58 15.34-16.36-19.77-51.49-33.92-57.22-38.09 19.39 15.89 63.96 52.39 81.08 87.37 16.19 33.08 6.65 63.4 14.84 71.25 2.33 2.25 34.82 42.73 41.07 63.07 10.9 35.45.65 72.7-13.62 95.81l-39.85 6.21c-5.83-1.62-9.76-2.43-14.99-5.46 2.88-5.1 8.61-17.82 8.67-20.44l-2.25-3.95c-12.4 17.57-33.18 34.63-50.44 44.43-22.59 12.8-48.63 10.83-65.58 5.58-48.11-14.84-93.6-47.35-104.57-55.89 0 0-.34 6.82 1.73 8.35 12.13 13.68 39.92 38.43 66.78 55.68l-57.26 6.3 27.07 210.78c-12 1.72-13.87 2.56-27.01 4.43-11.58-40.91-33.73-67.62-57.94-83.18-21.35-13.72-50.8-16.81-78.99-11.23l-1.81 2.1c19.6-2.04 42.74.8 66.51 15.85 23.33 14.75 42.13 52.85 49.05 75.79 8.86 29.32 14.99 60.68-8.86 93.92-16.97 23.63-66.51 36.69-106.53 8.44 10.69 17.19 25.14 31.25 44.59 33.9 28.88 3.92 56.29-1.09 75.16-20.46 16.11-16.56 24.65-51.19 22.4-87.66l25.49-3.7 9.2 65.46 421.98-50.81-34.43-335.8zM509.12 244.59c-1.18 2.69-3.03 4.45-.25 13.2l.17.5.44 1.13 1.16 2.62c5.01 10.24 10.51 19.9 19.7 24.83 2.38-.4 4.84-.67 7.39-.8 8.63-.38 14.08.99 17.54 2.85.31-1.72.38-4.24.19-7.95-.67-12.97 2.57-35.03-22.36-46.64-9.41-4.37-22.61-3.02-27.01 2.43.8.1 1.52.27 2.08.46 6.65 2.33 2.14 4.62.95 7.37m69.87 121.02c-3.27-1.8-18.55-1.09-29.29.19-20.46 2.41-42.55 9.51-47.39 13.29-8.8 6.8-4.8 18.66 1.7 23.53 18.23 13.62 34.21 22.75 51.08 20.53 10.36-1.36 19.49-17.76 25.96-32.64 4.43-10.25 4.43-21.31-2.06-24.9M397.85 260.65c5.77-5.48-28.74-12.68-55.52 5.58-19.75 13.47-20.38 42.35-1.47 58.72 1.89 1.62 3.45 2.77 4.91 3.71 5.52-2.6 11.81-5.23 19.05-7.58 12.23-3.97 22.4-6.02 30.76-7.11 4-4.47 8.65-12.34 7.49-26.59-1.58-19.33-16.23-16.26-5.22-26.73" />
</svg>
),
emailrep: (props: IconProps) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="150"
height="100"
viewBox="0 0 34 23"
fill="none"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M0.0997772 11.5L8.34994 19.6435C12.8838 24.1188 20.3157 24.1188 24.8496 19.6435L29.436 15.1163L28.5201 14.2122L27.6043 13.3082L25.7724 11.5L23.0397 8.80266L21.186 6.97293C18.6742 4.49361 14.5253 4.49361 12.0136 6.97293L11.0908 7.88375L12.9227 9.69178L13.8454 8.78111C15.3458 7.29999 17.8537 7.29999 19.3541 8.78111L19.5341 8.95872L21.2078 10.6108L22.1087 11.5L23.9405 13.3082L25.7724 15.1163L23.0179 17.8353C19.4949 21.3126 13.7045 21.3126 10.1816 17.8353L5.59527 13.3082L3.76341 11.5L1.93167 9.69178L0.0997772 11.5ZM7.42719 7.88375L9.25906 9.69178L11.0908 11.5L11.5522 11.9553L13.3839 13.7635L13.8454 14.2189C15.3458 15.7001 17.8537 15.7001 19.3541 14.2189L20.2769 13.3082L22.1087 15.1163L21.186 16.0271C18.6742 18.5064 14.5253 18.5064 12.0136 16.0271L9.72027 13.7635L7.42719 11.5L5.59527 9.69178L4.23987 8.35405L3.76341 7.88375L8.34994 3.35648C12.8838 -1.11883 20.3157 -1.11883 24.8496 3.35648L33.0998 11.5L31.2679 13.3082L29.436 11.5L27.7385 9.82443L23.0179 5.16469C19.4949 1.68739 13.7045 1.68739 10.1816 5.16469L7.42719 7.88375ZM14.7546 11.5L15.6772 12.4108C16.1666 12.8938 17.0329 12.8938 17.5224 12.4108L18.445 11.5L17.5224 10.5892C17.0329 10.1062 16.1666 10.1062 15.6772 10.5892L14.7546 11.5Z"
fill="#00C292"
fill-opacity="0.8"
/>
</svg>
),
urlscan: (props: IconProps) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 950 950" {...props}>
<path
Expand Down
32 changes: 17 additions & 15 deletions frontend/src/types/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,39 @@ const actionTypes = [
] as const
export type ActionType = (typeof actionTypes)[number]

/** All platforms that are supported by the system. */
const integrationPlatforms = [
"aws_cloudtrail",
"datadog",
"emailrep",
"urlscan",
"virustotal"
] as const
export type IntegrationPlatform = (typeof integrationPlatforms)[number]

/**
* Integration types are prefixed with the platform name.
* This is to ensure that integrations from different platforms do not clash.
*
* Format: integrations.<platform>.<optional_namespaces>.<function>
*
* Not sure how to generate this dynamically - cuyrrently needs to be manually updated.
* Not sure how to generate this dynamically - currently needs to be manually updated.
*/
const integrationTypes = [
"integrations.aws_cloudtrail.query_cloudtrail_logs",
"integrations.datadog.list_detection_rules",
"integrations.datadog.list_security_signals",
"integrations.datadog.update_security_signal_state",
"integrations.datadog.list_detection_rules",
"integrations.emailrep.check_email_reputation",
"integrations.urlscan.analyze_url",
"integrations.virustotal.get_file_report",
"integrations.virustotal.get_url_report",
"integrations.virustotal.get_domain_report",
"integrations.virustotal.get_file_report",
"integrations.virustotal.get_ip_address_report",
"integrations.virustotal.get_url_report",
] as const
export type IntegrationType = (typeof integrationTypes)[number]

/**
* All platforms that are supported by the system.
*/
const integrationPlatforms = [
"sublime_security",
"datadog",
"virustotal",
"urlscan",
] as const
export type IntegrationPlatform = (typeof integrationPlatforms)[number]

/** Workflow Schemas */
export type NodeType = ActionType | IntegrationType

const actionStatusSchema = z.enum(["online", "offline"])
Expand Down
19 changes: 17 additions & 2 deletions tracecat/integrations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
"""Integrations module."""

# Import modules to register integrations
from tracecat.integrations import datadog, urlscan, virustotal
from tracecat.integrations import (
aws_cloudtrail,
datadog,
emailrep,
urlscan,
virustotal,
)
from tracecat.integrations._meta import IntegrationSpec
from tracecat.integrations._registry import registry

__all__ = ["IntegrationSpec", "registry", "datadog", "urlscan", "virustotal"]
__all__ = [
"IntegrationSpec",
"registry",
# Integrations
"aws_cloudtrail",
"datadog",
"emailrep",
"urlscan",
"virustotal",
]
10 changes: 6 additions & 4 deletions tracecat/types/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
"receive_email",
"open_case",
# Integrations
"integrations.aws_cloudtrail.query_cloudtrail_logs",
"integrations.datadog.list_detection_rules",
"integrations.datadog.list_security_signals",
"integrations.datadog.update_security_signal_state",
"integrations.datadog.list_detection_rules",
"integrations.virustotal.get_file_report",
"integrations.virustotal.get_url_report",
"integrations.emailrep.check_email_reputation",
"integrations.urlscan.analyze_url",
"integrations.virustotal.get_domain_report",
"integrations.virustotal.get_file_report",
"integrations.virustotal.get_ip_address_report",
"integrations.urlscan.analyze_url",
"integrations.virustotal.get_url_report",
]

0 comments on commit eaae997

Please sign in to comment.