iriusrisk-cli 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- iriusrisk_cli-0.1.0/CHANGELOG.md +54 -0
- iriusrisk_cli-0.1.0/LICENSE +21 -0
- iriusrisk_cli-0.1.0/MANIFEST.in +24 -0
- iriusrisk_cli-0.1.0/PKG-INFO +504 -0
- iriusrisk_cli-0.1.0/README.md +455 -0
- iriusrisk_cli-0.1.0/manifest.json +165 -0
- iriusrisk_cli-0.1.0/requirements.txt +5 -0
- iriusrisk_cli-0.1.0/setup.cfg +4 -0
- iriusrisk_cli-0.1.0/setup.py +73 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/__init__.py +3 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/api/__init__.py +15 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/api/base_client.py +467 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/api/countermeasure_client.py +169 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/api/health_client.py +23 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/api/project_client.py +638 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/api/report_client.py +219 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/api/threat_client.py +169 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/api/version_client.py +235 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/api_client.py +181 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/cli_context.py +67 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/commands/__init__.py +1 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/commands/components.py +391 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/commands/config_cmd.py +298 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/commands/countermeasures.py +530 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/commands/init.py +183 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/commands/issue_trackers.py +338 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/commands/mcp.py +1578 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/commands/otm.py +296 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/commands/projects.py +576 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/commands/reports.py +202 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/commands/sync.py +959 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/commands/threats.py +509 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/commands/updates.py +192 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/commands/versions.py +341 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/config.py +459 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/container.py +190 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/exceptions.py +264 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/main.py +380 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/prompts/analyze_source_material.md +204 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/prompts/architecture_and_design_review.md +29 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/prompts/create_threat_model.md +643 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/prompts/initialize_iriusrisk_workflow.md +328 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/prompts/security_development_advisor.md +143 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/prompts/threats_and_countermeasures.md +146 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/repositories/__init__.py +15 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/repositories/base_repository.py +100 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/repositories/countermeasure_repository.py +399 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/repositories/project_repository.py +282 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/repositories/report_repository.py +315 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/repositories/threat_repository.py +359 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/repositories/version_repository.py +284 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/service_factory.py +154 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/services/__init__.py +4 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/services/countermeasure_service.py +305 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/services/health_service.py +34 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/services/project_service.py +421 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/services/report_service.py +245 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/services/threat_service.py +176 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/services/version_service.py +230 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/utils/__init__.py +1 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/utils/api_helpers.py +316 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/utils/error_handling.py +496 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/utils/filtering.py +185 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/utils/logging_config.py +461 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/utils/lookup.py +251 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/utils/mcp_logging.py +65 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/utils/output_formatters.py +367 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/utils/project.py +94 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/utils/project_discovery.py +140 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/utils/project_resolution.py +97 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/utils/table.py +468 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli/utils/updates.py +307 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli.egg-info/PKG-INFO +504 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli.egg-info/SOURCES.txt +76 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli.egg-info/dependency_links.txt +1 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli.egg-info/entry_points.txt +2 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli.egg-info/requires.txt +5 -0
- iriusrisk_cli-0.1.0/src/iriusrisk_cli.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2025-11-12
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
#### Core CLI Features
|
|
13
|
+
- Project management commands (`list`, `show`)
|
|
14
|
+
- Threat viewing and status updates
|
|
15
|
+
- Countermeasure tracking and management
|
|
16
|
+
- Report generation in multiple formats (PDF, HTML, XLSX, CSV)
|
|
17
|
+
- Project version snapshots (create, list, compare)
|
|
18
|
+
- Configuration management with multiple sources (user config, .env, environment variables)
|
|
19
|
+
- API connection testing
|
|
20
|
+
|
|
21
|
+
#### MCP Integration
|
|
22
|
+
- Full Model Context Protocol (MCP) server implementation for AI assistant integration
|
|
23
|
+
- AI-guided threat modeling workflow
|
|
24
|
+
- Automated security analysis from source code
|
|
25
|
+
- OTM (Open Threat Model) file import/export
|
|
26
|
+
- Threat and countermeasure status tracking
|
|
27
|
+
- Diagram generation and visualization
|
|
28
|
+
- Custom prompt support for organization-specific requirements
|
|
29
|
+
- Security development advisor guidance
|
|
30
|
+
- Architecture and design review capabilities
|
|
31
|
+
|
|
32
|
+
#### Developer Experience
|
|
33
|
+
- Comprehensive test suite (unit, CLI, integration tests)
|
|
34
|
+
- Flexible logging with verbosity controls
|
|
35
|
+
- Multiple output formats (table, JSON, CSV)
|
|
36
|
+
- Secure credential management
|
|
37
|
+
- Configuration priority system
|
|
38
|
+
- Rich help documentation
|
|
39
|
+
|
|
40
|
+
### Security
|
|
41
|
+
- Secure API key handling with masked input
|
|
42
|
+
- Credentials stored separately from project files
|
|
43
|
+
- Environment variable support for CI/CD
|
|
44
|
+
- No credentials in version control
|
|
45
|
+
|
|
46
|
+
### Documentation
|
|
47
|
+
- Complete README with usage examples
|
|
48
|
+
- Developer guide for contributors
|
|
49
|
+
- MCP integration examples
|
|
50
|
+
- Configuration best practices
|
|
51
|
+
- AI workflow examples
|
|
52
|
+
|
|
53
|
+
[0.1.0]: https://github.com/iriusrisk/iriusrisk_cli/releases/tag/v0.1.0
|
|
54
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 IriusRisk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Include documentation and metadata files
|
|
2
|
+
include README.md
|
|
3
|
+
include LICENSE
|
|
4
|
+
include CHANGELOG.md
|
|
5
|
+
include requirements.txt
|
|
6
|
+
include manifest.json
|
|
7
|
+
|
|
8
|
+
# Include prompt templates used by MCP
|
|
9
|
+
recursive-include src/iriusrisk_cli/prompts *.md
|
|
10
|
+
|
|
11
|
+
# Exclude test files and development artifacts
|
|
12
|
+
recursive-exclude tests *
|
|
13
|
+
recursive-exclude * __pycache__
|
|
14
|
+
recursive-exclude * *.py[co]
|
|
15
|
+
recursive-exclude * .DS_Store
|
|
16
|
+
exclude .gitignore
|
|
17
|
+
exclude pytest.ini
|
|
18
|
+
exclude DEVELOPER_GUIDE.md
|
|
19
|
+
exclude FEEDME.md
|
|
20
|
+
|
|
21
|
+
# Exclude logs and captured responses
|
|
22
|
+
prune logs
|
|
23
|
+
prune captured_responses
|
|
24
|
+
|
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: iriusrisk-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AI-powered threat modeling integration for IriusRisk. Command line interface and MCP server for security analysis.
|
|
5
|
+
Home-page: https://github.com/iriusrisk/iriusrisk_cli
|
|
6
|
+
Author: IriusRisk
|
|
7
|
+
Author-email: support@iriusrisk.com
|
|
8
|
+
Project-URL: Bug Reports, https://github.com/iriusrisk/iriusrisk_cli/issues
|
|
9
|
+
Project-URL: Documentation, https://github.com/iriusrisk/iriusrisk_cli#readme
|
|
10
|
+
Project-URL: Source, https://github.com/iriusrisk/iriusrisk_cli
|
|
11
|
+
Project-URL: Changelog, https://github.com/iriusrisk/iriusrisk_cli/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: security,threat-modeling,iriusrisk,cli,mcp,ai,threat-analysis,security-testing,compliance,cybersecurity
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Information Technology
|
|
16
|
+
Classifier: Intended Audience :: System Administrators
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Topic :: Security
|
|
26
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
27
|
+
Classifier: Topic :: Software Development :: Testing
|
|
28
|
+
Classifier: Environment :: Console
|
|
29
|
+
Requires-Python: >=3.8
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
License-File: LICENSE
|
|
32
|
+
Requires-Dist: click>=8.0.0
|
|
33
|
+
Requires-Dist: requests>=2.25.0
|
|
34
|
+
Requires-Dist: python-dotenv>=0.19.0
|
|
35
|
+
Requires-Dist: tabulate>=0.8.0
|
|
36
|
+
Requires-Dist: mcp>=1.0.0
|
|
37
|
+
Dynamic: author
|
|
38
|
+
Dynamic: author-email
|
|
39
|
+
Dynamic: classifier
|
|
40
|
+
Dynamic: description
|
|
41
|
+
Dynamic: description-content-type
|
|
42
|
+
Dynamic: home-page
|
|
43
|
+
Dynamic: keywords
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
Dynamic: project-url
|
|
46
|
+
Dynamic: requires-dist
|
|
47
|
+
Dynamic: requires-python
|
|
48
|
+
Dynamic: summary
|
|
49
|
+
|
|
50
|
+
# IriusRisk CLI
|
|
51
|
+
|
|
52
|
+
An AI-powered threat modeling integration that brings IriusRisk security analysis directly into your development workflow. Designed primarily for use with AI-enabled IDEs through MCP (Model Context Protocol), this tool enables AI assistants to help you create threat models, analyze security risks, and implement countermeasures seamlessly within your coding environment.
|
|
53
|
+
|
|
54
|
+
## Primary Use Case: AI-Enabled IDE Integration
|
|
55
|
+
|
|
56
|
+
This tool is designed to work alongside AI assistants in your IDE, enabling:
|
|
57
|
+
|
|
58
|
+
- **AI-Guided Threat Modeling**: Let AI assistants analyze your code and automatically create comprehensive threat models
|
|
59
|
+
- **Intelligent Security Analysis**: Get AI-powered insights on threats and countermeasures specific to your codebase
|
|
60
|
+
- **Contextual Security Recommendations**: Receive security guidance based on your actual code changes and architecture
|
|
61
|
+
- **Automated Security Workflows**: Have AI assistants track threat status, implement countermeasures, and generate reports
|
|
62
|
+
|
|
63
|
+
## What You Can Do
|
|
64
|
+
|
|
65
|
+
- **Manage Projects**: List, view, and analyze your IriusRisk projects
|
|
66
|
+
- **Analyze Threats**: View threats with filtering and update their status
|
|
67
|
+
- **Track Countermeasures**: Monitor implementation progress and create tracking issues
|
|
68
|
+
- **Generate Reports**: Create compliance and security reports in multiple formats
|
|
69
|
+
- **Automate Workflows**: Script security processes with consistent CLI commands
|
|
70
|
+
- **MCP Integration**: Enable AI assistants to perform all operations through Model Context Protocol
|
|
71
|
+
|
|
72
|
+
# MCP Integration for AI-Enabled IDEs
|
|
73
|
+
|
|
74
|
+
## Setting Up MCP Integration
|
|
75
|
+
|
|
76
|
+
The IriusRisk CLI is designed to work with AI assistants through MCP (Model Context Protocol). This enables your AI assistant to:
|
|
77
|
+
|
|
78
|
+
- Analyze your codebase and create threat models automatically
|
|
79
|
+
- Provide security recommendations based on your specific code
|
|
80
|
+
- Track and update threat and countermeasure status
|
|
81
|
+
- Generate security reports and documentation
|
|
82
|
+
|
|
83
|
+
### Configuration for MCP
|
|
84
|
+
|
|
85
|
+
1. Install the IriusRisk CLI (see installation instructions below)
|
|
86
|
+
2. Configure your IriusRisk connection with environment variables
|
|
87
|
+
3. Your AI assistant will automatically detect and use the MCP integration
|
|
88
|
+
|
|
89
|
+
### AI Assistant Capabilities
|
|
90
|
+
|
|
91
|
+
When integrated through MCP, AI assistants can:
|
|
92
|
+
|
|
93
|
+
- **Analyze Source Code**: Examine your application code, infrastructure, and documentation to identify security-relevant components
|
|
94
|
+
- **Create Threat Models**: Generate comprehensive OTM (Open Threat Model) files from your codebase
|
|
95
|
+
- **Import to IriusRisk**: Automatically upload threat models to IriusRisk for professional analysis
|
|
96
|
+
- **Review Threats**: Help you understand and prioritize security threats identified by IriusRisk
|
|
97
|
+
- **Implement Countermeasures**: Guide you through implementing security controls and track their status
|
|
98
|
+
- **Generate Reports**: Create compliance reports and security documentation
|
|
99
|
+
|
|
100
|
+
## Example AI Workflow
|
|
101
|
+
|
|
102
|
+
1. **Code Analysis**: "Analyze my web application for security threats"
|
|
103
|
+
2. **Threat Model Creation**: AI examines your code and creates a comprehensive threat model
|
|
104
|
+
3. **IriusRisk Integration**: Threat model is uploaded to IriusRisk for professional analysis
|
|
105
|
+
4. **Threat Review**: AI helps you understand the identified threats and their priorities
|
|
106
|
+
5. **Implementation Guidance**: AI guides you through implementing security countermeasures
|
|
107
|
+
6. **Status Tracking**: Progress is tracked and synchronized with IriusRisk
|
|
108
|
+
7. **Report Generation**: Compliance and security reports are generated automatically
|
|
109
|
+
|
|
110
|
+
# Using the CLI
|
|
111
|
+
|
|
112
|
+
## Installation
|
|
113
|
+
|
|
114
|
+
### For Development (Current)
|
|
115
|
+
|
|
116
|
+
Clone this repository and install in development mode:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
$ git clone <repository-url>
|
|
120
|
+
|
|
121
|
+
$ cd iriusrisk_cli
|
|
122
|
+
$ pip install -e .
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### From PyPI (Future)
|
|
126
|
+
|
|
127
|
+
Eventually users will be able to install the CLI using:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
$ pip install iriusrisk-cli
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Configuration
|
|
134
|
+
|
|
135
|
+
Before using the CLI, you need to configure your IriusRisk connection. The CLI supports multiple configuration methods with a clear priority order.
|
|
136
|
+
|
|
137
|
+
### Recommended: User-Level Configuration
|
|
138
|
+
|
|
139
|
+
Set up your credentials once for use across all projects:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# Set your default IriusRisk hostname
|
|
143
|
+
iriusrisk config set-hostname https://your-instance.iriusrisk.com
|
|
144
|
+
|
|
145
|
+
# Set your API key (prompts securely, not stored in shell history)
|
|
146
|
+
iriusrisk config set-api-key
|
|
147
|
+
|
|
148
|
+
# View your current configuration
|
|
149
|
+
iriusrisk config show
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
This approach:
|
|
153
|
+
- Keeps your API key secure (not in project files)
|
|
154
|
+
- Works across all projects automatically
|
|
155
|
+
- Can be overridden per-project or per-session
|
|
156
|
+
|
|
157
|
+
### Configuration Priority
|
|
158
|
+
|
|
159
|
+
The CLI checks configuration sources in this order (highest to lowest):
|
|
160
|
+
|
|
161
|
+
1. **Environment variables** - `IRIUS_HOSTNAME` and `IRIUS_API_KEY` (or `IRIUS_API_TOKEN`)
|
|
162
|
+
2. **Project .env file** - `.env` in your project directory
|
|
163
|
+
3. **Project config** - `.iriusrisk/project.json` (hostname only, never API credentials)
|
|
164
|
+
4. **User config** - `~/.iriusrisk/config.json` (set via `iriusrisk config` commands)
|
|
165
|
+
|
|
166
|
+
Each setting is resolved independently, so you can mix sources (e.g., API key from user config, hostname from environment variable).
|
|
167
|
+
|
|
168
|
+
### Alternative Configuration Methods
|
|
169
|
+
|
|
170
|
+
#### Option 2: Project .env file
|
|
171
|
+
|
|
172
|
+
Create a `.env` file in your project directory:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
cat > .env << EOF
|
|
176
|
+
IRIUS_HOSTNAME=https://your-instance.iriusrisk.com
|
|
177
|
+
IRIUS_API_KEY=your-api-token-here
|
|
178
|
+
EOF
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Warning**: If using `.env` files, add them to `.gitignore` to avoid committing credentials.
|
|
182
|
+
|
|
183
|
+
#### Option 3: Environment variables
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
export IRIUS_HOSTNAME=https://your-instance.iriusrisk.com
|
|
187
|
+
export IRIUS_API_KEY=your-api-token-here
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
#### Option 4: Project-specific hostname
|
|
191
|
+
|
|
192
|
+
For teams working with different IriusRisk instances, you can set a hostname in the project config:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# Manually edit .iriusrisk/project.json and add:
|
|
196
|
+
{
|
|
197
|
+
"hostname": "https://dev-instance.iriusrisk.com",
|
|
198
|
+
"project_id": "...",
|
|
199
|
+
...
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**Note**: API credentials should never be stored in project config files.
|
|
204
|
+
|
|
205
|
+
## Logging and Output Control
|
|
206
|
+
|
|
207
|
+
The IriusRisk CLI provides flexible logging options to control output verbosity:
|
|
208
|
+
|
|
209
|
+
### Default Behavior
|
|
210
|
+
By default, the CLI operates quietly with minimal output - only showing command results and critical errors.
|
|
211
|
+
|
|
212
|
+
### Logging Options
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
# Enable verbose output (shows progress and status messages)
|
|
216
|
+
iriusrisk --verbose project list
|
|
217
|
+
|
|
218
|
+
# Enable debug output (shows detailed API calls and timing)
|
|
219
|
+
iriusrisk --debug project list
|
|
220
|
+
|
|
221
|
+
# Suppress all non-essential output (quiet mode)
|
|
222
|
+
iriusrisk --quiet project list
|
|
223
|
+
|
|
224
|
+
# Write logs to a specific file
|
|
225
|
+
iriusrisk --log-file debug.log --debug project list
|
|
226
|
+
|
|
227
|
+
# Set specific log level
|
|
228
|
+
iriusrisk --log-level INFO project list
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Environment Variables
|
|
232
|
+
You can also control logging through environment variables:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# Enable debug mode
|
|
236
|
+
export IRIUSRISK_DEBUG=1
|
|
237
|
+
|
|
238
|
+
# Set log file path
|
|
239
|
+
export IRIUSRISK_LOG_FILE=debug.log
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Output Destinations
|
|
243
|
+
- **stdout**: Command results and data (for piping/redirection)
|
|
244
|
+
- **stderr**: Status messages, progress, warnings, errors, debug info
|
|
245
|
+
- **Log files**: Only when explicitly requested via `--log-file`
|
|
246
|
+
|
|
247
|
+
## Testing API Connection
|
|
248
|
+
|
|
249
|
+
After configuration, test your connection to ensure everything is working correctly:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
# Test your IriusRisk connection
|
|
253
|
+
iriusrisk test
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
This command will:
|
|
257
|
+
- Test connectivity to your IriusRisk instance
|
|
258
|
+
- Verify your authentication credentials
|
|
259
|
+
- Display your IriusRisk version information
|
|
260
|
+
|
|
261
|
+
Example output:
|
|
262
|
+
```
|
|
263
|
+
Testing connection to IriusRisk...
|
|
264
|
+
✓ Connection successful!
|
|
265
|
+
✓ IriusRisk version: 4.47.19-0-g41bcb27de1f-30/09/2025 17:48
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
If the test fails, it will provide specific error information to help you troubleshoot configuration issues.
|
|
269
|
+
|
|
270
|
+
## Getting help
|
|
271
|
+
|
|
272
|
+
Users can get help using the following commands:
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
$ iriusrisk help # Detailed help with examples and configuration
|
|
276
|
+
$ iriusrisk --help # Basic command help
|
|
277
|
+
$ iriusrisk --version # Show version information
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## Quick Start
|
|
281
|
+
|
|
282
|
+
After installation and configuration:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
# Test the installation
|
|
286
|
+
$ iriusrisk --version
|
|
287
|
+
|
|
288
|
+
# Test your API connection
|
|
289
|
+
$ iriusrisk test
|
|
290
|
+
|
|
291
|
+
# Get detailed help
|
|
292
|
+
$ iriusrisk help
|
|
293
|
+
|
|
294
|
+
# Basic help
|
|
295
|
+
$ iriusrisk --help
|
|
296
|
+
|
|
297
|
+
# List projects
|
|
298
|
+
$ iriusrisk project list
|
|
299
|
+
|
|
300
|
+
# List projects with filtering
|
|
301
|
+
$ iriusrisk project list --name "web" --format json
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## Available Commands
|
|
305
|
+
|
|
306
|
+
### Projects
|
|
307
|
+
```bash
|
|
308
|
+
# List all projects
|
|
309
|
+
$ iriusrisk project list
|
|
310
|
+
|
|
311
|
+
# List projects with pagination
|
|
312
|
+
$ iriusrisk project list --page 1 --size 10
|
|
313
|
+
|
|
314
|
+
# Filter by name (partial match)
|
|
315
|
+
$ iriusrisk project list --name "web application"
|
|
316
|
+
|
|
317
|
+
# Filter by tags
|
|
318
|
+
$ iriusrisk project list --tags "production critical"
|
|
319
|
+
|
|
320
|
+
# Filter by workflow state
|
|
321
|
+
$ iriusrisk project list --workflow-state "in-progress"
|
|
322
|
+
|
|
323
|
+
# Show only non-archived projects
|
|
324
|
+
$ iriusrisk project list --not-archived
|
|
325
|
+
|
|
326
|
+
# Include version information
|
|
327
|
+
$ iriusrisk project list --include-versions
|
|
328
|
+
|
|
329
|
+
# Output as JSON
|
|
330
|
+
$ iriusrisk project list --format json
|
|
331
|
+
|
|
332
|
+
# Output as CSV
|
|
333
|
+
$ iriusrisk project list --format csv
|
|
334
|
+
|
|
335
|
+
# Advanced filtering with custom expressions
|
|
336
|
+
$ iriusrisk project list --filter "'name'~'web':AND:'tags'~'prod'"
|
|
337
|
+
|
|
338
|
+
# Show detailed project information
|
|
339
|
+
$ iriusrisk project show <project_id>
|
|
340
|
+
|
|
341
|
+
# Show project info as JSON
|
|
342
|
+
$ iriusrisk project show <project_id> --format json
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### MCP (Model Context Protocol)
|
|
346
|
+
```bash
|
|
347
|
+
# Generate example mcp.json configuration file
|
|
348
|
+
$ iriusrisk mcp-example
|
|
349
|
+
|
|
350
|
+
# Save mcp.json configuration to file
|
|
351
|
+
$ iriusrisk mcp-example > mcp.json
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
The `mcp-example` command generates a configuration file that can be used to set up the IriusRisk CLI as an MCP server for AI integration tools like Claude Desktop. The `iriusrisk mcp` command is not run directly by users - it's automatically invoked by AI tools through the MCP stdio transport when configured properly.
|
|
355
|
+
|
|
356
|
+
The generated configuration looks like:
|
|
357
|
+
|
|
358
|
+
```json
|
|
359
|
+
{
|
|
360
|
+
"mcpServers": {
|
|
361
|
+
"iriusrisk-cli": {
|
|
362
|
+
"command": "iriusrisk",
|
|
363
|
+
"args": [
|
|
364
|
+
"mcp"
|
|
365
|
+
]
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
### Customizing MCP Prompts
|
|
372
|
+
|
|
373
|
+
You can customize the prompts that MCP tools provide to AI assistants by adding a `prompts` section to your `.iriusrisk/project.json` file. This allows you to add organization-specific security standards, compliance requirements, or technology constraints.
|
|
374
|
+
|
|
375
|
+
#### Inline String Customization
|
|
376
|
+
|
|
377
|
+
For short customizations, use strings directly in the configuration:
|
|
378
|
+
|
|
379
|
+
```json
|
|
380
|
+
{
|
|
381
|
+
"name": "my-project",
|
|
382
|
+
"project_id": "abc-123",
|
|
383
|
+
"prompts": {
|
|
384
|
+
"threats_and_countermeasures": {
|
|
385
|
+
"prefix": "Organization Security Standards:\n- All implementations must use approved cryptography libraries\n- Follow ACME Corp Secure Coding Guidelines\n\n"
|
|
386
|
+
},
|
|
387
|
+
"security_development_advisor": {
|
|
388
|
+
"postfix": "\n\nCompliance Note: This is a HIPAA-regulated application."
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
#### File-Based Customization
|
|
395
|
+
|
|
396
|
+
For complex or lengthy customizations, reference external files. Files are resolved relative to the `.iriusrisk` directory:
|
|
397
|
+
|
|
398
|
+
```json
|
|
399
|
+
{
|
|
400
|
+
"name": "my-project",
|
|
401
|
+
"project_id": "abc-123",
|
|
402
|
+
"prompts": {
|
|
403
|
+
"threats_and_countermeasures": {
|
|
404
|
+
"prefix": {"file": "custom_prompts/threat_standards.md"}
|
|
405
|
+
},
|
|
406
|
+
"create_threat_model": {
|
|
407
|
+
"replace": {"file": "custom_prompts/custom_workflow.md"}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
**File path resolution:**
|
|
414
|
+
- Relative paths: Resolved from `.iriusrisk/` directory (e.g., `"custom_prompts/file.md"` → `.iriusrisk/custom_prompts/file.md`)
|
|
415
|
+
- Absolute paths: Used as-is (e.g., `"/path/to/file.md"`)
|
|
416
|
+
|
|
417
|
+
**Example directory structure:**
|
|
418
|
+
```
|
|
419
|
+
project/
|
|
420
|
+
├── .iriusrisk/
|
|
421
|
+
│ ├── project.json
|
|
422
|
+
│ └── custom_prompts/
|
|
423
|
+
│ ├── threat_standards.md
|
|
424
|
+
│ └── custom_workflow.md
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
#### Mixing String and File Customizations
|
|
428
|
+
|
|
429
|
+
You can combine inline strings and file references:
|
|
430
|
+
|
|
431
|
+
```json
|
|
432
|
+
{
|
|
433
|
+
"prompts": {
|
|
434
|
+
"threats_and_countermeasures": {
|
|
435
|
+
"prefix": "Quick note: Check OWASP Top 10\n\n",
|
|
436
|
+
"postfix": {"file": "custom_prompts/additional_guidelines.md"}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
**Available actions:**
|
|
443
|
+
- `prefix` - Add text before the default prompt
|
|
444
|
+
- `postfix` - Add text after the default prompt
|
|
445
|
+
- `replace` - Completely replace the default prompt
|
|
446
|
+
|
|
447
|
+
Each action accepts either:
|
|
448
|
+
- A string value (used directly)
|
|
449
|
+
- A dict with `file` key (loaded from file)
|
|
450
|
+
|
|
451
|
+
**Customizable tools:**
|
|
452
|
+
- `initialize_iriusrisk_workflow`
|
|
453
|
+
- `threats_and_countermeasures`
|
|
454
|
+
- `analyze_source_material`
|
|
455
|
+
- `create_threat_model`
|
|
456
|
+
- `architecture_and_design_review`
|
|
457
|
+
- `security_development_advisor`
|
|
458
|
+
|
|
459
|
+
## Planned Commands
|
|
460
|
+
|
|
461
|
+
These commands will be added in future versions:
|
|
462
|
+
|
|
463
|
+
```bash
|
|
464
|
+
$ iriusrisk project fetch <project_id> # downloads the project data
|
|
465
|
+
$ iriusrisk threats get <project_id> # gets the threats for a given project
|
|
466
|
+
$ iriusrisk threats get <project_id> --top-10 # gets the top 10 highest risk threats
|
|
467
|
+
$ iriusrisk countermeasures get <project> --top-10 # gets the top 10 highest priority countermeasures
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
# API
|
|
471
|
+
|
|
472
|
+
## Authentication
|
|
473
|
+
|
|
474
|
+
Authentication is done using an API key. Configuration can be set via:
|
|
475
|
+
|
|
476
|
+
1. User config: `iriusrisk config set-hostname` and `iriusrisk config set-api-key`
|
|
477
|
+
2. Environment variables: `IRIUS_HOSTNAME` and `IRIUS_API_KEY` (or `IRIUS_API_TOKEN`)
|
|
478
|
+
3. Project .env file
|
|
479
|
+
4. Project config (hostname only)
|
|
480
|
+
|
|
481
|
+
See the Configuration section above for detailed setup instructions.
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
## Getting Help
|
|
486
|
+
|
|
487
|
+
- **MCP Integration**: The primary use case is through AI-enabled IDEs with MCP integration
|
|
488
|
+
- **CLI Usage**: Direct command-line usage is also supported for scripting and automation
|
|
489
|
+
- **Issues**: Report bugs and request features via GitHub Issues
|
|
490
|
+
- **Contributing**: See [DEVELOPER_GUIDE.md](DEVELOPER_GUIDE.md) for setup and contribution guidelines
|
|
491
|
+
|
|
492
|
+
## Architecture
|
|
493
|
+
|
|
494
|
+
This tool serves as a bridge between your development environment and IriusRisk's professional threat modeling platform:
|
|
495
|
+
|
|
496
|
+
```
|
|
497
|
+
Your IDE + AI Assistant
|
|
498
|
+
↓ (MCP)
|
|
499
|
+
IriusRisk CLI
|
|
500
|
+
↓ (REST API)
|
|
501
|
+
IriusRisk Platform
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
The MCP integration enables AI assistants to understand your code context and provide intelligent security guidance, while the CLI provides the underlying functionality for both interactive and automated use cases.
|