This page details the StackIT Cloud provider implementation in Prowler. By default, Prowler audits a single StackIT project per scan. To configure it, provide the project ID and either a service account key file path or inline service account key JSON.Documentation Index
Fetch the complete documentation index at: https://docs.prowler.com/llms.txt
Use this file to discover all available pages before exploring further.
StackIT Provider Classes Architecture
The StackIT provider implementation follows the general Provider structure. This section focuses on the StackIT-specific implementation, highlighting how the generic provider concepts are realized for StackIT in Prowler. For a full overview of the provider pattern, base classes, and extension guidelines, see Provider documentation.StackitProvider (Main Class)
- Location:
prowler/providers/stackit/stackit_provider.py - Base Class: Inherits from
Provider(see base class details). - Purpose: Central orchestrator for StackIT-specific logic, API authentication, credential validation, and configuration.
- Key StackIT Responsibilities:
- Initializes StackIT SDK authentication via a service account key file or inline service account key JSON. The SDK mints and refreshes access tokens internally.
- Validates the service account credentials and project ID (UUID format validation).
- Loads and manages configuration, mutelist, and fixer settings.
- Provides properties and methods for downstream StackIT service classes to access credentials, identity, and configuration data.
Data Models
- Location:
prowler/providers/stackit/models.py - Purpose: Define structured data for StackIT identity and output configuration.
- Key StackIT Models:
StackITIdentityInfo: Holds StackIT identity metadata, including project ID and project name (fetched automatically from Resource Manager API).StackITOutputOptions: Customizes default output filenames so StackIT reports include the audited project ID.- IaaS resource models such as
SecurityGroupandSecurityGroupRuleare defined in the IaaS service module.
StackIT Services
- Location:
prowler/providers/stackit/services/ - Purpose: Implement StackIT service clients and resource collection logic following the generic service pattern.
- Current Implementation: The
IaaSServicecollects security groups, rules, and network interface usage across supported StackIT regions.
Exception Handling
- Location:
prowler/providers/stackit/exceptions/exceptions.py - Purpose: Custom exception classes for StackIT-specific error handling, such as credential validation, API connection, and configuration errors.
- Key Exception Classes:
StackITBaseException: Base exception for all StackIT provider errors.StackITCredentialsError: Raised when credentials are invalid or missing.StackITInvalidProjectIdError: Raised when project ID is invalid or not in UUID format.StackITAPIError: Raised when StackIT API calls fail.
Authentication
Service Account Creation and Key Generation
StackIT uses service account keys for API authentication. Service account keys are RSA key-pair based and provide secure, short-lived access tokens.Creating a Service Account Key
Method 1: Via StackIT Portal
-
Navigate to Service Accounts
- Go to the StackIT Portal
- Select your project
- Click on Service Accounts in the left sidebar
-
Create or Select Service Account
- If you don’t have a service account, click Create Service Account
- Provide a name and description
- Assign necessary permissions:
- For IaaS security checks:
iaas.viewerorproject.owner - For comprehensive audits:
project.owner
- For IaaS security checks:
-
Generate Service Account Key
- Select your service account
- Navigate to Service Account Keys
- Click Create key
- Choose one of the following options:
- STACKIT-generated key pair (Recommended): Let STACKIT automatically generate an RSA key-pair
- User-provided key pair: Upload your own RSA 2048 public key
-
Download and Save the Key
- Download the generated service account key file (JSON format)
- Important: Save the key securely - it contains your private key and will only be available once
- Store the key file in a secure location (e.g.,
~/.stackit/sa_key.json)
Method 2: Via StackIT CLI
Finding Your Project ID
Your StackIT project ID is a UUID that can be found:- In the StackIT Portal URL when viewing your project:
https://portal.stackit.cloud/projects/{PROJECT_ID}/... - In the project settings page
- Using the StackIT CLI:
stackit project list
Passing the Service Account Key to Prowler
Prowler accepts the service account credentials in two equivalent forms; both go through the same StackIT SDK flow and refresh access tokens internally.Option 1: Key File Path (key persisted on disk)
Option 2: Inline Key Content (CI/CD, secret managers)
--stackit-service-account-key CLI flag; passing the secret on the command line leaks it through process listings and shell history.
Credential Lookup Order
Prowler resolves credentials in this order:- Command-line arguments:
--stackit-service-account-key--stackit-service-account-key-path--stackit-project-id
- Environment variables:
STACKIT_SERVICE_ACCOUNT_KEYSTACKIT_SERVICE_ACCOUNT_KEY_PATHSTACKIT_PROJECT_ID
Configuration
Command-Line Arguments
StackIT-specific command-line arguments:| Argument | Description | Required | Default |
|---|---|---|---|
--stackit-service-account-key-path | Path to a StackIT service account key JSON file | Yes* | $STACKIT_SERVICE_ACCOUNT_KEY_PATH |
--stackit-service-account-key | Inline JSON content of a StackIT service account key (preferred env var: STACKIT_SERVICE_ACCOUNT_KEY) | Yes* | $STACKIT_SERVICE_ACCOUNT_KEY |
--stackit-project-id | StackIT project ID (UUID format) | Yes* | $STACKIT_PROJECT_ID |
--stackit-region | StackIT region(s) to scan | No | All available regions |
Input Validation
The StackIT provider performs comprehensive input validation:-
Service Account Credentials:
- At least one of
service_account_key_path(file path) orservice_account_key(inline JSON) must be supplied; both empty raisesStackITNonExistentTokenError - When both are provided the inline content takes precedence
- The key file path is logged as-is; the inline content is redacted in the credentials box
- At least one of
-
Project ID:
- Must not be empty
- Must be a valid UUID format (e.g.,
12345678-1234-1234-1234-123456789abc) - Validated using Python’s UUID constructor
Available Services
IaaS (Infrastructure as a Service)
- Service Class:
IaaSService - Location:
prowler/providers/stackit/services/iaas/iaas_service.py - SDK: Uses the stackit-iaas Python SDK
- Purpose: Manages IaaS resources including security groups, servers, and network interfaces.
- Security Groups and Rules
- Servers (Virtual Machines)
- Network Interfaces (NICs)
- Automatic discovery of all security groups in the project
- Security rule parsing with support for unrestricted access detection
- Network interface analysis to determine whether security groups are in use
- By default, reports only security groups attached to at least one NIC;
--scan-unused-servicesincludes unused security groups too
Available Checks
The StackIT provider currently implements 4 security checks focused on network security:1. iaas_security_group_ssh_unrestricted
- Severity: High
- Description: Detects security groups that allow unrestricted SSH access (port 22) from the internet.
- Risk: Unrestricted SSH access increases the attack surface and risk of brute-force attacks.
- Detection Logic:
- Checks for ingress rules allowing TCP port 22
- Flags rules with
ip_range=Noneorip_range="0.0.0.0/0"orip_range="::/0" - Reports security groups attached to NICs by default, or all security groups when
--scan-unused-servicesis enabled
2. iaas_security_group_rdp_unrestricted
- Severity: High
- Description: Detects security groups that allow unrestricted RDP access (port 3389) from the internet.
- Risk: Unrestricted RDP access enables potential unauthorized remote desktop access.
- Detection Logic:
- Checks for ingress rules allowing TCP port 3389
- Flags unrestricted IP ranges (None, 0.0.0.0/0, ::/0)
- Reports security groups attached to NICs by default, or all security groups when
--scan-unused-servicesis enabled
3. iaas_security_group_database_unrestricted
- Severity: High
- Description: Detects security groups that allow unrestricted access to common database ports.
- Monitored Ports:
- MySQL: 3306
- PostgreSQL: 5432
- MongoDB: 27017
- Redis: 6379
- SQL Server: 1433
- CouchDB: 5984
- Risk: Unrestricted database access can lead to data breaches and unauthorized data access.
4. iaas_security_group_all_traffic_unrestricted
- Severity: Critical
- Description: Detects security groups that allow all traffic from the internet.
- Detection Logic:
- Checks for rules with
port_range=None(all ports) - Checks for rules with port range covering 0-65535 or 1-65535
- Flags unrestricted IP ranges
- Critical security misconfiguration requiring immediate remediation
- Checks for rules with
Important Implementation Notes
Self-Referencing Security Group Rules: Security group rules withremoteSecurityGroupId set are automatically filtered out from unrestricted access checks. These rules only allow traffic from instances within the same security group (self-referencing), not from the internet, and are therefore not flagged as security risks.
Rule Display Names:
All findings include user-friendly rule descriptions when available. If a security group rule has a description field set (the name shown in the StackIT UI), it will be displayed in the finding message along with the rule ID:
- With description:
'Allow SSH from office' (sgr-abc123) - Without description:
'sgr-abc123'
- Default behavior: Report security groups attached to at least one NIC.
--scan-unused-services: Report every security group, including unused ones.- FAIL logic: Internet exposure is driven by security group rules that allow unrestricted source ranges, not by the presence of a public IP on the NIC.
ip_range=null: No IP restriction specified (implicit unrestricted)ip_range="0.0.0.0/0"or"::/0": Explicitly configured to allow all IPs
null value is more permissive than an explicit range and applies to all protocols/ports if other fields are also null.
Requirements
Python Version
- Minimum: Python 3.10+
- Reason: The StackIT SDK requires Python 3.10 or higher
Dependencies
The StackIT provider requires the following Python packages (automatically installed with Prowler):- stackit-core (v0.2.0): Core SDK for StackIT API authentication and configuration
- stackit-iaas (v1.4.0): IaaS service SDK for managing compute resources
- stackit-resourcemanager (v0.8.0): Resource Manager SDK for fetching project metadata (e.g., project names)
pyproject.toml and installed automatically with:
stackit-resourcemanager package enables automatic retrieval of project names for display in reports. If this package is not available, Prowler will still function normally but project names will be empty in the output.
Region Support
Supported Regions
- Available Regions:
eu01(Germany South) andeu02(Austria West) - Default: All scans use both
eu01andeu02regions by default.
Multi-Region Scanning
Prowler supports scanning multiple StackIT regions in a single execution. By default, it will scan all regions defined in thestackit_regions_by_service.json configuration file.
CLI Argument
You can specify which regions to scan using the--stackit-region argument:
Implementation Details
- Regional Clients: Prowler generates a separate API client for each audited region.
- Service Iteration: Each service (e.g., IaaS) iterates through the regional clients to fetch and audit resources.
- Identity Tracking: The
audited_regionsare stored in the identity model for reporting.
Future Enhancements
As StackIT adds more regions, they can be easily added to Prowler by updating theprowler/providers/stackit/stackit_regions_by_service.json file without requiring code changes.
Command Examples
Scan Specific Regions
Scan only theeu01 region:
Scan Specific Checks
Run only SSH unrestricted check:Scan All Security Group Checks
Output Formats
Generate JSON output:Known Limitations
Current Limitations
- Single Project Scope: Only one project can be scanned at a time
- Service Coverage: Only the IaaS service is currently implemented
- Check Coverage: Limited to security group network security checks (4 checks total)
- No Compliance Frameworks: Compliance framework mappings are not yet implemented
Planned Enhancements
- Multi-project scanning capability
- Additional IaaS checks (volume encryption, server public IP exposure, backup status)
- Compliance framework mappings (CIS, custom StackIT best practices)
- StackIT CLI remediation examples in metadata
Troubleshooting
Authentication Errors
Error:StackIT service account key was rejected
Solutions:
- Re-issue the service account key in the StackIT Portal
- Verify the service account key file or inline JSON content is complete
- Check that the service account has the necessary permissions (
iaas.viewerorproject.owner) - Ensure the service account key is provided through
STACKIT_SERVICE_ACCOUNT_KEY_PATH,STACKIT_SERVICE_ACCOUNT_KEY, or the matching CLI arguments
StackIT credentials not found or are invalid
Solutions:
- Ensure the project ID and one service account credential source are provided
- Check that credentials are set via environment variables or command-line arguments
- Verify there are no extra spaces or newlines in the credentials
Invalid StackIT project ID format
Solutions:
- Verify the project ID is a valid UUID format:
12345678-1234-1234-1234-123456789abc - Copy the project ID directly from the StackIT Portal
- Ensure there are no extra spaces or quotes around the UUID
API Connection Errors
Error:Failed to connect to StackIT API
Solutions:
- Check your internet connection
- Verify the StackIT API endpoint is accessible from your network
- Check if there are any firewall rules blocking HTTPS connections
- Review the full error message for specific API error codes
HTTP 403 Forbidden
Solutions:
- Verify the service account has the correct permissions
- Ensure the project ID is correct and you have access to it
- Check that the service account is enabled (not disabled or expired)
- Verify the service account key has not been revoked
HTTP 404 Not Found
Solutions:
- Verify the project ID exists and is correct
- Check that the IaaS service is enabled in your project
- Ensure you’re using the correct region (eu01)
Empty Results
Issue: No security groups or findings reported Solutions:- Verify that security groups exist in your project
- Check that the IaaS service is properly configured
- Ensure the service account has
iaas.viewerpermission - Check Prowler logs for any API errors (use
--log-level DEBUG)
Debug Mode
Enable debug logging for detailed troubleshooting:- API authentication details (with inline service account keys redacted)
- Resource discovery progress
- Security rule parsing details
- Any API errors or warnings
Specific Patterns in StackIT Services
The generic service pattern is described in service page. You can find all the currently implemented services in the following locations:- Directly in the code, in location
prowler/providers/stackit/services/ - In the Prowler Hub for a more human-readable view.
StackIT Service Common Patterns
- Services communicate with StackIT using the StackIT Python SDK, you can find the documentation here.
- Service constructors receive a
StackitProviderinstance and use it to access credentials, identity, and configuration. - The provider builds StackIT SDK
Configurationobjects from the service account key path or inline key content. - Resource containers must be initialized in the constructor, typically as lists or dictionaries.
- Do not manipulate
os.environfor credentials inside services. Use the provider session and SDK configuration helpers. - All StackIT resources are represented as Pydantic
BaseModelclasses, providing type safety and structured access to resource attributes. - StackIT SDK calls are wrapped in try/except blocks, with specific handling for API errors, always logging errors.
- Centralized Error Handling: Use
provider.handle_api_error(exception)for consistent authentication error detection across all services. - SDK Warning Suppression: StackIT SDK prints deprecation warnings to stderr - use the
suppress_stderr()context manager during SDK initialization and API calls. - Unrestricted Access Detection: In StackIT API,
Nonevalues mean “allow all” (more permissive than explicit 0.0.0.0/0).protocol=None→ All protocols allowedip_range=None→ All source IPs allowed (unrestricted!)port_range=None→ All ports allowedremote_security_group_idset → Only allows traffic from the same security group (not unrestricted!)
IaaS Service Specific Patterns
Security Group Discovery:Specific Patterns in StackIT Checks
The StackIT checks pattern is described in checks page. You can find all the currently implemented checks:- Directly in the code, within each service folder, each check has its own folder named after the name of the check. (e.g.
prowler/providers/stackit/services/iaas/iaas_security_group_ssh_unrestricted/) - In the Prowler Hub for a more human-readable view.
Check Report Class
TheCheckReportStackIT class models a single finding for a StackIT resource in a check report. It is defined in prowler/lib/check/models.py and inherits from the generic Check_Report base class.
Purpose
CheckReportStackIT extends the base report structure with StackIT-specific fields, enabling detailed tracking of the resource, project, and location associated with each finding.
Constructor and Attribute Population
When you instantiateCheckReportStackIT, you must provide the check metadata and a resource object. The class will attempt to automatically populate its StackIT-specific attributes from the resource, using the following logic:
-
resource_id:- Uses
resource.idif present. - Otherwise, uses
resource.resource_idif present. - Defaults to an empty string if none are available.
- Uses
-
resource_name:- Uses
resource.nameif present. - Defaults to an empty string if not available.
- Uses
-
project_id:- Uses
resource.project_idif present. - Defaults to an empty string if not available (should be set in check logic).
- Uses
-
location:- Uses
resource.regionif present. - Otherwise, uses
resource.locationif present. - Defaults to an empty string if not available.
- Uses
Check_Report class, from which you always have to set the status and status_extended attributes in the check logic.
Example Usage
Common Check Pattern
Resources
Official StackIT Documentation
- StackIT Portal: https://portal.stackit.cloud/
- StackIT Documentation: https://docs.stackit.cloud/
- StackIT API Documentation: https://docs.api.eu01.stackit.cloud/
Python SDK
- StackIT Python SDK (GitHub): https://github.com/stackitcloud/stackit-sdk-python
- stackit-core (PyPI): https://pypi.org/project/stackit-core/
- stackit-iaas (PyPI): https://pypi.org/project/stackit-iaas/
- IaaS Models: https://github.com/stackitcloud/stackit-sdk-python/tree/main/services/iaas/src/stackit/iaas/models
Prowler Resources
- Provider Implementation:
prowler/providers/stackit/ - IaaS Service:
prowler/providers/stackit/services/iaas/ - Prowler Hub: https://hub.prowler.com/
- GitHub Issues: https://github.com/prowler-cloud/prowler/issues
Contributing
If you’d like to contribute to the StackIT provider:- Add New Checks: Follow the check creation guide and use existing StackIT checks as templates
- Enhance Services: Implement additional IaaS resource discovery or add new services
- Improve Documentation: Add metadata enhancements, CLI remediation examples, or Terraform code samples
- Report Issues: Submit bug reports or feature requests on GitHub
Quick Start for Contributors
- Install dependencies:
poetry install(includes stackit-core and stackit-iaas) - Set credentials: Export
STACKIT_SERVICE_ACCOUNT_KEY_PATHandSTACKIT_PROJECT_ID - Run checks:
prowler stackit - View code: Start in
prowler/providers/stackit/ - Add checks: Create new check directories under
services/iaas/ - Run tests:
poetry run pytest tests/providers/stackit/ -v
Code Quality Standards
The StackIT provider should follow the same quality expectations as the rest of the Prowler SDK:- Keep service and check logic covered by unit tests.
- Redact inline service account keys from generated output.
- Keep documentation aligned with the implemented services and checks.
- Follow existing provider, service, and check patterns before adding StackIT-specific abstractions.

