Listen for events and forward to external security scanning services.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

events_json_fixtures_test.go 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. package main
  2. const (
  3. portCreateWhenCreatingInstance = `
  4. {
  5. "_context_roles": [
  6. "admin"
  7. ],
  8. "_context_request_id": "req-fdb23f2e-9c0e-46b1-802f-3194c1fad251",
  9. "event_type": "port.create.end",
  10. "timestamp": "2016-10-03 18:40:34.596836",
  11. "_context_tenant_id": "0b65cf220eab4a3cbd68681d188d7dc7",
  12. "_unique_id": "bca88f14c46e40559e981ac0b4ffebf5",
  13. "_context_tenant_name": "services",
  14. "_context_user": "31055c32b50442e5a4eb4c0f0cb3430b",
  15. "_context_user_id": "31055c32b50442e5a4eb4c0f0cb3430b",
  16. "payload": {
  17. "port": {
  18. "status": "DOWN",
  19. "binding:host_id": "controller",
  20. "name": "",
  21. "allowed_address_pairs": [
  22. ],
  23. "admin_state_up": true,
  24. "network_id": "af33487a-4e96-4499-bfcd-4f741617a763",
  25. "tenant_id": "ada3b9b0dbac429f9361e803b54f5f32",
  26. "binding:vif_details": {
  27. "port_filter": true,
  28. "ovs_hybrid_plug": true
  29. },
  30. "binding:vnic_type": "normal",
  31. "binding:vif_type": "ovs",
  32. "device_owner": "compute:None",
  33. "mac_address": "fa:16:3e:4a:ac:75",
  34. "binding:profile": {
  35. },
  36. "fixed_ips": [
  37. {
  38. "subnet_id": "4a23cb36-b861-4daa-a8ef-c61360663669",
  39. "ip_address": "162.150.0.117"
  40. },
  41. {
  42. "subnet_id": "244c99a6-8011-4177-855b-dd493c5175c5",
  43. "ip_address": "2001:558:fe21:403:f816:3eff:fe4a:ac75"
  44. }
  45. ],
  46. "id": "a6c671d7-b4d5-4ebb-afaf-0c822bcc8948",
  47. "security_groups": [
  48. "0783a151-768c-49d3-a31d-178f70fabd51",
  49. "46d46540-98ac-4c93-ae62-68dddab2282e"
  50. ],
  51. "device_id": "128bc33a-22ae-48b4-8283-093b6ec749d0"
  52. }
  53. },
  54. "_context_project_name": "services",
  55. "_context_read_deleted": "no",
  56. "_context_tenant": "0b65cf220eab4a3cbd68681d188d7dc7",
  57. "priority": "INFO",
  58. "_context_is_admin": true,
  59. "_context_project_id": "0b65cf220eab4a3cbd68681d188d7dc7",
  60. "_context_timestamp": "2016-10-03 18:40:34.477012",
  61. "_context_user_name": "neutron",
  62. "publisher_id": "network.controller03",
  63. "message_id": "71047538-531f-4aca-be09-a31bec441d16"
  64. }
  65. `
  66. securityGroupRuleCreateWithCustomProtocall = `
  67. {
  68. "_context_roles":[
  69. "Member"
  70. ],
  71. "_context_request_id":"req-a17c784c-fec9-4077-8908-44b6f56b6196",
  72. "event_type":"security_group_rule.create.end",
  73. "timestamp":"2016-10-03 17:50:59.982008",
  74. "_context_tenant_id":"ada3b9b0dbac429f9361e803b54f5f32",
  75. "_unique_id":"a7452605170c4979b2c6b76911d22026",
  76. "_context_tenant_name":"VOIP",
  77. "_context_user":"bca89c1b248e4aef9c69ece9e744cc54",
  78. "_context_user_id":"bca89c1b248e4aef9c69ece9e744cc54",
  79. "payload":{
  80. "security_group_rule":{
  81. "remote_group_id":null,
  82. "direction":"ingress",
  83. "protocol":10,
  84. "remote_ip_prefix":"10.0.0.0/8",
  85. "port_range_max":null,
  86. "dscp":null,
  87. "security_group_id":"46d46540-98ac-4c93-ae62-68dddab2282e",
  88. "tenant_id":"ada3b9b0dbac429f9361e803b54f5f32",
  89. "port_range_min":null,
  90. "ethertype":"IPv4",
  91. "id":"3eff38bb-eb03-450b-aed4-019d612baeec"
  92. }
  93. },
  94. "_context_project_name":"VOIP",
  95. "_context_read_deleted":"no",
  96. "_context_tenant":"ada3b9b0dbac429f9361e803b54f5f32",
  97. "priority":"INFO",
  98. "_context_is_admin":false,
  99. "_context_project_id":"ada3b9b0dbac429f9361e803b54f5f32",
  100. "_context_timestamp":"2016-10-03 17:50:59.925462",
  101. "_context_user_name":"admin",
  102. "publisher_id":"network.controller03",
  103. "message_id":"6c93e24f-0892-494b-8e68-46252ceb9611"
  104. }
  105. `
  106. securityGroupRuleCreateWithIcmpAndCider = `
  107. {
  108. "_context_roles":[
  109. "Member"
  110. ],
  111. "_context_request_id":"req-c584fd21-9e58-4624-b316-b53487eed98e",
  112. "event_type":"security_group_rule.create.end",
  113. "timestamp":"2016-10-03 18:05:35.836029",
  114. "_context_tenant_id":"ada3b9b0dbac429f9361e803b54f5f32",
  115. "_unique_id":"cd280fd4f1474266bd0ad6e3ee5933a6",
  116. "_context_tenant_name":"VOIP",
  117. "_context_user":"bca89c1b248e4aef9c69ece9e744cc54",
  118. "_context_user_id":"bca89c1b248e4aef9c69ece9e744cc54",
  119. "payload":{
  120. "security_group_rule":{
  121. "remote_group_id":null,
  122. "direction":"ingress",
  123. "protocol":"icmp",
  124. "remote_ip_prefix":"192.168.1.0/24",
  125. "port_range_max":null,
  126. "dscp":null,
  127. "security_group_id":"46d46540-98ac-4c93-ae62-68dddab2282e",
  128. "tenant_id":"ada3b9b0dbac429f9361e803b54f5f32",
  129. "port_range_min":null,
  130. "ethertype":"IPv4",
  131. "id":"66d7ac79-3551-4436-83c7-103b50760cfb"
  132. }
  133. },
  134. "_context_project_name":"VOIP",
  135. "_context_read_deleted":"no",
  136. "_context_tenant":"ada3b9b0dbac429f9361e803b54f5f32",
  137. "priority":"INFO",
  138. "_context_is_admin":false,
  139. "_context_project_id":"ada3b9b0dbac429f9361e803b54f5f32",
  140. "_context_timestamp":"2016-10-03 18:05:35.769947",
  141. "_context_user_name":"admin",
  142. "publisher_id":"network.controller03",
  143. "message_id":"f67b70d5-a782-4c5e-a274-a7ff197b73ec"
  144. }
  145. `
  146. securityGroupRuleCreateWithports = `
  147. {
  148. "_context_roles":[
  149. "Member"
  150. ],
  151. "_context_request_id":"req-1f17d667-c33f-4fa4-a026-8e2872dbf1d8",
  152. "event_type":"security_group_rule.create.end",
  153. "timestamp":"2016-10-03 17:32:25.723344",
  154. "_context_tenant_id":"ada3b9b0dbac429f9361e803b54f5f32",
  155. "_unique_id":"2fad8ecdd86e4748850d91bb0c83d625",
  156. "_context_tenant_name":"VOIP",
  157. "_context_user":"bca89c1b248e4aef9c69ece9e744cc54",
  158. "_context_user_id":"bca89c1b248e4aef9c69ece9e744cc54",
  159. "payload":{
  160. "security_group_rule":{
  161. "remote_group_id":null,
  162. "direction":"ingress",
  163. "protocol":"tcp",
  164. "remote_ip_prefix":"10.0.0.0/8",
  165. "port_range_max":443,
  166. "dscp":null,
  167. "security_group_id":"46d46540-98ac-4c93-ae62-68dddab2282e",
  168. "tenant_id":"ada3b9b0dbac429f9361e803b54f5f32",
  169. "port_range_min":443,
  170. "ethertype":"IPv4",
  171. "id":"2b84d898-67b4-4370-9808-40a3fdb55a64"
  172. }
  173. },
  174. "_context_project_name":"VOIP",
  175. "_context_read_deleted":"no",
  176. "_context_tenant":"ada3b9b0dbac429f9361e803b54f5f32",
  177. "priority":"INFO",
  178. "_context_is_admin":false,
  179. "_context_project_id":"ada3b9b0dbac429f9361e803b54f5f32",
  180. "_context_timestamp":"2016-10-03 17:32:25.665588",
  181. "_context_user_name":"admin",
  182. "publisher_id":"network.controller03",
  183. "message_id":"4df01871-8bdb-4b85-bb34-cbff59ee6034"
  184. }
  185. `
  186. securityGroupRuleCreateWithSecurityGroupAsRemoteIPPrefix = `
  187. {
  188. "_context_roles":[
  189. "Member"
  190. ],
  191. "_context_request_id":"req-9e0360c7-786f-4a5b-84b6-7d2ccd23cbdd",
  192. "event_type":"security_group_rule.create.end",
  193. "timestamp":"2016-10-03 17:36:58.780554",
  194. "_context_tenant_id":"ada3b9b0dbac429f9361e803b54f5f32",
  195. "_unique_id":"b38fe8caed514eb2ba910e1ae74c6321",
  196. "_context_tenant_name":"VOIP",
  197. "_context_user":"bca89c1b248e4aef9c69ece9e744cc54",
  198. "_context_user_id":"bca89c1b248e4aef9c69ece9e744cc54",
  199. "payload":{
  200. "security_group_rule":{
  201. "remote_group_id":"0783a151-768c-49d3-a31d-178f70fabd51",
  202. "direction":"ingress",
  203. "protocol":"tcp",
  204. "remote_ip_prefix":null,
  205. "port_range_max":25,
  206. "dscp":null,
  207. "security_group_id":"46d46540-98ac-4c93-ae62-68dddab2282e",
  208. "tenant_id":"ada3b9b0dbac429f9361e803b54f5f32",
  209. "port_range_min":20,
  210. "ethertype":"IPv6",
  211. "id":"7b14b6cd-f966-4b61-aaad-c03d8eacc830"
  212. }
  213. },
  214. "_context_project_name":"VOIP",
  215. "_context_read_deleted":"no",
  216. "_context_tenant":"ada3b9b0dbac429f9361e803b54f5f32",
  217. "priority":"INFO",
  218. "_context_is_admin":false,
  219. "_context_project_id":"ada3b9b0dbac429f9361e803b54f5f32",
  220. "_context_timestamp":"2016-10-03 17:36:58.712962",
  221. "_context_user_name":"admin",
  222. "publisher_id":"network.controller03",
  223. "message_id":"e2d7c089-8194-4523-8f84-ae22db497f60"
  224. }
  225. `
  226. securityGroupRuleCreateWithSSHOpenToTheInternet = `
  227. {
  228. "_context_roles":[
  229. "Member"
  230. ],
  231. "_context_request_id":"req-94df69c6-1c3f-48bd-b2f6-f47abdef5d9b",
  232. "event_type":"security_group_rule.create.end",
  233. "timestamp":"2016-10-03 18:09:11.938476",
  234. "_context_tenant_id":"ada3b9b0dbac429f9361e803b54f5f32",
  235. "_unique_id":"09412fff881543679f30412ef2342954",
  236. "_context_tenant_name":"VOIP",
  237. "_context_user":"bca89c1b248e4aef9c69ece9e744cc54",
  238. "_context_user_id":"bca89c1b248e4aef9c69ece9e744cc54",
  239. "payload":{
  240. "security_group_rule":{
  241. "remote_group_id":null,
  242. "direction":"ingress",
  243. "protocol":"tcp",
  244. "remote_ip_prefix":"0.0.0.0/0",
  245. "port_range_max":22,
  246. "dscp":null,
  247. "security_group_id":"46d46540-98ac-4c93-ae62-68dddab2282e",
  248. "tenant_id":"ada3b9b0dbac429f9361e803b54f5f32",
  249. "port_range_min":22,
  250. "ethertype":"IPv4",
  251. "id":"bf288dfc-f9cb-446b-bacc-a8de016c9b11"
  252. }
  253. },
  254. "_context_project_name":"VOIP",
  255. "_context_read_deleted":"no",
  256. "_context_tenant":"ada3b9b0dbac429f9361e803b54f5f32",
  257. "priority":"INFO",
  258. "_context_is_admin":false,
  259. "_context_project_id":"ada3b9b0dbac429f9361e803b54f5f32",
  260. "_context_timestamp":"2016-10-03 18:09:11.876789",
  261. "_context_user_name":"admin",
  262. "publisher_id":"network.controller03",
  263. "message_id":"afb043b6-fa56-470b-b17e-984fb4cb6505"
  264. }
  265. `
  266. securityGroupRuleDeleteWithIcmpAndCider = `
  267. {
  268. "_context_roles": [
  269. "Member"
  270. ],
  271. "_context_request_id": "req-836eb80f-c6eb-459b-87b6-a093ebac3051",
  272. "event_type": "security_group_rule.delete.end",
  273. "timestamp": "2016-10-03 18:14:33.007074",
  274. "_context_tenant_id": "ada3b9b0dbac429f9361e803b54f5f32",
  275. "_unique_id": "04beeb34769b43bca09ec837d86ed18b",
  276. "_context_tenant_name": "VOIP",
  277. "_context_user": "bca89c1b248e4aef9c69ece9e744cc54",
  278. "_context_user_id": "bca89c1b248e4aef9c69ece9e744cc54",
  279. "payload": {
  280. "security_group_rule_id": "7b14b6cd-f966-4b61-aaad-c03d8eacc830"
  281. },
  282. "_context_project_name": "VOIP",
  283. "_context_read_deleted": "no",
  284. "_context_tenant": "ada3b9b0dbac429f9361e803b54f5f32",
  285. "priority": "INFO",
  286. "_context_is_admin": false,
  287. "_context_project_id": "ada3b9b0dbac429f9361e803b54f5f32",
  288. "_context_timestamp": "2016-10-03 18:14:32.962116",
  289. "_context_user_name": "admin",
  290. "publisher_id": "network.controller03",
  291. "message_id": "9bc5106c-a08b-4cda-9311-20bc16bc3008"
  292. }
  293. `
  294. )