Skip to content

Commit 6deb5ec

Browse files
author
Samuel Hassine
committed
[examples] Remove all tokens
1 parent a556f9a commit 6deb5ec

35 files changed

+41
-35
lines changed

examples/add_external_reference_to_report.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Variables
77
api_url = "https://demo.opencti.io"
8-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
8+
api_token = "YOUR_TOKEN"
99

1010
# OpenCTI initialization
1111
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/add_organization_to_sector.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/add_tag_to_malware.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/add_tool_usage_to_intrusion-set.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/cmd_line_tag_latest_indicators_of_threat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Variables
88
api_url = "https://demo.opencti.io"
9-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
9+
api_token = "YOUR_TOKEN"
1010

1111
# OpenCTI initialization
1212
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/create_campaign_attributed-to_intrusion_set.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Variables
77
api_url = "https://demo.opencti.io"
8-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
8+
api_token = "YOUR_TOKEN"
99

1010
# OpenCTI initialization
1111
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/create_file_with_hashes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/create_incident_with_ttps_and_indicators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Variables
88
api_url = "https://demo.opencti.io"
9-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
9+
api_token = "YOUR_TOKEN"
1010

1111
# OpenCTI initialization
1212
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/create_indicator_of_campaign.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Variables
77
api_url = "https://demo.opencti.io"
8-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
8+
api_token = "YOUR_TOKEN"
99

1010
# OpenCTI initialization
1111
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/create_intrusion_set.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Variables
77
api_url = "https://demo.opencti.io"
8-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
8+
api_token = "YOUR_TOKEN"
99

1010
# OpenCTI initialization
1111
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/create_ip_address_resolves_domain.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/create_marking_definition.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/create_report_with_author.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Variables
77
api_url = "https://demo.opencti.io"
8-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
8+
api_token = "YOUR_TOKEN"
99

1010
# OpenCTI initialization
1111
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/delete_intrusion_set.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/delete_relation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/export_async_of_indicators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/export_async_of_malware.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/export_incident_stix2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Variables
77
api_url = "https://demo.opencti.io"
8-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
8+
api_token = "YOUR_TOKEN"
99

1010
# OpenCTI initialization
1111
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/export_incidents_stix2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Variables
77
api_url = "https://demo.opencti.io"
8-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
8+
api_token = "YOUR_TOKEN"
99

1010
# OpenCTI initialization
1111
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/export_intrusion_set_stix2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Variables
77
api_url = "https://demo.opencti.io"
8-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
8+
api_token = "YOUR_TOKEN"
99

1010
# OpenCTI initialization
1111
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/export_report_stix2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Variables
77
api_url = "https://demo.opencti.io"
8-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
8+
api_token = "YOUR_TOKEN"
99

1010
# OpenCTI initialization
1111
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/get_all_indicators_using_pagination.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/get_all_reports_using_pagination.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/get_attack_pattern_by_mitre_id.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/get_entity_by_name_or_alias.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/get_malwares_of_intrusion_set.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/get_marking_definitions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/get_reports_about_intrusion_set.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/import_stix2_file.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/search_attack_pattern.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/search_malware.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/update_entity_attribute.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/upload_file.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Variables
66
api_url = "https://demo.opencti.io"
7-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
7+
api_token = "YOUR_TOKEN"
88

99
# OpenCTI initialization
1010
opencti_api_client = OpenCTIApiClient(api_url, api_token)

examples/upload_file_to_intrusion_set.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Variables
77
api_url = "https://demo.opencti.io"
8-
api_token = "2b4f29e3-5ea8-4890-8cf5-a76f61f1e2b2"
8+
api_token = "YOUR_TOKEN"
99

1010
# OpenCTI initialization
1111
opencti_api_client = OpenCTIApiClient(api_url, api_token)

pycti/entities/opencti_stix_cyber_observable.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ def __init__(self, opencti, file):
149149
ctime
150150
mtime
151151
atime
152-
hashes {
152+
x_opencti_additional_names
153+
hashes {
153154
algorithm
154155
hash
155156
}
@@ -734,6 +735,11 @@ def create(self, **kwargs):
734735
"atime": observable_data["atime"]
735736
if "atime" in observable_data
736737
else None,
738+
"x_opencti_additional_names": observable_data[
739+
"x_opencti_additional_names"
740+
]
741+
if "x_opencti_additional_names" in observable_data
742+
else None,
737743
}
738744
elif type == "X509-Certificate":
739745
input_variables["X509Certificate"] = {

0 commit comments

Comments
 (0)