{"action":"created","issue":{"url":"https://api.github.com/repos/STIXProject/python-stix/issues/276","labels_url":"https://api.github.com/repos/STIXProject/python-stix/issues/276/labels{/name}","comments_url":"https://api.github.com/repos/STIXProject/python-stix/issues/276/comments","events_url":"https://api.github.com/repos/STIXProject/python-stix/issues/276/events","html_url":"https://github.com/STIXProject/python-stix/issues/276","id":104774064,"number":276,"title":"'str' object has no attribute 'to_obj' when setting vuln.published_datetime","user":{"login":"egeniius","id":14115472,"avatar_url":"https://avatars.githubusercontent.com/u/14115472?v=3","gravatar_id":"","url":"https://api.github.com/users/egeniius","html_url":"https://github.com/egeniius","followers_url":"https://api.github.com/users/egeniius/followers","following_url":"https://api.github.com/users/egeniius/following{/other_user}","gists_url":"https://api.github.com/users/egeniius/gists{/gist_id}","starred_url":"https://api.github.com/users/egeniius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egeniius/subscriptions","organizations_url":"https://api.github.com/users/egeniius/orgs","repos_url":"https://api.github.com/users/egeniius/repos","events_url":"https://api.github.com/users/egeniius/events{/privacy}","received_events_url":"https://api.github.com/users/egeniius/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-03T20:23:52Z","updated_at":"2015-11-24T04:26:29Z","closed_at":"2015-11-18T20:29:53Z","body":"I'm trying to express a CVE in an et:vulnerability using a script to generate the STIX package.\r\n\r\nWhen I set vuln.published_datetime = \"015-02-16T11:56:00+00:00\", for example, it tells me I am using the wrong type, however vuln.discovered_datetime is the same object type (DateTimeWithPrecisionType) and gives no error when set to string. \r\n\r\nAlso, would you be able to make an example of how to enumerate cvss_score using the CVSSVector elements defined in vulnerability.py?\r\n\r\nI appreciate your time.\r\nE.G. Roberts\r\n\r\nhere's a brief version of the script I am testing with\r\n\r\n    #!/usr/bin/env python\r\n    from cybox.core import Observable\r\n    from cybox.objects.product_object import Product\r\n    from stix.core import STIXPackage\r\n    from stix.exploit_target import ExploitTarget,Vulnerability\r\n    def main():\r\n        pkg = STIXPackage()\r\n        vuln = Vulnerability()\r\n        vuln.is_known = 0\r\n        vuln.is_publicly_acknowledged = 1\r\n        vuln.title = \"Title\"\r\n        vuln.description = \"Description\"\r\n        vuln.short_description = \"Short Description\"\r\n        vuln.cve_id = \"CVE-XXXX-XXXX\"\r\n        vuln.osvdb_id = 8675309\r\n        vuln.source = \"https://web.nvd.nist.gov\"\r\n        vuln.discovered_datetime = \"015-02-16T11:56:00+00:00\"\r\n        vuln.published_datetime = \"015-02-16T11:56:00+00:00\"\r\n        vuln.cvss_score =\tNone\r\n        vuln.references = [\"reference 1\",\"reference 2\"]\r\n        software = Product()\r\n        software.vendor = \"barfoo\"\r\n        software.product = \"Foobar\"\r\n        software.version = \"3.0\"\r\n        software.update = \"xxx\"\r\n        software.edition = \"GOTY\"\r\n        software.language = \"Esperanto\"\r\n        software.device_details = None\r\n        observable = Observable(software)\r\n        vuln.affected_software.append(observable)\r\n\r\n        et = ExploitTarget(title=\"This is a CVE expressed as a STIX ET:Vulnerability\")\r\n        et.add_vulnerability(vuln)\r\n\r\n        pkg.add_exploit_target(et)\r\n    \r\n        print pkg.to_xml()\r\n    \r\n    if __name__ == '__main__':\r\n        main()"},"comment":{"url":"https://api.github.com/repos/STIXProject/python-stix/issues/comments/159146370","html_url":"https://github.com/STIXProject/python-stix/issues/276#issuecomment-159146370","issue_url":"https://api.github.com/repos/STIXProject/python-stix/issues/276","id":159146370,"user":{"login":"egeniius","id":14115472,"avatar_url":"https://avatars.githubusercontent.com/u/14115472?v=3","gravatar_id":"","url":"https://api.github.com/users/egeniius","html_url":"https://github.com/egeniius","followers_url":"https://api.github.com/users/egeniius/followers","following_url":"https://api.github.com/users/egeniius/following{/other_user}","gists_url":"https://api.github.com/users/egeniius/gists{/gist_id}","starred_url":"https://api.github.com/users/egeniius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egeniius/subscriptions","organizations_url":"https://api.github.com/users/egeniius/orgs","repos_url":"https://api.github.com/users/egeniius/repos","events_url":"https://api.github.com/users/egeniius/events{/privacy}","received_events_url":"https://api.github.com/users/egeniius/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T04:26:29Z","updated_at":"2015-11-24T04:26:29Z","body":"Cheers!"}}