{"id":21578703,"url":"https://github.com/julian-nash/cwe","last_synced_at":"2025-04-10T17:41:37.489Z","repository":{"id":62566105,"uuid":"250295936","full_name":"Julian-Nash/cwe","owner":"Julian-Nash","description":"Common weakness enumeration library for Python","archived":false,"fork":false,"pushed_at":"2024-03-17T21:20:17.000Z","size":1678,"stargazers_count":14,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T04:54:17.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Julian-Nash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-26T15:25:18.000Z","updated_at":"2023-07-19T22:38:22.000Z","dependencies_parsed_at":"2024-11-21T19:31:20.716Z","dependency_job_id":"cb403da7-9609-4522-b41d-ffdb4c956da7","html_url":"https://github.com/Julian-Nash/cwe","commit_stats":{"total_commits":36,"total_committers":4,"mean_commits":9.0,"dds":0.25,"last_synced_commit":"af43faeccc8b9489d1ceb6403fac53814a2c5f9c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julian-Nash%2Fcwe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julian-Nash%2Fcwe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julian-Nash%2Fcwe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julian-Nash%2Fcwe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Julian-Nash","download_url":"https://codeload.github.com/Julian-Nash/cwe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248262187,"owners_count":21074260,"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","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":[],"created_at":"2024-11-24T13:11:24.276Z","updated_at":"2025-04-10T17:41:37.473Z","avatar_url":"https://github.com/Julian-Nash.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Common weakness enumeration library for Python\n\n![Python package](https://github.com/Julian-Nash/cwe/workflows/Python%20package/badge.svg)\n\nhttps://cwe.mitre.org/index.html\n\n#### Installation\n\n```sh\npip install cwe\n```\n\n#### Usage\n\n- Get a CWE by ID:\n\n```pycon\n\u003e\u003e\u003e from cwe import Database\n\u003e\u003e\u003e db = Database()\n\u003e\u003e\u003e db.get(15)\nWeakness(cwe_id=15, name=External Control of System or Configuration Setting)\n```\n\n- Access attributes of the Weakness using dot notation\n\n```pycon\n\u003e\u003e\u003e weakness = db.get(15)\n\u003e\u003e\u003e weakness.description\n'One or more system settings or configuration elements can be externally controlled by a user.'\n```\n\n- Or use the weakness `get` method\n\n```pycon\n\u003e\u003e\u003e weakness.get(\"status\", None)\n'Incomplete'\n```\n\n- Get a dictionary of the weakness (Truncated for this example)\n\n```pycon\n\u003e\u003e\u003e weakness.to_dict()\n{'cwe_id': '15', 'name': 'External Control of System or Configuration Setting', 'weakness_abstraction': 'Base'}\n```\n\n- Get the top 25 weaknesses\n\n```pycon\n\u003e\u003e\u003e from cwe import Database\n\u003e\u003e\u003e db = Database()\n\u003e\u003e\u003e db.get_top_25()\n\n```\n\n#### Weakness attributes\n\nThe following weakness object attributes can accessed:\n\n- `cwe_id`\n- `name`\n- `weakness_abstraction`\n- `status`\n- `description`\n- `extended_description`\n- `related_weaknesses`\n- `weakness_ordinalities`\n- `applicable_platforms`\n- `background_details`\n- `alternate_terms`\n- `modes_of_introduction`\n- `exploitation_factors`\n- `likelihood_of_exploit`\n- `common_consequences`\n- `detection_methods`\n- `potential_mitigations`\n- `observed_examples`\n- `functional_areas`\n- `affected_resources`\n- `taxonomy_mappings`\n- `related_attack_patterns`\n- `notes`\n\n#### Tests\n\nThere's a small `unittest` test suite in the `tests` directory\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulian-nash%2Fcwe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjulian-nash%2Fcwe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulian-nash%2Fcwe/lists"}