[TT-14473] - support for encrypted aws kinesis#876
Conversation
4a40c93 to
b6ed51f
Compare
🔍 Code Analysis Results1. Change Impact AnalysisWhat this PR AccomplishesThis pull request introduces a significant security enhancement to the Tyk Kinesis Pump by adding support for server-side encryption (SSE). Users can now specify an AWS Key Management Service (KMS) key ID in the pump's configuration. The pump will then ensure that the target Kinesis stream is encrypted using this key, protecting data at rest and helping to meet compliance requirements. Key Technical Changes Introduced
Affected System Components
2. Architecture VisualizationThe following sequence diagram illustrates the updated initialization flow of the Kinesis pump. It highlights the new conditional logic for checking and enabling server-side encryption. sequenceDiagram
participant P as Tyk Pump
participant KP as KinesisPump
participant AWS_SDK as AWS Kinesis Client
participant Kinesis as AWS Kinesis API
P->>KP: Init(config)
KP->>KP: Parse config, load StreamName & KMSKeyID
alt KMSKeyID is provided
KP->>AWS_SDK: DescribeStream(StreamName)
AWS_SDK->>Kinesis: API Call: DescribeStream
Kinesis-->>AWS_SDK: returns StreamDescription
AWS_SDK-->>KP: returns StreamDescription
alt Stream is NOT encrypted
KP->>AWS_SDK: StartStreamEncryption(StreamName, KMSKeyID)
AWS_SDK->>Kinesis: API Call: StartStreamEncryption
Kinesis-->>AWS_SDK: API Response (Success or Error)
alt API Call Succeeds
AWS_SDK-->>KP: returns success
KP->>KP: Log "Server-side encryption enabled"
else API returns Error
AWS_SDK-->>KP: returns error
KP->>P: Log.Fatalf("Failed to enable encryption")
end
else Stream is encrypted with a different key
KP->>P: Log.Fatal("Encryption enabled with wrong key")
else Stream is already encrypted correctly
KP->>KP: Log "Encryption already enabled"
end
end
KP-->>P: Initialization Complete
Powered by Visor from Probelabs Last updated: 2025-10-09T14:40:06.877Z | Triggered by: synchronize | Commit: bb13c40 |
🔍 Code Analysis ResultsSecurity Issues (1)
Performance Issues (1)
Quality Issues (3)
✅ Style Check PassedNo style issues found – changes LGTM. Powered by Visor from Probelabs Last updated: 2025-10-09T14:40:08.023Z | Triggered by: synchronize | Commit: bb13c40 |
Description
kms_key_idto enable server side encryption for Amazon Kinesis.Related Issue
TT-14473
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
fork, don't request your
master!masterbranch (left side). Also, you should startyour branch off our latest
master.go mod tidy && go mod vendorgo fmt -sgo vet