@infrascan/shared-types 0.6.2 → 0.8.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @infrascan/shared-types
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#127](https://github.com/infrascan/infrascan/pull/127) [`dd08208963705f2211ea1db16983bb4034ee5446`](https://github.com/infrascan/infrascan/commit/dd08208963705f2211ea1db16983bb4034ee5446) Thanks [@lfarrel6](https://github.com/lfarrel6)! - Introduce launch templates into EC2 scans, extend audit component to include version numbers
8
+
9
+ ## 0.7.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#123](https://github.com/infrascan/infrascan/pull/123) [`d05dc6ffe36f6b219964407b63b002520cf89795`](https://github.com/infrascan/infrascan/commit/d05dc6ffe36f6b219964407b63b002520cf89795) Thanks [@lfarrel6](https://github.com/lfarrel6)! - Introduce informational node support
14
+
3
15
  ## 0.6.2
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrascan/shared-types",
3
- "version": "0.6.2",
3
+ "version": "0.8.0",
4
4
  "description": "Shared types for multiple infrascan packages",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
package/src/graph.ts CHANGED
@@ -56,18 +56,6 @@ export interface Node extends BaseState<unknown> {
56
56
  outgoingEdges: ElementRecord<string, Edge, string>;
57
57
  }
58
58
 
59
- export interface NodeOld {
60
- id: string;
61
- name: string;
62
- metadata: Record<string, unknown>;
63
- service?: string;
64
- type?: string;
65
- parent?: ElementType<Node, string>;
66
- children?: ElementRecord<string, Node, string>;
67
- incomingEdges: ElementRecord<string, Edge, string>;
68
- outgoingEdges: ElementRecord<string, Edge, string>;
69
- }
70
-
71
59
  export interface Edge {
72
60
  id: string;
73
61
  name?: string;
package/src/scan.ts CHANGED
@@ -35,22 +35,36 @@ export interface Coordinates {
35
35
  z?: number;
36
36
  }
37
37
 
38
+ /**
39
+ * Indicates how the node should be consumed.
40
+ *
41
+ * - Informational nodes are not likely to be useful when rendered, but may include useful insights for infrastructure comprehension. Informational nodes are unlikely to have edges.
42
+ * - Visual nodes should be considered a superset of informational nodes - they convey information and can be rendered in an obvious way.
43
+ */
44
+ export type NodeClass = "informational" | "visual";
45
+
38
46
  /**
39
47
  * Details about the nodes position in the graph and how it relates to other components
40
48
  */
41
49
  export interface GraphInfo {
42
50
  /**
43
51
  * The unique ID of the node in the graph
52
+ * @deprecated Use Resource.id instead
44
53
  */
45
54
  id: string;
46
55
  /**
47
56
  * The human readable name of the node in the graph
57
+ * @deprecated Use Resource.name instead
48
58
  */
49
59
  label: string;
50
60
  /**
51
61
  * The type of the node, used for assigning an icon in the graph
52
62
  */
53
63
  nodeType: string;
64
+ /**
65
+ * Indicates if the node is intended to be rendered or used for infrastructure comprehension.
66
+ */
67
+ nodeClass: NodeClass;
54
68
  /**
55
69
  * The ID of the parent node, optional.
56
70
  */
@@ -141,6 +155,7 @@ export interface IAM {
141
155
  export interface Audit {
142
156
  createdAt?: string | Date;
143
157
  createdBy?: string;
158
+ versionNumber?: string;
144
159
  }
145
160
 
146
161
  /**
@@ -155,6 +170,57 @@ export interface DNS {
155
170
 
156
171
  export type PublicIpStatus = "enabled" | "disabled";
157
172
 
173
+ export type AddressFamily = "ipv4" | "ipv6";
174
+
175
+ export interface ReservedAddresses {
176
+ family: AddressFamily;
177
+ cidrBlock: string;
178
+ cidrBlockAssociationSets?: [
179
+ {
180
+ associationId: string;
181
+ cidrBlock: string;
182
+ state: string;
183
+ stateMessage: string;
184
+ },
185
+ ];
186
+ firstAddress?: string;
187
+ lastAddress?: string;
188
+ }
189
+
190
+ export interface IpRange {
191
+ family?: AddressFamily;
192
+ cidrBlock?: string;
193
+ description?: string;
194
+ }
195
+
196
+ export interface ReferencedAwsSecurityGroup {
197
+ description?: string;
198
+ securityGroupId?: string;
199
+ securityGroupName?: string;
200
+ referencedAccountId?: string;
201
+ referencedVpcId?: string;
202
+ vpcPeeringStatus?: string;
203
+ vpcPeeringConnectionId?: string;
204
+ }
205
+
206
+ export interface PrefixLists {
207
+ description?: string;
208
+ prefixListId?: string;
209
+ }
210
+
211
+ export interface AwsNetworkingRules {
212
+ referencedSecurityGroups?: ReferencedAwsSecurityGroup[];
213
+ prefixLists?: PrefixLists[];
214
+ }
215
+
216
+ export interface NetworkRule {
217
+ fromPort?: number;
218
+ toPort?: number;
219
+ protocol?: string;
220
+ permittedIpRanges?: IpRange[];
221
+ awsConfig?: AwsNetworkingRules;
222
+ }
223
+
158
224
  /**
159
225
  * The network information for a scanned resource which aims to cover both resources being assigned an address
160
226
  * and the networking resource itself (VPC, subnet)
@@ -185,26 +251,12 @@ export interface Network {
185
251
  /**
186
252
  * The IP ranges reserved for a networking resource (VPC, subnet)
187
253
  */
188
- reservedAddresses?: [
189
- {
190
- family: "ipv4" | "ipv6";
191
- cidrBlock: string;
192
- cidrBlockAssociationSets?: [
193
- {
194
- associationId: string;
195
- cidrBlock: string;
196
- state: string;
197
- stateMessage: string;
198
- },
199
- ];
200
- firstAddress: string;
201
- lastAddress: string;
202
- },
203
- ];
254
+ reservedAddresses?: ReservedAddresses[];
204
255
  /**
205
256
  * The information relating to a specific subnet
206
257
  */
207
258
  subnet?: {
259
+ state?: string;
208
260
  ipv6Only?: boolean;
209
261
  availableAddressCount?: number;
210
262
  };
@@ -223,6 +275,7 @@ export interface Network {
223
275
  interfaceId?: string;
224
276
  macAddress?: string;
225
277
  };
278
+ rules?: NetworkRule[];
226
279
  }
227
280
 
228
281
  /**