forked from demisto/content
/
sample.py
87 lines (87 loc) · 2.93 KB
/
sample.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
SG_INFO = [
{
"Type": 1,
"Contents": [
{
"Description": "sldkjdlskfjs",
"GroupId": "sg-00000000000000001",
"GroupName": "demo-sg",
"IpPermissions": [
{
"FromPort": 0,
"IpProtocol": "tcp",
"IpRanges": [
{
"CidrIp": "0.0.0.0/0"
}
],
"Ipv6Ranges": [],
"PrefixListIds": [],
"ToPort": 65535,
"UserIdGroupPairs": []
},
{
"FromPort": 22,
"IpProtocol": "tcp",
"IpRanges": [
{
"CidrIp": "0.0.0.0/0"
}
],
"Ipv6Ranges": [],
"PrefixListIds": [],
"ToPort": 22,
"UserIdGroupPairs": []
}
],
"IpPermissionsEgress": [
{
"FromPort": 0,
"IpProtocol": "tcp",
"IpRanges": [
{
"CidrIp": "0.0.0.0/0"
}
],
"Ipv6Ranges": [],
"PrefixListIds": [],
"ToPort": 65535,
"UserIdGroupPairs": []
}
],
"OwnerId": "717007404259",
"Region": "us-east-1",
"VpcId": "vpc-061c242911e464170"
}
],
"HumanReadable": "### AWS EC2 SecurityGroups\n|Description|GroupId|GroupName|OwnerId|Region|VpcId|\n|---|---|---|---|---|---|\n| sldkjdlskfjs | sg-0408c2745d3d13b15 | demo-sg | 717007404259 | us-east-1 | vpc-061c242911e464170 |\n",
"ImportantEntryContext": "None",
}
]
INSTANCE_INFO = [
{
"Metadata": {
"instance": "AWS - EC2"
},
"Type": 1,
"Contents": [
{
"NetworkInterfaces": [
{
"Association": {
"PublicIp": "1.1.1.1"
},
"Groups": [
{
"GroupId": "sg-00000000000000000",
"GroupName": "sg-name"
}
],
"NetworkInterfaceId": "eni-00000000000000000"
}
]
}
]
}
]
NEW_SG = [{'Type': 1, 'Contents': {'GroupId': 'sg-00000000000000001'}}]