xsoar-cli 1.0.1__tar.gz → 1.0.3__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.
Potentially problematic release.
This version of xsoar-cli might be problematic. Click here for more details.
- xsoar_cli-1.0.3/.github/workflows/pull-request-open.yml +34 -0
- xsoar_cli-1.0.3/CONTRIBUTING.md +197 -0
- xsoar_cli-1.0.3/PKG-INFO +256 -0
- xsoar_cli-1.0.3/README.md +235 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/pyproject.toml +2 -6
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/__about__.py +1 -1
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/case/commands.py +1 -0
- xsoar_cli-1.0.3/src/xsoar_cli/manifest/README.md +269 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/utilities.py +3 -3
- xsoar_cli-1.0.1/PKG-INFO +0 -128
- xsoar_cli-1.0.1/README.md +0 -103
- xsoar_cli-1.0.1/src/xsoar_cli/manifest/README.md +0 -23
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/.github/workflows/release.yml +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/.gitignore +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/LICENSE.txt +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/examples/README.md +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/examples/advanced_plugin.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/requirements.txt +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/requirements_dev.txt +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/__init__.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/case/README.md +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/case/__init__.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/cli.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/config/README.md +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/config/__init__.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/config/commands.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/graph/README.md +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/graph/__init__.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/graph/commands.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/manifest/__init__.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/manifest/commands.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/pack/README.md +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/pack/__init__.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/pack/commands.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/playbook/README.md +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/playbook/__init__.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/playbook/commands.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/plugins/README.md +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/plugins/__init__.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/plugins/commands.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/src/xsoar_cli/plugins/manager.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/__init__.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/conftest.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_base.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_case.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_config.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Download/playbook-empty.yml +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_CommonPlaybooks/.pack-ignore +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_CommonPlaybooks/.secrets-ignore +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_CommonPlaybooks/Author_image.png +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_CommonPlaybooks/Playbooks/GenericPlaybook.yml +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_CommonPlaybooks/README.md +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_CommonPlaybooks/pack_metadata.json +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_CommonScripts/.pack-ignore +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_CommonScripts/.secrets-ignore +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_CommonScripts/Author_image.png +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_CommonScripts/README.md +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_CommonScripts/Scripts/GenericScript/GenericScript.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_CommonScripts/Scripts/GenericScript/GenericScript.yml +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_CommonScripts/Scripts/GenericScript/README.md +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_CommonScripts/pack_metadata.json +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/.pack-ignore +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/.secrets-ignore +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/Author_image.png +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/Playbooks/EDR_InitialTriage.yml +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/README.md +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/Scripts/EDR_FetchFile/EDR_FetchFile.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/Scripts/EDR_FetchFile/EDR_FetchFile.yml +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/Scripts/EDR_FetchFile/README.md +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/Scripts/EDR_Triage/EDR_Triage.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/Scripts/EDR_Triage/EDR_Triage.yml +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/Scripts/EDR_Triage/README.md +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/Scripts/LegacyItem/LegacyItem.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/Scripts/LegacyItem/LegacyItem.yml +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/Scripts/LegacyItem/README.md +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/Scripts/LegacyItem/test_data/basescript-dummy.json +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_EDR/pack_metadata.json +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_Layouts/.pack-ignore +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_Layouts/.secrets-ignore +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_Layouts/Author_image.png +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_Layouts/Layouts/layoutscontainer-GenericLayout.json +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_Layouts/README.md +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/MyOrg_Layouts/pack_metadata.json +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/Packs/Not_applicable/Playbooks/Empty.yml +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/manifest_base.json +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/manifest_invalid.json +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/manifest_with_pack_not_on_server.json +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/server_base_response.json +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/server_base_response_missing_one_pack.json +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/server_base_response_with_updates.json +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_data/server_base_response_with_updates_and_one_extra.json +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_graph.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_manifest.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_pack.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_playbook.py +0 -0
- {xsoar_cli-1.0.1 → xsoar_cli-1.0.3}/tests/test_plugins.py +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
on:
|
|
2
|
+
pull_request:
|
|
3
|
+
types: [opened, synchronize, reopened]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
test:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- name: Checkout code
|
|
10
|
+
uses: actions/checkout@v4
|
|
11
|
+
|
|
12
|
+
- name: Setup Python 3.12
|
|
13
|
+
uses: actions/setup-python@v5
|
|
14
|
+
with:
|
|
15
|
+
python-version: "3.12"
|
|
16
|
+
|
|
17
|
+
- name: Create and activate virtual environment
|
|
18
|
+
run: |
|
|
19
|
+
python3.12 -m venv venv
|
|
20
|
+
source venv/bin/activate
|
|
21
|
+
|
|
22
|
+
- name: Install requirements
|
|
23
|
+
run: |
|
|
24
|
+
pip install -r requirements.txt
|
|
25
|
+
pip install -r requirements_dev.txt
|
|
26
|
+
|
|
27
|
+
- name: Install xsoar-cli
|
|
28
|
+
run: pip install -e .
|
|
29
|
+
|
|
30
|
+
- name: Create example plugin
|
|
31
|
+
run: xsoar-cli plugins create-example
|
|
32
|
+
|
|
33
|
+
- name: Run unit tests
|
|
34
|
+
run: pytest
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# Contributing to xsoar-cli
|
|
2
|
+
|
|
3
|
+
We welcome contributions of all kinds! Whether you're fixing bugs, adding features, improving documentation, or sharing ideas, your help makes this project better.
|
|
4
|
+
|
|
5
|
+
## Ways to Contribute
|
|
6
|
+
|
|
7
|
+
### Documentation (just as valuable as code!)
|
|
8
|
+
- Fix typos or unclear explanations
|
|
9
|
+
- Add examples and use cases
|
|
10
|
+
- Improve command documentation
|
|
11
|
+
- Translate documentation
|
|
12
|
+
- Write tutorials or blog posts
|
|
13
|
+
|
|
14
|
+
### Code Contributions
|
|
15
|
+
- Bug fixes and performance improvements
|
|
16
|
+
- New features and command enhancements
|
|
17
|
+
- Plugin examples and templates
|
|
18
|
+
- Test coverage improvements
|
|
19
|
+
|
|
20
|
+
### Issue Reports
|
|
21
|
+
- Bug reports with clear reproduction steps
|
|
22
|
+
- Feature requests with use case descriptions
|
|
23
|
+
- Documentation gaps or confusion points
|
|
24
|
+
|
|
25
|
+
## Getting Started
|
|
26
|
+
|
|
27
|
+
### 1. Fork and Clone
|
|
28
|
+
1. **Fork the repository** on GitHub
|
|
29
|
+
2. **Clone your fork** locally:
|
|
30
|
+
```bash
|
|
31
|
+
git clone https://github.com/YOUR_USERNAME/xsoar-cli.git
|
|
32
|
+
cd xsoar-cli
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 2. Set Up Development Environment
|
|
36
|
+
```bash
|
|
37
|
+
# Create virtual environment
|
|
38
|
+
python -m venv venv
|
|
39
|
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
40
|
+
|
|
41
|
+
# Install development dependencies
|
|
42
|
+
pip install -r requirements_dev.txt
|
|
43
|
+
|
|
44
|
+
# Install the package in development mode
|
|
45
|
+
pip install -e .
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 3. Verify Setup
|
|
49
|
+
```bash
|
|
50
|
+
# Run tests to ensure everything works
|
|
51
|
+
pytest
|
|
52
|
+
|
|
53
|
+
# Check code style
|
|
54
|
+
black --check src/ tests/
|
|
55
|
+
|
|
56
|
+
# Run the CLI to verify installation
|
|
57
|
+
xsoar-cli --help
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Development Workflow
|
|
61
|
+
|
|
62
|
+
### Making Changes
|
|
63
|
+
1. **Create a feature branch**:
|
|
64
|
+
```bash
|
|
65
|
+
git checkout -b feature/your-feature-name
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
2. **Make your changes** (code, docs, tests)
|
|
69
|
+
|
|
70
|
+
3. **Run quality checks**:
|
|
71
|
+
```bash
|
|
72
|
+
# Run tests
|
|
73
|
+
pytest
|
|
74
|
+
|
|
75
|
+
# Format code
|
|
76
|
+
black src/ tests/
|
|
77
|
+
|
|
78
|
+
# Check for any issues
|
|
79
|
+
python -m pytest --cov=src/xsoar_cli
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
4. **Commit with clear messages**:
|
|
83
|
+
```bash
|
|
84
|
+
git add .
|
|
85
|
+
git commit -m "Add feature: brief description of what you added"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
5. **Push and create Pull Request**:
|
|
89
|
+
```bash
|
|
90
|
+
git push origin feature/your-feature-name
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Code Style
|
|
94
|
+
- We use [Black](https://github.com/psf/black) for code formatting
|
|
95
|
+
- Run `black src/ tests/` before committing
|
|
96
|
+
- Follow existing code patterns and conventions
|
|
97
|
+
- Add type hints where appropriate
|
|
98
|
+
- Write docstrings for new functions and classes
|
|
99
|
+
|
|
100
|
+
### Testing
|
|
101
|
+
- Add tests for new features
|
|
102
|
+
- Ensure existing tests still pass
|
|
103
|
+
- Aim for good test coverage
|
|
104
|
+
- Test commands work with both XSOAR v6 and v8 when applicable
|
|
105
|
+
|
|
106
|
+
## Documentation Contributions
|
|
107
|
+
|
|
108
|
+
Documentation improvements are especially welcome! You can contribute to documentation in several ways:
|
|
109
|
+
|
|
110
|
+
### Quick Edits
|
|
111
|
+
- **Edit files directly on GitHub** (great for small fixes like typos)
|
|
112
|
+
- Click the "Edit" button on any file in the GitHub interface
|
|
113
|
+
- Make your changes and create a pull request
|
|
114
|
+
|
|
115
|
+
### Larger Documentation Changes
|
|
116
|
+
- Use the full development setup described above
|
|
117
|
+
- Focus on clarity - assume readers are new to the tool
|
|
118
|
+
- Include practical examples where helpful
|
|
119
|
+
- Test any code examples you include
|
|
120
|
+
|
|
121
|
+
### Types of Documentation Contributions
|
|
122
|
+
- **README improvements**: Better explanations, more examples
|
|
123
|
+
- **Command documentation**: Individual command READMEs in `src/xsoar_cli/*/README.md`
|
|
124
|
+
- **Plugin documentation**: Examples and guides for plugin development
|
|
125
|
+
- **Troubleshooting**: Common issues and solutions
|
|
126
|
+
- **Tutorials**: Step-by-step guides for specific workflows
|
|
127
|
+
|
|
128
|
+
## Submitting Pull Requests
|
|
129
|
+
|
|
130
|
+
### Before Submitting
|
|
131
|
+
- [ ] Tests pass (`pytest`)
|
|
132
|
+
- [ ] Code is formatted (`black src/ tests/`)
|
|
133
|
+
- [ ] Documentation is updated if needed
|
|
134
|
+
- [ ] Commit messages are clear and descriptive
|
|
135
|
+
|
|
136
|
+
### Pull Request Guidelines
|
|
137
|
+
- **Describe your changes** clearly in the PR description
|
|
138
|
+
- **Reference any related issues** (e.g., "Fixes #123")
|
|
139
|
+
- **Include testing instructions** if applicable
|
|
140
|
+
- **Be responsive to feedback** during code review
|
|
141
|
+
|
|
142
|
+
### What to Expect
|
|
143
|
+
- We'll review your PR as soon as possible
|
|
144
|
+
- We may suggest changes or improvements
|
|
145
|
+
- Once approved, we'll merge your contribution
|
|
146
|
+
- Your contribution will be included in the next release
|
|
147
|
+
|
|
148
|
+
## Reporting Issues
|
|
149
|
+
|
|
150
|
+
### Bug Reports
|
|
151
|
+
Please include:
|
|
152
|
+
- **Clear description** of the problem
|
|
153
|
+
- **Steps to reproduce** the issue
|
|
154
|
+
- **Expected vs actual behavior**
|
|
155
|
+
- **Environment details** (Python version, XSOAR version, OS)
|
|
156
|
+
- **Error messages** and stack traces if applicable
|
|
157
|
+
|
|
158
|
+
### Feature Requests
|
|
159
|
+
Please include:
|
|
160
|
+
- **Use case description** - what problem does this solve?
|
|
161
|
+
- **Proposed solution** or implementation ideas
|
|
162
|
+
- **Examples** of how the feature would be used
|
|
163
|
+
|
|
164
|
+
## Development Tips
|
|
165
|
+
|
|
166
|
+
### Working with XSOAR Environments
|
|
167
|
+
- Test against both XSOAR v6 and v8 when possible
|
|
168
|
+
- Use the configuration examples in the README as reference
|
|
169
|
+
- Consider how features work with different authentication methods
|
|
170
|
+
|
|
171
|
+
### Plugin Development
|
|
172
|
+
- Look at examples in the `examples/` directory
|
|
173
|
+
- Follow the plugin architecture in `src/xsoar_cli/plugins/`
|
|
174
|
+
- Test plugin loading and command registration
|
|
175
|
+
|
|
176
|
+
### Command Development
|
|
177
|
+
- Follow the existing command structure
|
|
178
|
+
- Use Click decorators consistently
|
|
179
|
+
- Include proper help text and examples
|
|
180
|
+
- Consider error handling and user feedback
|
|
181
|
+
|
|
182
|
+
## Questions or Ideas?
|
|
183
|
+
|
|
184
|
+
- **Open an issue** for discussion
|
|
185
|
+
- **Check existing issues** for similar topics
|
|
186
|
+
- **Feel free to ask questions** - we're here to help!
|
|
187
|
+
- **Join discussions** on existing PRs and issues
|
|
188
|
+
|
|
189
|
+
## Code of Conduct
|
|
190
|
+
|
|
191
|
+
Be respectful and constructive in all interactions. We want this to be a welcoming space for contributors of all backgrounds and experience levels.
|
|
192
|
+
|
|
193
|
+
## Recognition
|
|
194
|
+
|
|
195
|
+
Contributors are recognized in release notes and we appreciate all contributions, no matter how small!
|
|
196
|
+
|
|
197
|
+
Thank you for contributing!
|
xsoar_cli-1.0.3/PKG-INFO
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xsoar-cli
|
|
3
|
+
Version: 1.0.3
|
|
4
|
+
Project-URL: Documentation, https://github.com/tlium/xsoar-cli#readme
|
|
5
|
+
Project-URL: Issues, https://github.com/tlium/xsoar-cli/issues
|
|
6
|
+
Project-URL: Source, https://github.com/tlium/xsoar-cli
|
|
7
|
+
Author-email: Torbjørn Lium <torben@lium.org>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE.txt
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Programming Language :: Python
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
14
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
15
|
+
Requires-Python: >=3.12
|
|
16
|
+
Requires-Dist: click==8.1.8
|
|
17
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
18
|
+
Requires-Dist: xsoar-client>=1.0.0
|
|
19
|
+
Requires-Dist: xsoar-dependency-graph>=0.0.3
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# xsoar-cli
|
|
23
|
+
|
|
24
|
+
[](https://badge.fury.io/py/xsoar-cli) [](https://pypi.org/project/xsoar-cli/) [](https://github.com/psf/black) [](https://opensource.org/licenses/MIT)
|
|
25
|
+
|
|
26
|
+
A command-line interface for managing Palo Alto Networks XSOAR (Cortex XSOAR) that streamlines content development and deployment workflows.
|
|
27
|
+
|
|
28
|
+
**Key Features:**
|
|
29
|
+
- **Content Management**: Validate and deploy content packs with declarative manifests
|
|
30
|
+
- **Case Operations**: Retrieve case details and clone cases between environments
|
|
31
|
+
- **Playbook Development**: Download playbooks for local editing and testing
|
|
32
|
+
- **Dependency Analysis**: Generate visual graphs of content pack dependencies
|
|
33
|
+
- **Plugin System**: Extend functionality with custom commands
|
|
34
|
+
|
|
35
|
+
Perfect for DevOps teams using CI/CD pipelines to manage XSOAR content stored in [content repositories](https://github.com/demisto/content-ci-cd-template).
|
|
36
|
+
|
|
37
|
+
Pull Requests are very welcome and appreciated! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Install
|
|
43
|
+
pip install xsoar-cli
|
|
44
|
+
|
|
45
|
+
# Create configuration file
|
|
46
|
+
xsoar-cli config create
|
|
47
|
+
|
|
48
|
+
# Validate and deploy your content
|
|
49
|
+
xsoar-cli manifest validate ./xsoar_config.json
|
|
50
|
+
xsoar-cli manifest deploy ./xsoar_config.json
|
|
51
|
+
|
|
52
|
+
# Get help on available commands
|
|
53
|
+
xsoar-cli --help
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Important Notes
|
|
57
|
+
|
|
58
|
+
This CLI tool is made to be run from the root of a content repository. Some commands depend on files located in your content repository or expects a certain directory structure to be available from your currently working directory.
|
|
59
|
+
|
|
60
|
+
## Requirements
|
|
61
|
+
|
|
62
|
+
### Core Requirements
|
|
63
|
+
- XSOAR servers version 6 or 8
|
|
64
|
+
- Python 3.9+ (only tested with Python 3.12, earlier versions may work but are not guaranteed)
|
|
65
|
+
|
|
66
|
+
### Additional Requirements (depending on usage)
|
|
67
|
+
- **AWS SDK for Python (Boto3)** - Only required when working with custom content packs stored in S3. You can use marketplace packs and other functionality without AWS setup.
|
|
68
|
+
|
|
69
|
+
**Note:** AWS S3 is currently the only available artifacts repository provider for custom packs. Pull requests for new providers are welcome!
|
|
70
|
+
|
|
71
|
+
## Installation
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
pip install xsoar-cli
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Upgrading
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pip install --upgrade xsoar-cli
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Uninstalling
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pip uninstall xsoar-cli
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Configuration
|
|
90
|
+
|
|
91
|
+
The xsoar-cli config file is located in `~/.config/xsoar-cli/config.json`. To create a configuration file from template, please run:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
xsoar-cli config create
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Configuration File Structure
|
|
98
|
+
|
|
99
|
+
After creating the config file, edit it with your XSOAR server details:
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"default_environment": "xsoar6",
|
|
104
|
+
"default_new_case_type": "",
|
|
105
|
+
"custom_pack_authors": ["SOMEONE"],
|
|
106
|
+
"server_config": {
|
|
107
|
+
"xsoar6": {
|
|
108
|
+
"base_url": "https://xsoar-v6.example.com",
|
|
109
|
+
"api_token": "YOUR API TOKEN HERE",
|
|
110
|
+
"artifacts_location": "S3",
|
|
111
|
+
"s3_bucket_name": "xsoar-cicd",
|
|
112
|
+
"verify_ssl": "/path/to/your/CA_bundle.pem",
|
|
113
|
+
"server_version": 6
|
|
114
|
+
},
|
|
115
|
+
"xsoar8": {
|
|
116
|
+
"base_url": "https://xsoar-v8.example.com",
|
|
117
|
+
"api_token": "YOUR API TOKEN HERE",
|
|
118
|
+
"artifacts_location": "S3",
|
|
119
|
+
"s3_bucket_name": "xsoar-cicd-prod",
|
|
120
|
+
"verify_ssl": false,
|
|
121
|
+
"server_version": 8,
|
|
122
|
+
"xsiam_auth_id": 123
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Configuration Options
|
|
129
|
+
|
|
130
|
+
- **default_environment**: Which environment to use by default (e.g., "xsoar6")
|
|
131
|
+
- **default_new_case_type**: Default case type when creating new cases
|
|
132
|
+
- **custom_pack_authors**: List of author names used in your custom content packs. This helps xsoar-cli distinguish between your custom packs and marketplace packs. Use the same values you have in `pack_metadata.json` files.
|
|
133
|
+
|
|
134
|
+
- **server_config**: Define multiple XSOAR environments (xsoar6, xsoar8, etc.)
|
|
135
|
+
- **base_url**: Your XSOAR server URL
|
|
136
|
+
- **api_token**: API token for authentication (see XSOAR documentation for creating API keys)
|
|
137
|
+
- **artifacts_location**: Where artifacts are stored (currently only "S3" is supported)
|
|
138
|
+
- **s3_bucket_name**: S3 bucket where your custom content packs are stored
|
|
139
|
+
- **verify_ssl**: SSL certificate verification - use `false` for self-signed certificates, or path to CA bundle
|
|
140
|
+
- **server_version**: XSOAR server version (6 or 8)
|
|
141
|
+
- **xsiam_auth_id**: Required for XSOAR 8 (XSIAM) - the authentication ID for API access
|
|
142
|
+
|
|
143
|
+
### Validation
|
|
144
|
+
|
|
145
|
+
Test your configuration with:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
xsoar-cli config validate
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
This will verify connectivity to all configured XSOAR environments.
|
|
152
|
+
|
|
153
|
+
## Usage
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
xsoar-cli <command> <sub-command> <args>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
For information about available commands, run `xsoar-cli` without arguments.
|
|
160
|
+
|
|
161
|
+
For more information on a specific command execute `xsoar-cli <command> --help`.
|
|
162
|
+
|
|
163
|
+
### Commands
|
|
164
|
+
|
|
165
|
+
- **[case](src/xsoar_cli/case/README.md)** - Retrieve case details and clone cases between environments
|
|
166
|
+
- **[config](src/xsoar_cli/config/README.md)** - Create, validate, and manage CLI configuration files
|
|
167
|
+
- **[graph](src/xsoar_cli/graph/README.md)** - Generate visual dependency graphs for content packs
|
|
168
|
+
- **[manifest](src/xsoar_cli/manifest/README.md)** - Validate and deploy content using declarative manifests
|
|
169
|
+
- **[pack](src/xsoar_cli/pack/README.md)** - Manage content pack operations and information
|
|
170
|
+
- **[playbook](src/xsoar_cli/playbook/README.md)** - Download playbooks for local editing and development
|
|
171
|
+
- **[plugins](src/xsoar_cli/plugins/README.md)** - Extend CLI functionality with custom commands
|
|
172
|
+
|
|
173
|
+
## Plugin System
|
|
174
|
+
|
|
175
|
+
xsoar-cli supports a plugin system that allows you to extend the CLI with custom commands. Plugins are Python files that you place in `~/.local/xsoar-cli/plugins/` and they're automatically discovered and loaded.
|
|
176
|
+
|
|
177
|
+
### Quick Start with Plugins
|
|
178
|
+
|
|
179
|
+
1. **Create an example plugin**:
|
|
180
|
+
```bash
|
|
181
|
+
xsoar-cli plugins create-example
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
2. **List available plugins**:
|
|
185
|
+
```bash
|
|
186
|
+
xsoar-cli plugins list
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
3. **Test the example plugin**:
|
|
190
|
+
```bash
|
|
191
|
+
xsoar-cli example hello --name "World"
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Plugin Management Commands
|
|
195
|
+
|
|
196
|
+
- `xsoar-cli plugins list` - List all plugins
|
|
197
|
+
- `xsoar-cli plugins info <plugin>` - Show plugin information
|
|
198
|
+
- `xsoar-cli plugins validate` - Validate all plugins
|
|
199
|
+
- `xsoar-cli plugins reload <plugin>` - Reload a specific plugin
|
|
200
|
+
- `xsoar-cli plugins create-example` - Create an example plugin
|
|
201
|
+
- `xsoar-cli plugins open` - Open the plugins directory
|
|
202
|
+
|
|
203
|
+
### Creating Your Own Plugins
|
|
204
|
+
|
|
205
|
+
Create a Python file in `~/.local/xsoar-cli/plugins/` that inherits from `XSOARPlugin`:
|
|
206
|
+
|
|
207
|
+
```python
|
|
208
|
+
import click
|
|
209
|
+
from xsoar_cli.plugins import XSOARPlugin
|
|
210
|
+
|
|
211
|
+
class MyPlugin(XSOARPlugin):
|
|
212
|
+
@property
|
|
213
|
+
def name(self) -> str:
|
|
214
|
+
return "myplugin"
|
|
215
|
+
|
|
216
|
+
@property
|
|
217
|
+
def version(self) -> str:
|
|
218
|
+
return "1.0.0"
|
|
219
|
+
|
|
220
|
+
def get_command(self) -> click.Command:
|
|
221
|
+
@click.command(help="My custom command")
|
|
222
|
+
def mycommand():
|
|
223
|
+
click.echo("Hello from my plugin!")
|
|
224
|
+
return mycommand
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
For detailed documentation, see [Plugin System Documentation](src/xsoar_cli/plugins/README.md).
|
|
228
|
+
|
|
229
|
+
## Troubleshooting
|
|
230
|
+
|
|
231
|
+
### Common Issues
|
|
232
|
+
|
|
233
|
+
**"Config file not found"**
|
|
234
|
+
- Run `xsoar-cli config create` to generate a template configuration file
|
|
235
|
+
- Ensure the file exists at `~/.config/xsoar-cli/config.json`
|
|
236
|
+
|
|
237
|
+
**"Failed to reach pack" or connection errors**
|
|
238
|
+
- Verify your XSOAR server URL and API token in the config file
|
|
239
|
+
- Check network connectivity to your XSOAR server
|
|
240
|
+
- For custom packs: Ensure AWS credentials are configured and S3 bucket is accessible
|
|
241
|
+
|
|
242
|
+
**"Invalid environment"**
|
|
243
|
+
- Check that the environment name matches exactly what's defined in your config file
|
|
244
|
+
- Use `xsoar-cli config validate` to verify your configuration
|
|
245
|
+
|
|
246
|
+
**Python compatibility issues**
|
|
247
|
+
- Ensure you're using Python 3.9 or later
|
|
248
|
+
- Consider using Python 3.12 for best compatibility
|
|
249
|
+
|
|
250
|
+
## Contributing
|
|
251
|
+
|
|
252
|
+
We welcome all contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines on how to contribute to this project.
|
|
253
|
+
|
|
254
|
+
## License
|
|
255
|
+
|
|
256
|
+
`xsoar-cli` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
|