Skip to content

Commit b645e46

Browse files
Merge pull request #19 from superstreamlabs/master
Push to latest
2 parents 3fd1cf8 + b4e9baa commit b645e46

File tree

11 files changed

+432
-31
lines changed

11 files changed

+432
-31
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ config.production.json
203203
config.apache-kafka-no-auth.json
204204
config.aws-msk-iam.json
205205
test-config-confluent.json
206+
certs/*
206207
*.key
207208
*.pem
208209
*.crt

Jenkinsfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pipeline {
2323

2424
stage('Install dependencies') {
2525
steps {
26+
sh 'sudo dnf install -y nodejs || true'
2627
sh 'npm install'
2728
sh 'npm pack'
2829
}

README.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,11 @@ The full list is under the `./config-examples/` folder:
218218
"brokers": ["kafka-xxxxx-aiven-kafka.aivencloud.com:12345"],
219219
"clientId": "superstream-analyzer",
220220
"vendor": "aiven",
221-
"useSasl": true,
222-
"sasl": {
223-
"mechanism": "SCRAM-SHA-256",
224-
"username": "avnadmin",
225-
"password": "YOUR_AVNADMIN_PASSWORD"
226-
},
221+
"useSasl": false,
227222
"ssl": {
228-
"ca": "./path/to/ca.pem"
223+
"ca": "path/to/ca.pem",
224+
"cert": "path/to/service.cert",
225+
"key": "path/to/service.key"
229226
}
230227
},
231228
"file": {
@@ -549,6 +546,27 @@ The tool includes comprehensive validation that will:
549546

550547
### Common Issues
551548

549+
**Missing Vendor Field Error**
550+
- **Error**: "Missing 'vendor' field in kafka configuration"
551+
- **Solution**: Add the appropriate vendor field to your configuration:
552+
- AWS MSK IAM: `"vendor": "aws-msk"`
553+
- Confluent Cloud: `"vendor": "confluent-cloud"`
554+
- Aiven: `"vendor": "aiven"`
555+
- Apache Kafka: `"vendor": "apache"`
556+
- Redpanda: `"vendor": "redpanda"`
557+
- **Why**: The vendor field tells the tool how to handle vendor-specific authentication mechanisms
558+
559+
**AWS MSK IAM Authentication Failed**
560+
- **Error**: "Failed to generate auth token" or "authenticationProvider is not a function"
561+
- **Solution**:
562+
1. Ensure AWS credentials are properly configured:
563+
- Set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables, OR
564+
- Include credentials in config file: `"accessKeyId"` and `"secretAccessKey"`
565+
2. Verify the IAM user has proper MSK permissions
566+
3. Check that the broker URLs are correct (should use port 9198 for IAM)
567+
4. Ensure the region matches your MSK cluster
568+
- **Why**: AWS MSK IAM requires valid AWS credentials and proper IAM permissions
569+
552570
**Connection Timeout**
553571
- Verify broker URLs are correct
554572
- Check network connectivity

bin/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ program
1313
.description('Interactive utility to analyze Kafka clusters health and configuration')
1414
.version('1.0.0')
1515
.option('-c, --config <path>', 'Path to configuration file')
16+
.option('--nats-config <path>', 'Path to NATS configuration file (uploads to NATS instead of generating files)')
1617
.option('-b, --bootstrap-servers <servers>', 'Comma-separated list of Kafka bootstrap servers')
1718
.option('-v, --verbose', 'Enable verbose logging')
1819
.option('-t, --timeout <seconds>', 'Connection timeout in seconds', '30')

config-examples/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
This directory contains configuration examples for different Kafka vendors. Each vendor has specific authentication requirements and SSL settings.
44

5+
## ⚠️ Important: Vendor Field Requirement
6+
7+
**The `vendor` field is required for authentication mechanisms that are vendor-specific:**
8+
9+
- **AWS MSK IAM**: Must use `"vendor": "aws-msk"`
10+
- **OAuth/OIDC**: Must specify the vendor (e.g., `"aws-msk"`, `"confluent-cloud"`, `"oidc"`)
11+
- **Other mechanisms**: Vendor field helps optimize connection settings
12+
13+
If you get an error about missing vendor field, add the appropriate vendor value to your configuration.
14+
515
## 🔐 Authentication Methods Supported
616

717
- **PLAINTEXT** - No authentication (development only)
@@ -36,6 +46,34 @@ This directory contains configuration examples for different Kafka vendors. Each
3646
}
3747
```
3848

49+
**AWS MSK IAM Authentication (Port 9198):**
50+
```json
51+
{
52+
"kafka": {
53+
"brokers": ["your-msk-cluster.amazonaws.com:9198"],
54+
"clientId": "superstream-analyzer",
55+
"vendor": "aws-msk",
56+
"useSasl": true,
57+
"sasl": {
58+
"mechanism": "AWS_MSK_IAM",
59+
"accessKeyId": "AKIA...",
60+
"secretAccessKey": "...",
61+
"authorizationIdentity": "arn:aws:iam::123456789012:user/your-iam-user"
62+
}
63+
},
64+
"file": {
65+
"outputDir": "./kafka-analysis",
66+
"formats": ["json", "csv", "html"],
67+
"includeMetadata": true
68+
}
69+
}
70+
```
71+
72+
**Note**: For AWS MSK IAM authentication, you can either:
73+
1. Provide AWS credentials in the config file (as shown above)
74+
2. Set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables
75+
3. Use AWS IAM roles (if running on EC2 or ECS)
76+
3977
**SCRAM Authentication (Port 9096):**
4078
```json
4179
{

config-examples/config.example.aiven-kafka.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
"brokers": ["kafka-xxxxx-aiven-kafka.aivencloud.com:12345"],
44
"clientId": "superstream-analyzer",
55
"vendor": "aiven",
6-
"useSasl": true,
7-
"sasl": {
8-
"mechanism": "SCRAM-SHA-256",
9-
"username": "avnadmin",
10-
"password": "YOUR_AVNADMIN_PASSWORD"
11-
},
6+
"useSasl": false,
127
"ssl": {
13-
"ca": "/PATH/TO/YOUR/ca.pem"
8+
"ca": "path/to/ca.pem",
9+
"cert": "path/to/service.cert",
10+
"key": "path/to/service.key"
1411
}
1512
},
1613
"file": {
@@ -19,4 +16,4 @@
1916
"includeMetadata": true
2017
},
2118
"email": "[email protected]"
22-
}
19+
}

config-examples/config.example.aws-msk-iam.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
"kafka": {
33
"brokers": ["b-1.your-cluster.abc123.c2.kafka.us-east-1.amazonaws.com:9098", "b-2.your-cluster.abc123.c2.kafka.us-east-1.amazonaws.com:9098"],
44
"clientId": "superstream-analyzer",
5+
"vendor": "aws-msk",
56
"useSasl": true,
67
"sasl": {
78
"mechanism": "AWS_MSK_IAM",
8-
"authorizationIdentity": "arn:aws:iam::123456789012:user/your-iam-user",
9-
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
10-
"secretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
9+
"authorizationIdentity": "arn:aws:iam::123123123:user/your-iam-user",
10+
"accessKeyId": "aaaaaa",
11+
"secretAccessKey": "aaaa/K7MDENG/aaaaaaaa"
1112
}
1213
},
1314
"file": {

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "superstream-kafka-analyzer",
3-
"version": "1.0.14",
3+
"version": "1.0.15",
44
"description": "Interactive utility to analyze Kafka clusters health and configuration",
55
"main": "src/cli.js",
66
"bin": {
@@ -38,6 +38,7 @@
3838
"jsonwebtoken": "^9.0.2",
3939
"jwks-rsa": "^3.1.0",
4040
"kafkajs": "^2.2.4",
41+
"nats": "^2.19.0",
4142
"ora": "^5.4.1",
4243
"simple-oauth2": "^5.1.0",
4344
"superstream-kafka-analyzer": "^1.0.13"

0 commit comments

Comments
 (0)