Utility functions for AttackIQ Platform API usage
Project description
AttackIQ Platform API
⚠️ Beta - Under active development. APIs subject to change. Feedback: rajesh.sharma@attackiq.com | Access: Request invite to AttackIQ GitHub.
Tools for interacting with the AttackIQ Platform API:
- Python SDK (
aiq-platform-api) - Async library for Python applications - CLI (
aiq) - Command-line interface
Python SDK
Install from PyPI:
pip install aiq-platform-api
Usage
import asyncio
from aiq_platform_api import AttackIQClient, Scenarios, Assets
async def main():
async with AttackIQClient(
"https://your-platform.attackiq.com",
"your-api-token"
) as client:
# Search scenarios
result = await Scenarios.search_scenarios(client, query="powershell", limit=10)
print(f"Found {result['count']} scenarios")
# List assets
async for asset in Assets.get_assets(client, limit=5):
print(asset["hostname"])
asyncio.run(main())
Configuration
Both the SDK and CLI require these environment variables:
export ATTACKIQ_PLATFORM_URL="https://your-platform.attackiq.com"
export ATTACKIQ_PLATFORM_API_TOKEN="your-api-token"
Or create a .env file in your working directory (auto-loaded).
CLI
Quick Install (Recommended)
Linux / macOS
GITHUB_TOKEN="your_token" sh -c 'curl -fsSL -H "Authorization: token $GITHUB_TOKEN" \
https://raw.githubusercontent.com/AttackIQ/aiq-platform-api/main/install.sh | sh'
Add to PATH (first time only):
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc # or ~/.bashrc
Auto-detects OS/arch, installs to ~/.local/bin (no sudo).
Windows (Native)
PowerShell installer:
$env:GITHUB_TOKEN = "your_token"
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/AttackIQ/aiq-platform-api/main/install.ps1" -Headers @{Authorization="token $env:GITHUB_TOKEN"} -OutFile "$env:TEMP\install.ps1"
powershell -ExecutionPolicy Bypass -File "$env:TEMP\install.ps1"
Installs to %LOCALAPPDATA%\Programs\aiq and adds to PATH automatically.
Usage
# List available commands
aiq --help
# List assessments
aiq assessments list
# Search assets
aiq assets search --query "hostname"
# Get scenario details
aiq scenarios get --scenario-id "abc123"
Shell Completion
The CLI supports shell completion for bash, zsh, fish, and PowerShell.
Bash
Current session:
source <(aiq completion bash)
Permanent installation:
# Linux
aiq completion bash | sudo tee /etc/bash_completion.d/aiq
# macOS
aiq completion bash > $(brew --prefix)/etc/bash_completion.d/aiq
Zsh
Current session:
source <(aiq completion zsh)
Permanent installation:
# Add to ~/.zshrc
echo "source <(aiq completion zsh)" >> ~/.zshrc
# Or install to completions directory
aiq completion zsh > "${fpath[1]}/_aiq"
Fish
Permanent installation:
aiq completion fish | source
# Or save to completions directory
aiq completion fish > ~/.config/fish/completions/aiq.fish
PowerShell
Current session:
aiq completion powershell | Out-String | Invoke-Expression
Permanent installation: Add the following to your PowerShell profile:
aiq completion powershell | Out-String | Invoke-Expression
Contributing
We welcome feedback and contributions! For detailed contribution guidelines, please see CONTRIBUTING.md.
Quick ways to contribute:
- Open issues for bugs or feature requests
- Submit pull requests
- Provide feedback on the API design
License
MIT License - See LICENSE file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiq_platform_api-1.0.17.tar.gz.
File metadata
- Download URL: aiq_platform_api-1.0.17.tar.gz
- Upload date:
- Size: 55.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.11.8 Linux/6.6.87.2-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca01e59dd7f83a888d37651806dcd2e5f7051537ed49952abe948552ec3bede5
|
|
| MD5 |
3cb35bb1889a845251d62130eef2319d
|
|
| BLAKE2b-256 |
dcf0e81b471574443b46ed3977a0d91b6549ee6957567dc74577aaae997686f7
|
File details
Details for the file aiq_platform_api-1.0.17-py3-none-any.whl.
File metadata
- Download URL: aiq_platform_api-1.0.17-py3-none-any.whl
- Upload date:
- Size: 62.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.11.8 Linux/6.6.87.2-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b151590d1e8cf1da458f60f0534029ad23c3a8cd5e0dc634d18e415cd608cf9
|
|
| MD5 |
eb48ff2f5b612b2fa15ff39a92f00cc0
|
|
| BLAKE2b-256 |
91a05369734d2730bdaf64bb48d82cabf8cefaed3c2bd8deb6afcb067b0f0f1f
|