{"id":13505732,"url":"https://github.com/hupe1980/cdk-threagile","last_synced_at":"2026-02-25T12:12:48.313Z","repository":{"id":37521075,"uuid":"504493742","full_name":"hupe1980/cdk-threagile","owner":"hupe1980","description":"Agile Threat Modeling as Code","archived":false,"fork":false,"pushed_at":"2022-06-30T17:17:08.000Z","size":623,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-07T22:19:51.381Z","etag":null,"topics":["appsec","cdk","cdktg","constructs","devsecops","modeling","stride","threagile","threat"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/hupe1980.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":null,"security":null,"support":null}},"created_at":"2022-06-17T10:34:17.000Z","updated_at":"2024-12-31T19:54:53.000Z","dependencies_parsed_at":"2022-07-13T19:10:29.028Z","dependency_job_id":null,"html_url":"https://github.com/hupe1980/cdk-threagile","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fcdk-threagile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fcdk-threagile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fcdk-threagile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fcdk-threagile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hupe1980","download_url":"https://codeload.github.com/hupe1980/cdk-threagile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643521,"owners_count":21138451,"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":["appsec","cdk","cdktg","constructs","devsecops","modeling","stride","threagile","threat"],"created_at":"2024-08-01T00:01:12.367Z","updated_at":"2026-02-25T12:12:48.285Z","avatar_url":"https://github.com/hupe1980.png","language":"TypeScript","funding_links":[],"categories":["Related Projects"],"sub_categories":["Multi-accounts setup"],"readme":"# cdk-threagile (cdktg)\n![Build](https://github.com/hupe1980/cdk-threagile/workflows/build/badge.svg)\n![Release](https://github.com/hupe1980/cdk-threagile/workflows/release/badge.svg)\n\u003e Agile Threat Modeling as Code\n\nCDK Constructs for [threagile](https://threagile.io/)\n## Installation\nTypeScript/JavaScript:\n\n```bash\nnpm i cdktg\n```\n\nPython:\n\n```bash\npip install cdktg\n```\n\n## How to use\nInitialize a project:\n\n```bash\nmkdir threagile\ncd threagile\ncdktg init\n```\n\n### Threat Model written in typescript:\n```typescript\n// threagile.ts\n\nconst project = new Project();\n\nconst model = new Model(project, 'Model Stub', {\n    title: 'Model Stub',\n    version: '1.0.0',\n    date: '2020-03-31',\n    author: new Author({\n        name: 'John Doe',\n    }),\n    businessCriticality: BusinessCriticality.IMPORTANT,\n});\n\nconst someData = new DataAsset(model, 'Some Data Asset', {\n    description: 'Some Description',\n    usage: Usage.BUSINESS,\n    origin: 'Some Origin',\n    owner: 'Some Owner',\n    quantity: Quantity.MANY,\n    ciaTriad: new CIATriad({\n        confidentiality: Confidentiality.CONFIDENTIAL,\n        integrity: Integrity.CRITICAL,\n        availability: Availability.OPERATIONAL,\n    }),\n});\n\nconst someTrustBoundary = new TrustBoundary(model, 'Some Trust Boundary', {\n    description: 'Some Description',\n    type: TrustBoundaryType.NETWORK_DEDICATED_HOSTER,\n});\n\nconst someTechnicalAsset = new TechnicalAsset(model, 'Some Technical Asset', {\n    trustBoundary: someTrustBoundary,\n    description: 'Some Description',\n    type: TechnicalAssetType.PROCESS,\n    usage: Usage.BUSINESS,\n    humanUse: false,\n    size: Size.COMPONENT,\n    technology: Technology.WEB_SERVICE_REST,\n    internet: false,\n    machine: Machine.VIRTUAL,\n    encryption: Encryption.NONE,\n    owner: 'Some Owner',\n    ciaTriad: new CIATriad({\n        confidentiality: Confidentiality.CONFIDENTIAL,\n        integrity: Integrity.CRITICAL,\n        availability: Availability.CRITICAL,\n    }),\n    multiTenant: false,\n    redundant: true,\n});\n\nsomeTechnicalAsset.processes(someData);\n\nconst someOtherTechnicalAsset = new TechnicalAsset(model, 'Some Other Technical Asset', {\n    description: 'Some Description',\n    type: TechnicalAssetType.PROCESS,\n    usage: Usage.BUSINESS,\n    humanUse: false,\n    size: Size.COMPONENT,\n    technology: Technology.WEB_SERVICE_REST,\n    tags: ['some-tag', 'some-other-tag'],\n    internet: false,\n    machine: Machine.VIRTUAL,\n    encryption: Encryption.NONE,\n    owner: 'Some Owner',\n    ciaTriad: new CIATriad({\n        confidentiality: Confidentiality.CONFIDENTIAL,\n        integrity: Integrity.IMPORTANT,\n        availability: Availability.IMPORTANT,\n    }),\n    multiTenant: false,\n    redundant: true,\n});\n\nsomeOtherTechnicalAsset.processes(someData);\n\nconst someTraffic = someTechnicalAsset.communicatesWith('Some Traffic', someOtherTechnicalAsset, {\n    description: 'Some Description',\n    protocol: Protocol.HTTPS,\n    authentication: Authentication.NONE,\n    authorization: Authorization.NONE,\n    vpn: false,\n    ipFiltered: false,\n    readonly: false,\n    usage: Usage.BUSINESS,\n});\n\nsomeTraffic.sends(someData);\n\nconst someSharedRuntime = new SharedRuntime(model, \"Some Shared Runtime\", {\n    description: \"Some Description\",\n});\n\nsomeSharedRuntime.runs(someTechnicalAsset, someOtherTechnicalAsset);\n\nproject.synth();\n```\n\n### High level constructs (cdktg/plus*)\n```typescript\nimport { ApplicationLoadBalancer, Cloud } from \"cdktg/plus-aws\";\n\n// ...\n\nconst alb = new ApplicationLoadBalancer(model, \"ALB\", {\n    waf: true,\n    ciaTriad: new CIATriad({\n        availability: Availability.CRITICAL,\n        integrity: Integrity.IMPORTANT,\n        confidentiality: Confidentiality.CONFIDENTIAL,\n    }),\n});\n\nconst cloud = new Cloud(model, \"AWS-Cloud\");\n\ncloud.addTechnicalAssets(alb);\n\n// ...\n```\n\n### cdktg CLI commands:\nA running thragile rest api server is required for the CLI. The URL can be passed by parameter `url` or environment variable `CDKTG_THREAGILE_BASE_URL`.\n\nThe examples can be used with the [threagile playground](https://run.threagile.io/)\n```sh\ncdktg [command]\n\nCommands:\n  cdktg init              create a new cdk-threagile project\n  cdktg synth \u003cfilename\u003e  synthesize the models\n  cdktg ping              ping the api\n  cdktg check             check the models\n  cdktg analyze           analyze the models\n  cdktg completion        generate completion script\n\nOptions:\n  --help     Show help                               [boolean]\n  --version  Show version number                     [boolean]\n```\n### Analyze outputs:\n```sh\ndist\n└── ModelStub\n    ├── data-asset-diagram.png\n    ├── data-flow-diagram.png\n    ├── report.pdf\n    ├── risks.json\n    ├── risks.xlsx\n    ├── stats.json\n    ├── tags.xlsx\n    ├── technical-assets.json\n    └── threagile.yaml\n```\n\n## Examples\n\nSee more complete [examples](https://github.com/hupe1980/cdk-threagile-examples).\n## License\n\n[MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhupe1980%2Fcdk-threagile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhupe1980%2Fcdk-threagile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhupe1980%2Fcdk-threagile/lists"}