Skip to content

API Reference parrot_tools.cloudsploit.toolkit

github-actions[bot] edited this page Nov 10, 2026 · 4 revisions

parrot_tools.cloudsploit.toolkit

View source

CloudSploit Security Scanning Toolkit for AI-Parrot.

Orchestrates CloudSploit executor, parser, report generator, and comparator into a single AbstractToolkit subclass. Every public async method is automatically exposed as an agent tool.

Alias AbstractToolkit

Re-exported from parrot_tools.toolkit.AbstractToolkit.

Alias CloudProvider

Re-exported from parrot_tools.cloudsploit.models.CloudProvider.

Alias CloudSploitConfig

Re-exported from parrot_tools.cloudsploit.models.CloudSploitConfig.

Alias CloudSploitExecutor

Re-exported from parrot_tools.cloudsploit.executor.CloudSploitExecutor.

Class CloudSploitToolkit

Cloud Security Posture Management toolkit powered by CloudSploit.

Runs security scans against AWS infrastructure, parses results, generates reports, and tracks security posture over time.

Parameter Type Default Description
config Optional[CloudSploitConfig] None
**kwargs {}

Method CloudSploitToolkit.run_scan

Run a CloudSploit security scan against cloud infrastructure.

run_scan(plugins: Optional[list[str]] = None, ignore_ok: bool = False, suppress: Optional[list[str]] = None, config: Optional[str] = None) -> ScanResult

Parameter Type Default Description
plugins Optional[list[str]] None Specific plugins to run. If None, runs all plugins.
ignore_ok bool False If True, exclude passing (OK) results.
suppress Optional[list[str]] None Regex patterns to suppress specific results.
config Optional[str] None Path to a CloudSploit JS credentials file. When set, takes precedence over CloudSploitConfig.config_file and over env-var credentials. The file must exist on disk.

Returns: ScanResult — ScanResult with typed findings and summary.

Method CloudSploitToolkit.run_compliance_scan

Run a compliance-filtered CloudSploit scan.

run_compliance_scan(framework: str, ignore_ok: bool = True, config: Optional[str] = None) -> ScanResult

Parameter Type Default Description
framework str Compliance framework - one of: hipaa, cis1, cis2, pci.
ignore_ok bool True If True, exclude passing results (default True for compliance).
config Optional[str] None Path to a CloudSploit JS credentials file. When set, takes precedence over CloudSploitConfig.config_file and over env-var credentials. The file must exist on disk.

Returns: ScanResult — ScanResult filtered to the specified compliance framework.

Method CloudSploitToolkit.scan_open_ports

Scan only the "open ports" plugins for a given cloud provider.

Runs CloudSploit's curated open-port plugin set for the target provider (AWS EC2 Security Groups, GCP Firewall Rules, or OCI Security Lists). Temporarily switches self.config.cloud_provider for the duration of the scan and restores it afterwards.

scan_open_ports(provider: str = 'aws', extra_plugins: Optional[list[str]] = None, ignore_ok: bool = False, suppress: Optional[list[str]] = None, config: Optional[str] = None) -> ScanResult

Parameter Type Default Description
provider str 'aws' One of "aws", "google", "oracle".
extra_plugins Optional[list[str]] None Additional CloudSploit plugin names to append.
ignore_ok bool False If True, exclude passing (OK) results.
suppress Optional[list[str]] None Regex patterns to suppress specific results.
config Optional[str] None Per-call CloudSploit JS credentials file (see run_scan).

Returns: ScanResult — ScanResult with findings limited to the open-port plugins.

Method CloudSploitToolkit.scan_security_groups

Scan AWS EC2 Security Groups for open-port misconfigurations.

Convenience alias for scan_open_ports(provider="aws", ...).

scan_security_groups(extra_plugins: Optional[list[str]] = None, ignore_ok: bool = False, suppress: Optional[list[str]] = None, config: Optional[str] = None) -> ScanResult

Parameter Type Default Description
extra_plugins Optional[list[str]] None
ignore_ok bool False
suppress Optional[list[str]] None
config Optional[str] None

Returns: ScanResult

Method CloudSploitToolkit.scan_firewall_rules

Scan GCP Firewall Rules for open-port misconfigurations.

Convenience alias for scan_open_ports(provider="google", ...).

scan_firewall_rules(extra_plugins: Optional[list[str]] = None, ignore_ok: bool = False, suppress: Optional[list[str]] = None, config: Optional[str] = None) -> ScanResult

Parameter Type Default Description
extra_plugins Optional[list[str]] None
ignore_ok bool False
suppress Optional[list[str]] None
config Optional[str] None

Returns: ScanResult

Method CloudSploitToolkit.scan_security_lists

Scan OCI Security Lists for open-port misconfigurations.

Convenience alias for scan_open_ports(provider="oracle", ...).

scan_security_lists(extra_plugins: Optional[list[str]] = None, ignore_ok: bool = False, suppress: Optional[list[str]] = None, config: Optional[str] = None) -> ScanResult

Parameter Type Default Description
extra_plugins Optional[list[str]] None
ignore_ok bool False
suppress Optional[list[str]] None
config Optional[str] None

Returns: ScanResult

Method CloudSploitToolkit.get_summary

Get a summary of the most recent scan results.

get_summary() -> dict

Returns: dict — Dictionary with severity counts and category breakdown. Returns an error dict if no scan has been run yet.

Method CloudSploitToolkit.generate_report

Generate a security report from the most recent scan.

generate_report(format: str = 'html', output_path: Optional[str] = None) -> str

Parameter Type Default Description
format str 'html' Report format - 'html' or 'pdf'.
output_path Optional[str] None File path to save the report. Auto-generated if not set.

Returns: str — File path of the generated report.

Method CloudSploitToolkit.compare_scans

Compare two scan results to track security posture changes.

compare_scans(baseline_path: str, current_path: Optional[str] = None) -> ComparisonReport

Parameter Type Default Description
baseline_path str Path to a previously saved scan result JSON.
current_path Optional[str] None Path to current scan JSON. Uses last scan if not set.

Returns: ComparisonReport — ComparisonReport showing new, resolved, and unchanged findings.

Method CloudSploitToolkit.list_findings

List findings from the most recent scan with optional filters.

list_findings(severity: Optional[str] = None, category: Optional[str] = None, region: Optional[str] = None) -> list[dict]

Parameter Type Default Description
severity Optional[str] None Filter by severity level (OK, WARN, FAIL, UNKNOWN).
category Optional[str] None Filter by service category (e.g., EC2, S3, IAM).
region Optional[str] None Filter by cloud region.

Returns: list[dict] — List of finding dictionaries matching the filters.

Method CloudSploitToolkit.collect_ecr_findings

Aggregate ECR vulnerability scan findings across many repos.

Three ways to specify what to scan, in precedence order:

  1. repos (inline) — preferred for ad-hoc, single-repo, or one-off scopes. Each entry uses key name (NOT repo) and a tags list, e.g. [{"name": "navigator-api-tf", "tags": ["staging"]}]. Do NOT write a YAML file on disk just to pass an ad-hoc scope — use this parameter.
  2. plan (YAML path on disk) — for stable, version-controlled scopes.
  3. CloudSploitConfig.ecr_plan_file — the configured default plan, used when both repos and plan are None.

The result is stored as self._last_ecr_result and persisted to the security-report catalog when persistence dependencies are wired.

collect_ecr_findings(repos: Optional[list[EcrRepoPlan]] = None, region: Optional[str] = None, aws_id: Optional[str] = None, concurrency: Optional[int] = None, plan: Optional[str] = None) -> EcrCollectionResult

Parameter Type Default Description
repos Optional[list[EcrRepoPlan]] None Inline repositories to scan. When set, takes precedence over plan and the configured default plan.
region Optional[str] None AWS region for the inline scope. Required when repos is set unless CloudSploitConfig.aws_region is configured. Ignored when plan is used.
aws_id Optional[str] None Credential identifier for the inline scope. Defaults to "default". Ignored when plan is used.
concurrency Optional[int] None Max concurrent ECR API calls for the inline scope. Defaults to 5. Ignored when plan is used.
plan Optional[str] None Path to a YAML ECR collection plan on disk. Falls back to CloudSploitConfig.ecr_plan_file when None.

Returns: EcrCollectionResult — EcrCollectionResult with per-repo findings and severity counts.

Raises:

  • ValueError — When no scope can be resolved from any of the inputs, or when repos is set without a usable region.

Method CloudSploitToolkit.generate_ecr_report

Render the interactive HTML ECR vulnerability report.

Uses the most recent collect_ecr_findings result stored in self._last_ecr_result (or the optional result argument when called programmatically; LLMs never pass it). The output path is auto-generated from CloudSploitConfig.results_dir when not given, and the filename includes the repo name(s) so it's predictable.

IMPORTANT for LLM callers: the returned string is the ABSOLUTE PATH of the written file. Quote it back to the user EXACTLY — do not rename, paraphrase, or invent a "friendlier" filename.

generate_ecr_report(output_path: Optional[str] = None, result: Optional[EcrCollectionResult] = None) -> str

Parameter Type Default Description
output_path Optional[str] None File path to write the HTML report. Parent directories are created automatically. Auto-generated when None.
result Optional[EcrCollectionResult] None Override the last collected result. Defaults to self._last_ecr_result. Not exposed to LLM callers.

Returns: str — Absolute file path of the written report (always a str).

Raises:

  • ValueError — When neither result nor self._last_ecr_result is available.

Alias ComparisonReport

Re-exported from parrot_tools.cloudsploit.models.ComparisonReport.

Alias ComplianceFramework

Re-exported from parrot_tools.cloudsploit.models.ComplianceFramework.

Alias EcrCollectionPlan

Re-exported from parrot_tools.cloudsploit.models.EcrCollectionPlan.

Alias EcrCollectionResult

Re-exported from parrot_tools.cloudsploit.models.EcrCollectionResult.

Alias EcrRepoPlan

Re-exported from parrot_tools.cloudsploit.models.EcrRepoPlan.

Alias EcrScanCollector

Re-exported from parrot_tools.cloudsploit.ecr_collector.EcrScanCollector.

Alias EcrSeverity

Re-exported from parrot_tools.cloudsploit.models.EcrSeverity.

Alias ReportGenerator

Re-exported from parrot_tools.cloudsploit.reports.ReportGenerator.

Alias ReportPersistenceMixin

Re-exported from parrot_tools.security.persistence.ReportPersistenceMixin.

Alias ScanComparator

Re-exported from parrot_tools.cloudsploit.comparator.ScanComparator.

Alias ScanResult

Re-exported from parrot_tools.cloudsploit.models.ScanResult.

Alias ScanResultParser

Re-exported from parrot_tools.cloudsploit.parser.ScanResultParser.

Alias SeverityLevel

Re-exported from parrot_tools.cloudsploit.models.SeverityLevel.

Alias pop_persistence_kwargs

Re-exported from parrot_tools.security.persistence.pop_persistence_kwargs.

Alias tool_schema

Re-exported from parrot_tools.decorators.tool_schema.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally