@infrascan/aws-cloudwatch-logs-scanner 0.2.3 → 0.2.4
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/dist/generated/client.d.mts +7 -0
- package/dist/generated/client.d.ts +7 -0
- package/dist/generated/client.js +37 -0
- package/dist/generated/client.mjs +12 -0
- package/dist/generated/getters.d.mts +7 -0
- package/dist/generated/getters.d.ts +7 -0
- package/dist/generated/getters.js +121 -0
- package/dist/generated/getters.mjs +99 -0
- package/dist/generated/graph.d.mts +6 -0
- package/dist/generated/graph.d.ts +6 -0
- package/dist/generated/graph.js +68 -0
- package/dist/generated/graph.mjs +48 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +5 -5
- package/package.json +4 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CloudWatchLogsClient } from '@aws-sdk/client-cloudwatch-logs';
|
|
2
|
+
import { AwsCredentialIdentityProvider, RetryStrategy, RetryStrategyV2 } from '@aws-sdk/types';
|
|
3
|
+
import { AwsContext } from '@infrascan/shared-types';
|
|
4
|
+
|
|
5
|
+
declare function getClient(credentials: AwsCredentialIdentityProvider, context: AwsContext, retryStrategy?: RetryStrategy | RetryStrategyV2): CloudWatchLogsClient;
|
|
6
|
+
|
|
7
|
+
export { getClient };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CloudWatchLogsClient } from '@aws-sdk/client-cloudwatch-logs';
|
|
2
|
+
import { AwsCredentialIdentityProvider, RetryStrategy, RetryStrategyV2 } from '@aws-sdk/types';
|
|
3
|
+
import { AwsContext } from '@infrascan/shared-types';
|
|
4
|
+
|
|
5
|
+
declare function getClient(credentials: AwsCredentialIdentityProvider, context: AwsContext, retryStrategy?: RetryStrategy | RetryStrategyV2): CloudWatchLogsClient;
|
|
6
|
+
|
|
7
|
+
export { getClient };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/generated/client.ts
|
|
21
|
+
var client_exports = {};
|
|
22
|
+
__export(client_exports, {
|
|
23
|
+
getClient: () => getClient
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(client_exports);
|
|
26
|
+
var import_client_cloudwatch_logs = require("@aws-sdk/client-cloudwatch-logs");
|
|
27
|
+
function getClient(credentials, context, retryStrategy) {
|
|
28
|
+
return new import_client_cloudwatch_logs.CloudWatchLogsClient({
|
|
29
|
+
credentials,
|
|
30
|
+
region: context.region,
|
|
31
|
+
retryStrategy
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
getClient
|
|
37
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/generated/client.ts
|
|
2
|
+
import { CloudWatchLogsClient } from "@aws-sdk/client-cloudwatch-logs";
|
|
3
|
+
function getClient(credentials, context, retryStrategy) {
|
|
4
|
+
return new CloudWatchLogsClient({
|
|
5
|
+
credentials,
|
|
6
|
+
region: context.region,
|
|
7
|
+
retryStrategy
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
getClient
|
|
12
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CloudWatchLogsClient } from '@aws-sdk/client-cloudwatch-logs';
|
|
2
|
+
import { Connector, AwsContext } from '@infrascan/shared-types';
|
|
3
|
+
|
|
4
|
+
declare function DescribeLogGroups(client: CloudWatchLogsClient, stateConnector: Connector, context: AwsContext): Promise<void>;
|
|
5
|
+
declare function DescribeSubscriptionFilters(client: CloudWatchLogsClient, stateConnector: Connector, context: AwsContext): Promise<void>;
|
|
6
|
+
|
|
7
|
+
export { DescribeLogGroups, DescribeSubscriptionFilters };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CloudWatchLogsClient } from '@aws-sdk/client-cloudwatch-logs';
|
|
2
|
+
import { Connector, AwsContext } from '@infrascan/shared-types';
|
|
3
|
+
|
|
4
|
+
declare function DescribeLogGroups(client: CloudWatchLogsClient, stateConnector: Connector, context: AwsContext): Promise<void>;
|
|
5
|
+
declare function DescribeSubscriptionFilters(client: CloudWatchLogsClient, stateConnector: Connector, context: AwsContext): Promise<void>;
|
|
6
|
+
|
|
7
|
+
export { DescribeLogGroups, DescribeSubscriptionFilters };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/generated/getters.ts
|
|
21
|
+
var getters_exports = {};
|
|
22
|
+
__export(getters_exports, {
|
|
23
|
+
DescribeLogGroups: () => DescribeLogGroups,
|
|
24
|
+
DescribeSubscriptionFilters: () => DescribeSubscriptionFilters
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(getters_exports);
|
|
27
|
+
var import_core = require("@infrascan/core");
|
|
28
|
+
var import_client_cloudwatch_logs = require("@aws-sdk/client-cloudwatch-logs");
|
|
29
|
+
async function DescribeLogGroups(client, stateConnector, context) {
|
|
30
|
+
const state = [];
|
|
31
|
+
console.log("cloudwatch-logs DescribeLogGroups");
|
|
32
|
+
let pagingToken;
|
|
33
|
+
do {
|
|
34
|
+
const preparedParams = {};
|
|
35
|
+
preparedParams.nextToken = pagingToken;
|
|
36
|
+
try {
|
|
37
|
+
const cmd = new import_client_cloudwatch_logs.DescribeLogGroupsCommand(preparedParams);
|
|
38
|
+
const result = await client.send(cmd);
|
|
39
|
+
state.push({
|
|
40
|
+
_metadata: { account: context.account, region: context.region },
|
|
41
|
+
_parameters: preparedParams,
|
|
42
|
+
_result: result
|
|
43
|
+
});
|
|
44
|
+
pagingToken = result.nextToken;
|
|
45
|
+
} catch (err) {
|
|
46
|
+
if (err instanceof import_client_cloudwatch_logs.CloudWatchLogsServiceException) {
|
|
47
|
+
if (err?.$retryable) {
|
|
48
|
+
console.log("Encountered retryable error", err);
|
|
49
|
+
} else {
|
|
50
|
+
console.log("Encountered unretryable error", err);
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
console.log("Encountered unexpected error", err);
|
|
54
|
+
}
|
|
55
|
+
pagingToken = void 0;
|
|
56
|
+
}
|
|
57
|
+
} while (pagingToken != null);
|
|
58
|
+
await stateConnector.onServiceScanCompleteCallback(
|
|
59
|
+
context.account,
|
|
60
|
+
context.region,
|
|
61
|
+
"CloudWatchLogs",
|
|
62
|
+
"DescribeLogGroups",
|
|
63
|
+
state
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
async function DescribeSubscriptionFilters(client, stateConnector, context) {
|
|
67
|
+
const state = [];
|
|
68
|
+
console.log("cloudwatch-logs DescribeSubscriptionFilters");
|
|
69
|
+
const resolvers = [
|
|
70
|
+
{
|
|
71
|
+
Key: "logGroupName",
|
|
72
|
+
Selector: "CloudWatchLogs|DescribeLogGroups|[]._result.logGroups[].logGroupName"
|
|
73
|
+
}
|
|
74
|
+
];
|
|
75
|
+
const parameterQueue = await (0, import_core.resolveFunctionCallParameters)(
|
|
76
|
+
context.account,
|
|
77
|
+
context.region,
|
|
78
|
+
resolvers,
|
|
79
|
+
stateConnector
|
|
80
|
+
);
|
|
81
|
+
for (const parameters of parameterQueue) {
|
|
82
|
+
let pagingToken;
|
|
83
|
+
do {
|
|
84
|
+
const preparedParams = parameters;
|
|
85
|
+
preparedParams.nextToken = pagingToken;
|
|
86
|
+
try {
|
|
87
|
+
const cmd = new import_client_cloudwatch_logs.DescribeSubscriptionFiltersCommand(preparedParams);
|
|
88
|
+
const result = await client.send(cmd);
|
|
89
|
+
state.push({
|
|
90
|
+
_metadata: { account: context.account, region: context.region },
|
|
91
|
+
_parameters: preparedParams,
|
|
92
|
+
_result: result
|
|
93
|
+
});
|
|
94
|
+
pagingToken = result.nextToken;
|
|
95
|
+
} catch (err) {
|
|
96
|
+
if (err instanceof import_client_cloudwatch_logs.CloudWatchLogsServiceException) {
|
|
97
|
+
if (err?.$retryable) {
|
|
98
|
+
console.log("Encountered retryable error", err);
|
|
99
|
+
} else {
|
|
100
|
+
console.log("Encountered unretryable error", err);
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
console.log("Encountered unexpected error", err);
|
|
104
|
+
}
|
|
105
|
+
pagingToken = void 0;
|
|
106
|
+
}
|
|
107
|
+
} while (pagingToken != null);
|
|
108
|
+
}
|
|
109
|
+
await stateConnector.onServiceScanCompleteCallback(
|
|
110
|
+
context.account,
|
|
111
|
+
context.region,
|
|
112
|
+
"CloudWatchLogs",
|
|
113
|
+
"DescribeSubscriptionFilters",
|
|
114
|
+
state
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
118
|
+
0 && (module.exports = {
|
|
119
|
+
DescribeLogGroups,
|
|
120
|
+
DescribeSubscriptionFilters
|
|
121
|
+
});
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// src/generated/getters.ts
|
|
2
|
+
import { resolveFunctionCallParameters } from "@infrascan/core";
|
|
3
|
+
import {
|
|
4
|
+
CloudWatchLogsServiceException,
|
|
5
|
+
DescribeLogGroupsCommand,
|
|
6
|
+
DescribeSubscriptionFiltersCommand
|
|
7
|
+
} from "@aws-sdk/client-cloudwatch-logs";
|
|
8
|
+
async function DescribeLogGroups(client, stateConnector, context) {
|
|
9
|
+
const state = [];
|
|
10
|
+
console.log("cloudwatch-logs DescribeLogGroups");
|
|
11
|
+
let pagingToken;
|
|
12
|
+
do {
|
|
13
|
+
const preparedParams = {};
|
|
14
|
+
preparedParams.nextToken = pagingToken;
|
|
15
|
+
try {
|
|
16
|
+
const cmd = new DescribeLogGroupsCommand(preparedParams);
|
|
17
|
+
const result = await client.send(cmd);
|
|
18
|
+
state.push({
|
|
19
|
+
_metadata: { account: context.account, region: context.region },
|
|
20
|
+
_parameters: preparedParams,
|
|
21
|
+
_result: result
|
|
22
|
+
});
|
|
23
|
+
pagingToken = result.nextToken;
|
|
24
|
+
} catch (err) {
|
|
25
|
+
if (err instanceof CloudWatchLogsServiceException) {
|
|
26
|
+
if (err?.$retryable) {
|
|
27
|
+
console.log("Encountered retryable error", err);
|
|
28
|
+
} else {
|
|
29
|
+
console.log("Encountered unretryable error", err);
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
console.log("Encountered unexpected error", err);
|
|
33
|
+
}
|
|
34
|
+
pagingToken = void 0;
|
|
35
|
+
}
|
|
36
|
+
} while (pagingToken != null);
|
|
37
|
+
await stateConnector.onServiceScanCompleteCallback(
|
|
38
|
+
context.account,
|
|
39
|
+
context.region,
|
|
40
|
+
"CloudWatchLogs",
|
|
41
|
+
"DescribeLogGroups",
|
|
42
|
+
state
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
async function DescribeSubscriptionFilters(client, stateConnector, context) {
|
|
46
|
+
const state = [];
|
|
47
|
+
console.log("cloudwatch-logs DescribeSubscriptionFilters");
|
|
48
|
+
const resolvers = [
|
|
49
|
+
{
|
|
50
|
+
Key: "logGroupName",
|
|
51
|
+
Selector: "CloudWatchLogs|DescribeLogGroups|[]._result.logGroups[].logGroupName"
|
|
52
|
+
}
|
|
53
|
+
];
|
|
54
|
+
const parameterQueue = await resolveFunctionCallParameters(
|
|
55
|
+
context.account,
|
|
56
|
+
context.region,
|
|
57
|
+
resolvers,
|
|
58
|
+
stateConnector
|
|
59
|
+
);
|
|
60
|
+
for (const parameters of parameterQueue) {
|
|
61
|
+
let pagingToken;
|
|
62
|
+
do {
|
|
63
|
+
const preparedParams = parameters;
|
|
64
|
+
preparedParams.nextToken = pagingToken;
|
|
65
|
+
try {
|
|
66
|
+
const cmd = new DescribeSubscriptionFiltersCommand(preparedParams);
|
|
67
|
+
const result = await client.send(cmd);
|
|
68
|
+
state.push({
|
|
69
|
+
_metadata: { account: context.account, region: context.region },
|
|
70
|
+
_parameters: preparedParams,
|
|
71
|
+
_result: result
|
|
72
|
+
});
|
|
73
|
+
pagingToken = result.nextToken;
|
|
74
|
+
} catch (err) {
|
|
75
|
+
if (err instanceof CloudWatchLogsServiceException) {
|
|
76
|
+
if (err?.$retryable) {
|
|
77
|
+
console.log("Encountered retryable error", err);
|
|
78
|
+
} else {
|
|
79
|
+
console.log("Encountered unretryable error", err);
|
|
80
|
+
}
|
|
81
|
+
} else {
|
|
82
|
+
console.log("Encountered unexpected error", err);
|
|
83
|
+
}
|
|
84
|
+
pagingToken = void 0;
|
|
85
|
+
}
|
|
86
|
+
} while (pagingToken != null);
|
|
87
|
+
}
|
|
88
|
+
await stateConnector.onServiceScanCompleteCallback(
|
|
89
|
+
context.account,
|
|
90
|
+
context.region,
|
|
91
|
+
"CloudWatchLogs",
|
|
92
|
+
"DescribeSubscriptionFilters",
|
|
93
|
+
state
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
DescribeLogGroups,
|
|
98
|
+
DescribeSubscriptionFilters
|
|
99
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Connector, AwsContext, GraphNode, GraphEdge } from '@infrascan/shared-types';
|
|
2
|
+
|
|
3
|
+
declare function getNodes(stateConnector: Connector, context: AwsContext): Promise<GraphNode[]>;
|
|
4
|
+
declare function getEdges(stateConnector: Connector): Promise<GraphEdge[]>;
|
|
5
|
+
|
|
6
|
+
export { getEdges, getNodes };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Connector, AwsContext, GraphNode, GraphEdge } from '@infrascan/shared-types';
|
|
2
|
+
|
|
3
|
+
declare function getNodes(stateConnector: Connector, context: AwsContext): Promise<GraphNode[]>;
|
|
4
|
+
declare function getEdges(stateConnector: Connector): Promise<GraphEdge[]>;
|
|
5
|
+
|
|
6
|
+
export { getEdges, getNodes };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/generated/graph.ts
|
|
21
|
+
var graph_exports = {};
|
|
22
|
+
__export(graph_exports, {
|
|
23
|
+
getEdges: () => getEdges,
|
|
24
|
+
getNodes: () => getNodes
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(graph_exports);
|
|
27
|
+
var import_core = require("@infrascan/core");
|
|
28
|
+
async function getNodes(stateConnector, context) {
|
|
29
|
+
const state = [];
|
|
30
|
+
const DescribeSubscriptionFiltersNodes = await (0, import_core.evaluateSelector)(
|
|
31
|
+
context.account,
|
|
32
|
+
context.region,
|
|
33
|
+
"CloudWatchLogs|DescribeSubscriptionFilters|[]._result.subscriptionFilters[].{id:logGroupName,name:logGroupName}",
|
|
34
|
+
stateConnector
|
|
35
|
+
);
|
|
36
|
+
state.push(...DescribeSubscriptionFiltersNodes);
|
|
37
|
+
return state.map(
|
|
38
|
+
(node) => (0, import_core.formatNode)(node, "cloudwatch-logs", "CloudWatchLogs", context, true)
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
async function getEdges(stateConnector) {
|
|
42
|
+
const edges = [];
|
|
43
|
+
const DescribeSubscriptionFiltersState1 = await (0, import_core.evaluateSelectorGlobally)(
|
|
44
|
+
"CloudWatchLogs|DescribeSubscriptionFilters|[]._result.subscriptionFilters[]",
|
|
45
|
+
stateConnector
|
|
46
|
+
);
|
|
47
|
+
const DescribeSubscriptionFiltersEdges1 = DescribeSubscriptionFiltersState1.flatMap((state) => {
|
|
48
|
+
const source = (0, import_core.filterState)(state, "logGroupName");
|
|
49
|
+
const target = (0, import_core.filterState)(
|
|
50
|
+
state,
|
|
51
|
+
"{target:destinationArn}"
|
|
52
|
+
);
|
|
53
|
+
if (!target || !source) {
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
if (Array.isArray(target)) {
|
|
57
|
+
return target.map((edgeTarget) => (0, import_core.formatEdge)(source, edgeTarget));
|
|
58
|
+
}
|
|
59
|
+
return (0, import_core.formatEdge)(source, target);
|
|
60
|
+
});
|
|
61
|
+
edges.push(...DescribeSubscriptionFiltersEdges1);
|
|
62
|
+
return edges;
|
|
63
|
+
}
|
|
64
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
+
0 && (module.exports = {
|
|
66
|
+
getEdges,
|
|
67
|
+
getNodes
|
|
68
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// src/generated/graph.ts
|
|
2
|
+
import {
|
|
3
|
+
evaluateSelector,
|
|
4
|
+
formatNode,
|
|
5
|
+
evaluateSelectorGlobally,
|
|
6
|
+
filterState,
|
|
7
|
+
formatEdge
|
|
8
|
+
} from "@infrascan/core";
|
|
9
|
+
async function getNodes(stateConnector, context) {
|
|
10
|
+
const state = [];
|
|
11
|
+
const DescribeSubscriptionFiltersNodes = await evaluateSelector(
|
|
12
|
+
context.account,
|
|
13
|
+
context.region,
|
|
14
|
+
"CloudWatchLogs|DescribeSubscriptionFilters|[]._result.subscriptionFilters[].{id:logGroupName,name:logGroupName}",
|
|
15
|
+
stateConnector
|
|
16
|
+
);
|
|
17
|
+
state.push(...DescribeSubscriptionFiltersNodes);
|
|
18
|
+
return state.map(
|
|
19
|
+
(node) => formatNode(node, "cloudwatch-logs", "CloudWatchLogs", context, true)
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
async function getEdges(stateConnector) {
|
|
23
|
+
const edges = [];
|
|
24
|
+
const DescribeSubscriptionFiltersState1 = await evaluateSelectorGlobally(
|
|
25
|
+
"CloudWatchLogs|DescribeSubscriptionFilters|[]._result.subscriptionFilters[]",
|
|
26
|
+
stateConnector
|
|
27
|
+
);
|
|
28
|
+
const DescribeSubscriptionFiltersEdges1 = DescribeSubscriptionFiltersState1.flatMap((state) => {
|
|
29
|
+
const source = filterState(state, "logGroupName");
|
|
30
|
+
const target = filterState(
|
|
31
|
+
state,
|
|
32
|
+
"{target:destinationArn}"
|
|
33
|
+
);
|
|
34
|
+
if (!target || !source) {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
if (Array.isArray(target)) {
|
|
38
|
+
return target.map((edgeTarget) => formatEdge(source, edgeTarget));
|
|
39
|
+
}
|
|
40
|
+
return formatEdge(source, target);
|
|
41
|
+
});
|
|
42
|
+
edges.push(...DescribeSubscriptionFiltersEdges1);
|
|
43
|
+
return edges;
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
getEdges,
|
|
47
|
+
getNodes
|
|
48
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -35,12 +35,12 @@ function getClient(credentials, context, retryStrategy) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// src/generated/getters.ts
|
|
38
|
-
var import_client_cloudwatch_logs2 = require("@aws-sdk/client-cloudwatch-logs");
|
|
39
38
|
var import_core = require("@infrascan/core");
|
|
39
|
+
var import_client_cloudwatch_logs2 = require("@aws-sdk/client-cloudwatch-logs");
|
|
40
40
|
async function DescribeLogGroups(client, stateConnector, context) {
|
|
41
41
|
const state = [];
|
|
42
42
|
console.log("cloudwatch-logs DescribeLogGroups");
|
|
43
|
-
let pagingToken
|
|
43
|
+
let pagingToken;
|
|
44
44
|
do {
|
|
45
45
|
const preparedParams = {};
|
|
46
46
|
preparedParams.nextToken = pagingToken;
|
|
@@ -90,7 +90,7 @@ async function DescribeSubscriptionFilters(client, stateConnector, context) {
|
|
|
90
90
|
stateConnector
|
|
91
91
|
);
|
|
92
92
|
for (const parameters of parameterQueue) {
|
|
93
|
-
let pagingToken
|
|
93
|
+
let pagingToken;
|
|
94
94
|
do {
|
|
95
95
|
const preparedParams = parameters;
|
|
96
96
|
preparedParams.nextToken = pagingToken;
|
package/dist/index.mjs
CHANGED
|
@@ -9,16 +9,16 @@ function getClient(credentials, context, retryStrategy) {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
// src/generated/getters.ts
|
|
12
|
+
import { resolveFunctionCallParameters } from "@infrascan/core";
|
|
12
13
|
import {
|
|
14
|
+
CloudWatchLogsServiceException,
|
|
13
15
|
DescribeLogGroupsCommand,
|
|
14
|
-
DescribeSubscriptionFiltersCommand
|
|
15
|
-
CloudWatchLogsServiceException
|
|
16
|
+
DescribeSubscriptionFiltersCommand
|
|
16
17
|
} from "@aws-sdk/client-cloudwatch-logs";
|
|
17
|
-
import { resolveFunctionCallParameters } from "@infrascan/core";
|
|
18
18
|
async function DescribeLogGroups(client, stateConnector, context) {
|
|
19
19
|
const state = [];
|
|
20
20
|
console.log("cloudwatch-logs DescribeLogGroups");
|
|
21
|
-
let pagingToken
|
|
21
|
+
let pagingToken;
|
|
22
22
|
do {
|
|
23
23
|
const preparedParams = {};
|
|
24
24
|
preparedParams.nextToken = pagingToken;
|
|
@@ -68,7 +68,7 @@ async function DescribeSubscriptionFilters(client, stateConnector, context) {
|
|
|
68
68
|
stateConnector
|
|
69
69
|
);
|
|
70
70
|
for (const parameters of parameterQueue) {
|
|
71
|
-
let pagingToken
|
|
71
|
+
let pagingToken;
|
|
72
72
|
do {
|
|
73
73
|
const preparedParams = parameters;
|
|
74
74
|
preparedParams.nextToken = pagingToken;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infrascan/aws-cloudwatch-logs-scanner",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Infrascan scanner definition for AWS Cloudwatch Logs",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"splitting": false,
|
|
23
23
|
"sourcemap": false,
|
|
24
24
|
"entry": [
|
|
25
|
-
"src
|
|
25
|
+
"src/**/*.ts"
|
|
26
26
|
],
|
|
27
27
|
"format": [
|
|
28
28
|
"cjs",
|
|
@@ -67,6 +67,6 @@
|
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@aws-sdk/client-cloudwatch-logs": "3.428.0",
|
|
70
|
-
"@infrascan/core": "0.2.
|
|
70
|
+
"@infrascan/core": "0.2.3"
|
|
71
71
|
}
|
|
72
|
-
}
|
|
72
|
+
}
|