@ayurak/aribot-cli 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -1
- package/dist/cli.js +435 -66
- package/dist/sdk.d.ts +8 -1
- package/dist/sdk.js +32 -10
- package/package.json +7 -2
- package/src/cli.ts +466 -68
- package/src/sdk.ts +35 -10
- package/tests/e2e.test.ts +244 -0
- package/tests/sdk.test.ts +500 -0
- package/vitest.config.ts +17 -0
package/dist/sdk.d.ts
CHANGED
|
@@ -146,13 +146,20 @@ declare class ThreatModelingResource {
|
|
|
146
146
|
declare class CloudSecurityResource {
|
|
147
147
|
private client;
|
|
148
148
|
constructor(client: AribotClient);
|
|
149
|
+
listCustomers(): Promise<any[]>;
|
|
150
|
+
listAccounts(customerId?: number): Promise<any[]>;
|
|
151
|
+
listViolations(options?: {
|
|
152
|
+
severity?: string;
|
|
153
|
+
platform?: string;
|
|
154
|
+
limit?: number;
|
|
155
|
+
}): Promise<any[]>;
|
|
156
|
+
getDashboard(): Promise<any>;
|
|
149
157
|
scanPosture(cloudProvider?: string): Promise<any>;
|
|
150
158
|
getFindings(options?: {
|
|
151
159
|
severity?: string;
|
|
152
160
|
status?: string;
|
|
153
161
|
limit?: number;
|
|
154
162
|
}): Promise<SecurityFinding[]>;
|
|
155
|
-
getDashboard(): Promise<any>;
|
|
156
163
|
remediate(findingId: string, autoFix?: boolean): Promise<any>;
|
|
157
164
|
}
|
|
158
165
|
declare class ComplianceResource {
|
package/dist/sdk.js
CHANGED
|
@@ -272,23 +272,45 @@ class CloudSecurityResource {
|
|
|
272
272
|
constructor(client) {
|
|
273
273
|
this.client = client;
|
|
274
274
|
}
|
|
275
|
-
async
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
});
|
|
275
|
+
async listCustomers() {
|
|
276
|
+
const data = await this.client.request('GET', '/v1/customers/');
|
|
277
|
+
return data.results || [];
|
|
279
278
|
}
|
|
280
|
-
async
|
|
281
|
-
|
|
279
|
+
async listAccounts(customerId) {
|
|
280
|
+
if (customerId) {
|
|
281
|
+
const data = await this.client.request('GET', `/v1/customers/${customerId}/accounts/`);
|
|
282
|
+
return data.results || [];
|
|
283
|
+
}
|
|
284
|
+
// Fallback - try to get from first customer with accounts
|
|
285
|
+
const customers = await this.listCustomers();
|
|
286
|
+
for (const cust of customers) {
|
|
287
|
+
if (cust.ac_count > 0) {
|
|
288
|
+
return this.listAccounts(cust.id);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return [];
|
|
292
|
+
}
|
|
293
|
+
async listViolations(options = {}) {
|
|
294
|
+
const data = await this.client.request('GET', '/v2/compliances/unified-violations/', {
|
|
282
295
|
params: {
|
|
283
|
-
status: options.status || 'open',
|
|
284
296
|
limit: options.limit || 50,
|
|
285
|
-
...(options.severity && { severity: options.severity })
|
|
297
|
+
...(options.severity && { severity: options.severity }),
|
|
298
|
+
...(options.platform && { platform: options.platform })
|
|
286
299
|
}
|
|
287
300
|
});
|
|
288
|
-
return data.results || data.
|
|
301
|
+
return Array.isArray(data) ? data : (data.results || data.violations || []);
|
|
289
302
|
}
|
|
290
303
|
async getDashboard() {
|
|
291
|
-
return this.client.request('GET', '/v2/
|
|
304
|
+
return this.client.request('GET', '/v2/compliances/dashboard/trends/');
|
|
305
|
+
}
|
|
306
|
+
async scanPosture(cloudProvider) {
|
|
307
|
+
return this.client.request('POST', '/v2/cloud-security/scan/', {
|
|
308
|
+
params: cloudProvider ? { provider: cloudProvider } : {}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
async getFindings(options = {}) {
|
|
312
|
+
// Use unified-violations endpoint which actually has data
|
|
313
|
+
return this.listViolations(options);
|
|
292
314
|
}
|
|
293
315
|
async remediate(findingId, autoFix = false) {
|
|
294
316
|
return this.client.request('POST', `/v2/cloud-security/findings/${findingId}/remediate/`, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ayurak/aribot-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Aribot - Economic, Regulatory & Security APIs for Modern Applications. Advanced multi-framework threat modeling (STRIDE, PASTA, NIST, Aristiun), 100+ compliance standards, Cloud Security, FinOps, and Red Team automation.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "tsc",
|
|
25
25
|
"start": "node dist/cli.js",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:watch": "vitest",
|
|
28
|
+
"test:coverage": "vitest run --coverage",
|
|
26
29
|
"prepublishOnly": "npm run build"
|
|
27
30
|
},
|
|
28
31
|
"keywords": [
|
|
@@ -80,6 +83,8 @@
|
|
|
80
83
|
"devDependencies": {
|
|
81
84
|
"@types/inquirer": "^9.0.9",
|
|
82
85
|
"@types/node": "^20.0.0",
|
|
83
|
-
"
|
|
86
|
+
"msw": "^2.0.0",
|
|
87
|
+
"typescript": "^5.3.0",
|
|
88
|
+
"vitest": "^1.0.0"
|
|
84
89
|
}
|
|
85
90
|
}
|