{"id":30178289,"url":"https://github.com/panther-labs/stix2","last_synced_at":"2025-08-12T05:18:37.949Z","repository":{"id":39968688,"uuid":"491648370","full_name":"panther-labs/stix2","owner":"panther-labs","description":"Pure go implementation of stix2","archived":false,"fork":false,"pushed_at":"2023-06-16T21:08:13.000Z","size":558,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":23,"default_branch":"main","last_synced_at":"2024-06-20T12:42:36.921Z","etag":null,"topics":["golang","security"],"latest_commit_sha":null,"homepage":"https://panther.com/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/panther-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-12T19:49:37.000Z","updated_at":"2024-02-05T19:37:13.000Z","dependencies_parsed_at":"2024-06-20T11:57:28.187Z","dependency_job_id":"6b8fb87c-f656-48fa-8b2a-6c6c5c7a7bc9","html_url":"https://github.com/panther-labs/stix2","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/panther-labs/stix2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panther-labs%2Fstix2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panther-labs%2Fstix2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panther-labs%2Fstix2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panther-labs%2Fstix2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panther-labs","download_url":"https://codeload.github.com/panther-labs/stix2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panther-labs%2Fstix2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270005591,"owners_count":24510939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","security"],"created_at":"2025-08-12T05:18:18.530Z","updated_at":"2025-08-12T05:18:37.933Z","avatar_url":"https://github.com/panther-labs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stix2\n\nA pure Go library for working with Structured Threat Information Expression\n(STIX™) version 2.x data.\n\n**Note:**\nThis pkg was ported over from https://github.com/TcM1911/stix2 with some modifications\n\n## Parsing STIX JSON data\n\nThe library provides a helper function to parse STIX JSON. It can handle\nboth the bundle object and JSON objects as a JSON array. The function returns\na `Collection` object that holds all the extracted STIX objects.\n\n```go\ncollection, err := stix2.FromJSON(jsonData)\n```\n\n```go\ncollection, err := stix2.FromReader(yourReader)\n```\n\n## Creating a STIX Bundle\n\nCreating a STIX Bundle, is as easy as creating a set of STIX objects and add\nthem to the Collection. The Bundle can be created by calling the `ToBundle`\nmethod on the Collection object. The Bundle can be serialized to `JSON`\nusing the `JSON` encoder in the standard library.\n\n```go\nc := stix2.New()\nip, err := stix2.NewIPv4Address(\"10.0.0.1\")\nc.Add(ip)\nip, err = stix2.NewIPv4Address(\"10.0.0.2\")\nc.Add(ip)\nb, err := c.ToBundle()\ndata, err := json.Marshal(b)\n```\n\n## Example of a malware using an infrastructure\n\nTaken from: https://docs.oasis-open.org/cti/stix/v2.1/csprd02/stix-v2.1-csprd02.html#_Toc26789941\n\n```go\ncollection := stix2.New()\ndomain, err := stix2.NewDomainName(\"example.com\")\ncollection.Add(domain)\n\nmal, err := stix2.NewMalware(\n\tfalse,\n\tstix2.OptionName(\"IMDDOS\"),\n\tstix2.OptionTypes([]string{stix2.MalwareTypeBot}),\n)\ncollection.Add(mal)\n\ninfra, err := stix2.NewInfrastructure(\n\t\"Example Target List Host\",\n\t[]string{stix2.InfrastructureTypeHostingTargetLists},\n)\ncollection.Add(infra)\n\nref, err := mal.AddUses(infra.ID)\ncollection.Add(ref)\n\nref, err = infra.AddConsistsOf(domain.ID)\ncollection.Add(ref)\n\nb, err := collection.ToBundle()\ndata, err := json.MarshalIndent(b, \"\", \"\\t\")\n```\n\n## Extensions and Customization\n\nWith the release of version 2.1 of the specification custom properties\nhas been deprecated. Instead, `property-extension` functionality should\nbe used. This library supports parsing objects with old custom properties\nfor backwards compatibility. The fields can be accessed via the\n`GetExtendedTopLevelProperties` method.\n\nSee the examples in the documentation on how to work with extensions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanther-labs%2Fstix2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanther-labs%2Fstix2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanther-labs%2Fstix2/lists"}