prowler-test-sdk
This skill documents testing conventions for Prowler SDK checks and services across multiple cloud providers. It covers AWS testing with moto mocking, Azure and GCP testing with MagicMock, and establishes provider-specific patterns for fixtures, client patching, and assertion structures.
prowler-test-sdk provides testing patterns for Prowler SDK checks across AWS, Azure, GCP, and Kubernetes providers.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-07-27
prowler-test-sdk provides testing patterns for Prowler SDK checks across AWS, Azure, GCP, and Kubernetes providers. This skill documents testing conventions for Prowler SDK checks and services across multiple cloud providers. It covers AWS testing with moto mocking, Azure and GCP testing with MagicMock, and establishes provider-specific patterns for fixtures, client patching, and assertion structures.
Use it when
- Prowler-test-sdk uses moto to mock AWS resources in unit tests.
- Prowler-test-sdk uses MagicMock to mock Azure and GCP providers, along with Kubernetes.
Verify before relying
Read SKILL.md below before installing (5 files). Open directory: indexed for reading, not audited.
Install
prowler-cloud/prowler/prowler-test-sdk · repository language: Python
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I test prowler checks?
Prowler-test-sdk provides patterns for writing unit tests for Prowler SDK checks and services. Tests use pytest fixtures to set up mocked cloud resources, with provider-specific mocking strategies: moto for AWS resource mocking, and MagicMock for Azure, GCP, and Kubernetes providers. Each test verifies check logic by asserting pass/fail/no-resource outcomes against mocked infrastructure.
What mocking approach does prowler-test-sdk use for AWS?
Prowler-test-sdk uses moto to mock AWS resources in unit tests. Moto decorators intercept boto3 calls, allowing tests to create and inspect simulated AWS infrastructure without hitting real APIs. This enables deterministic testing of Prowler checks against controlled resource states and configurations.
How does prowler-test-sdk handle Azure and GCP testing?
Prowler-test-sdk uses MagicMock to mock Azure and GCP providers, along with Kubernetes. MagicMock patches client methods and responses, allowing tests to simulate provider-specific behaviors without external dependencies. This approach provides flexibility for mocking complex cloud provider APIs and custom resource structures.
What is the prowler-test-sdk test file structure?
Prowler-test-sdk establishes conventions for test file organization, including fixture definitions for client setup, resource initialization, and check invocation. Tests follow a consistent structure: arrange mocked resources, execute the check, and assert expected pass/fail/no-resource outcomes. Fixtures enable reusable test components across multiple check tests.
How does prowler-test-sdk verify compliance check scenarios?
Prowler-test-sdk tests verify three core scenarios: pass (compliant resources), fail (non-compliant resources), and no-resource (when no resources exist). Each scenario uses mocked provider clients to simulate conditions, then asserts that the check produces correct findings with appropriate status codes and metadata.
What are prowler-test-sdk provider mocking patterns?
Prowler-test-sdk documents provider-specific mocking patterns: AWS uses moto decorators for resource lifecycle simulation; Azure, GCP, and Kubernetes use MagicMock for client patching and response mocking. Each pattern establishes how to configure clients, inject mock data, and verify check behavior against provider-specific API contracts.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
> Generic Patterns: For base pytest patterns (fixtures, mocking, parametrize, markers), see the pytest skill.
> This skill covers Prowler-specific conventions only.
>
> Full Documentation: docs/developer-guide/unit-testing.mdx
CRITICAL: Provider-Specific Testing
| Provider | Mocking Approach | Decorator |
|---|---|---|
| AWS | moto library |
@mock_aws |
| Azure, GCP, K8s, others | MagicMock |
None |
NEVER use moto for non-AWS providers. NEVER use MagicMock for AWS.
AWS Check Test Pattern
```python from unittest import mock from boto3 import client from moto import mock_aws from tests.providers.aws.utils import
(truncated - see the full file via the links below)
File tree — 5 files
skills/prowler-test-sdk/SKILL.md
skills/prowler-test-sdk/assets/aws_test.py
skills/prowler-test-sdk/assets/azure_test.py
skills/prowler-test-sdk/assets/gcp_test.py
skills/prowler-test-sdk/references/testing-docs.md
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Write unit tests for Prowler SDK checks and services”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
tdd guides you through mandatory test-driven development across all Prowler components using the red-green-refactor cycle. Learn to write failing tests first, implement minimum code to pass, triangulate with edge cases, and refactor with confidence. Covers TypeScript/React, Python SDK, and Django API stacks with practical examples.
Prowler-provider guides you through adding new cloud providers or services to the Prowler SDK. It provides the required directory structure, class templates for providers and services, and patterns for handling authentication and CLI arguments securely.
This skill equips you with battle-tested patterns for writing Prowler API tests, covering JSON:API request formatting, cross-tenant isolation via row-level security, role-based access control, and Celery task mocking. It includes a fixture dependency chain, response status code reference, and explicit rules for avoiding common pitfalls like TruffleHog false positives and incorrect content-type headers.
Prowler-docs provides the authoring standards and formatting conventions for creating consistent Prowler documentation. It covers brand voice principles, markdown formatting, SEO best practices, and MDX component usage across feature docs, tutorials, API references, and compliance guides.
This skill guides implementation of Prowler's multi-tenant API architecture, covering row-level security enforcement, role-based access control, provider validation, and async task patterns. Learn the 4-database setup, RLS model constraints, M2M through-model requirements, and critical decorator ordering for tenant-isolated operations.
This skill handles end-to-end compliance framework authoring, from choosing between universal (multi-provider, zero Python code) or legacy (single-provider, existing families) schemas to syncing with upstream sources, mapping checks to controls, and fixing JSON bugs. Use it when creating new frameworks, adding ConfigRequirements guardrails, auditing check mappings, or troubleshooting compliance output in the UI.
More skills skill-creator (Apache-2.0) · prowler-compliance-review (Apache-2.0) · vitest (Apache-2.0) · prowler-test-ui (Apache-2.0)