Tenancy Check
Reference
Plugin Id: 422002
Resource
Remediation
To remediate the “Tenancy Check” vulnerability in a multi-tenant API, follow these steps:
-
Implement Strict Access Controls: In your OpenAPI specification, define security schemes for authentication and authorization. Use role-based access control (RBAC) or attribute-based access control (ABAC) to ensure each tenant can only access their data. Apply these schemes to endpoints that handle tenant-specific data.
securitySchemes: OAuth2: type: oauth2 flows: clientCredentials: tokenUrl: https://example.com/oauth/token scopes: tenant1: Access for Tenant 1 tenant2: Access for Tenant 2 paths: /tenant-data: get: security: - OAuth2: [tenant1]
-
Isolate Tenant Data: Employ data isolation techniques like separate databases or schemas for each tenant. In the OpenAPI spec, define different base paths or parameters to segregate access to resources based on the tenant.
-
Regularly Test and Audit the System: Conduct security assessments and audits to ensure the effectiveness of access controls and data isolation. Regularly update your OpenAPI specification to reflect any changes made to improve tenancy checks.
About
The “Tenancy Check” vulnerability occurs in multi-tenant architectures, leading to potential unauthorized access and data leakage between tenants. It is critical to implement strict access controls and data isolation to prevent such vulnerabilities.
Risks
Risks of the “Tenancy Check” vulnerability include unauthorized access, data leakage, and reputation damage. Properly managing tenancy in API design is essential for maintaining data security and trust in multi-tenant environments.