Run Boto3 Use Case in Apache Spark OLAC¶
Prerequisites¶
- The Spark plugin image must be built with Privacera Boto3 Signer support enabled. Refer Enable Boto3 Signer Support.
- The Privacera Boto3 Signer supports only JWT authentication. JWT authentication must be enabled and configured in Privacera. Refer Configuring JWT for Authentication.
Steps¶
-
Connect to the Kubernetes pod where the Spark plugin is deployed
Bash -
Verify the signer is installed:
Bash -
Export the signer runtime configuration. Set the DataServer external URL and the JWT token for the identity to run the use case as.
-
Start Python and run the boto3 use case. The signer prints its auto-registration messages at startup, confirming boto3 calls are routed through Privacera:
Bash Expected startup outputINFO [PRIVACERA] Privacera auto-registration enabled INFO [PRIVACERA] Boto3 client and resource wrapped for Privacera auto-registration- Read and write S3 objects with plain boto3 code:
Python
- Read and write S3 objects with plain boto3 code:
-
Validate policy enforcement:
- If access is denied, the call fails with
botocore.exceptions.ClientError: An error occurred (AccessDenied)and a Denied audit record appears in the Privacera Portal under Access Management → Audits. - In the Privacera Portal, grant the required
Read/Writepermissions to the identity under Access Management → Resource Policies → privacera_s3, then re-run the use case.
- If access is denied, the call fails with
- Prev topic: Connector Guide