Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 11f67c3

Browse files
authored
[client] Add new SCO - SSH-key (#10905)
1 parent 69b11fb commit 11f67c3

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

pycti/entities/opencti_stix_cyber_observable.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ def create(self, **kwargs):
287287
type = "IPv6-Addr"
288288
elif type.lower() == "persona":
289289
type = "Persona"
290+
elif type.lower() == "ssh-key":
291+
type = "SSH-Key"
290292
elif type.lower() == "hostname" or type.lower() == "x-opencti-hostname":
291293
type = "Hostname"
292294
elif type.lower() == "payment-card" or type.lower() == "x-opencti-payment-card":
@@ -420,6 +422,7 @@ def create(self, **kwargs):
420422
$PaymentCard: PaymentCardAddInput
421423
$Persona: PersonaAddInput
422424
$MediaContent: MediaContentAddInput
425+
$SSHKey: SSHKeyAddInput
423426
) {
424427
stixCyberObservableAdd(
425428
type: $type,
@@ -465,6 +468,7 @@ def create(self, **kwargs):
465468
PaymentCard: $PaymentCard
466469
Persona: $Persona
467470
MediaContent: $MediaContent
471+
SSHKey: $SSHKey
468472
) {
469473
id
470474
standard_id
@@ -713,6 +717,49 @@ def create(self, **kwargs):
713717
else None
714718
),
715719
}
720+
elif type == "SSH-Key" or type.lower() == "ssh-key":
721+
input_variables["SSHKey"] = {
722+
"key_type": (
723+
observable_data["key_type"]
724+
if "key_type" in observable_data
725+
else None
726+
),
727+
"public_key": (
728+
observable_data["public_key"]
729+
if "public_key" in observable_data
730+
else None
731+
),
732+
"fingerprint_sha256": (
733+
observable_data["fingerprint_sha256"]
734+
if "fingerprint_sha256" in observable_data
735+
else False
736+
),
737+
"fingerprint_md5": (
738+
observable_data["fingerprint_md5"]
739+
if "fingerprint_md5" in observable_data
740+
else None
741+
),
742+
"key_length": (
743+
observable_data["key_length"]
744+
if "key_length" in observable_data
745+
else None
746+
),
747+
"comment": (
748+
observable_data["comment"]
749+
if "comment" in observable_data
750+
else None
751+
),
752+
"created": (
753+
observable_data["created"]
754+
if "created" in observable_data
755+
else None
756+
),
757+
"expiration_date": (
758+
observable_data["expiration_date"]
759+
if "expiration_date" in observable_data
760+
else None
761+
),
762+
}
716763
elif type == "IPv4-Addr":
717764
input_variables["IPv4Addr"] = {
718765
"value": (

0 commit comments

Comments
 (0)