diff --git a/Pipfile b/Pipfile index 14e25ebe6..97250092a 100644 --- a/Pipfile +++ b/Pipfile @@ -10,7 +10,8 @@ mixbox = "*" cybox = "*" stix = "*" maec = "*" - -pymisp = {git = "https://github.com/MISP/PyMISP.git", ref = "a68bd80ab9dceaee9674bd9a2b0bffc4f387fcdc", extras=["fileobjects"]} +pymisp = {path = "./PyMISP", extras=["fileobjects"]} stix2 = {git = "https://github.com/MISP/cti-python-stix2", ref = "61e9fc0748691f6b768acf47c18ef01b5dc0a854"} pydeep = {git = "https://github.com/kbandla/pydeep.git"} +python-dateutil = "*" +urllib3 = ">=1.26.5" diff --git a/Pipfile.lock b/Pipfile.lock index 2e00f426b..823e946e3 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "c927ad078b97ebe317e66dbdddb57f5288db85a0d954dfa88f3d724ae9f954db" + "sha256": "2ed2877b6c9e8cfec7a9956bb7b739928eca2eea89d839d7717b854cf268d289" }, "pipfile-spec": 6, "requires": {}, @@ -33,9 +33,62 @@ "hashes": [ "sha256:2bbf76fd432960138b3ef6dda3dde0544f27cbf8546c458e60baf371917ba9ee", "sha256:50b1e4f8446b06f41be7dd6338db18e0990601dce795c2b1686458aa7e8fa7d8" - ], "version": "==2021.5.30" }, + "cffi": { + "hashes": [ + "sha256:005a36f41773e148deac64b08f233873a4d0c18b053d37da83f6af4d9087b813", + "sha256:04c468b622ed31d408fea2346bec5bbffba2cc44226302a0de1ade9f5ea3d373", + "sha256:06d7cd1abac2ffd92e65c0609661866709b4b2d82dd15f611e602b9b188b0b69", + "sha256:06db6321b7a68b2bd6df96d08a5adadc1fa0e8f419226e25b2a5fbf6ccc7350f", + "sha256:0857f0ae312d855239a55c81ef453ee8fd24136eaba8e87a2eceba644c0d4c06", + "sha256:0f861a89e0043afec2a51fd177a567005847973be86f709bbb044d7f42fc4e05", + "sha256:1071534bbbf8cbb31b498d5d9db0f274f2f7a865adca4ae429e147ba40f73dea", + "sha256:158d0d15119b4b7ff6b926536763dc0714313aa59e320ddf787502c70c4d4bee", + "sha256:1bf1ac1984eaa7675ca8d5745a8cb87ef7abecb5592178406e55858d411eadc0", + "sha256:1f436816fc868b098b0d63b8920de7d208c90a67212546d02f84fe78a9c26396", + "sha256:24a570cd11895b60829e941f2613a4f79df1a27344cbbb82164ef2e0116f09c7", + "sha256:24ec4ff2c5c0c8f9c6b87d5bb53555bf267e1e6f70e52e5a9740d32861d36b6f", + "sha256:2894f2df484ff56d717bead0a5c2abb6b9d2bf26d6960c4604d5c48bbc30ee73", + "sha256:29314480e958fd8aab22e4a58b355b629c59bf5f2ac2492b61e3dc06d8c7a315", + "sha256:293e7ea41280cb28c6fcaaa0b1aa1f533b8ce060b9e701d78511e1e6c4a1de76", + "sha256:34eff4b97f3d982fb93e2831e6750127d1355a923ebaeeb565407b3d2f8d41a1", + "sha256:35f27e6eb43380fa080dccf676dece30bef72e4a67617ffda586641cd4508d49", + "sha256:3c3f39fa737542161d8b0d680df2ec249334cd70a8f420f71c9304bd83c3cbed", + "sha256:3d3dd4c9e559eb172ecf00a2a7517e97d1e96de2a5e610bd9b68cea3925b4892", + "sha256:43e0b9d9e2c9e5d152946b9c5fe062c151614b262fda2e7b201204de0b99e482", + "sha256:48e1c69bbacfc3d932221851b39d49e81567a4d4aac3b21258d9c24578280058", + "sha256:51182f8927c5af975fece87b1b369f722c570fe169f9880764b1ee3bca8347b5", + "sha256:58e3f59d583d413809d60779492342801d6e82fefb89c86a38e040c16883be53", + "sha256:5de7970188bb46b7bf9858eb6890aad302577a5f6f75091fd7cdd3ef13ef3045", + "sha256:65fa59693c62cf06e45ddbb822165394a288edce9e276647f0046e1ec26920f3", + "sha256:681d07b0d1e3c462dd15585ef5e33cb021321588bebd910124ef4f4fb71aef55", + "sha256:69e395c24fc60aad6bb4fa7e583698ea6cc684648e1ffb7fe85e3c1ca131a7d5", + "sha256:6c97d7350133666fbb5cf4abdc1178c812cb205dc6f41d174a7b0f18fb93337e", + "sha256:6e4714cc64f474e4d6e37cfff31a814b509a35cb17de4fb1999907575684479c", + "sha256:72d8d3ef52c208ee1c7b2e341f7d71c6fd3157138abf1a95166e6165dd5d4369", + "sha256:8ae6299f6c68de06f136f1f9e69458eae58f1dacf10af5c17353eae03aa0d827", + "sha256:8b198cec6c72df5289c05b05b8b0969819783f9418e0409865dac47288d2a053", + "sha256:99cd03ae7988a93dd00bcd9d0b75e1f6c426063d6f03d2f90b89e29b25b82dfa", + "sha256:9cf8022fb8d07a97c178b02327b284521c7708d7c71a9c9c355c178ac4bbd3d4", + "sha256:9de2e279153a443c656f2defd67769e6d1e4163952b3c622dcea5b08a6405322", + "sha256:9e93e79c2551ff263400e1e4be085a1210e12073a31c2011dbbda14bda0c6132", + "sha256:9ff227395193126d82e60319a673a037d5de84633f11279e336f9c0f189ecc62", + "sha256:a465da611f6fa124963b91bf432d960a555563efe4ed1cc403ba5077b15370aa", + "sha256:ad17025d226ee5beec591b52800c11680fca3df50b8b29fe51d882576e039ee0", + "sha256:afb29c1ba2e5a3736f1c301d9d0abe3ec8b86957d04ddfa9d7a6a42b9367e396", + "sha256:b85eb46a81787c50650f2392b9b4ef23e1f126313b9e0e9013b35c15e4288e2e", + "sha256:bb89f306e5da99f4d922728ddcd6f7fcebb3241fc40edebcb7284d7514741991", + "sha256:cbde590d4faaa07c72bf979734738f328d239913ba3e043b1e98fe9a39f8b2b6", + "sha256:cc5a8e069b9ebfa22e26d0e6b97d6f9781302fe7f4f2b8776c3e1daea35f1adc", + "sha256:cd2868886d547469123fadc46eac7ea5253ea7fcb139f12e1dfc2bbd406427d1", + "sha256:d42b11d692e11b6634f7613ad8df5d6d5f8875f5d48939520d351007b3c13406", + "sha256:df5052c5d867c1ea0b311fb7c3cd28b19df469c056f7fdcfe88c7473aa63e333", + "sha256:f2d45f97ab6bb54753eab54fffe75aaf3de4ff2341c9daee1987ee1837636f1d", + "sha256:fd78e5fee591709f32ef6edb9a015b4aa1a5022598e36227500c8f4e02328d9c" + ], + "version": "==1.14.5" + }, "chardet": { "hashes": [ "sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa", @@ -44,6 +97,36 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", "version": "==4.0.0" }, + "colorclass": { + "hashes": [ + "sha256:b05c2a348dfc1aff2d502527d78a5b7b7e2f85da94a96c5081210d8e9ee8e18b" + ], + "version": "==2.2.0" + }, + "compressed-rtf": { + "hashes": [ + "sha256:c1c827f1d124d24608981a56e8b8691eb1f2a69a78ccad6440e7d92fde1781dd" + ], + "version": "==1.0.6" + }, + "cryptography": { + "hashes": [ + "sha256:0f1212a66329c80d68aeeb39b8a16d54ef57071bf22ff4e521657b27372e327d", + "sha256:1e056c28420c072c5e3cb36e2b23ee55e260cb04eee08f702e0edfec3fb51959", + "sha256:240f5c21aef0b73f40bb9f78d2caff73186700bf1bc6b94285699aff98cc16c6", + "sha256:26965837447f9c82f1855e0bc8bc4fb910240b6e0d16a664bb722df3b5b06873", + "sha256:37340614f8a5d2fb9aeea67fd159bfe4f5f4ed535b1090ce8ec428b2f15a11f2", + "sha256:3d10de8116d25649631977cb37da6cbdd2d6fa0e0281d014a5b7d337255ca713", + "sha256:3d8427734c781ea5f1b41d6589c293089704d4759e34597dce91014ac125aad1", + "sha256:7ec5d3b029f5fa2b179325908b9cd93db28ab7b85bb6c1db56b10e0b54235177", + "sha256:8e56e16617872b0957d1c9742a3f94b43533447fd78321514abbe7db216aa250", + "sha256:de4e5f7f68220d92b7637fc99847475b59154b7a1b3868fb7385337af54ac9ca", + "sha256:eb8cc2afe8b05acbd84a43905832ec78e7b3873fb124ca190f574dca7389a87d", + "sha256:ee77aa129f481be46f8d92a1a7db57269a2f23052d5f2433b4621bb457081cc9" + ], + "markers": "python_version >= '3.6'", + "version": "==3.4.7" + }, "cybox": { "hashes": [ "sha256:19a588bcdce8f3a088f7d5edd3e8862c11b701bb3d64257b18f3092deb9c3b7a", @@ -52,6 +135,34 @@ "index": "pypi", "version": "==2.1.0.21" }, + "deprecated": { + "hashes": [ + "sha256:08452d69b6b5bc66e8330adde0a4f8642e969b9e1702904d137eeb29c8ffc771", + "sha256:6d2de2de7931a968874481ef30208fd4e08da39177d61d3d4ebdf4366e7dbca1" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==1.2.12" + }, + "easygui": { + "hashes": [ + "sha256:073f728ca88a77b74f404446fb8ec3004945427677c5618bd00f70c1b999fef2", + "sha256:8d38764803c27bbccab2771e6c021cb20647049b36617f765fac79f01af07a27" + ], + "version": "==0.98.2" + }, + "ebcdic": { + "hashes": [ + "sha256:33b4cb729bc2d0bf46cc1847b0e5946897cb8d3f53520c5b9aa5fa98d7e735f1" + ], + "version": "==1.1.1" + }, + "extract-msg": { + "hashes": [ + "sha256:6ad2702bef86e6c1b8505e2993c7f3d37a1f3d140903138ee2df4a299dd2a29c", + "sha256:7ebdbd7863a3699080a69f71ec0cd30ed9bfee70bad9acc6a8e6abe9523c78c0" + ], + "version": "==0.28.7" + }, "idna": { "hashes": [ "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6", @@ -60,6 +171,13 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.10" }, + "imapclient": { + "hashes": [ + "sha256:3eeb97b9aa8faab0caa5024d74bfde59408fbd542781246f6960873c7bf0dd01", + "sha256:60ba79758cc9f13ec910d7a3df9acaaf2bb6c458720d9a02ec33a41352fd1b99" + ], + "version": "==2.1.0" + }, "jsonschema": { "hashes": [ "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163", @@ -67,6 +185,44 @@ ], "version": "==3.2.0" }, + "lark-parser": { + "hashes": [ + "sha256:e29ca814a98bb0f81674617d878e5f611cb993c19ea47f22c80da3569425f9bd" + ], + "version": "==0.11.3" + }, + "lief": { + "hashes": [ + "sha256:17314177c0124ccd450554bbcb203b8cd2660c94e36bdc05a6eba04bb0af3954", + "sha256:1cca100e77382f4137a3b1283769efa0e68a965fa4f3e21e64e3f67b6e22fdc8", + "sha256:208294f208354f57ded772efc4c3b2ea61fae35325a048d38c21571cb35e4bfc", + "sha256:3f510836d19cee407015ee565ea566e444471f0ecb3028a5c5e2219a7583f3c4", + "sha256:44bd7804a39837ff46cd543154f6e4a28e2d4fafa312752ca6deea1c849995ce", + "sha256:5122e4e70fecc32e7fdf2e9cd9b580ddd63fb4509eae373be78b3c11d67175b8", + "sha256:544b0f8a587bc5f6fd39cf47d9785af2714f982682efcd1dd3291604e7cb6351", + "sha256:5a0da170943aaf7019b27b9a7199b860298426c0455f88add392f472605c39ee", + "sha256:5f5fb42461b5d5d5b2ccf7fe17e8f26bd632afcbaedf29a9d30819eeea5dab29", + "sha256:621ad19f77884a008d61e05b92aed8309a8460e93916f4722439beaa529ca37d", + "sha256:710112ebc642bf5287a7b25c54c8a4e1079cbb403d4e844a364e1c3cbed52486", + "sha256:8b219ce4a41b0734fe9a7fbfde7d23a92bc005c8684882662808fc438568c1b5", + "sha256:8fd1ecdb3001e8e19df7278b77df5d6394ad6071354e177d11ad08b0a727d390", + "sha256:932ba495388fb52b4ba056a0b00abe0bda3567ad3ebc6d726be1e87b8be08b3f", + "sha256:9c6cc9da3e3a56ad29fc4e77e7109e960bd0cae3e3ba5307e3ae5c65d85fbdc4", + "sha256:a1f7792f1d811a898d3d676c32731d6b055573a2c3e67988ab1b32917db3de96", + "sha256:a4bb649a2f5404b8e2e4b8beb3772466430e7382fc5f7f014f3f778137133987", + "sha256:b275a542b5ef173ec9602d2f511a895c4228db63bbbc58699859da4afe8bfd58", + "sha256:bfc0246af63361e22a952f8babd542477d64288d993c5a053a72f9e3f59da795", + "sha256:c672dcd78dbbe2c0746721cdb1593b237a8b983d039e73713b055449e4a58207", + "sha256:c773eaee900f398cc98a9c8501d9ab7465af9729979841bb78f4aaa8b821fd9a", + "sha256:e6d9621c1db852ca4de37efe98151838edf0a976fe03cace471b3a761861f95e", + "sha256:e743345290649f54efcf2c1ea530f3520a7b22583fb8b0772df48b1901ecb1ea", + "sha256:eb8c2ae617ff54c4ea73dbd055544681b3cfeafbdbf0fe4535fac494515ab65b", + "sha256:f4e8a878615a46ef4ae016261a59152b8c019a35adb865e26a37c8ef25200d7e", + "sha256:fd41077526e30bfcafa3d03bff8466a4a9ae4bbe21cadd6a09168a62ce18710c" + ], + "markers": "python_version >= '3.6'", + "version": "==0.11.5" + }, "lxml": { "hashes": [ "sha256:079f3ae844f38982d156efce585bc540c16a926d4436712cf4baee0cce487a3d", @@ -135,6 +291,28 @@ "index": "pypi", "version": "==1.0.5" }, + "msoffcrypto-tool": { + "hashes": [ + "sha256:234f85ef59945fa1ebb618ca029f31f0cb43a637344dbda5c1bb8578b2d96a68", + "sha256:7f04b621365e3753f8cef8ba40536acc23d0d201c0ad2dcb1b3d82c83056b7ff" + ], + "markers": "python_version >= '3' and platform_python_implementation != 'PyPy' or (platform_system != 'Windows' and platform_system != 'Darwin')", + "version": "==4.12.0" + }, + "olefile": { + "hashes": [ + "sha256:133b031eaf8fd2c9399b78b8bc5b8fcbe4c31e85295749bb17a87cba8f3c3964" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==0.46" + }, + "oletools": { + "hashes": [ + "sha256:bad54d3ced34f3475a5bffc0122f8481c66c3f3e09ad946dbda6ec80b75f72cb", + "sha256:dfad0328ac83b4f8db9f47e706cbd64db739ae4ebf9d98b2dcc465728a35f4a6" + ], + "version": "==0.60" + }, "ordered-set": { "hashes": [ "sha256:ba93b2df055bca202116ec44b9bead3df33ea63a7d5827ff8e16738b97f33a95" @@ -142,6 +320,21 @@ "markers": "python_version >= '3.5'", "version": "==4.0.2" }, + "pcodedmp": { + "hashes": [ + "sha256:025f8c809a126f45a082ffa820893e6a8d990d9d7ddb68694b5a9f0a6dbcd955", + "sha256:4441f7c0ab4cbda27bd4668db3b14f36261d86e5059ce06c0828602cbe1c4278" + ], + "version": "==1.2.6" + }, + "pycparser": { + "hashes": [ + "sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0", + "sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==2.20" + }, "pydeep": { "git": "https://github.com/kbandla/pydeep.git", "ref": "bc0d33bff4b45718b4c5f2c79d4715d92a427eda" @@ -150,8 +343,16 @@ "extras": [ "fileobjects" ], - "git": "https://github.com/MISP/PyMISP.git", - "ref": "a68bd80ab9dceaee9674bd9a2b0bffc4f387fcdc" + "path": "./PyMISP", + "version": "==2.4.102" + }, + "pyparsing": { + "hashes": [ + "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1", + "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b" + ], + "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==2.4.7" }, "pyrsistent": { "hashes": [ @@ -165,9 +366,17 @@ "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c", "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "index": "pypi", "version": "==2.8.1" }, + "python-magic": { + "hashes": [ + "sha256:4fec8ee805fea30c07afccd1592c0f17977089895bdfaae5fec870a84e997626", + "sha256:de800df9fb50f8ec5974761054a708af6e4246b03b4bdaee993f948947b0ebcf" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==0.4.24" + }, "pytz": { "hashes": [ "sha256:83a4a90894bf38e243cf052c8b58f381bfe9a7a483f6a9cab140bc7f702ac4da", @@ -183,6 +392,14 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", "version": "==2.25.1" }, + "rtfde": { + "hashes": [ + "sha256:18386e4f060cee12a2a8035b0acf0cc99689f5dff1bf347bab7e92351860a21d", + "sha256:b86b5d734950fe8745a5b89133f50554252dbd67c6d1b9265e23ee140e7ea8a2" + ], + "markers": "python_version >= '3.6'", + "version": "==0.0.2" + }, "simplejson": { "hashes": [ "sha256:034550078a11664d77bc1a8364c90bb7eef0e44c2dbb1fd0a4d92e3997088667", @@ -261,12 +478,23 @@ ], "version": "==1.3.2" }, + "tzlocal": { + "hashes": [ + "sha256:643c97c5294aedc737780a49d9df30889321cbe1204eac2c2ec6134035a92e44", + "sha256:e2cb6c6b5b604af38597403e9852872d7f534962ae2954c7f35efcb1ccacf4a4" + ], + "version": "==2.1" + }, "urllib3": { "hashes": [ "sha256:753a0374df26658f99d826cfe40394a686d05985786d946fbe4165b5148f5a7c", "sha256:a7acd0977125325f516bda9735fa7142b909a8d01e8b2e4c8108d0984e6e0098" ], +<<<<<<< HEAD "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", +======= + "index": "pypi", +>>>>>>> develop "version": "==1.26.5" }, "weakrefmethod": { @@ -274,6 +502,12 @@ "sha256:37bc1fbb5575acf82172d4eb7b6fc4412d77d5a1d70dff2c1f8a4574301cda66" ], "version": "==1.0.3" + }, + "wrapt": { + "hashes": [ + "sha256:b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec1eb88e6d9b97d7" + ], + "version": "==1.12.1" } }, "develop": {} diff --git a/PyMISP b/PyMISP index 3c289b971..7dbaf665d 160000 --- a/PyMISP +++ b/PyMISP @@ -1 +1 @@ -Subproject commit 3c289b971dbbf58b192ecf84b3acbe438a2a76e9 +Subproject commit 7dbaf665d9288f2a2692bee3d6207bb6abe3c51f diff --git a/VERSION.json b/VERSION.json index dc4a4d29c..55ffeb440 100644 --- a/VERSION.json +++ b/VERSION.json @@ -1 +1 @@ -{"major":2, "minor":4, "hotfix":143} +{"major":2, "minor":4, "hotfix":144} diff --git a/app/Console/Command/ServerShell.php b/app/Console/Command/ServerShell.php index 05ac12536..a70fa16a9 100644 --- a/app/Console/Command/ServerShell.php +++ b/app/Console/Command/ServerShell.php @@ -212,6 +212,33 @@ class ServerShell extends AppShell } } + public function pushAll() + { + $this->ConfigLoad->execute(); + + $userId = $this->args[0]; + $user = $this->User->getAuthUser($userId); + if (empty($user)) { + die('User ID do not match an existing user.' . PHP_EOL); + } + + $servers = $this->Server->find('all', array( + 'conditions' => array('Server.push' => 1), + 'recursive' => -1, + 'order' => 'Server.priority', + 'fields' => array('Server.name', 'Server.id'), + )); + + foreach ($servers as $server) { + $jobId = CakeResque::enqueue( + 'default', + 'ServerShell', + array('push', $userId, $server['Server']['id'], $technique) + ); + $this->out("Enqueued pushing from {$server['Server']['name']} server as job $jobId"); + } + } + public function fetchFeed() { $this->ConfigLoad->execute(); @@ -320,6 +347,34 @@ class ServerShell extends AppShell echo $message . PHP_EOL; } + public function cacheServerAll() + { + $this->ConfigLoad->execute(); + + $userId = $this->args[0]; + $user = $this->User->getAuthUser($userId); + if (empty($user)) { + die('User ID do not match an existing user.' . PHP_EOL); + } + + $servers = $this->Server->find('all', array( + 'conditions' => array('Server.pull' => 1), + 'recursive' => -1, + 'order' => 'Server.priority', + 'fields' => array('Server.name', 'Server.id'), + )); + + foreach ($servers as $server) { + $jobId = CakeResque::enqueue( + 'default', + 'ServerShell', + array('cacheServer', $userId, $server['Server']['id']) + ); + $this->out("Enqueued cacheServer from {$server['Server']['name']} server as job $jobId"); + } + + } + public function cacheFeed() { $this->ConfigLoad->execute(); diff --git a/app/Controller/AppController.php b/app/Controller/AppController.php index 7d53b9520..3f20bbe7f 100755 --- a/app/Controller/AppController.php +++ b/app/Controller/AppController.php @@ -25,8 +25,8 @@ class AppController extends Controller public $helpers = array('OrgImg', 'FontAwesome', 'UserName', 'DataPathCollector'); - private $__queryVersion = '129'; - public $pyMispVersion = '2.4.143'; + private $__queryVersion = '130'; + public $pyMispVersion = '2.4.144'; public $phpmin = '7.2'; public $phprec = '7.4'; public $phptoonew = '8.0'; diff --git a/app/Controller/AuditLogsController.php b/app/Controller/AuditLogsController.php index 8ff3d7ef4..4401b56e2 100644 --- a/app/Controller/AuditLogsController.php +++ b/app/Controller/AuditLogsController.php @@ -25,6 +25,7 @@ class AuditLogsController extends AppController 'CorrelationExclusion', 'Event', 'EventBlocklist', + 'EventReport', 'Feed', 'DecayingModel', 'Object', @@ -490,18 +491,6 @@ class AuditLogsController extends AppController $events = array_column(array_column($events, 'Event'), null, 'id'); } - $existingObjects = []; - foreach (['User', 'Organisation', 'Galaxy', 'GalaxyCluster', 'Warninglist', 'AuthKey', 'ObjectTemplate', 'Role'] as $modelName) { - if (isset($models[$modelName])) { - $this->loadModel($modelName); - $data = $this->{$modelName}->find('column', [ - 'conditions' => ['id' => array_unique($models[$modelName])], - 'fields' => ['id'], - ]); - $existingObjects[$modelName] = array_flip($data); - } - } - $links = [ 'ObjectTemplate' => 'objectTemplates', 'AuthKey' => 'auth_keys', @@ -511,8 +500,21 @@ class AuditLogsController extends AppController 'Warninglist' => 'warninglists', 'User' => 'admin/user', 'Role' => 'roles', + 'EventReport' => 'eventReports', ]; + $existingObjects = []; + foreach ($links as $modelName => $foo) { + if (isset($models[$modelName])) { + $this->loadModel($modelName); + $data = $this->{$modelName}->find('column', [ + 'conditions' => ['id' => array_unique($models[$modelName])], + 'fields' => ['id'], + ]); + $existingObjects[$modelName] = array_flip($data); + } + } + foreach ($auditLogs as $k => $auditLog) { $auditLog = $auditLog['AuditLog']; $modelId = (int)$auditLog['model_id']; diff --git a/app/Controller/AuthKeysController.php b/app/Controller/AuthKeysController.php index 47e1fef57..13e396fd1 100644 --- a/app/Controller/AuthKeysController.php +++ b/app/Controller/AuthKeysController.php @@ -51,6 +51,7 @@ class AuthKeysController extends AppController return $this->restResponsePayload; } $this->set('title_for_layout', __('Auth Keys')); + $this->set('advancedEnabled', !empty(Configure::read('Security.advanced_authkeys'))); $this->set('keyUsageEnabled', $keyUsageEnabled); $this->set('menuData', [ 'menuList' => $this->_isSiteAdmin() ? 'admin' : 'globalActions', diff --git a/app/Controller/Component/ACLComponent.php b/app/Controller/Component/ACLComponent.php index 0fb9c0a02..439dc6420 100644 --- a/app/Controller/Component/ACLComponent.php +++ b/app/Controller/Component/ACLComponent.php @@ -310,6 +310,8 @@ class ACLComponent extends Component 'attachCluster' => array('perm_tagger'), 'attachMultipleClusters' => array('perm_tagger'), 'delete' => array(), + 'disable' => array('perm_site_admin'), + 'enable' => array('perm_site_admin'), 'export' => array('*'), 'forkTree' => array('*'), 'index' => array('*'), @@ -320,6 +322,7 @@ class ACLComponent extends Component 'selectGalaxyNamespace' => array('perm_tagger'), 'selectCluster' => array('perm_tagger'), 'showGalaxies' => array('*'), + 'toggle' => array('perm_site_admin'), 'update' => array(), 'view' => array('*'), 'viewGraph' => array('*'), @@ -345,6 +348,7 @@ class ACLComponent extends Component 'unpublish' => array('perm_galaxy_editor'), 'updateCluster' => array('perm_galaxy_editor'), 'view' => array('*'), + 'viewCyCatRelations' => array('*'), 'viewGalaxyMatrix' => array('*'), 'viewRelations' => array('*'), 'viewRelationTree' => array('*'), @@ -533,6 +537,7 @@ class ACLComponent extends Component 'resetRemoteAuthKey' => array(), 'removeOrphanedCorrelations' => array('perm_site_admin'), 'rest' => array('perm_auth'), + 'openapi' => array('*'), 'restartDeadWorkers' => array(), 'restartWorkers' => array(), 'serverSettings' => array(), diff --git a/app/Controller/DashboardsController.php b/app/Controller/DashboardsController.php index 0bfaa6566..fa258b5cb 100644 --- a/app/Controller/DashboardsController.php +++ b/app/Controller/DashboardsController.php @@ -12,7 +12,7 @@ class DashboardsController extends AppController public function beforeFilter() { parent::beforeFilter(); - $this->Security->unlockedActions = array_merge(array('renderWidget', 'updateSettings', 'getForm'), $this->Security->unlockedActions); + $this->Security->unlockedActions = array_merge(array('renderWidget', 'getForm'), $this->Security->unlockedActions); } public $paginate = array( @@ -113,14 +113,14 @@ class DashboardsController extends AppController { if ($this->request->is('post')) { $this->UserSetting = ClassRegistry::init('UserSetting'); - if (!isset($this->request->data['value'])) { + if (!isset($this->request->data['Dashboard']['value'])) { throw new InvalidArgumentException(__('No setting data found.')); } $data = array( 'UserSetting' => array( 'user_id' => $this->Auth->user('id'), 'setting' => 'dashboard', - 'value' => $this->request->data['value'] + 'value' => $this->request->data['Dashboard']['value'] ) ); $result = $this->UserSetting->setSetting($this->Auth->user(), $data); diff --git a/app/Controller/EventsController.php b/app/Controller/EventsController.php index a910adb6f..26d389dc2 100644 --- a/app/Controller/EventsController.php +++ b/app/Controller/EventsController.php @@ -41,7 +41,7 @@ class EventsController extends AppController 'proposal' => 0, 'correlation' => 0, 'warning' => 0, - 'deleted' => 2, + 'deleted' => 0, 'includeRelatedTags' => 0, 'includeDecayScore' => 0, 'toIDS' => 0, @@ -1130,13 +1130,12 @@ class EventsController extends AppController $conditions['overrideLimit'] = 1; } if (isset($filters['deleted'])) { - $conditions['deleted'] = $filters['deleted'] == 2 ? 0 : [0, 1]; - if ($filters['deleted'] == 2) { // not-deleted only - $conditions['deleted'] = 0; - } elseif ($filters['deleted'] == 1) { // deleted only - $conditions['deleted'] = 1; - } else { // both + if ($filters['deleted'] == 1) { // both $conditions['deleted'] = [0, 1]; + } elseif ($filters['deleted'] == 0) { // not-deleted only + $conditions['deleted'] = 1; + } else { // only deleted + $conditions['deleted'] = 0; } } if (isset($filters['toIDS']) && $filters['toIDS'] != 0) { @@ -1283,7 +1282,7 @@ class EventsController extends AppController } $deleted = 0; if (isset($filters['deleted'])) { - $deleted = $filters['deleted'] == 2 ? 0 : 1; + $deleted = $filters['deleted'] > 0 ? 1 : 0; } $this->set('includeSightingdb', (!empty($filters['includeSightingdb']) && Configure::read('Plugin.Sightings_sighting_db_enable'))); $this->set('deleted', $deleted); @@ -1626,7 +1625,15 @@ class EventsController extends AppController if (($this->userRole['perm_sync'] && $this->_isRest() && !$this->userRole['perm_site_admin']) && $deleted == 1) { $conditions['deleted'] = array(0,1); } else { - $conditions['deleted'] = $deleted == 2 ? array(0,1) : $deleted; + if (is_array($deleted)) { + $conditions['deleted'] = $deleted; + } else if ($deleted == 1) { // both + $conditions['deleted'] = [0, 1]; + } elseif ($deleted == 0) { // not-deleted only + $conditions['deleted'] = 0; + } else { // only deleted + $conditions['deleted'] = 1; + } } } if (isset($this->params['named']['toIDS']) && $this->params['named']['toIDS'] != 0) { @@ -1728,7 +1735,7 @@ class EventsController extends AppController return $this->__restResponse($event); } - $this->set('deleted', isset($deleted) ? ($deleted == 2 ? 0 : 1) : 0); + $this->set('deleted', isset($deleted) ? ($deleted > 0 ? 1 : 0) : 0); $this->set('includeRelatedTags', (!empty($this->params['named']['includeRelatedTags'])) ? 1 : 0); $this->set('includeDecayScore', (!empty($this->params['named']['includeDecayScore'])) ? 1 : 0); diff --git a/app/Controller/FeedsController.php b/app/Controller/FeedsController.php index 8daa9c3d1..aac0f966e 100644 --- a/app/Controller/FeedsController.php +++ b/app/Controller/FeedsController.php @@ -202,9 +202,6 @@ class FeedsController extends AppController $tags = $this->Event->EventTag->Tag->find('list', array('fields' => array('Tag.name'), 'order' => array('lower(Tag.name) asc'))); $tags[0] = 'None'; $this->set('tags', $tags); - if (!isset($this->request->data['Feed']['fixed_event'])) { - $this->request->data['Feed']['fixed_event'] = 1; - } $this->set('orgs', $this->Event->Orgc->find('list', array( 'fields' => array('id', 'name'), 'order' => 'LOWER(name)' @@ -221,6 +218,9 @@ class FeedsController extends AppController } } } + if (!isset($this->request->data['Feed']['fixed_event'])) { + $this->request->data['Feed']['fixed_event'] = 1; + } $error = false; if (isset($this->request->data['Feed']['pull_rules'])) { $this->request->data['Feed']['rules'] = $this->request->data['Feed']['pull_rules']; @@ -459,8 +459,15 @@ class FeedsController extends AppController $this->Feed->data['Feed']['settings'] = json_decode($this->Feed->data['Feed']['settings'], true); } if (!$this->Feed->data['Feed']['enabled']) { - $this->Flash->error(__('Feed is currently not enabled. Make sure you enable it.')); - $this->redirect(array('action' => 'index')); + if ($this->_isRest()) { + return $this->RestResponse->viewData( + array('result' => __('Feed is currently not enabled. Make sure you enable it.')), + $this->response->type() + ); + } else { + $this->Flash->error(__('Feed is currently not enabled. Make sure you enable it.')); + $this->redirect(array('action' => 'index')); + } } if (Configure::read('MISP.background_jobs')) { $this->loadModel('Job'); diff --git a/app/Controller/GalaxiesController.php b/app/Controller/GalaxiesController.php index cd874d7dd..8b2f4a7d0 100644 --- a/app/Controller/GalaxiesController.php +++ b/app/Controller/GalaxiesController.php @@ -19,7 +19,7 @@ class GalaxiesController extends AppController public function index() { $aclConditions = array(); - $filters = $this->IndexFilter->harvestParameters(array('value')); + $filters = $this->IndexFilter->harvestParameters(array('value', 'enabled')); $searchConditions = array(); if (empty($filters['value'])) { $filters['value'] = ''; @@ -35,6 +35,9 @@ class GalaxiesController extends AppController ) ); } + if (isset($filters['enabled'])) { + $searchConditions[]['enabled'] = $filters['enabled'] ? 1 : 0; + } if ($this->_isRest()) { $galaxies = $this->Galaxy->find( 'all', @@ -51,6 +54,7 @@ class GalaxiesController extends AppController $this->paginate['conditions']['AND'][] = $aclConditions; $galaxies = $this->paginate(); $this->set('galaxyList', $galaxies); + $this->set('passedArgsArray', $this->passedArgs); $this->set('searchall', $filters['value']); } } @@ -139,7 +143,7 @@ class GalaxiesController extends AppController } $result = $this->Galaxy->delete($id); if ($result) { - $message = 'Galaxy deleted'; + $message = __('Galaxy deleted'); if ($this->_isRest()) { return $this->RestResponse->saveSuccessResponse('Galaxy', 'delete', false, $this->response->type(), $message); } else { @@ -147,7 +151,7 @@ class GalaxiesController extends AppController $this->redirect(array('controller' => 'galaxies', 'action' => 'index')); } } else { - $message = 'Could not delete Galaxy.'; + $message = __('Could not delete Galaxy.'); if ($this->_isRest()) { return $this->RestResponse->saveFailResponse('Galaxy', 'delete', false, $message); } else { @@ -156,7 +160,55 @@ class GalaxiesController extends AppController } } } - + + public function enable($id) { + return $this->toggle($id, true); + } + + public function disable($id) { + return $this->toggle($id, false); + } + + public function toggle($id, $enabled=null) + { + if (Validation::uuid($id)) { + $id = $this->Toolbox->findIdByUuid($this->Galaxy, $id); + } elseif (!is_numeric($id)) { + throw new NotFoundException('Invalid galaxy.'); + } + + $galaxy = $this->Galaxy->find('first', array( + 'recursive' => -1, + 'conditions' => array('Galaxy.id' => $id) + )); + if (empty($galaxy)) { + throw new NotFoundException('Invalid galaxy.'); + } + if (is_null($enabled)) { + $galaxy['Galaxy']['enabled'] = !$galaxy['Galaxy']['enabled']; + } else { + $galaxy['Galaxy']['enabled'] = $enabled; + } + $result = $this->Galaxy->save($galaxy); + if ($result) { + $message = __('Galaxy enabled'); + if ($this->_isRest()) { + return $this->RestResponse->saveSuccessResponse('Galaxy', 'toggle', false, $this->response->type(), $message); + } else { + $this->Flash->success($message); + $this->redirect(array('controller' => 'galaxies', 'action' => 'index')); + } + } else { + $message = __('Could not enable Galaxy.'); + if ($this->_isRest()) { + return $this->RestResponse->saveFailResponse('Galaxy', 'toggle', false, $message); + } else { + $this->Flash->success($message); + $this->redirect($this->referer()); + } + } + } + public function import() { if ($this->request->is('post') || $this->request->is('put')) { @@ -284,6 +336,9 @@ class GalaxiesController extends AppController $local = !empty($this->params['named']['local']) ? $this->params['named']['local'] : '0'; $eventid = !empty($this->params['named']['eventid']) ? $this->params['named']['eventid'] : '0'; $conditions = $namespace === '0' ? array() : array('namespace' => $namespace); + $conditions[] = [ + 'enabled' => true + ]; $galaxies = $this->Galaxy->find('all', array( 'recursive' => -1, 'fields' => array('MAX(Galaxy.version) as latest_version', 'id', 'kill_chain_order', 'name', 'icon', 'description'), @@ -339,6 +394,7 @@ class GalaxiesController extends AppController $namespaces = $this->Galaxy->find('list', array( 'recursive' => -1, 'fields' => array('namespace', 'namespace'), + 'conditions' => array('enabled' => 1), 'group' => array('namespace'), 'order' => array('namespace asc') )); diff --git a/app/Controller/GalaxyClustersController.php b/app/Controller/GalaxyClustersController.php index dcd313c7d..3c4d3e2ef 100644 --- a/app/Controller/GalaxyClustersController.php +++ b/app/Controller/GalaxyClustersController.php @@ -159,7 +159,7 @@ class GalaxyClustersController extends AppController $this->render('ajax/index'); } } - + /** * @param mixed $id ID or UUID of the cluster */ @@ -204,7 +204,7 @@ class GalaxyClustersController extends AppController } } } - + /** * @param mixed $galaxyId ID of the galaxy to which the cluster will be added */ @@ -329,7 +329,7 @@ class GalaxyClustersController extends AppController $this->set('sharingGroups', $sgs); $this->set('action', 'add'); } - + /** * @param mixed $id ID or UUID of the cluster */ @@ -396,7 +396,7 @@ class GalaxyClustersController extends AppController if (empty($cluster['GalaxyCluster']['authors'])) { $cluster['GalaxyCluster']['authors'] = []; } else if (is_array($cluster['GalaxyCluster']['authors'])) { - // This is as intended, move on + // This is as intended, move on }else { $decoded = json_decode($cluster['GalaxyCluster']['authors'], true); if (is_null($decoded)) { // authors might be comma separated @@ -774,6 +774,15 @@ class GalaxyClustersController extends AppController } } + public function viewCyCatRelations($id) + { + $cluster = $this->GalaxyCluster->fetchIfAuthorized($this->Auth->user(), $id, 'view', true, false); + $CyCatRelations = $this->GalaxyCluster->getCyCatRelations($cluster); + $this->set('cluster', $cluster); + $this->set('CyCatRelations', $CyCatRelations); + $this->render('cluster_cycatrelations'); + } + public function viewGalaxyMatrix($id) { if (!$this->request->is('ajax')) { diff --git a/app/Controller/NoticelistsController.php b/app/Controller/NoticelistsController.php index 3c439be3a..0e59bfadf 100644 --- a/app/Controller/NoticelistsController.php +++ b/app/Controller/NoticelistsController.php @@ -171,6 +171,10 @@ class NoticelistsController extends AppController if (empty($noticelist)) { throw new NotFoundException('Noticelist not found.'); } + + $noticelist['Noticelist']['ref'] = json_decode($noticelist['Noticelist']['ref']); + $noticelist['Noticelist']['geographical_area'] = json_decode($noticelist['Noticelist']['geographical_area']); + if ($this->_isRest()) { $noticelist['Noticelist']['NoticelistEntry'] = $noticelist['NoticelistEntry']; return $this->RestResponse->viewData($noticelist, $this->response->type()); diff --git a/app/Controller/ServersController.php b/app/Controller/ServersController.php index d031098e7..f53977c0c 100644 --- a/app/Controller/ServersController.php +++ b/app/Controller/ServersController.php @@ -2527,4 +2527,7 @@ misp.direct_call(relative_path, body) $syncFilteringRules = $this->Server->getAvailableSyncFilteringRules($this->Auth->user()); return $this->RestResponse->viewData($syncFilteringRules); } + + public function openapi() { + } } diff --git a/app/Controller/SightingsController.php b/app/Controller/SightingsController.php index 401551a6d..d89d3632c 100644 --- a/app/Controller/SightingsController.php +++ b/app/Controller/SightingsController.php @@ -15,9 +15,9 @@ class SightingsController extends AppController } public $paginate = array( - 'limit' => 60, - 'maxLimit' => 9999, // LATER we will bump here on a problem once we have more than 9999 events <- no we won't, this is the max a user van view/page. - 'order' => array('Sighting.date_sighting' => 'DESC'), + 'limit' => 60, + 'maxLimit' => 9999, // LATER we will bump here on a problem once we have more than 9999 events <- no we won't, this is the max a user van view/page. + 'order' => array('Sighting.date_sighting' => 'DESC'), ); // takes an attribute ID or UUID @@ -78,9 +78,9 @@ class SightingsController extends AppController if ($this->request->is('ajax')) { if ($error) { $error_message = 'Could not add the Sighting. Reason: ' . $error; - return new CakeResponse(array('body'=> json_encode(array('saved' => false, 'errors' => $error_message)), 'status' => 200, 'type' => 'json')); + return new CakeResponse(array('body' => json_encode(array('saved' => false, 'errors' => $error_message)), 'status' => 200, 'type' => 'json')); } else { - return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'success' => $result . ' ' . $this->Sighting->type[$type] . (($result == 1) ? '' : 's') . ' added.')), 'status' => 200, 'type' => 'json')); + return new CakeResponse(array('body' => json_encode(array('saved' => true, 'success' => $result . ' ' . $this->Sighting->type[$type] . (($result == 1) ? '' : 's') . ' added.')), 'status' => 200, 'type' => 'json')); } } else { if ($error) { @@ -147,7 +147,7 @@ class SightingsController extends AppController $this->render('/Sightings/ajax/advanced'); } - public function quickAdd($id=false, $type=1, $onvalue=false) + public function quickAdd($id = false, $type = 1, $onvalue = false) { if (!$this->userRole['perm_modify_org']) { throw new MethodNotAllowedException(__('You are not authorised to remove sightings data as you don\'t have permission to modify your organisation\'s data.')); @@ -174,7 +174,7 @@ class SightingsController extends AppController } } else { if (!isset($id)) { - return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'errors' => __('Invalid request.'))), 'status' => 200, 'type' => 'json')); + return new CakeResponse(array('body' => json_encode(array('saved' => true, 'errors' => __('Invalid request.'))), 'status' => 200, 'type' => 'json')); } else { if ($onvalue) { $result = $this->Sighting->add(); @@ -183,9 +183,9 @@ class SightingsController extends AppController } if ($result) { - return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'success' => __('Sighting added.'))), 'status' => 200, 'type' => 'json')); + return new CakeResponse(array('body' => json_encode(array('saved' => true, 'success' => __('Sighting added.'))), 'status' => 200, 'type' => 'json')); } else { - return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'errors' => __('Sighting could not be added'))), 'status' => 200, 'type' => 'json')); + return new CakeResponse(array('body' => json_encode(array('saved' => true, 'errors' => __('Sighting could not be added'))), 'status' => 200, 'type' => 'json')); } } } @@ -204,20 +204,20 @@ class SightingsController extends AppController $this->render('ajax/quickDeleteConfirmationForm'); } else { if (!isset($id)) { - return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'errors' => 'Invalid request.')), 'status' => 200, 'type' => 'json')); + return new CakeResponse(array('body' => json_encode(array('saved' => true, 'errors' => 'Invalid request.')), 'status' => 200, 'type' => 'json')); } else { $sighting = $this->Sighting->find('first', array('conditions' => array('Sighting.id' => $id), 'recursive' => -1)); if (empty($sighting)) { - return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'errors' => 'Invalid sighting.')), 'status' => 200, 'type' => 'json')); + return new CakeResponse(array('body' => json_encode(array('saved' => true, 'errors' => 'Invalid sighting.')), 'status' => 200, 'type' => 'json')); } if (!$this->_isSiteAdmin() && $sighting['Sighting']['org_id'] != $this->Auth->user('org_id')) { - return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'errors' => 'Invalid sighting.')), 'status' => 200, 'type' => 'json')); + return new CakeResponse(array('body' => json_encode(array('saved' => true, 'errors' => 'Invalid sighting.')), 'status' => 200, 'type' => 'json')); } $result = $this->Sighting->delete($id); if ($result) { - return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'success' => 'Sighting deleted.')), 'status' => 200, 'type' => 'json')); + return new CakeResponse(array('body' => json_encode(array('saved' => true, 'success' => 'Sighting deleted.')), 'status' => 200, 'type' => 'json')); } else { - return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'errors' => 'Sighting could not be deleted')), 'status' => 200, 'type' => 'json')); + return new CakeResponse(array('body' => json_encode(array('saved' => true, 'errors' => 'Sighting could not be deleted')), 'status' => 200, 'type' => 'json')); } } } @@ -259,7 +259,7 @@ class SightingsController extends AppController $sightingConditions = array('Sighting.event_id' => $eventid); } $sightedEvents = $this->Sighting->find('list', array( - 'group' => 'Sighting.event_id', + 'group' => ['Sighting.id', 'Sighting.event_id'], 'fields' => array('Sighting.event_id'), 'conditions' => $sightingConditions )); diff --git a/app/Lib/Tools/SecurityAudit.php b/app/Lib/Tools/SecurityAudit.php index dd036c321..577563f53 100644 --- a/app/Lib/Tools/SecurityAudit.php +++ b/app/Lib/Tools/SecurityAudit.php @@ -373,7 +373,7 @@ class SecurityAudit if ($diffDays > 300) { $output['System'][] = [ 'warning', - __('Kernel build time was s days ago. This usually means that the system kernel is not updated.', $diffDays), + __('Kernel build time was %s days ago. This usually means that the system kernel is not updated.', $diffDays), ]; } } diff --git a/app/Model/AppModel.php b/app/Model/AppModel.php index e007ef595..2a1738f27 100644 --- a/app/Model/AppModel.php +++ b/app/Model/AppModel.php @@ -90,7 +90,7 @@ class AppModel extends Model 51 => false, 52 => false, 53 => false, 54 => false, 55 => false, 56 => false, 57 => false, 58 => false, 59 => false, 60 => false, 61 => false, 62 => false, 63 => true, 64 => false, 65 => false, 66 => false, 67 => false, 68 => false, - 69 => false, + 69 => false, 70 => false, ); public $advanced_updates_description = array( @@ -1600,6 +1600,9 @@ class AppModel extends Model INDEX `model_id` (`model_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;"; break; + case 70: + $sqlArray[] = "ALTER TABLE `galaxies` ADD `enabled` tinyint(1) NOT NULL DEFAULT 1 AFTER `namespace`;"; + break; case 'fixNonEmptySharingGroupID': $sqlArray[] = 'UPDATE `events` SET `sharing_group_id` = 0 WHERE `distribution` != 4;'; $sqlArray[] = 'UPDATE `attributes` SET `sharing_group_id` = 0 WHERE `distribution` != 4;'; diff --git a/app/Model/Attribute.php b/app/Model/Attribute.php index b71e59e10..c3798e51e 100644 --- a/app/Model/Attribute.php +++ b/app/Model/Attribute.php @@ -3628,6 +3628,13 @@ class Attribute extends AppModel if (!empty($parentEvent)) { $params['parentEvent'] = $parentEvent; } + if (!empty($attribute['SharingGroup'])) { + $attribute['sharing_group_id'] = $this->SharingGroup->captureSG($attribute['SharingGroup'], $user); + } elseif (!empty($attribute['sharing_group_id'])) { + if (!$this->SharingGroup->checkIfAuthorised($user, $attribute['sharing_group_id'])) { + unset($attribute['sharing_group_id']); + } + } if (!$this->save($attribute, $params)) { $attribute_short = (isset($attribute['category']) ? $attribute['category'] : 'N/A') . '/' . (isset($attribute['type']) ? $attribute['type'] : 'N/A') . ' ' . (isset($attribute['value']) ? $attribute['value'] : 'N/A'); $log->create(); diff --git a/app/Model/Event.php b/app/Model/Event.php index df6c9d241..112bdb73e 100755 --- a/app/Model/Event.php +++ b/app/Model/Event.php @@ -1004,17 +1004,28 @@ class Event extends AppModel private function __prepareForPushToServer($event, $server) { if ($event['Event']['distribution'] == 4) { - if (!empty($event['SharingGroup']['SharingGroupServer'])) { - $found = false; - foreach ($event['SharingGroup']['SharingGroupServer'] as $sgs) { - if ($sgs['server_id'] == $server['Server']['id']) { - $found = true; + if (empty($event['SharingGroup']['SharingGroup']['roaming']) && empty($server['Server']['internal'])) { + $serverFound = false; + if (!empty($event['SharingGroup']['SharingGroupServer'])) { + foreach ($event['SharingGroup']['SharingGroupServer'] as $sgs) { + if ($sgs['server_id'] == $server['Server']['id']) { + $serverFound = true; + } } } - if (!$found) { + if (!$serverFound) { return 403; } - } else if (empty($event['SharingGroup']['roaming'])) { + } + $orgFound = false; + if (!empty($event['SharingGroup']['SharingGroupOrg'])) { + foreach ($event['SharingGroup']['SharingGroupOrg'] as $org) { + if (isset($org['Organisation']) && $org['Organisation']['uuid'] === $server['RemoteOrg']['uuid']) { + $orgFound = true; + } + } + } + if (!$orgFound) { return 403; } } @@ -2992,9 +3003,20 @@ class Event extends AppModel public function set_filter_value(&$params, $conditions, $options, $keys = array('Attribute.value1', 'Attribute.value2')) { if (!empty($params['value'])) { + $valueParts = explode('|', $params['value'], 2); $params[$options['filter']] = $this->convert_filters($params[$options['filter']]); $conditions = $this->generic_add_filter($conditions, $params[$options['filter']], $keys); - + // Allows searching for ['value1' => [full, part1], 'value2' => [full, part2]] + if (count($valueParts) == 2) { + $convertedFilterVal1 = $this->convert_filters($valueParts[0]); + $convertedFilterVal2 = $this->convert_filters($valueParts[1]); + $conditionVal1 = $this->generic_add_filter([], $convertedFilterVal1, ['Attribute.value1'])['AND'][0]['OR']; + $conditionVal2 = $this->generic_add_filter([], $convertedFilterVal2, ['Attribute.value2'])['AND'][0]['OR']; + $tmpConditions = [ + 'AND' => [$conditionVal1, $conditionVal2] + ]; + $conditions['AND'][0]['OR']['OR']['AND'] = [$conditionVal1, $conditionVal2]; + } } return $conditions; } diff --git a/app/Model/GalaxyCluster.php b/app/Model/GalaxyCluster.php index fda10332d..93ce8abe9 100644 --- a/app/Model/GalaxyCluster.php +++ b/app/Model/GalaxyCluster.php @@ -602,7 +602,7 @@ class GalaxyCluster extends AppModel $this->GalaxyClusterRelation->GalaxyClusterRelationTag->deleteAll(['GalaxyClusterRelationTag.galaxy_cluster_relation_id' => $relation_ids], false, false); $this->Log = ClassRegistry::init('Log'); $this->Log->createLogEntry('SYSTEM', 'wipe_default', 'GalaxyCluster', 0, "Wiping default galaxy clusters"); - + } /** @@ -2133,4 +2133,44 @@ class GalaxyCluster extends AppModel ]); return empty($cluster['Tag']['id']) ? false : $cluster['Tag']['id']; } + + public function getCyCatRelations($cluster) + { + $CyCatRelations = []; + if (empty(Configure::read('Plugin.CyCat_enable'))) { + return $CyCatRelations; + } + App::uses('SyncTool', 'Tools'); + $cycatUrl = empty(Configure::read("Plugin.CyCat_url")) ? 'https://api.cycat.org': Configure::read("Plugin.CyCat_url"); + $syncTool = new SyncTool(); + if (empty($this->HttpSocket)) { + $this->HttpSocket = $syncTool->createHttpSocket(); + } + $request = array( + 'header' => array( + 'Accept' => array('application/json'), + 'MISP-version' => implode('.', $this->checkMISPVersion()), + 'MISP-uuid' => Configure::read('MISP.uuid'), + 'x-ground-truth' => 'Dogs are superior to cats' + ) + ); + $response = $this->HttpSocket->get($cycatUrl . '/lookup/' . $cluster['GalaxyCluster']['uuid'], array(), $request); + if ($response->code === '200') { + $response = $this->HttpSocket->get($cycatUrl . '/relationships/' . $cluster['GalaxyCluster']['uuid'], array(), $request); + if ($response->code === '200') { + $relationUUIDs = json_decode($response->body); + if (!empty($relationUUIDs)) { + foreach ($relationUUIDs as $relationUUID) { + $response = $this->HttpSocket->get($cycatUrl . '/lookup/' . $relationUUID, array(), $request); + if ($response->code === '200') { + $lookupResult = json_decode($response->body, true); + $lookupResult['uuid'] = $relationUUID; + $CyCatRelations[$relationUUID] = $lookupResult; + } + } + } + } + } + return $CyCatRelations; + } } diff --git a/app/Model/Organisation.php b/app/Model/Organisation.php index 8155efd56..6a84fe31e 100644 --- a/app/Model/Organisation.php +++ b/app/Model/Organisation.php @@ -98,7 +98,7 @@ class Organisation extends AppModel 'uuid' => '0', 'contacts' => '', 'local' => true, - 'restricted_to_domain' => '[]', + 'restricted_to_domain' => [], 'landingpage' => null ); diff --git a/app/Model/Role.php b/app/Model/Role.php index 394a1afa1..29e442fee 100644 --- a/app/Model/Role.php +++ b/app/Model/Role.php @@ -59,113 +59,6 @@ class Role extends AppModel 'publish' => 3 ); - // #TODO i18n? - public $permFlags = array( - 'perm_site_admin' => array( - 'id' => 'RolePermSiteAdmin', - 'text' => 'Site Admin', - 'readonlyenabled' => false, - 'title' => 'Unrestricted access to any data and functionality on this instance.' - ), - 'perm_admin' => array( - 'id' => 'RolePermAdmin', - 'text' => 'Org Admin', - 'readonlyenabled' => false, - 'title' => 'Limited organisation admin - create, manage users of their own organisation' - ), - 'perm_sync' => array( - 'id' => 'RolePermSync', - 'text' => 'Sync Actions', - 'readonlyenabled' => true, - 'title' => 'Synchronisation permission, can be used to connect two MISP instances create data on behalf of other users. Make sure that the role with this permission has also access to tagging and tag editing rights.' - ), - 'perm_audit' => array( - 'id' => 'RolePermAudit', - 'text' => 'Audit Actions', - 'readonlyenabled' => true, - 'title' => 'Access to the audit logs of the user\'s organisation.' - ), - 'perm_auth' => array( - 'id' => 'RolePermAuth', - 'text' => 'Auth key access', - 'readonlyenabled' => true, - 'title' => 'Users with this permission have access to authenticating via their Auth keys, granting them access to the API.', - 'site_admin_optional' => true - ), - 'perm_regexp_access' => array( - 'id' => 'RolePermRegexpAccess', - 'text' => 'Regex Actions', - 'readonlyenabled' => false, - 'title' => 'Users with this role can modify the regex rules affecting how data is fed into MISP. Make sure that caution is advised with handing out roles that include this permission, user controlled executed regexes are dangerous.' - ), - 'perm_tagger' => array( - 'id' => 'RolePermTagger', - 'text' => 'Tagger', - 'readonlyenabled' => false, - 'title' => 'Users with roles that include this permission can attach or detach existing tags to and from events/attributes.' - ), - 'perm_tag_editor' => array( - 'id' => 'RolePermTagEditor', - 'text' => 'Tag Editor', - 'readonlyenabled' => false, - 'title' => 'This permission gives users the ability to create tags.' - ), - 'perm_template' => array( - 'id' => 'RolePermTemplate', - 'text' => 'Template Editor', - 'readonlyenabled' => false, - 'title' => 'Create or modify templates, to be used when populating events.' - ), - 'perm_sharing_group' => array( - 'id' => 'RolePermSharingGroup', - 'text' => 'Sharing Group Editor', - 'readonlyenabled' => false, - 'title' => 'Permission to create or modify sharing groups.' - ), - 'perm_delegate' => array( - 'id' => 'RolePermDelegate', - 'text' => 'Delegations Access', - 'readonlyenabled' => false, - 'title' => 'Allow users to create delegation requests for their own org only events to trusted third parties.' - ), - 'perm_sighting' => array( - 'id' => 'RolePermSighting', - 'text' => 'Sighting Creator', - 'readonlyenabled' => true, - 'title' => 'Permits the user to push feedback on attributes into MISP by providing sightings.' - ), - 'perm_object_template' => array( - 'id' => 'RolePermObjectTemplate', - 'text' => 'Object Template Editor', - 'readonlyenabled' => false, - 'title' => 'Create or modify MISP Object templates' - ), - 'perm_galaxy_editor' => array( - 'id' => 'RolePermGalaxyEditor', - 'text' => 'Galaxy Editor', - 'readonlyenabled' => false, - 'title' => 'Create or modify MISP Galaxies and MISP Galaxies Clusters' - ), - 'perm_decaying' => array( - 'id' => 'RolePermDecaying', - 'text' => 'Decaying Model Editor', - 'readonlyenabled' => true, - 'title' => 'Create or modify MISP Decaying Models' - ), - 'perm_publish_zmq' => array( - 'id' => 'RolePermPublishZmq', - 'text' => 'ZMQ publisher', - 'readonlyenabled' => false, - 'title' => 'Allow users to publish data to the ZMQ pubsub channel via the publish event to ZMQ button.' - ), - 'perm_publish_kafka' => array( - 'id' => 'RolePermPublishKafka', - 'text' => 'Kafka publisher', - 'readonlyenabled' => false, - 'title' => 'Allow users to publish data to Kafka via the publish event to Kafka button.' - ) - ); - public $premissionLevelName = array('Read Only', 'Manage Own Events', 'Manage Organisation Events', 'Manage and Publish Organisation Events'); public function beforeSave($options = array()) @@ -307,4 +200,125 @@ class Role extends AppModel } return $suggestedRole; } + + public function __get($name) + { + if ($name === 'permFlags') { + $this->permFlags = $this->generatePermFlags(); + return $this->permFlags; + } + return parent::__get($name); + } + + /** + * @return array[] + */ + private function generatePermFlags() + { + return array( + 'perm_site_admin' => array( + 'id' => 'RolePermSiteAdmin', + 'text' => 'Site Admin', + 'readonlyenabled' => false, + 'title' => __('Unrestricted access to any data and functionality on this instance.') + ), + 'perm_admin' => array( + 'id' => 'RolePermAdmin', + 'text' => 'Org Admin', + 'readonlyenabled' => false, + 'title' => __('Limited organisation admin - create, manage users of their own organisation.') + ), + 'perm_sync' => array( + 'id' => 'RolePermSync', + 'text' => 'Sync Actions', + 'readonlyenabled' => true, + 'title' => __('Synchronisation permission, can be used to connect two MISP instances create data on behalf of other users. Make sure that the role with this permission has also access to tagging and tag editing rights.') + ), + 'perm_audit' => array( + 'id' => 'RolePermAudit', + 'text' => 'Audit Actions', + 'readonlyenabled' => true, + 'title' => __('Access to the audit logs of the user\'s organisation.') + ), + 'perm_auth' => array( + 'id' => 'RolePermAuth', + 'text' => 'Auth key access', + 'readonlyenabled' => true, + 'title' => __('Users with this permission have access to authenticating via their Auth keys, granting them access to the API.'), + 'site_admin_optional' => true + ), + 'perm_regexp_access' => array( + 'id' => 'RolePermRegexpAccess', + 'text' => 'Regex Actions', + 'readonlyenabled' => false, + 'title' => __('Users with this role can modify the regex rules affecting how data is fed into MISP. Make sure that caution is advised with handing out roles that include this permission, user controlled executed regexes are dangerous.') + ), + 'perm_tagger' => array( + 'id' => 'RolePermTagger', + 'text' => 'Tagger', + 'readonlyenabled' => false, + 'title' => __('Users with roles that include this permission can attach or detach existing tags to and from events/attributes.') + ), + 'perm_tag_editor' => array( + 'id' => 'RolePermTagEditor', + 'text' => 'Tag Editor', + 'readonlyenabled' => false, + 'title' => __('This permission gives users the ability to create tags.') + ), + 'perm_template' => array( + 'id' => 'RolePermTemplate', + 'text' => 'Template Editor', + 'readonlyenabled' => false, + 'title' => __('Create or modify templates, to be used when populating events.') + ), + 'perm_sharing_group' => array( + 'id' => 'RolePermSharingGroup', + 'text' => 'Sharing Group Editor', + 'readonlyenabled' => false, + 'title' => __('Permission to create or modify sharing groups.') + ), + 'perm_delegate' => array( + 'id' => 'RolePermDelegate', + 'text' => 'Delegations Access', + 'readonlyenabled' => false, + 'title' => __('Allow users to create delegation requests for their own org only events to trusted third parties.') + ), + 'perm_sighting' => array( + 'id' => 'RolePermSighting', + 'text' => 'Sighting Creator', + 'readonlyenabled' => true, + 'title' => __('Permits the user to push feedback on attributes into MISP by providing sightings.') + ), + 'perm_object_template' => array( + 'id' => 'RolePermObjectTemplate', + 'text' => 'Object Template Editor', + 'readonlyenabled' => false, + 'title' => __('Create or modify MISP Object templates.') + ), + 'perm_galaxy_editor' => array( + 'id' => 'RolePermGalaxyEditor', + 'text' => 'Galaxy Editor', + 'readonlyenabled' => false, + 'title' => __('Create or modify MISP Galaxies and MISP Galaxies Clusters.') + ), + 'perm_decaying' => array( + 'id' => 'RolePermDecaying', + 'text' => 'Decaying Model Editor', + 'readonlyenabled' => true, + 'title' => __('Create or modify MISP Decaying Models.') + ), + 'perm_publish_zmq' => array( + 'id' => 'RolePermPublishZmq', + 'text' => 'ZMQ publisher', + 'readonlyenabled' => false, + 'title' => __('Allow users to publish data to the ZMQ pubsub channel via the publish event to ZMQ button.') + ), + 'perm_publish_kafka' => array( + 'id' => 'RolePermPublishKafka', + 'text' => 'Kafka publisher', + 'readonlyenabled' => false, + 'title' => __('Allow users to publish data to Kafka via the publish event to Kafka button.'), + ), + ); + } } diff --git a/app/Model/Server.php b/app/Model/Server.php index 7c4182f6f..3367f93fa 100644 --- a/app/Model/Server.php +++ b/app/Model/Server.php @@ -165,7 +165,10 @@ class Server extends AppModel 'data' => array( 'PullAll' => 'MISP/app/Console/cake Server pullAll [user_id] [full|update]', 'Pull' => 'MISP/app/Console/cake Server pull [user_id] [server_id] [full|update]', + 'PushAll' => 'MISP/app/Console/cake Server pushAll [user_id]', 'Push' => 'MISP/app/Console/cake Server push [user_id] [server_id]', + 'Cache server' => 'MISP/app/Console/cake server cacheServer [user_id] [server_id]', + 'Cache all servers' => 'MISP/app/Console/cake server cacheServerAll [user_id]', 'Cache feeds for quick lookups' => 'MISP/app/Console/cake Server cacheFeed [user_id] [feed_id|all|csv|text|misp]', 'Fetch feeds as local data' => 'MISP/app/Console/cake Server fetchFeed [user_id] [feed_id|all|csv|text|misp]', 'Run enrichment' => 'MISP/app/Console/cake Event enrichment [user_id] [event_id] [json_encoded_module_list]', @@ -7013,7 +7016,25 @@ class Server extends AppModel 'test' => 'testForEmpty', 'type' => 'string', 'null' => true - ) + ), + 'CyCat_enable' => [ + 'level' => 1, + 'description' => __('Enable lookups for additional relations via CyCat.'), + 'value' => false, + 'errorMessage' => '', + 'test' => 'testBool', + 'type' => 'boolean', + 'null' => true + ], + 'CyCat_url' => [ + 'level' => 2, + 'description' => __('URL to use for CyCat lookups, if enabled.'), + 'value' => 'https://api.cycat.org', + 'errorMessage' => '', + 'test' => 'testForEmpty', + 'type' => 'string', + 'null' => true + ] ), 'debug' => array( 'level' => 0, diff --git a/app/Model/SharingGroup.php b/app/Model/SharingGroup.php index 950fa5971..7e3778f2d 100644 --- a/app/Model/SharingGroup.php +++ b/app/Model/SharingGroup.php @@ -533,7 +533,7 @@ class SharingGroup extends AppModel } } } - if ($conditional === false) { + if ($conditional === false && empty($server['Server']['internal'])) { return false; } } @@ -618,6 +618,7 @@ class SharingGroup extends AppModel if ($existingCaptureResult !== true) { return $existingCaptureResult; } + $sg_id = $existingSG['SharingGroup']['id']; $forceUpdate = true; } unset($sg['Organisation']); @@ -838,7 +839,7 @@ class SharingGroup extends AppModel $temp = $this->SharingGroupOrg->find('first', array( 'recursive' => -1, 'conditions' => array( - 'sharing_group_id' => $existingSG['SharingGroup']['id'], + 'sharing_group_id' => $sg_id, 'org_id' => $sg['SharingGroupOrg'][$k]['org_id'] ), )); @@ -891,7 +892,7 @@ class SharingGroup extends AppModel $temp = $this->SharingGroupServer->find('first', array( 'recursive' => -1, 'conditions' => array( - 'sharing_group_id' => $existingSG['SharingGroup']['id'], + 'sharing_group_id' => $sg_id, 'server_id' => $sg['SharingGroupServer'][$k]['server_id'] ), )); diff --git a/app/View/AuthKeys/index.ctp b/app/View/AuthKeys/index.ctp index 77c3ab45f..f1286b817 100644 --- a/app/View/AuthKeys/index.ctp +++ b/app/View/AuthKeys/index.ctp @@ -1,4 +1,7 @@ ' . __('Advanced auth keys are not enabled.') . ''; + } echo sprintf('', empty($ajax) ? ' class="index"' : ''); echo $this->element('genericElements/IndexTable/index_table', [ 'data' => [ diff --git a/app/View/Dashboards/update_settings.ctp b/app/View/Dashboards/update_settings.ctp new file mode 100644 index 000000000..0629f5bc5 --- /dev/null +++ b/app/View/Dashboards/update_settings.ctp @@ -0,0 +1,19 @@ +element('genericElements/Form/genericForm', array( + 'form' => $this->Form, + 'url' => 'updateSettings', + 'data' => array( + 'title' => __('Add Widget'), + 'model' => 'Dashboard', + 'fields' => array( + array( + 'field' => 'value', + ), + ), + 'submit' => array( + 'action' => 'updateSettings', + ), + ) + )); +?> diff --git a/app/View/Elements/Events/View/eventFilteringQueryBuilder.ctp b/app/View/Elements/Events/View/eventFilteringQueryBuilder.ctp index 72e21bd33..69af674db 100644 --- a/app/View/Elements/Events/View/eventFilteringQueryBuilder.ctp +++ b/app/View/Elements/Events/View/eventFilteringQueryBuilder.ctp @@ -101,9 +101,9 @@ function triggerEventFilteringTool(hide) { "id": "deleted", "label": "Deleted", "values": { - 0: "Both", - 1: "Deleted only", - 2: "Exclude deleted" + 0: "Exclude deleted", + 1: "Both", + 2: "Deleted only" } }, { @@ -314,7 +314,7 @@ function triggerEventFilteringTool(hide) { { field: 'deleted', id: 'deleted', - value: + value: }, diff --git a/app/View/Elements/eventattributetoolbar.ctp b/app/View/Elements/eventattributetoolbar.ctp index 736a68391..070e8dc86 100644 --- a/app/View/Elements/eventattributetoolbar.ctp +++ b/app/View/Elements/eventattributetoolbar.ctp @@ -1,4 +1,7 @@ passedArgs['correlation'])) { + $attributeFilter = 'correlation'; + } $simple_filter_data = array( array( 'id' => 'filter_all', @@ -32,8 +35,8 @@ 'title' => __('Only show correlating attributes'), 'text' => __('Correlation'), 'active' => $attributeFilter == 'correlation', - 'onClick' => 'filterAttributes', - 'onClickParams' => array('correlation', $event['Event']['id']) + 'onClick' => 'toggleBoolFilter', + 'onClickParams' => array($urlHere, 'correlation'), ); $simple_filter_data[] = array( 'id' => 'filter_warning', diff --git a/app/View/Elements/genericElements/SideMenu/side_menu.ctp b/app/View/Elements/genericElements/SideMenu/side_menu.ctp index df5734366..5b9c44bd7 100644 --- a/app/View/Elements/genericElements/SideMenu/side_menu.ctp +++ b/app/View/Elements/genericElements/SideMenu/side_menu.ctp @@ -440,6 +440,11 @@ $divider = $this->element('/genericElements/SideMenu/side_menu_divider'); 'url' => '/eventReports/edit/' . h($id), 'text' => __('Edit Event Report') )); + echo $this->element('/genericElements/SideMenu/side_menu_link', array( + 'url' => '/admin/audit_logs/index/model:EventReport/model_id:' . h($id), + 'text' => __('View report history'), + 'requirement' => Configure::read('MISP.log_new_audit') && $canAccess('auditLogs', 'admin_index'), + )); } break; @@ -1551,6 +1556,23 @@ $divider = $this->element('/genericElements/SideMenu/side_menu_divider'); )); } break; + + case 'api': + echo $this->element('/genericElements/SideMenu/side_menu_link', array( + 'element_id' => 'openapi', + 'url' => $baseurl . '/servers/openapi', + 'text' => __('OpenAPI') + )); + if ($isAclAdd) { + if ($canAccess('servers', 'rest')) { + echo $this->element('/genericElements/SideMenu/side_menu_link', array( + 'element_id' => 'rest', + 'url' => $baseurl . '/servers/rest', + 'text' => __('REST client') + )); + } + } + break; } ?> diff --git a/app/View/Elements/genericElements/accordion.ctp b/app/View/Elements/genericElements/accordion.ctp index 80491920f..1ffd5a296 100644 --- a/app/View/Elements/genericElements/accordion.ctp +++ b/app/View/Elements/genericElements/accordion.ctp @@ -13,7 +13,7 @@ ', h($elementId), h($elementId) . '-collapse', - h($title), + !empty($titleHTML) ? $titleHTML : h($title), !empty($allowFullscreen) ? '' : sprintf( '', h($title), diff --git a/app/View/Elements/global_menu.ctp b/app/View/Elements/global_menu.ctp index 7a05cf6a4..14ef1bdaf 100755 --- a/app/View/Elements/global_menu.ctp +++ b/app/View/Elements/global_menu.ctp @@ -33,11 +33,6 @@ 'text' => __('Search Attributes'), 'url' => $baseurl . '/attributes/search' ), - array( - 'text' => __('REST client'), - 'url' => $baseurl . '/servers/rest', - 'requirement' => $canAccess('servers', 'rest'), - ), array( 'type' => 'separator' ), @@ -476,6 +471,21 @@ 'url' => $baseurl . '/admin/logs/search' ) ) + ), + array( + 'type' => 'root', + 'text' => __('API'), + 'children' => array( + array( + 'text' => __('OpenAPI'), + 'url' => $baseurl . '/servers/openapi' + ), + array( + 'text' => __('REST client'), + 'url' => $baseurl . '/servers/rest', + 'requirement' => $canAccess('servers', 'rest') + ) + ) ) ); $menu_right = array( diff --git a/app/View/Errors/error403.ctp b/app/View/Errors/error403.ctp index f6d53d84b..2d4bcc2f0 100644 --- a/app/View/Errors/error403.ctp +++ b/app/View/Errors/error403.ctp @@ -1,7 +1,9 @@

+

- : - + : +

+
diff --git a/app/View/Events/automation.ctp b/app/View/Events/automation.ctp index 936ec07e9..8564c7ea9 100644 --- a/app/View/Events/automation.ctp +++ b/app/View/Events/automation.ctp @@ -3,6 +3,7 @@ ?>

+

here.', $baseurl . '/servers/openapi');?>


REST client to test your API queries against your MISP and export the resulting tuned queries as curl or python scripts.');?> diff --git a/app/View/Galaxies/index.ctp b/app/View/Galaxies/index.ctp index ab6b0bc10..4c516c1af 100644 --- a/app/View/Galaxies/index.ctp +++ b/app/View/Galaxies/index.ctp @@ -5,6 +5,26 @@ 'data' => $galaxyList, 'top_bar' => array( 'children' => array( + array( + 'type' => 'simple', + 'children' => array( + array( + 'url' => $baseurl . '/galaxies/index', + 'text' => __('All'), + 'active' => !isset($passedArgsArray['enabled']), + ), + array( + 'url' => $baseurl . '/galaxies/index/enabled:1', + 'text' => __('Enabled'), + 'active' => isset($passedArgsArray['enabled']) && $passedArgsArray['enabled'] === "1", + ), + array( + 'url' => $baseurl . '/galaxies/index/enabled:0', + 'text' => __('Disabled'), + 'active' => isset($passedArgsArray['enabled']) && $passedArgsArray['enabled'] === "0", + ) + ) + ), array( 'type' => 'search', 'button' => __('Filter'), @@ -52,7 +72,14 @@ array( 'name' => __('Description'), 'data_path' => 'Galaxy.description', - ) + ), + array( + 'name' => __('Enabled'), + 'element' => 'boolean', + 'sort' => 'enabled', + 'class' => 'short', + 'data_path' => 'Galaxy.enabled', + ), ), 'title' => __('Galaxy index'), 'actions' => array( @@ -64,6 +91,42 @@ 'icon' => 'eye', 'dbclickAction' => true ), + array( + 'title' => __('Enable'), + 'icon' => 'play', + 'postLink' => true, + 'url' => $baseurl . '/galaxies/enable', + 'url_params_data_paths' => ['Galaxy.id'], + 'postLinkConfirm' => __('Are you sure you want to enable this galaxy library?'), + 'complex_requirement' => array( + 'function' => function ($row, $options) use ($isSiteAdmin) { + return $isSiteAdmin && !$options['datapath']['enabled']; + }, + 'options' => array( + 'datapath' => array( + 'enabled' => 'Galaxy.enabled' + ) + ) + ), + ), + array( + 'title' => __('Disable'), + 'icon' => 'stop', + 'postLink' => true, + 'url' => $baseurl . '/galaxies/disable', + 'url_params_data_paths' => ['Galaxy.id'], + 'postLinkConfirm' => __('Are you sure you want to disable this galaxy library?'), + 'complex_requirement' => array( + 'function' => function ($row, $options) use ($isSiteAdmin) { + return $isSiteAdmin && $options['datapath']['enabled']; + }, + 'options' => array( + 'datapath' => array( + 'enabled' => 'Galaxy.enabled' + ) + ) + ), + ), array( 'url' => '/galaxies/delete', 'url_params_data_paths' => array( diff --git a/app/View/GalaxyClusters/cluster_cycatrelations.ctp b/app/View/GalaxyClusters/cluster_cycatrelations.ctp new file mode 100644 index 000000000..0b11978d7 --- /dev/null +++ b/app/View/GalaxyClusters/cluster_cycatrelations.ctp @@ -0,0 +1,34 @@ +element('/genericElements/IndexTable/index_table', [ + 'data' => [ + 'skip_pagination' => true, + 'data' => $CyCatRelations, + 'fields' => [ + [ + 'name' => __('UUID'), + 'class' => 'short', + 'data_path' => 'uuid', + 'element' => 'links', + 'url_params_data_paths' => 'uuid', + 'url' => $cycatUrl . '/lookup' + ], + [ + 'name' => __('MITRE CTI Name'), + 'class' => 'short', + 'data_path' => 'mitre-cti:name', + ], + [ + 'name' => __('MITRE CTI Type'), + 'class' => 'short', + 'data_path' => 'mitre-cti:type', + ], + [ + 'name' => __('MITRE CTI Description'), + 'data_path' => 'mitre-cti:description', + ], + ], + ] + ]); + echo $CyCatRelationsTable; +?> diff --git a/app/View/GalaxyClusters/view.ctp b/app/View/GalaxyClusters/view.ctp index f7d869b04..21ebc6021 100755 --- a/app/View/GalaxyClusters/view.ctp +++ b/app/View/GalaxyClusters/view.ctp @@ -102,6 +102,21 @@ if (!empty($extendedByHtml)) {

+ ', + 'https://cycat.org/', + __('CyCAT or the CYbersecurity Resource CATalogue aims at mapping and documenting, in a single formalism and catalogue all the available cybersecurity tools, rules, playbooks, processes and controls.'), + $baseurl . '/img/CyCat.ico' + ); + echo $this->element('/genericElements/accordion', [ + 'title' => 'CyCat Relationships', + 'titleHTML' => $titleHTML, + 'url' => '/galaxy_clusters/viewCyCatRelations/' . $cluster['GalaxyCluster']['id'] + ]); + } + ?>
element('genericElements/assetLoader', array( diff --git a/app/View/Noticelists/view.ctp b/app/View/Noticelists/view.ctp index 6558ed56f..969e5a6c6 100644 --- a/app/View/Noticelists/view.ctp +++ b/app/View/Noticelists/view.ctp @@ -5,7 +5,7 @@ $fields = array(); foreach ($field_names as $field_name) { if ($field_name == 'ref' || $field_name == 'geographical_area') { - $value = json_decode($noticelist['Noticelist'][$field_name]); + $value = $noticelist['Noticelist'][$field_name]; foreach ($value as $k => $v) { if ($field_name == 'ref') { $value[$k] = '' . h($v) . ''; diff --git a/app/View/Servers/openapi.ctp b/app/View/Servers/openapi.ctp new file mode 100644 index 000000000..006d405d3 --- /dev/null +++ b/app/View/Servers/openapi.ctp @@ -0,0 +1,13 @@ +element('genericElements/assetLoader', array( + 'js' => array('redoc.standalone') + )); +?> +
+ diff --git a/app/View/Servers/rest.ctp b/app/View/Servers/rest.ctp index 61d86edc6..4bc5a623f 100644 --- a/app/View/Servers/rest.ctp +++ b/app/View/Servers/rest.ctp @@ -189,7 +189,7 @@ element('/genericElements/SideMenu/side_menu', array('menuList' => 'event-collection', 'menuItem' => 'rest')); + echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'api', 'menuItem' => 'rest')); echo $this->element('genericElements/assetLoader', array( 'js' => array( 'moment.min', diff --git a/app/View/Users/login.ctp b/app/View/Users/login.ctp index 603f5a735..10c102c92 100644 --- a/app/View/Users/login.ctp +++ b/app/View/Users/login.ctp @@ -19,7 +19,7 @@ - + __('Id'), 'value' => $data['id']), + array('key' => __('ID'), 'value' => $data['id']), array('key' => __('Name'), 'value' => $data['name']), array('key' => __('Description'), 'value' => $data['description']), array('key' => __('Version'), 'value' => $data['version']), array('key' => __('Type'), 'value' => $data['type']), - array('key' => __('Accepted attribute types'), 'value' => $text), + array('key' => __('Accepted attribute types'), 'value' => implode(', ', $types)), array( 'key' => __('Enabled'), 'boolean' => $data['enabled'], @@ -26,24 +22,14 @@ ), ); echo sprintf( - '
%s

%s

%s
%s', + '
%s

%s

%s
', sprintf( '

%s

%s', h(strtoupper($warninglist['Warninglist']['name'])), $this->element('genericElements/viewMetaTable', array('table_data' => $table_data)) ), __('Values'), - implode('
', array_column($warninglist['WarninglistEntry'], 'value')), - $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'warninglist', 'menuItem' => 'view')) + implode('
', array_column($warninglist['WarninglistEntry'], 'value')) ); + echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'warninglist', 'menuItem' => 'view')); -?> - diff --git a/app/webroot/doc/openapi.yaml b/app/webroot/doc/openapi.yaml new file mode 100644 index 000000000..424e4fa97 --- /dev/null +++ b/app/webroot/doc/openapi.yaml @@ -0,0 +1,7306 @@ +openapi: 3.0.0 +info: + version: 2.4.142 + title: MISP Automation API + description: | + + ### Getting Started + Automation functionality is designed to automatically generate signatures for intrusion detection systems. + To enable signature generation for a given attribute, Signature field of this attribute must be set to Yes. + Note that not all attribute types are applicable for signature generation, currently we only support NIDS signature + generation for IP, domains, host names, user agents etc., and hash list generation for MD5/SHA1 values of file artefacts. + Support for more attribute types is planned. To make this functionality available for automated tools an authentication + key is used. This makes it easier for your tools to access the data without further form-based-authentication. + The [API](https://www.circl.lu/doc/misp/GLOSSARY.html#api) key can be found and managed under My Profile page (/users/view/me) + on a MISP instance. + + #### Accept and Content-Type headers + When performing your request, depending on the type of request, you might need to explicitly specify in what content + type you want to get your results. This is done by setting one of the below `Accept` headers: + + Accept: application/json + Accept: application/xml + + When submitting data in a `POST`, `PUT` or `DELETE` operation you also need to specify in what content-type you encoded the payload. + This is done by setting one of the below `Content-Type` headers: + + Content-Type: application/json + Content-Type: application/xml + + Example: + ``` + curl --header "Authorization: YOUR_API_KEY" \ + --header "Accept: application/json" \ + --header "Content-Type: application/json" https:/// + ``` + + > **NOTE**: By appending .json or .xml the content type can also be set without the need for a header. + + #### Automation using PyMISP + + [PyMISP](https://github.com/MISP/PyMISP) is a Python library to access MISP platforms via their REST [API](https://www.circl.lu/doc/misp/GLOSSARY.html#api). + It allows you to fetch events, add or update events/attributes, add or update samples or search for attributes. + + ### FAQ + * [Dev FAQ](https://www.circl.lu/doc/misp/dev-faq/) + * [GitHub project FAQ](https://github.com/MISP/MISP/wiki/Frequently-Asked-Questions) + +servers: + - url: / +tags: + - name: Attributes + description: "Attributes in MISP can be network indicators (e.g. IP address), system indicators (e.g. a string in memory) or even bank account details." + externalDocs: + url: https://www.circl.lu/doc/misp/GLOSSARY.html#misp-attribute + - name: Events + description: "MISP events are encapsulations for contextually related information represented as attributes and objects." + externalDocs: + url: https://www.circl.lu/doc/misp/GLOSSARY.html#misp-event + - name: Galaxies + description: "Galaxies in MISP are a method used to express a large object called cluster that can be attached to MISP events or attributes." + externalDocs: + url: https://www.circl.lu/doc/misp/galaxy/ + - name: GalaxyClusters + description: "A galaxy cluster that can be attached to MISP events or attributes." + externalDocs: + url: https://www.circl.lu/doc/misp/galaxy/ + - name: Users + description: "As an admin (not to be confused with Org Admin), you can set up new accounts for users, edit user profiles, delete them, or just have a look at all the viewers' profiles." + externalDocs: + url: https://www.circl.lu/doc/misp/administration/#users + - name: Organisations + description: "Each users belongs to an organisation. As admin, you can manage these organisations." + externalDocs: + url: https://www.circl.lu/doc/misp/administration/#organisations + - name: Servers + description: "Servers represent MISP instances we are connected to and from which we can pull/push data from/to." + externalDocs: + url: https://www.circl.lu/doc/misp/sharing/ + - name: Sharing Groups + description: "Sharing groups in MISP are a more granular way to create re-usable distribution lists for events/attributes that allow users to include organisations from their own instance (local organisations) as well as organisations from directly, or indirectly connected instances (external organisations)." + externalDocs: + url: https://www.circl.lu/doc/misp/sharing/#sharing-groups + - name: Feeds + description: "Feeds are remote or local resources containing indicators that can be automatically imported into MISP at regular intervals. Feeds can be structured in [MISP format](https://www.circl.lu/doc/misp/GLOSSARY.html#misp-format), CSV format or even free-text format." + externalDocs: + url: https://www.circl.lu/doc/misp/managing-feeds/#feeds + - name: Objects + description: "MISP objects are in addition to MISP attributes to allow advanced combinations and concatenation of attributes. The creation of these objects and their associated attributes are based on real cyber security use-cases and existing practices in information sharing." + externalDocs: + url: https://www.circl.lu/doc/misp/misp-objects/ + - name: Tags + description: "" + externalDocs: + url: https://www.circl.lu/doc/misp/quick-start/#tags-and-taglist + - name: Sightings + description: "Sightings is a system allowing people to react on attributes on an event. It was originally designed to provide an easy method for user to tell when they see a given attribute, giving it more credibility." + externalDocs: + url: https://www.circl.lu/doc/misp/sightings/ + - name: Warninglists + description: "MISP warninglists are lists of well-known indicators that can be associated to potential false positives, errors or mistakes." + externalDocs: + url: https://www.circl.lu/doc/misp/warninglists/ + - name: Noticelists + description: "Notice lists to inform MISP users of the legal, privacy, policy or even technical implications of using specific attributes, categories or objects." + externalDocs: + url: https://www.circl.lu/doc/misp/noticelists/ + +paths: + /attributes/add/{eventId}: + post: + summary: "Add an attribute" + operationId: addAttribute + tags: + - Attributes + parameters: + - $ref: "#/components/parameters/eventIdParameter" + requestBody: + $ref: "#/components/requestBodies/AddAttributeRequest" + responses: + "200": + $ref: "#/components/responses/AttributeResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /attributes/edit/{attributeId}: + put: + summary: "Edit an attribute" + operationId: editAttribute + tags: + - Attributes + parameters: + - $ref: "#/components/parameters/attributeIdParameter" + requestBody: + $ref: "#/components/requestBodies/EditAttributeRequest" + responses: + "200": + $ref: "#/components/responses/AttributeResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /attributes/delete/{attributeId}: + delete: + summary: "Delete an attribute" + operationId: deleteAttribute + tags: + - Attributes + parameters: + - $ref: "#/components/parameters/attributeIdParameter" + responses: + "200": + $ref: "#/components/responses/DeleteAttributeResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /attributes/restore/{attributeId}: + post: + summary: "Restore an attribute" + operationId: restoreAttribute + tags: + - Attributes + parameters: + - $ref: "#/components/parameters/attributeIdParameter" + responses: + "200": + $ref: "#/components/responses/AttributeResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /attributes/addTag/{attributeId}/{tagId}: + post: + summary: "Add a tag to an attribute" + operationId: tagAttribute + tags: + - Attributes + parameters: + - $ref: "#/components/parameters/attributeIdParameter" + - $ref: "#/components/parameters/tagIdParameter" + responses: + "200": + $ref: "#/components/responses/AddAttributeTagResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /attributes/removeTag/{attributeId}/{tagId}: + post: + summary: "Remove a tag from an attribute" + operationId: untagAttribute + tags: + - Attributes + parameters: + - $ref: "#/components/parameters/attributeIdParameter" + - $ref: "#/components/parameters/tagIdParameter" + responses: + "200": + $ref: "#/components/responses/RemoveAttributeTagResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /attributes: + get: + summary: "Get a list of attributes" + operationId: getAttributes + tags: + - Attributes + responses: + "200": + $ref: "#/components/responses/AttributeListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /attributes/view/{attributeId}: + get: + summary: "Get an attribute by ID" + operationId: getAttributeById + tags: + - Attributes + parameters: + - $ref: "#/components/parameters/attributeIdParameter" + responses: + "200": + $ref: "#/components/responses/AttributeResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /attributes/restSearch: + post: + summary: "Get a filtered and paginated list of attributes" + operationId: restSearchAttributes + tags: + - Attributes + parameters: + - $ref: "#/components/parameters/returnFormatParameter" + requestBody: + $ref: "#/components/requestBodies/RestSearchAttributesRequest" + responses: + "200": + $ref: "#/components/responses/AttributesRestSearchResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /attributes/attributeStatistics/{context}/{percentage}: + get: + summary: "Get a filtered and paginated list of attributes" + operationId: getAttributeStatistics + tags: + - Attributes + parameters: + - $ref: "#/components/parameters/attributeStatisticsContextParameter" + - $ref: "#/components/parameters/attributeStatisticsPercentageParameter" + responses: + "200": + $ref: "#/components/responses/AttributeStatisticsResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /attributes/describeTypes: + get: + summary: "Get a list of the available attribute types" + operationId: describeAttributeTypes + tags: + - Attributes + responses: + "200": + $ref: "#/components/responses/DescribeAttributeTypesResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /events/add: + post: + summary: "Add event" + operationId: addEvent + tags: + - Events + requestBody: + $ref: "#/components/requestBodies/AddEventRequest" + responses: + "200": + $ref: "#/components/responses/AddEventResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /events/edit/{eventId}: + put: + summary: "Edit event" + operationId: editEvent + tags: + - Events + parameters: + - $ref: "#/components/parameters/eventIdParameter" + requestBody: + $ref: "#/components/requestBodies/EditEventRequest" + responses: + "200": + $ref: "#/components/responses/EditEventResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /events/delete/{eventId}: + delete: + summary: "Delete event" + operationId: deleteEvent + tags: + - Events + parameters: + - $ref: "#/components/parameters/eventIdParameter" + responses: + "200": + $ref: "#/components/responses/DeleteEventResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /events: + get: + summary: "Get a list of events" + operationId: getEvents + tags: + - Events + responses: + "200": + $ref: "#/components/responses/ExtendedEventListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /events/index: + post: + summary: "Search events" + operationId: searchEvents + tags: + - Events + requestBody: + $ref: "#/components/requestBodies/SearchEventRequest" + responses: + "200": + $ref: "#/components/responses/ExtendedEventListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /events/view/{eventId}: + get: + summary: "Get event by ID" + operationId: getEventById + tags: + - Events + parameters: + - $ref: "#/components/parameters/eventIdParameter" + responses: + "200": + $ref: "#/components/responses/ExtendedEventResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /events/restSearch: + post: + summary: "Get a filtered and paginated list of events" + operationId: restSearchEvents + tags: + - Events + parameters: + - $ref: "#/components/parameters/returnFormatParameter" + requestBody: + $ref: "#/components/requestBodies/RestSearchEventsRequest" + responses: + "200": + $ref: "#/components/responses/EventsRestSearchResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /events/publish/{eventId}: + post: + summary: "Publish an event" + operationId: publishEvent + tags: + - Events + parameters: + - $ref: "#/components/parameters/eventIdParameter" + responses: + "200": + $ref: "#/components/responses/PublishEventResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /events/unpublish/{eventId}: + post: + summary: "Unpublish an event" + operationId: unpublishEvent + tags: + - Events + parameters: + - $ref: "#/components/parameters/eventIdParameter" + responses: + "200": + $ref: "#/components/responses/UnpublishEventResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /events/addTag/{eventId}/{tagId}: + post: + summary: "Add event tag" + operationId: tagEvent + tags: + - Events + parameters: + - $ref: "#/components/parameters/eventIdParameter" + - $ref: "#/components/parameters/tagIdParameter" + responses: + "200": + $ref: "#/components/responses/AddEventTagResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /events/removeTag/{eventId}/{tagId}: + post: + summary: "Remove event tag" + operationId: untagEvent + tags: + - Events + parameters: + - $ref: "#/components/parameters/eventIdParameter" + - $ref: "#/components/parameters/tagIdParameter" + responses: + "200": + $ref: "#/components/responses/RemoveEventTagResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /galaxies: + get: + summary: "Get galaxies" + operationId: getGalaxies + tags: + - Galaxies + responses: + "200": + $ref: "#/components/responses/GalaxyListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + post: + summary: "Search galaxies" + operationId: searchGalaxies + tags: + - Galaxies + requestBody: + $ref: "#/components/requestBodies/SearchGalaxyRequest" + responses: + "200": + $ref: "#/components/responses/GalaxyListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /galaxies/view/{galaxyId}: + get: + summary: "Get galaxy by ID" + operationId: getGalaxyById + tags: + - Galaxies + parameters: + - $ref: "#/components/parameters/galaxyIdParameter" + responses: + "200": + $ref: "#/components/responses/ExtendedGalaxyResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /galaxies/update: + post: + summary: "Force update the galaxies with the galaxy json definitions" + operationId: updateGalaxies + tags: + - Galaxies + responses: + "200": + $ref: "#/components/responses/UpdateGalaxiesResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /galaxies/delete/{galaxyId}: + delete: + summary: "Delete a galaxy" + operationId: deleteGalaxy + tags: + - Galaxies + parameters: + - $ref: "#/components/parameters/galaxyIdParameter" + responses: + "200": + $ref: "#/components/responses/DeleteGalaxyResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /galaxies/import: + post: + summary: "Import a galaxy cluster" + operationId: importGalaxyCluster + tags: + - Galaxies + requestBody: + $ref: "#/components/requestBodies/ImportGalaxyClusterRequest" + responses: + "200": + $ref: "#/components/responses/ImportGalaxyClusterResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /galaxies/export/{galaxyId}: + post: + summary: "Export galaxy clusters" + operationId: exportGalaxyClusters + tags: + - Galaxies + parameters: + - $ref: "#/components/parameters/galaxyIdParameter" + requestBody: + $ref: "#/components/requestBodies/ExportGalaxyClusterRequest" + responses: + "200": + $ref: "#/components/responses/ExportGalaxyClustersResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /galaxies/attachCluster/{attachTargetId}/{attachTargetType}: + post: + summary: "Attach the galaxy cluster tag a given entity" + operationId: attachGalaxyCluster + tags: + - Galaxies + parameters: + - $ref: "#/components/parameters/attachTargetIdParameter" + - $ref: "#/components/parameters/attachTargetTypeParameter" + requestBody: + $ref: "#/components/requestBodies/AttachGalaxyClusterRequest" + responses: + "200": + $ref: "#/components/responses/AttachGalaxyClusterResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /galaxy_clusters/add/{galaxyId}: + post: + summary: "Add galaxy cluster" + operationId: addGalaxyCluster + tags: + - GalaxyClusters + parameters: + - $ref: "#/components/parameters/galaxyIdParameter" + requestBody: + $ref: "#/components/requestBodies/AddGalaxyClusterRequest" + responses: + "200": + $ref: "#/components/responses/GalaxyClusterResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /galaxy_clusters/edit/{galaxyClusterId}: + put: + summary: "Edit galaxy cluster" + operationId: editGalaxyCluster + tags: + - GalaxyClusters + parameters: + - $ref: "#/components/parameters/galaxyClusterIdParameter" + requestBody: + $ref: "#/components/requestBodies/EditGalaxyClusterRequest" + responses: + "200": + $ref: "#/components/responses/GalaxyClusterResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /galaxy_clusters/index/{galaxyId}: + get: + summary: "Get galaxy clusters" + operationId: getGalaxyClusters + tags: + - GalaxyClusters + parameters: + - $ref: "#/components/parameters/galaxyIdParameter" + responses: + "200": + $ref: "#/components/responses/GalaxyClusterListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + post: + summary: "Search galaxy clusters" + operationId: searchGalaxyClusters + tags: + - GalaxyClusters + parameters: + - $ref: "#/components/parameters/galaxyIdParameter" + requestBody: + $ref: "#/components/requestBodies/SearchGalaxyClustersRequest" + responses: + "200": + $ref: "#/components/responses/GalaxyClusterListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /galaxy_clusters/view/{galaxyClusterId}: + get: + summary: "Get galaxy cluster by ID" + operationId: getGalaxyClusterById + tags: + - GalaxyClusters + parameters: + - $ref: "#/components/parameters/galaxyClusterIdParameter" + responses: + "200": + $ref: "#/components/responses/ExtendedGalaxyClusterResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /galaxy_clusters/publish/{galaxyClusterId}: + post: + summary: "Publish galaxy cluster" + operationId: publishGalaxyCluster + tags: + - GalaxyClusters + parameters: + - $ref: "#/components/parameters/galaxyClusterIdParameter" + responses: + "200": + $ref: "#/components/responses/PublishGalaxyClusterResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /galaxy_clusters/unpublish/{galaxyClusterId}: + post: + summary: "Unpublish galaxy cluster" + operationId: unpublishGalaxyCluster + tags: + - GalaxyClusters + parameters: + - $ref: "#/components/parameters/galaxyClusterIdParameter" + responses: + "200": + $ref: "#/components/responses/UnpublishGalaxyClusterResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /galaxy_clusters/delete/{galaxyClusterId}: + post: + summary: "Delete galaxy cluster" + operationId: deleteGalaxyCluster + tags: + - GalaxyClusters + parameters: + - $ref: "#/components/parameters/galaxyClusterIdParameter" + responses: + "200": + $ref: "#/components/responses/DeleteGalaxyClusterResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /galaxy_clusters/restore/{galaxyClusterId}: + post: + summary: "Restore galaxy cluster" + operationId: restoreGalaxyCluster + tags: + - GalaxyClusters + parameters: + - $ref: "#/components/parameters/galaxyClusterIdParameter" + responses: + "200": + $ref: "#/components/responses/RestoreGalaxyClusterResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /users/initiatePasswordReset/{userId}/{firstTimeReset}: + post: + summary: "Reset user password" + operationId: resetUserPassword + tags: + - Users + parameters: + - $ref: "#/components/parameters/userIdParameter" + - $ref: "#/components/parameters/firstTimeResetParameter" + responses: + "200": + $ref: "#/components/responses/ResetUserPasswordResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /admin/users/add: + post: + summary: "Add user" + operationId: addUser + tags: + - Users + requestBody: + $ref: "#/components/requestBodies/AddUserRequest" + responses: + "200": + $ref: "#/components/responses/UserResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /admin/users/edit/{userId}: + put: + summary: "Edit user" + operationId: editUser + tags: + - Users + parameters: + - $ref: "#/components/parameters/userIdParameter" + requestBody: + $ref: "#/components/requestBodies/EditUserRequest" + responses: + "200": + $ref: "#/components/responses/UserResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /admin/users/delete/{userId}: + delete: + summary: "Delete user" + operationId: deleteUser + tags: + - Users + parameters: + - $ref: "#/components/parameters/userIdParameter" + responses: + "200": + $ref: "#/components/responses/DeleteUserResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /admin/users: + get: + summary: "Get users" + operationId: getUsers + tags: + - Users + responses: + "200": + $ref: "#/components/responses/UserListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /admin/users/view/{userId}: + get: + summary: "Get user by ID" + operationId: getUserById + tags: + - Users + parameters: + - $ref: "#/components/parameters/userIdParameter" + responses: + "200": + $ref: "#/components/responses/ExtendedUserResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /admin/organisations/add: + post: + summary: "Add organisation" + operationId: addOrganisation + tags: + - Organisations + requestBody: + $ref: "#/components/requestBodies/AddOrganisationRequest" + responses: + "200": + $ref: "#/components/responses/OrganisationResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /admin/organisations/edit/{organisationId}: + put: + summary: "Edit organisation" + operationId: editOrganisation + tags: + - Organisations + parameters: + - $ref: "#/components/parameters/organisationIdParameter" + requestBody: + $ref: "#/components/requestBodies/EditOrganisationRequest" + responses: + "200": + $ref: "#/components/responses/OrganisationResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /admin/organisations/delete/{organisationId}: + delete: + summary: "Delete organisation" + operationId: deleteOrganisation + tags: + - Organisations + parameters: + - $ref: "#/components/parameters/organisationIdParameter" + responses: + "200": + $ref: "#/components/responses/DeleteOrganisationResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /organisations: + get: + summary: "Get organisations" + operationId: getOrganisations + tags: + - Organisations + responses: + "200": + $ref: "#/components/responses/OrganisationListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /organisations/view/{organisationId}: + get: + summary: "Get organisation by ID" + operationId: getOrganisationById + tags: + - Organisations + parameters: + - $ref: "#/components/parameters/organisationIdParameter" + responses: + "200": + $ref: "#/components/responses/OrganisationResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/add: + post: + summary: "Add server" + operationId: addServer + tags: + - Servers + responses: + "200": + $ref: "#/components/responses/ServerResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/edit/{serverId}: + put: + summary: "Edit server" + operationId: editServer + tags: + - Servers + parameters: + - $ref: "#/components/parameters/serverIdParameter" + responses: + "200": + $ref: "#/components/responses/ServerResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/delete/{serverId}: + post: + summary: "Delete server" + operationId: deleteServer + tags: + - Servers + parameters: + - $ref: "#/components/parameters/serverIdParameter" + responses: + "200": + $ref: "#/components/responses/DeleteServerResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers: + get: + summary: "Get servers" + operationId: getServers + tags: + - Servers + responses: + "200": + $ref: "#/components/responses/ServerListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/pull/{serverId}/{pullTechnique}: + get: + summary: "Pull server" + operationId: pullServer + tags: + - Servers + parameters: + - $ref: "#/components/parameters/serverIdParameter" + - $ref: "#/components/parameters/pullTechniqueParameter" + responses: + "200": + $ref: "#/components/responses/PullServerResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/push/{serverId}/{pushTechnique}: + get: + summary: "Push server" + operationId: pushServer + tags: + - Servers + parameters: + - $ref: "#/components/parameters/serverIdParameter" + - $ref: "#/components/parameters/pushTechniqueParameter" + responses: + "200": + $ref: "#/components/responses/PushServerResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/getVersion: + get: + summary: "Get current instance version" + operationId: getServerVersion + tags: + - Servers + responses: + "200": + $ref: "#/components/responses/ServerVersionResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/getPyMISPVersion: + get: + summary: "Get current instance PyMISP version" + operationId: getPyMISPVersion + tags: + - Servers + responses: + "200": + $ref: "#/components/responses/ServerPyMISPVersionResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/serverSettings: + get: + summary: "Get current instance settings and diagnostics" + operationId: getServerSettings + tags: + - Servers + responses: + "200": + $ref: "#/components/responses/ServerSettingsResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/getWorkers: + get: + summary: "Get workers" + operationId: getWorkers + tags: + - Servers + responses: + "200": + $ref: "#/components/responses/GetWorkersResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/startWorker/{workerType}: + post: + summary: "Start worker" + operationId: startWorker + tags: + - Servers + parameters: + - $ref: "#/components/parameters/workerTypeParameter" + responses: + "200": + $ref: "#/components/responses/StartWorkerResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/stopWorker/{workerPid}: + post: + summary: "Stop worker" + operationId: stopWorker + tags: + - Servers + parameters: + - $ref: "#/components/parameters/workerPidParameter" + responses: + "200": + $ref: "#/components/responses/StopWorkerResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/killAllWorkers: + post: + summary: "Kill all workers" + operationId: killAllWorkers + tags: + - Servers + responses: + "200": + $ref: "#/components/responses/KillAllWorkersResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/restartWorkers: + post: + summary: "Restart workers" + operationId: restartWorkers + tags: + - Servers + responses: + "200": + $ref: "#/components/responses/RestartWorkersResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/restartDeadWorkers: + post: + summary: "Restart dead workers" + operationId: restartDeadWorkers + tags: + - Servers + responses: + "200": + $ref: "#/components/responses/RestartDeadWorkersResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/update: + post: + summary: "Update server" + operationId: updateServer + tags: + - Servers + responses: + "200": + $ref: "#/components/responses/UpdateServerResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/cache: + post: + summary: "Cache server" + operationId: cacheServer + tags: + - Servers + responses: + "200": + $ref: "#/components/responses/CacheServerResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/createSync: + post: + summary: "Create sync" + operationId: createSync + tags: + - Servers + responses: + "200": + $ref: "#/components/responses/CreateSyncResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/getInstanceUUID: + get: + summary: "Get instance UUID" + operationId: getServerUuid + tags: + - Servers + responses: + "200": + $ref: "#/components/responses/GetInstanceUUIDResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/getSetting/{settingName}: + get: + summary: "Get server setting by name" + operationId: getServerSetting + tags: + - Servers + parameters: + - $ref: "#/components/parameters/settingNameParameter" + responses: + "200": + $ref: "#/components/responses/GetServerSettingResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/serverSettingsEdit/{settingName}: + post: + summary: "Edit server setting" + operationId: editServerSetting + tags: + - Servers + parameters: + - $ref: "#/components/parameters/settingNameParameter" + requestBody: + $ref: "#/components/requestBodies/EditServerSettingRequest" + responses: + "200": + $ref: "#/components/responses/EditServerSettingResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /servers/import: + post: + summary: "Import server" + operationId: importServer + tags: + - Servers + requestBody: + $ref: "#/components/requestBodies/ImportServerRequest" + responses: + "200": + $ref: "#/components/responses/ServerResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /sharing_groups/add: + post: + summary: "Add a sharing group" + operationId: addSharingGroup + tags: + - Sharing Groups + requestBody: + $ref: "#/components/requestBodies/AddSharingGroupRequest" + responses: + "200": + $ref: "#/components/responses/SharingGroupResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /sharing_groups/edit/{sharingGroupId}: + post: + summary: "Edit a sharing group" + operationId: editSharingGroup + tags: + - Sharing Groups + parameters: + - $ref: "#/components/parameters/sharingGroupIdParameter" + requestBody: + $ref: "#/components/requestBodies/EditSharingGroupRequest" + responses: + "200": + $ref: "#/components/responses/SharingGroupResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /sharing_groups/delete/{sharingGroupId}: + delete: + summary: "Delete a sharing group" + operationId: deleteSharingGroup + tags: + - Sharing Groups + parameters: + - $ref: "#/components/parameters/sharingGroupIdParameter" + responses: + "200": + $ref: "#/components/responses/DeleteSharingGroupResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /sharing_groups: + get: + summary: "Get a list of sharing groups" + operationId: getSharingGroup + tags: + - Sharing Groups + responses: + "200": + $ref: "#/components/responses/SharingGroupListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /sharing_groups/view/{sharingGroupId}: + get: + summary: "Get a sharing group by ID" + operationId: getSharingGroupById + tags: + - Sharing Groups + parameters: + - $ref: "#/components/parameters/sharingGroupIdParameter" + responses: + "200": + $ref: "#/components/responses/SharingGroupResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /sharing_groups/addOrg/{sharingGroupId}/{organisationId}: + post: + summary: "Add an organisation to a sharing group" + operationId: addOrganisationToSharingGroup + tags: + - Sharing Groups + parameters: + - $ref: "#/components/parameters/sharingGroupIdParameter" + - $ref: "#/components/parameters/organisationIdParameter" + responses: + "200": + $ref: "#/components/responses/AddOrganisationToSharingGroupResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /sharing_groups/removeOrg/{sharingGroupId}/{organisationId}: + post: + summary: "Remove an organisation from a sharing group" + operationId: removeOrganisationFromSharingGroup + tags: + - Sharing Groups + parameters: + - $ref: "#/components/parameters/sharingGroupIdParameter" + - $ref: "#/components/parameters/organisationIdParameter" + responses: + "200": + $ref: "#/components/responses/RemoveOrganisationFromSharingGroupResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /sharing_groups/addServer/{sharingGroupId}/{serverId}: + post: + summary: "Add a server to a sharing group" + operationId: addServerToSharingGroup + tags: + - Sharing Groups + parameters: + - $ref: "#/components/parameters/sharingGroupIdParameter" + - $ref: "#/components/parameters/serverIdParameter" + responses: + "200": + $ref: "#/components/responses/AddServerToSharingGroupResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /sharing_groups/removeServer/{sharingGroupId}/{serverId}: + post: + summary: "Remove a server from a sharing group" + operationId: removeServerFromSharingGroup + tags: + - Sharing Groups + parameters: + - $ref: "#/components/parameters/sharingGroupIdParameter" + - $ref: "#/components/parameters/serverIdParameter" + responses: + "200": + $ref: "#/components/responses/RemoveServerFromSharingGroupResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /feeds: + get: + summary: "Get a list of feeds" + operationId: getFeeds + tags: + - Feeds + responses: + "200": + $ref: "#/components/responses/FeedListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /feeds/view/{feedId}: + get: + summary: "Get a feed by ID" + operationId: getFeedById + tags: + - Feeds + parameters: + - $ref: "#/components/parameters/feedIdParameter" + responses: + "200": + $ref: "#/components/responses/FeedResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /feeds/add: + post: + summary: "Add a feed" + operationId: addFeed + tags: + - Feeds + requestBody: + $ref: "#/components/requestBodies/AddFeedRequest" + responses: + "200": + $ref: "#/components/responses/FeedResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /feeds/edit/{feedId}: + put: + summary: "Edit a feed" + operationId: editFeed + tags: + - Feeds + parameters: + - $ref: "#/components/parameters/feedIdParameter" + requestBody: + $ref: "#/components/requestBodies/EditFeedRequest" + responses: + "200": + $ref: "#/components/responses/FeedResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /feeds/enable/{feedId}: + post: + summary: "Enable feed" + operationId: enableFeed + tags: + - Feeds + parameters: + - $ref: "#/components/parameters/feedIdParameter" + responses: + "200": + $ref: "#/components/responses/EnableFeedResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /feeds/disable/{feedId}: + post: + summary: "Disable feed" + operationId: disableFeed + tags: + - Feeds + parameters: + - $ref: "#/components/parameters/feedIdParameter" + responses: + "200": + $ref: "#/components/responses/DisableFeedResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /feeds/cacheFeeds/{cacheFeedsScope}: + post: + summary: "Cache feeds" + operationId: cacheFeeds + tags: + - Feeds + parameters: + - $ref: "#/components/parameters/cacheFeedsScopeParameter" + responses: + "200": + $ref: "#/components/responses/CacheFeedsResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /feeds/fetchFromFeed/{feedId}: + post: + summary: "Fetch from feed by ID" + operationId: fetchFromFeed + tags: + - Feeds + parameters: + - $ref: "#/components/parameters/feedIdParameter" + responses: + "200": + $ref: "#/components/responses/FetchFromFeedResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /feeds/fetchFromAllFeeds: + post: + summary: "Fetch from all feeds" + operationId: fetchFromAllFeeds + tags: + - Feeds + responses: + "200": + $ref: "#/components/responses/FetchFromAllFeedsResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /warninglists: + get: + summary: "Get a list of warninglists" + operationId: getWarninglists + tags: + - Warninglists + responses: + "200": + $ref: "#/components/responses/WarninglistListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + post: + summary: "Search warninglists" + operationId: searchWarninglists + tags: + - Warninglists + requestBody: + $ref: "#/components/requestBodies/WarninglistsSearchRequest" + responses: + "200": + $ref: "#/components/responses/WarninglistListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /warninglists/toggleEnable: + post: + summary: "Enable/disable warninglists" + operationId: toggleEnableWarninglist + tags: + - Warninglists + requestBody: + $ref: "#/components/requestBodies/WarninglistsToggleEnableRequest" + responses: + "200": + $ref: "#/components/responses/WarninglistToggleEnabledResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /warninglists/view/{warninglistId}: + get: + summary: "Get warninglist by ID" + operationId: getWarninglistById + tags: + - Warninglists + parameters: + - $ref: "#/components/parameters/warninglistIdParameter" + responses: + "200": + $ref: "#/components/responses/WarninglistResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /warninglists/checkValue: + post: + summary: "Check if a list of values matches any warninglists" + operationId: checkValueWarninglistsMatches + tags: + - Warninglists + requestBody: + $ref: "#/components/requestBodies/WarninglistCheckValuesRequest" + responses: + "200": + $ref: "#/components/responses/WarninglistMatchListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /warninglists/update: + post: + summary: "Update warninglists" + operationId: updateWarninglists + tags: + - Warninglists + responses: + "200": + $ref: "#/components/responses/UpdateWarninglistsResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /noticelists: + get: + summary: "Get a list of noticelists" + operationId: getNoticelists + tags: + - Noticelists + responses: + "200": + $ref: "#/components/responses/NoticelistListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /noticelists/view/{noticelistId}: + get: + summary: "Get a noticelist by ID" + operationId: getNoticelistById + tags: + - Noticelists + parameters: + - $ref: "#/components/parameters/noticelistIdParameter" + responses: + "200": + $ref: "#/components/responses/NoticelistResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /noticelists/toggleEnable: + post: + summary: "Enable/disable noticelist" + operationId: toggleEnableNoticelist + tags: + - Noticelists + requestBody: + $ref: "#/components/requestBodies/ToggleEnableNoticelistRequest" + responses: + "200": + $ref: "#/components/responses/NoticelistToggleEnableResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /noticelists/update: + post: + summary: "Update noticelists" + operationId: updateNoticelists + tags: + - Noticelists + responses: + "200": + $ref: "#/components/responses/UpdateNoticelistsResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /objects/add/{eventId}/{objectTemplateId}: + post: + summary: "Add an object to an event" + operationId: addObject + tags: + - Objects + parameters: + - $ref: "#/components/parameters/eventIdParameter" + - $ref: "#/components/parameters/objectTemplateIdParameter" + requestBody: + $ref: "#/components/requestBodies/AddObjectRequest" + responses: + "200": + $ref: "#/components/responses/ObjectResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /objects/view/{objectId}: + get: + summary: "Get object by ID" + operationId: getObjectById + tags: + - Objects + parameters: + - $ref: "#/components/parameters/objectIdParameter" + responses: + "200": + $ref: "#/components/responses/ExtendedObjectResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /objects/delete/{objectId}/{hardDelete}: + delete: + summary: "Delete object" + operationId: deleteObject + tags: + - Objects + parameters: + - $ref: "#/components/parameters/objectIdParameter" + - $ref: "#/components/parameters/hardDeleteParameter" + responses: + "200": + $ref: "#/components/responses/DeleteObjectResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /sightings/index/{eventId}: + get: + summary: "Get sightings by event ID" + operationId: getSightingsByEventId + tags: + - Sightings + parameters: + - $ref: "#/components/parameters/eventIdParameter" + responses: + "200": + $ref: "#/components/responses/SightingListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /sightings/add/{attributeId}: + post: + summary: "Add sighting of an attribute" + operationId: addSighting + tags: + - Sightings + parameters: + - $ref: "#/components/parameters/attributeIdParameter" + responses: + "200": + $ref: "#/components/responses/SightingResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /sightings/delete/{sightingId}: + post: + summary: "Delete sighting" + operationId: deleteSighting + tags: + - Sightings + parameters: + - $ref: "#/components/parameters/sightingIdParameter" + responses: + "200": + $ref: "#/components/responses/DeleteSightingResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /tags: + get: + summary: "Get tags" + operationId: getTags + tags: + - Tags + responses: + "200": + $ref: "#/components/responses/TagListResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /tags/view/{tagId}: + get: + summary: "Get tag by ID" + operationId: getTagById + tags: + - Tags + parameters: + - $ref: "#/components/parameters/tagIdParameter" + responses: + "200": + $ref: "#/components/responses/TagResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /tags/add: + post: + summary: "Add tag" + operationId: addTag + tags: + - Tags + requestBody: + $ref: "#/components/requestBodies/AddTagRequest" + responses: + "200": + $ref: "#/components/responses/TagResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /tags/delete/{tagId}: + post: + summary: "Delete tag" + operationId: deleteTag + tags: + - Tags + parameters: + - $ref: "#/components/parameters/tagIdParameter" + responses: + "200": + $ref: "#/components/responses/DeleteTagResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /tags/edit/{tagId}: + post: + summary: "Edit tag" + operationId: editTag + tags: + - Tags + parameters: + - $ref: "#/components/parameters/tagIdParameter" + requestBody: + $ref: "#/components/requestBodies/EditTagRequest" + responses: + "200": + $ref: "#/components/responses/EditTagResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + + /tags/search/{tagSearchTerm}: + get: + summary: "Search tag" + operationId: searchTag + tags: + - Tags + parameters: + - $ref: "#/components/parameters/tagSearchTermParameter" + responses: + "200": + $ref: "#/components/responses/SearchTagResponse" + "403": + $ref: "#/components/responses/UnauthorizedApiErrorResponse" + "404": + $ref: "#/components/responses/NotFoundApiErrorResponse" + default: + $ref: "#/components/responses/ApiErrorResponse" + +components: + schemas: + # Attributes + AttributeId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + AttributeType: + type: string + maxLength: 100 + example: "ip-src" + + AttributeValue: + type: string + maxLength: 131071 + example: "127.0.0.1" + + AttributeCategory: + type: string + maxLength: 255 + example: "Payload delivery" + + AttributeComment: + type: string + maxLength: 65535 + example: "logged source ip" + + AttributeEventUUID: + $ref: "#/components/schemas/UUID" + + AttributeAttachment: + description: "base64 representation of the attachment" + type: string + format: byte + + AttributeNoId: + type: object + properties: + event_id: + $ref: "#/components/schemas/EventId" + object_id: + $ref: "#/components/schemas/ObjectId" + object_relation: + nullable: true + $ref: "#/components/schemas/NullableObjectRelation" + category: + $ref: "#/components/schemas/AttributeCategory" + type: + $ref: "#/components/schemas/AttributeType" + value: + $ref: "#/components/schemas/AttributeValue" + to_ids: + $ref: "#/components/schemas/ToIDS" + uuid: + $ref: "#/components/schemas/UUID" + timestamp: + $ref: "#/components/schemas/NullableTimestamp" + distribution: + $ref: "#/components/schemas/DistributionLevelId" + sharing_group_id: + $ref: "#/components/schemas/SharingGroupId" + comment: + $ref: "#/components/schemas/AttributeComment" + deleted: + $ref: "#/components/schemas/SoftDeletedFlag" + disable_correlation: + $ref: "#/components/schemas/DisableCorrelationFlag" + first_seen: + $ref: "#/components/schemas/NullableMicroTimestamp" + last_seen: + $ref: "#/components/schemas/NullableMicroTimestamp" + + Attribute: + allOf: + - type: object + properties: + id: + $ref: "#/components/schemas/AttributeId" + - $ref: "#/components/schemas/AttributeNoId" + + ExtendedAttribute: + allOf: + - $ref: "#/components/schemas/Attribute" + - type: object + properties: + data: + $ref: "#/components/schemas/AttributeAttachment" + event_uuid: + nullable: true + $ref: "#/components/schemas/UUID" + decay_score: + nullable: true + $ref: "#/components/schemas/DecayScoreList" + + AttributeList: + type: array + items: + $ref: "#/components/schemas/Attribute" + + AttributeRestSearchListItem: + allOf: + - $ref: "#/components/schemas/ExtendedAttribute" + - type: object + properties: + Event: + $ref: "#/components/schemas/Event" + Object: + $ref: "#/components/schemas/Object" + Tag: + $ref: "#/components/schemas/TagList" + + AttributeRestSearchList: + type: array + items: + $ref: "#/components/schemas/AttributeRestSearchListItem" + + AttributeStatisticsResponse: + description: Dictionary of attribute types/categories showing the ammount of occurences/percentage. + type: object + example: + - "Antivirus detection": "10" + - "Artifacts dropped": "20" + + DescribeAttributeTypesResponse: + description: "Lists available attribute types, default categories and category-type mappings." + type: object + properties: + sane_defaults: + type: object + example: + md5: + default_category: "Payload delivery" + to_ids: 1 + pdb: + default_category: "Artifacts dropped" + to_ids: 0 + types: + type: array + items: + $ref: "#/components/schemas/AttributeType" + categories: + type: array + items: + $ref: "#/components/schemas/AttributeCategory" + category_type_mappings: + type: object + example: + "Internal reference": + - "text" + - "link" + - "comment" + - "other" + "Antivirus detection": + - "link" + - "comment" + - "text" + - "hex" + - "other" + + # Decay Models + DecayingModelParameters: + type: object + properties: + lifetime: + type: number + format: float + example: 3 + decay_speed: + type: number + format: float + example: 2.3 + threshold: + type: number + format: float + example: 30 + default_base_score: + type: number + format: float + example: 80 + base_score_config: + type: object + example: + estimative-language:confidence-in-analytic-judgment: 0.25 + estimative-language:likelihood-probability: 0.25 + phishing:psychological-acceptability: 0.25 + phishing:state: 0.20 + + DecayingModel: + type: object + properties: + id: + type: string + format: int32 + maxLength: 10 + example: "12345" + name: + type: string + maxLength: 255 + example: "Phishing model" + + FullDecayingModel: + description: "Present if the `includeFullModel` flag was set to *true* in the rest search request" + type: object + properties: + id: + type: string + format: int32 + maxLength: 10 + example: "12345" + uuid: + $ref: "#/components/schemas/UUID" + name: + type: string + maxLength: 255 + example: "Phishing model" + description: + type: string + maxLength: 65535 + example: "Simple model to rapidly decay phishing website." + parameters: + $ref: "#/components/schemas/DecayingModelParameters" + attribute_types: + type: array + items: + $ref: "#/components/schemas/AttributeType" + org_id: + $ref: "#/components/schemas/OrganisationId" + enabled: + type: boolean + all_orgs: + type: boolean + ref: + type: array + items: + type: string + example: "https://arxiv.org/abs/1902.03914" + formula: + type: string + enum: + - Polynomial + version: + type: string + example: "2" + default: + type: boolean + isEditable: + type: boolean + + DecayScore: + type: object + properties: + score: + type: number + format: float + example: 10.5 + base_score: + type: number + format: float + example: 80 + decayed: + type: boolean + DecayingModel: + oneOf: + - $ref: "#/components/schemas/DecayingModel" + - $ref: "#/components/schemas/FullDecayingModel" + + DecayScoreList: + type: array + items: + $ref: "#/components/schemas/DecayScore" + + # Events + EventId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + EventInfo: + type: string + maxLength: 65535 + example: "logged source ip" + + EventAttributeCount: + type: string + format: int64 + example: "321" + + EventProposalEmailLock: + type: boolean + + EventOrganisation: + type: object + properties: + id: + $ref: "#/components/schemas/OrganisationId" + name: + $ref: "#/components/schemas/OrganisationName" + uuid: + $ref: "#/components/schemas/UUID" + + EventTagId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + EventTag: + type: object + properties: + id: + $ref: "#/components/schemas/EventTagId" + event_id: + $ref: "#/components/schemas/EventId" + tag_id: + $ref: "#/components/schemas/TagId" + local: + $ref: "#/components/schemas/IsLocal" + Tag: + $ref: "#/components/schemas/Tag" + + EventTagList: + type: array + items: + $ref: "#/components/schemas/EventTag" + + EventReport: # TODO: describe + type: object + + EventNoId: + type: object + properties: + org_id: + $ref: "#/components/schemas/OrganisationId" + distribution: + $ref: "#/components/schemas/DistributionLevelId" + info: + $ref: "#/components/schemas/EventInfo" + orgc_id: + $ref: "#/components/schemas/OrganisationId" + uuid: + $ref: "#/components/schemas/UUID" + published: + $ref: "#/components/schemas/PublishedFlag" + analysis: + $ref: "#/components/schemas/AnalysisLevelId" + attribute_count: + $ref: "#/components/schemas/EventAttributeCount" + timestamp: + $ref: "#/components/schemas/NullableTimestamp" + sharing_group_id: + $ref: "#/components/schemas/SharingGroupId" + proposal_email_lock: + $ref: "#/components/schemas/EventProposalEmailLock" + locked: + $ref: "#/components/schemas/IsLocked" + threat_level_id: + $ref: "#/components/schemas/ThreatLevelId" + publish_timestamp: + $ref: "#/components/schemas/Timestamp" + sighting_timestamp: + $ref: "#/components/schemas/Timestamp" + disable_correlation: + $ref: "#/components/schemas/DisableCorrelationFlag" + extends_uuid: + $ref: "#/components/schemas/ExtendsUUID" + + Event: + allOf: + - type: object + properties: + id: + $ref: "#/components/schemas/EventId" + - $ref: "#/components/schemas/EventNoId" + + ExtendedEvent: + allOf: + - $ref: "#/components/schemas/Event" + - type: object + properties: + Org: + $ref: "#/components/schemas/EventOrganisation" + Orgc: + $ref: "#/components/schemas/EventOrganisation" + Attribute: + $ref: "#/components/schemas/AttributeList" + ShadowAttribute: + $ref: "#/components/schemas/AttributeList" + RelatedEvent: + type: array + items: + type: object + properties: + Event: + $ref: "#/components/schemas/ExtendedEvent" + EventTag: + $ref: "#/components/schemas/EventTagList" + required: + - Org + - Orgc + + CreatedEvent: + type: object + properties: + Event: + allOf: + - $ref: "#/components/schemas/ExtendedEvent" + - type: object + properties: + event_creator_email: + type: string + format: email + Galaxy: + type: array + items: + $ref: "#/components/schemas/Galaxy" + Object: + type: array + items: + $ref: "#/components/schemas/Object" + EventReport: + type: array + items: + $ref: "#/components/schemas/EventReport" + + UpdatedEvent: + type: object + properties: + Event: + allOf: + - $ref: "#/components/schemas/ExtendedEvent" + - type: object + properties: + event_creator_email: + type: string + format: email + Galaxy: + type: array + items: + $ref: "#/components/schemas/Galaxy" + Object: + type: array + items: + $ref: "#/components/schemas/Object" + EventReport: + type: array + items: + $ref: "#/components/schemas/EventReport" + Tag: + type: array + items: + $ref: "#/components/schemas/Tag" + + SlimEvent: + type: object + properties: + id: + $ref: "#/components/schemas/EventId" + timestamp: + $ref: "#/components/schemas/Timestamp" + sighting_timestamp: + $ref: "#/components/schemas/Timestamp" + published: + $ref: "#/components/schemas/PublishedFlag" + uuid: + $ref: "#/components/schemas/UUID" + orgc_uuid: + $ref: "#/components/schemas/UUID" + required: + - id + - timestamp + - sighting_timestamp + - published + - uuid + - orgc_uuid + + EventList: + type: array + items: + $ref: "#/components/schemas/Event" + + ExtendedEventList: + type: array + items: + $ref: "#/components/schemas/ExtendedEvent" + + SlimEventList: + type: array + items: + $ref: "#/components/schemas/SlimEvent" + + EventRestSearchList: + type: array + items: + type: object + properties: + Event: + type: object + allOf: + - $ref: "#/components/schemas/ExtendedEvent" + - type: object + properties: + Event: + $ref: "#/components/schemas/SlimEvent" + + # Objects + ObjectId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + ObjectName: + type: string + maxLength: 131071 + example: "ail-leak" + + ObjectMetaCategory: + type: string + + ObjectDescription: + type: string + + ObjectTemplateVersion: + type: string + format: int32 + example: "1" + + ObjectRelation: + type: string + maxLength: 255 + example: "sensor" + + NullableObjectRelation: + nullable: true + type: string + maxLength: 255 + example: "sensor" + + Object: + type: object + properties: + id: + $ref: "#/components/schemas/ObjectId" + name: + $ref: "#/components/schemas/ObjectName" + meta-category: + $ref: "#/components/schemas/ObjectMetaCategory" + description: + $ref: "#/components/schemas/ObjectDescription" + template_uuid: + $ref: "#/components/schemas/UUID" + template_version: + $ref: "#/components/schemas/ObjectTemplateVersion" + event_id: + $ref: "#/components/schemas/EventId" + uuid: + $ref: "#/components/schemas/UUID" + timestamp: + $ref: "#/components/schemas/Timestamp" + distribution: + $ref: "#/components/schemas/DistributionLevelId" + sharing_group_id: + $ref: "#/components/schemas/SharingGroupId" + comment: + type: string + deleted: + type: boolean + first_seen: + $ref: "#/components/schemas/NullableMicroTimestamp" + last_seen: + $ref: "#/components/schemas/NullableMicroTimestamp" + Attribute: + type: array + items: + $ref: "#/components/schemas/Attribute" + + ExtendedObject: + allOf: + - $ref: "#/components/schemas/Object" + - type: object + properties: + Event: + type: object + properties: + id: + $ref: "#/components/schemas/EventId" + info: + $ref: "#/components/schemas/EventInfo" + org_id: + $ref: "#/components/schemas/OrganisationId" + orgc_id: + $ref: "#/components/schemas/OrganisationId" + + ObjectTemplateId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + # Sightings + SightingId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + Sighting: + type: object + properties: + id: + $ref: "#/components/schemas/SightingId" + attribute_id: + $ref: "#/components/schemas/AttributeId" + event_id: + $ref: "#/components/schemas/EventId" + org_id: + $ref: "#/components/schemas/OrganisationId" + date_sighting: + $ref: "#/components/schemas/Timestamp" + uuid: + $ref: "#/components/schemas/UUID" + source: + type: string + type: + type: string + attribute_uuid: + $ref: "#/components/schemas/UUID" + Organisation: + type: object + properties: + id: + $ref: "#/components/schemas/OrganisationId" + uuid: + $ref: "#/components/schemas/UUID" + name: + $ref: "#/components/schemas/OrganisationName" + + # Galaxies + GalaxyId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + GalaxyName: + type: string + maxLength: 255 + example: "Ransomware" + + GalaxyType: + type: string + maxLength: 255 + example: "ransomware" + + GalaxyDescription: + type: string + maxLength: 65535 + example: "Ransomware galaxy based on ..." + + GalaxyVersion: + type: string + maxLength: 255 + example: "1" + + GalaxyNamespace: + type: string + maxLength: 255 + example: "misp" + + Galaxy: + type: object + properties: + id: + $ref: "#/components/schemas/GalaxyId" + uuid: + $ref: "#/components/schemas/UUID" + name: + $ref: "#/components/schemas/GalaxyName" + type: + $ref: "#/components/schemas/GalaxyType" + description: + $ref: "#/components/schemas/GalaxyDescription" + version: + $ref: "#/components/schemas/GalaxyVersion" + icon: + $ref: "#/components/schemas/Icon" + namespace: + $ref: "#/components/schemas/GalaxyNamespace" + kill_chain_order: + type: object + nullable: true + example: + fraud-tactics: + - "Initiation" + - "Target Compromise" + - "Perform Fraud" + - "Obtain Fraudulent Assets" + - "Assets Transfer" + - "Monetisation" + + GalaxyClusterId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + GalaxyClusterValue: + type: string + maxLength: 65535 + example: "Brute Force - T1110" + + GalaxyClusterType: + type: string + maxLength: 255 + example: "mitre-enterprise-attack-attack-pattern" + + GalaxyClusterDescription: + type: string + maxLength: 65535 + example: "Adversaries may use brute force techniques to attempt access to accounts when passwords are unknown or when password hashes are obtained..." + + GalaxyClusterSource: + type: string + maxLength: 255 + example: "https://github.com/mitre/cti" + + GalaxyClusterAuthors: + type: array + items: + type: string + example: "MITRE" + + GalaxyClusterVersion: + type: string + nullable: true + maxLength: 255 + example: "1" + + GalaxyElementId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + GalaxyElementKey: + type: string + maxLength: 255 + example: "categories" + + GalaxyElementValue: + type: string + maxLength: 65535 + example: "Military" + + GalaxyElement: + type: object + properties: + id: + $ref: "#/components/schemas/GalaxyElementId" + galaxy_cluster_id: + $ref: "#/components/schemas/GalaxyClusterId" + key: + $ref: "#/components/schemas/GalaxyElementKey" + value: + $ref: "#/components/schemas/GalaxyElementValue" + + GalaxyElementList: + type: array + items: + $ref: "#/components/schemas/GalaxyElement" + + GalaxyClusterRelation: + type: object # TODO describe + + GalaxyClusterRelationList: + type: array + items: + $ref: "#/components/schemas/GalaxyElement" + + GalaxyClusterNoId: + type: object + properties: + uuid: + $ref: "#/components/schemas/UUID" + collection_uuid: + $ref: "#/components/schemas/UUID" + type: + $ref: "#/components/schemas/GalaxyClusterType" + value: + $ref: "#/components/schemas/GalaxyClusterValue" + tag_name: + $ref: "#/components/schemas/TagName" + description: + $ref: "#/components/schemas/GalaxyClusterDescription" + galaxy_id: + $ref: "#/components/schemas/GalaxyId" + source: + $ref: "#/components/schemas/GalaxyClusterSource" + authors: + $ref: "#/components/schemas/GalaxyClusterAuthors" + version: + $ref: "#/components/schemas/GalaxyClusterVersion" + distribution: + $ref: "#/components/schemas/DistributionLevelId" + sharing_group_id: + $ref: "#/components/schemas/SharingGroupId" + org_id: + $ref: "#/components/schemas/OrganisationId" + orgc_id: + $ref: "#/components/schemas/OrganisationId" + default: + $ref: "#/components/schemas/IsDefault" + locked: + $ref: "#/components/schemas/IsLocked" + extends_uuid: + $ref: "#/components/schemas/ExtendsUUID" + extends_version: + $ref: "#/components/schemas/GalaxyClusterVersion" + published: + $ref: "#/components/schemas/PublishedFlag" + deleted: + $ref: "#/components/schemas/SoftDeletedFlag" + GalaxyElement: + type: array + items: + $ref: "#/components/schemas/GalaxyElement" + + GalaxyCluster: + description: "MISP galaxy is a simple method to express a large object called cluster that can be attached to MISP events or attributes." + allOf: + - type: object + properties: + id: + $ref: "#/components/schemas/GalaxyClusterId" + - $ref: "#/components/schemas/GalaxyClusterNoId" + + ExtendedGalaxyCluster: + description: "A galaxy cluster with all it's details." + allOf: + - $ref: "#/components/schemas/GalaxyCluster" + - type: object + properties: + Galaxy: + $ref: "#/components/schemas/Galaxy" + GalaxyElement: + $ref: "#/components/schemas/GalaxyElementList" + GalaxyClusterRelation: + $ref: "#/components/schemas/GalaxyClusterRelationList" + Org: + $ref: "#/components/schemas/Organisation" + Orgc: + $ref: "#/components/schemas/Organisation" + tag_count: + type: integer + format: int32 + tag_id: + $ref: "#/components/schemas/TagId" + + ExtendedGalaxy: + description: "A galaxy with it's galaxy cluster details." + allOf: + - type: object + properties: + Galaxy: + $ref: "#/components/schemas/Galaxy" + GalaxyCluster: + type: array + items: + $ref: "#/components/schemas/GalaxyCluster" + + GalaxyMispFormat: + description: "Galaxy and clusters representation in misp-galaxy format." + type: object + properties: + name: + $ref: "#/components/schemas/GalaxyName" + type: + $ref: "#/components/schemas/GalaxyType" + authors: + $ref: "#/components/schemas/GalaxyClusterAuthors" + version: + oneOf: + - type: boolean + - $ref: "#/components/schemas/GalaxyClusterVersion" + uuid: + description: "Collection UUID." + $ref: "#/components/schemas/UUID" + source: + $ref: "#/components/schemas/GalaxyClusterSource" + values: + type: array + items: + type: object + properties: + description: + $ref: "#/components/schemas/GalaxyClusterDescription" + uuid: + description: "Galaxy Cluster UUID." + $ref: "#/components/schemas/UUID" + value: + $ref: "#/components/schemas/GalaxyClusterValue" + extends_uuid: + $ref: "#/components/schemas/ExtendsUUID" + extends_Version: + $ref: "#/components/schemas/GalaxyClusterVersion" + meta: + description: "Each Galaxy element associated to this cluster represents a key-value property." + type: object + example: + - categories: "botnet" + - refs: "http://example.com" + - aliases: + - "malware" + - "win32" + - "windows" + - topics: + - "Windows" + - "Malware" + + GalaxyValueSearchFilter: + description: "Text search term to find a matching galaxy name, namespace, description, kill_chain_order or uuid." + type: string + example: "botnet" + + ImportGalaxyClusterItem: + type: object + properties: + GalaxyCluster: + $ref: "#/components/schemas/GalaxyClusterNoId" + Galaxy: + type: object + properties: + uuid: + $ref: "#/components/schemas/UUID" + + # Tags + TagId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + TagName: + type: string + example: "tlp:white" + maxLength: 255 + + TagColour: + type: string + example: "#ffffff" + maxLength: 7 + + TagNumericalValue: + type: string + nullable: true + format: int32 + example: "12345" + + HideTagFlag: + type: boolean + default: false + + TagNoId: + type: object + properties: + name: + $ref: "#/components/schemas/TagName" + colour: + $ref: "#/components/schemas/TagColour" + exportable: + $ref: "#/components/schemas/IsExportable" + org_id: + $ref: "#/components/schemas/OrganisationId" + user_id: + $ref: "#/components/schemas/UserId" + hide_tag: + $ref: "#/components/schemas/HideTagFlag" + numerical_value: + $ref: "#/components/schemas/TagNumericalValue" + is_galaxy: + $ref: "#/components/schemas/IsGalaxy" + is_custom_galaxy: + $ref: "#/components/schemas/IsCustomGalaxy" + inherited: + $ref: "#/components/schemas/IsInherited" + + Tag: + description: "A tag is a simple method to classify an event with a simple string. The tag name can be freely chosen. The tag name can be also chosen from a fixed machine-tag vocabulary called MISP taxonomies" + allOf: + - type: object + properties: + id: + $ref: "#/components/schemas/TagId" + - $ref: "#/components/schemas/TagNoId" + + TagList: + type: array + items: + $ref: "#/components/schemas/Tag" + + TagCollectionId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + ExtendedTag: + type: object + properties: + Tag: + $ref: "#/components/schemas/Tag" + Taxonomy: + $ref: "#/components/schemas/Taxonomy" + TaxonomyPredicate: + $ref: "#/components/schemas/TaxonomyPredicate" + + # Taxonomies + TaxonomyId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + TaxonomyPredicateId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + Taxonomy: + type: object + properties: + id: + $ref: "#/components/schemas/TaxonomyId" + namespace: + type: string + example: "tlp" + description: + type: string + example: "Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk of misuse, in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:WHITE information may be distributed without restriction." + version: + type: string + format: int32 + example: "5" + enabled: + type: boolean + exclusive: + type: boolean + required: + type: boolean + + TaxonomyPredicate: + type: object + properties: + id: + $ref: "#/components/schemas/TaxonomyPredicateId" + taxonomy_id: + $ref: "#/components/schemas/TaxonomyId" + value: + type: string + example: "white" + expanded: + type: string + example: "(TLP:WHITE) Information can be shared publicly in accordance with the law." + colour: + type: string + example: "#ffffff" + description: + type: string + example: Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk of misuse, in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:WHITE information may be distributed without restriction. + exclusive: + type: boolean + numerical_value: + type: integer + nullable: true + + # Users + UserId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + UserDashboardSetting: + type: object + properties: + widget: + type: string + example: "MispStatusWidget" + position: + type: object + properties: + x: + type: string + format: int32 + example: "0" + y: + type: string + format: int32 + example: "0" + width: + type: string + format: int32 + example: "2" + height: + type: string + format: int32 + example: "2" + + UserSetting: + type: object + properties: + dashboard: + type: array + items: + $ref: "#/components/schemas/UserDashboardSetting" + + UserNoId: + type: object + properties: + id: + $ref: "#/components/schemas/UserId" + org_id: + $ref: "#/components/schemas/OrganisationId" + server_id: + $ref: "#/components/schemas/ServerId" + email: + type: string + format: email + autoalert: + type: boolean + authkey: + description: "API auth key used for the API, only set if MISP setting `Security.advanced_authkeys` is set to `false`." + nullable: true + type: string + minLength: 40 + maxLength: 40 + example: "894c8d095180c7ea28789092e96ca6424199aa4f" + invited_by: + $ref: "#/components/schemas/UserId" + gpgkey: + type: string + nullable: true + certif_public: + type: string + nullable: true + nids_sid: + type: string + format: int32 + maxLength: 10 + example: "4000000" + termsaccepted: + type: boolean + newsread: + $ref: "#/components/schemas/Timestamp" + role_id: + $ref: "#/components/schemas/RoleId" + change_pw: + description: "Password change required." + type: string + format: int32 + enum: + - "0" + - "1" + contactalert: + type: boolean + disabled: + type: boolean + expiration: + type: string + format: date-time + nullable: true + current_login: + $ref: "#/components/schemas/Timestamp" + last_login: + $ref: "#/components/schemas/Timestamp" + force_logout: + type: boolean + date_created: + $ref: "#/components/schemas/Timestamp" + date_modified: + $ref: "#/components/schemas/Timestamp" + + User: + allOf: + - type: object + properties: + id: + $ref: "#/components/schemas/UserId" + - $ref: "#/components/schemas/UserNoId" + + ExtendedUser: + allOf: + - $ref: "#/components/schemas/User" + - type: object + properties: + User: + $ref: "#/components/schemas/User" + Role: + $ref: "#/components/schemas/Role" + UserSetting: + $ref: "#/components/schemas/UserSetting" + + UserListItem: + type: object + properties: + User: + $ref: "#/components/schemas/User" + Role: + $ref: "#/components/schemas/Role" + Organisation: + type: object + properties: + id: + $ref: "#/components/schemas/OrganisationId" + name: + $ref: "#/components/schemas/OrganisationName" + + UserList: + type: array + items: + $ref: "#/components/schemas/UserListItem" + + # Organisations + OrganisationId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + OrganisationName: + type: string + maxLength: 255 + example: "ORGNAME" + + OrganisationType: + type: string + nullable: true + maxLength: 255 + example: "ADMIN" + + OrganisationNoId: + type: object + properties: + name: + $ref: "#/components/schemas/OrganisationName" + date_created: + $ref: "#/components/schemas/Timestamp" + date_modified: + $ref: "#/components/schemas/Timestamp" + description: + type: string + type: + $ref: "#/components/schemas/OrganisationType" + nationality: + type: string + sector: + type: string + created_by: + $ref: "#/components/schemas/UserId" + uuid: + type: string + contacts: + type: string + nullable: true + local: + type: boolean + restricted_to_domain: + type: array + items: + type: string + format: hostname + landingpage: + type: string + nullable: true + user_count: + type: string + nullable: true + format: int32 + example: "3" + created_by_email: + nullable: true + type: string + + Organisation: + allOf: + - type: object + properties: + id: + $ref: "#/components/schemas/OrganisationId" + - $ref: "#/components/schemas/OrganisationNoId" + + OrganisationListItem: + type: object + properties: + Organisation: + $ref: "#/components/schemas/Organisation" + + OrganisationList: + type: array + items: + $ref: "#/components/schemas/OrganisationListItem" + + # Servers + ServerId: + type: string + format: int32 + maxLength: 10 + example: "12345" + + ServerName: + type: string + maxLength: 255 + example: "Phising Server" + + ServerNoId: + type: object + properties: + name: + $ref: "#/components/schemas/ServerName" + url: + type: string + example: "https://misppriv.circl.lu" + authkey: + $ref: "#/components/schemas/AuthKey" + org_id: + $ref: "#/components/schemas/OrganisationId" + push: + type: boolean + pull: + type: boolean + push_sightings: + type: boolean + push_galaxy_clusters: + type: boolean + pull_galaxy_clusters: + type: boolean + lastpulledid: + type: string + nullable: true + format: int32 + maxLength: 10 + example: "12345" + lastpushedid: + type: string + nullable: true + format: int32 + maxLength: 10 + example: "12345" + organization: + type: string + nullable: true + remote_org_id: + $ref: "#/components/schemas/OrganisationId" + publish_without_email: + type: boolean + unpublish_event: + type: boolean + self_signed: + type: boolean + pull_rules: + description: "Stringified JSON rules for pulling events from this server." + type: string + example: '{"tags":{"OR":[],"NOT":[]},"orgs":{"OR":[],"NOT":[]},"url_params":""}' + push_rules: + type: string + description: "Stringified JSON rules for pushing events from this server." + example: '{"tags":{"OR":[],"NOT":[]},"orgs":{"OR":[],"NOT":[]}}' + cert_file: + type: string + description: "Base64 encoded certificate" + nullable: true + format: byte + client_cert_file: + type: string + description: "Base64 encoded client certificate" + nullable: true + format: byte + internal: + type: boolean + skip_proxy: + type: boolean + caching_enabled: + type: boolean + priority: + type: string + nullable: true + format: int32 + maxLength: 10 + example: "1" + cache_timestamp: + type: boolean + + Server: + allOf: + - type: object + properties: + id: + $ref: "#/components/schemas/ServerId" + - $ref: "#/components/schemas/ServerNoId" + + ServerListItem: + type: object + properties: + Server: + $ref: "#/components/schemas/Server" + Organisation: + $ref: "#/components/schemas/Organisation" + RemoteOrg: + $ref: "#/components/schemas/Organisation" + User: + type: array + items: + $ref: "#/components/schemas/User" + + ServerList: + type: array + items: + $ref: "#/components/schemas/ServerListItem" + + PhpServerSetting: + type: object + properties: + explanation: + type: string + example: "The maximum duration that a script can run (does not affect the background workers). A too low number will break long running scripts like comprehensive API exports" + recommended: + anyOf: + - type: integer + example: 300 + - type: string + unit: + type: string + example: "seconds" + value: + anyOf: + - type: integer + example: 300 + - type: string + + ServerPackageVersion: + type: object + properties: + version: + type: string + example: "1.2.0.11" + expected: + type: string + example: ">1.2.0.9" + status: + type: integer + example: 1 + + DatabaseTableDiagnostics: + type: object + properties: + used: + type: string + example: "207.63MB" + reclaimable: + type: string + example: "5MB" + table: + type: string + example: "attributes" + + MispSetting: + type: object + properties: + level: + type: integer + example: 0 + value: + anyOf: + - type: string + - type: boolean + - type: number + errorMessage: + type: string + nullable: true + example: "The currently set baseurl does not match the URL through which you have accessed the page. Disregard this if you are accessing the page via an alternate URL (for example via IP address)." + test: + nullable: true + anyOf: + - type: string + example: "testBaseURL" + - type: boolean + type: + type: string + example: "string" + enum: + - "string" + - "boolean" + - "numeric" + "null": + type: boolean + nullable: true + subGroup: + type: string + nullable: true + example: "Enrichment" + cli_only: + type: integer + nullable: true + example: 1 + redacted: + type: boolean + nullable: true + optionsSource: + type: object + nullable: true + afterHook: + type: string + nullable: true + example: "cleanCacheFiles" + error: + type: integer + nullable: true + example: 1 + tab: + type: string + example: "MISP" + setting: + type: string + example: "MISP.baseurl" + options: + nullable: true + anyOf: + - type: object + - type: array + + Worker: + type: object + properties: + pid: + type: integer + example: 1233 + user: + type: string + example: "www-data" + alive: + type: boolean + correct_user: + type: boolean + ok: + type: boolean + + WorkersStatus: + type: object + properties: + ok: + type: boolean + workers: + type: array + items: + $ref: "#/components/schemas/Worker" + jobCount: + type: integer + nullable: true + example: 0 + + UpdateServerResultItem: + type: object + properties: + input: + type: string + example: "cd $(git rev-parse --show-toplevel) && git checkout app\/composer.json 2>&1" + output: + type: array + items: + type: string + example: "Updated 1 path from the index" + status: + type: integer + example: 0 + + # Feeds + FeedId: + type: string + format: int32 + maxLength: 10 + example: "3" + + FeedName: + type: string + maxLength: 255 + example: "CIRCL OSINT Feed" + + FeedSourceFormat: + type: string + enum: + - "1" + - "csv" + - "freetext" + - "misp" + + FeedInputSource: + description: "Specify whether the source (url field) is a directory (local) or an genuine url (network)." + type: string + enum: + - "local" + - "network" + + FeedHeaders: + description: "Headers to be passed with the requests. All separated by \n" + type: string + nullable: true + example: | + X-Custom-Header-A: Foo + X-Custom-Header-B: Bar + + FeedSettings: + type: string + nullable: true + example: '{"csv":{"value":"","delimiter":""},"common":{"excluderegex":""}}' + + FeedRules: + description: "Stringified JSON filter rules." + type: string + nullable: true + example: '{"tags":{"OR":[],"NOT":[]},"orgs":{"OR":[],"NOT":[]},"url_params":""}' + + FeedUrl: + type: string + example: "https://www.circl.lu/doc/misp/feed-osint" + + FeedFixedEvent: + description: "target_event option might be considered" + type: boolean + + FeedDeltaMergeFlag: + description: "Merge attributes (only add new attribute, remove revoked attributes)" + type: boolean + + FeedProvider: + type: string + example: "CIRCL" + + FeedOverrideIDSFlag: + description: "The IDS flags will be set to Off for this feed" + type: boolean + + FeedDeleteLocalFileFlag: + description: "The IDS flags will be set to Off for this feed" + type: boolean + + FeedLookupVisibleFlag: + description: "The lookup will not be visible in the feed correlation" + type: boolean + + FeedCachingEnabledFlag: + description: "The feed is cached" + type: boolean + + FeedForceToIDSFlag: + description: "The IDS flags will be set to On for this feed" + type: boolean + + FeedEnabledFlag: + type: boolean + + FeedCacheTimestamp: + nullable: true + anyOf: + - $ref: "#/components/schemas/Timestamp" + - type: boolean + + FeedNoId: + type: object + properties: + name: + $ref: "#/components/schemas/FeedName" + provider: + $ref: "#/components/schemas/FeedProvider" + url: + $ref: "#/components/schemas/FeedUrl" + rules: + $ref: "#/components/schemas/FeedRules" + enabled: + $ref: "#/components/schemas/FeedEnabledFlag" + distribution: + $ref: "#/components/schemas/DistributionLevelId" + sharing_group_id: + $ref: "#/components/schemas/SharingGroupId" + tag_id: + $ref: "#/components/schemas/TagId" + default: + $ref: "#/components/schemas/IsDefault" + source_format: + $ref: "#/components/schemas/FeedSourceFormat" + fixed_event: + $ref: "#/components/schemas/FeedFixedEvent" + delta_merge: + $ref: "#/components/schemas/FeedDeltaMergeFlag" + event_id: + $ref: "#/components/schemas/EventId" + publish: + $ref: "#/components/schemas/PublishedFlag" + override_ids: + $ref: "#/components/schemas/FeedOverrideIDSFlag" + settings: + $ref: "#/components/schemas/FeedSettings" + input_source: + $ref: "#/components/schemas/FeedInputSource" + delete_local_file: + $ref: "#/components/schemas/FeedDeleteLocalFileFlag" + lookup_visible: + $ref: "#/components/schemas/FeedLookupVisibleFlag" + headers: + $ref: "#/components/schemas/FeedHeaders" + caching_enabled: + $ref: "#/components/schemas/FeedCachingEnabledFlag" + force_to_ids: + $ref: "#/components/schemas/FeedForceToIDSFlag" + orgc_id: + $ref: "#/components/schemas/OrganisationId" + cache_timestamp: + $ref: "#/components/schemas/FeedCacheTimestamp" + + Feed: + allOf: + - type: object + properties: + id: + $ref: "#/components/schemas/FeedId" + - $ref: "#/components/schemas/FeedNoId" + + # Warninglists + WarninglistId: + type: string + format: int32 + maxLength: 10 + example: "3" + + WarninglistEntry: + type: object + properties: + id: + type: string + format: int32 + example: "1234" + value: + type: string + example: "10.128.0.0/24" + warninglist_id: + $ref: "#/components/schemas/WarninglistId" + + Warninglist: + type: object + properties: + id: + $ref: "#/components/schemas/WarninglistId" + name: + type: string + example: "List of known domains to know external IP" + type: + type: string + enum: + - "cidr" + - "hostname" + - "substring" + - "string" + - "regex" + example: "cidr" + description: + type: string + version: + type: string + format: int32 + example: "10" + enabled: + type: boolean + warninglist_entry_count: + type: string + format: int32 + example: "1234" + valid_attributes: + description: "List of comma separated warninglist types." + type: string + example: "domain, hostname, domain|ip, uri, url" + WarninglistEntry: + type: array + items: + $ref: "#/components/schemas/WarninglistEntry" + + WarninglistsIdFilter: + anyOf: + - $ref: "#/components/schemas/WarninglistId" + - type: array + items: + $ref: "#/components/schemas/WarninglistId" + + WarninglistsNameFilter: + anyOf: + - type: string + example: "%search term%" + - type: array + items: + type: string + example: "%search term%" + + # Noticelists + NoticelistId: + type: string + format: int32 + maxLength: 10 + example: "3" + + NoticelistEntry: + type: object + properties: + id: + type: string + format: int32 + example: "1234" + noticelist_id: + $ref: "#/components/schemas/NoticelistId" + data: + type: object + properties: + scope: + type: array + items: + type: string + example: "attribute" + field: + type: array + items: + type: string + example: "category" + value: + type: array + items: + type: string + example: "Person" + tags: + type: array + items: + $ref: "#/components/schemas/TagName" + message: + type: object + properties: + en: + type: string + example: "This attribute is likely to contain personal data and the data subject is likely to be directly identifiable." + + Noticelist: + type: object + properties: + id: + $ref: "#/components/schemas/NoticelistId" + name: + type: string + example: "List of known domains to know external IP" + type: + type: string + enum: + - "cidr" + - "hostname" + - "substring" + - "string" + - "regex" + example: "cidr" + description: + type: string + version: + type: string + format: int32 + example: "10" + enabled: + type: boolean + warninglist_entry_count: + type: string + format: int32 + example: "1234" + valid_attributes: + description: "List of comma separated warninglist types." + type: string + example: "domain, hostname, domain|ip, uri, url" + NoticelistEntry: + type: array + items: + $ref: "#/components/schemas/NoticelistEntry" + + # Roles + RoleId: + type: string + format: int32 + maxLength: 10 + example: "3" + + RoleName: + type: string + maxLength: 255 + example: "ORGNAME" + + Role: + type: object + properties: + id: + $ref: "#/components/schemas/RoleId" + name: + $ref: "#/components/schemas/RoleName" + perm_add: + type: boolean + perm_modify: + type: boolean + perm_modify_org: + type: boolean + perm_publish: + type: boolean + perm_delegate: + type: boolean + perm_sync: + type: boolean + perm_admin: + type: boolean + perm_audit: + type: boolean + perm_auth: + type: boolean + perm_site_admin: + type: boolean + perm_regexp_access: + type: boolean + perm_tagger: + type: boolean + perm_template: + type: boolean + perm_sharing_group: + type: boolean + perm_tag_editor: + type: boolean + perm_sighting: + type: boolean + perm_object_template: + type: boolean + perm_publish_zmq: + type: boolean + perm_publish_kafka: + type: boolean + perm_decaying: + type: boolean + perm_galaxy_editor: + type: boolean + default_role: + type: boolean + memory_limit: + type: string + nullable: true + format: int32 + max_execution_time: + type: string + nullable: true + format: int32 + restricted_to_site_admin: + type: boolean + enforce_rate_limit: + type: boolean + rate_limit_count: + type: string + format: int32 + permission: + type: string + format: int32 + example: "3" + permission_description: + type: string + example: "publish" + + # Sharing Groups + SharingGroupId: + type: string + nullable: true + format: int32 + maxLength: 10 + example: "1" + + SharingGroupOrganisationId: + type: string + nullable: true + format: int32 + maxLength: 10 + example: "1" + + SharingGroupName: + type: string + maxLength: 255 + example: "Banking Sharing Group" + + SharingGroupDescription: + type: string + maxLength: 65535 + example: "Banking Institutions of X Sharing Group" + + SharingGroupReleasability: + type: string + maxLength: 65535 + + SlimSharingGroupNoId: + type: object + properties: + id: + $ref: "#/components/schemas/SharingGroupId" + uuid: + $ref: "#/components/schemas/UUID" + name: + $ref: "#/components/schemas/SharingGroupName" + description: + $ref: "#/components/schemas/SharingGroupDescription" + releasability: + $ref: "#/components/schemas/SharingGroupReleasability" + local: + type: boolean + active: + type: boolean + org_count: + type: string + format: int32 + example: "6" + + SlimSharingGroup: + allOf: + - type: object + properties: + id: + $ref: "#/components/schemas/SharingGroupId" + - $ref: "#/components/schemas/SlimSharingGroupNoId" + + SharingGroupNoId: + allOf: + - $ref: "#/components/schemas/SlimSharingGroupNoId" + - type: object + properties: + organisation_uuid: + $ref: "#/components/schemas/UUID" + org_id: + $ref: "#/components/schemas/OrganisationId" + sync_user_id: + $ref: "#/components/schemas/UserId" + created: + type: string + format: datetime + modified: + type: string + format: datetime + roaming: + type: boolean + + SharingGroup: + allOf: + - type: object + properties: + id: + $ref: "#/components/schemas/SharingGroupId" + - $ref: "#/components/schemas/SharingGroupNoId" + + SharingGroupOrganisation: + type: object + properties: + id: + $ref: "#/components/schemas/SharingGroupOrganisationId" + sharing_group_id: + $ref: "#/components/schemas/SharingGroupId" + org_id: + $ref: "#/components/schemas/OrganisationId" + extend: + type: boolean + Organisation: + type: object + properties: + id: + $ref: "#/components/schemas/OrganisationId" + name: + $ref: "#/components/schemas/OrganisationName" + uuid: + $ref: "#/components/schemas/UUID" + + SharingGroupServer: + type: object + properties: + all_orgs: + type: boolean + server_id: + $ref: "#/components/schemas/ServerId" + sharing_group_id: + $ref: "#/components/schemas/SharingGroupId" + Server: + type: object + properties: + id: + $ref: "#/components/schemas/ServerId" + name: + $ref: "#/components/schemas/ServerName" + + SharingGroupListItem: + type: object + properties: + SharingGroup: + $ref: "#/components/schemas/SlimSharingGroup" + Organisation: + type: object + properties: + id: + $ref: "#/components/schemas/OrganisationId" + name: + $ref: "#/components/schemas/OrganisationName" + uuid: + $ref: "#/components/schemas/UUID" + SharingGroupOrg: + type: array + items: + $ref: "#/components/schemas/SharingGroupOrganisation" + SharingGroupServer: + type: array + items: + $ref: "#/components/schemas/SharingGroupServer" + editable: + type: boolean + deletable: + type: boolean + + # General + AuthKey: + type: string + minLength: 40 + maxLength: 40 + example: "894c8d095180c7ea28789092e96ca6424199aa4f" + + DistributionLevelId: + type: string + format: int32 + enum: ["0", "1", "2", "3", "4", "5"] + description: > + Who will be able to see this event once it becomes published and eventually when it becomes pulled: + * `0` - Your organization only + * `1` - This community only + * `2` - Connected communities + * `3` - All communities + * `4` - Sharing group + * `5` - Inherit Event + + ThreatLevelId: + type: string + format: int32 + enum: ["1", "2", "3", "4"] + description: > + Represents the threat level. + * `1` - High + * `2` - Medium + * `3` - Low + * `4` - Undefined + + AnalysisLevelId: + type: string + format: int32 + enum: ["0", "1", "2"] + description: > + Represents the analysis maturity level. + * `0` - Initial + * `1` - Ongoing + * `2` - Complete + + ToIDS: + type: boolean + default: true + + UUID: + type: string + format: uuid + maxLength: 36 + example: "c99506a6-1255-4b71-afa5-7b8ba48c3b1b" + + ExtendsUUID: + type: string + nullable: true + maxLength: 36 + example: "c99506a6-1255-4b71-afa5-7b8ba48c3b1b" + + Timestamp: + type: string + format: int64 + default: "0" + example: "1617875568" + + NullableTimestamp: + nullable: true + type: string + format: int64 + default: "0" + example: "1617875568" + + MicroTimestamp: + type: string + format: int64 + default: null + example: "1581984000000000" + + NullableMicroTimestamp: + nullable: true + type: string + format: int64 + default: null + example: "1581984000000000" + + SoftDeletedFlag: + type: boolean + default: false + + PublishedFlag: + type: boolean + default: false + + DisableCorrelationFlag: + type: boolean + default: false + + IsExportable: + type: boolean + default: true + + IsGalaxy: + type: boolean + default: true + + IsCustomGalaxy: + type: boolean + default: true + + IsInherited: + type: integer + format: int32 + default: 1 + + IsLocked: + type: boolean + + IsDefault: + type: boolean + + IsLocal: + type: boolean + + Icon: + type: string + maxLength: 255 + example: "globe" + + PageSearchFilter: + type: integer + format: int32 + nullable: true + minimum: 0 + + LimitSearchFilter: + type: integer + format: int32 + nullable: true + minimum: 1 + + SortSearchField: + description: Field to be used to sort the result + type: string + nullable: true + example: "timestamp" + + DirectionSearchField: + description: Sort direction of the result + type: string + nullable: true + default: "asc" + enum: + - "asc" + - "desc" + + DateRestSearchFilter: + description: "You can use any of the valid time related filters (examples: 7d, timestamps, [14d, 7d] for ranges, etc.)" + type: string + nullable: true + + LastRestSearchFilter: + description: "Published within the last x amount of time, where x can be defined in days, hours, minutes (for example 5d or 12h or 30m)" + type: integer + nullable: true + + TagsRestSearchFilter: + nullable: true + type: array + items: + type: string + example: "tlp:amber" + + MetadataRestSearchFilter: + description: "Will only return the metadata of the given query scope, contained data is omitted." + nullable: true + type: boolean + + IncludeEventUUIDRestSearchFlag: + description: "Include matching eventUuids in the response" + type: boolean + default: false + + IncludeEventTagsRestSearchFlag: + description: "Include tags of matching events in the response" + type: boolean + default: false + + IncludeProposalsRestSearchFlag: + description: "Include proposals of matching events in the response" + type: boolean + default: false + + EnforceWarninglistRestSearchFilter: + description: "Should the warning list be enforced. Adds blocked field for matching attributes" + nullable: true + type: boolean + + RequestedAttributesRestSearchFilter: + description: "List of properties that will be selected in the CSV export" + type: array + items: + type: string + example: "id" + + IncludeContextRestSearchFlag: + description: "Adds events context fields in the CSV export" + nullable: true + type: boolean + + HeaderlessRestSearchFlag: + description: "Removes header in the CSV export" + nullable: true + type: boolean + + IncludeWarninglistHitsRestSearchFlag: + nullable: true + type: boolean + + AttackGalaxyRestSearchFilter: + nullable: true + type: string + example: "mitre-attack" + + ExcludeLocalTagsRestSearchFilter: + description: "Exclude local tags from the export" + nullable: true + type: boolean + + IncludeSightingDbRestSearchFlag: + description: "Extend response with Sightings DB results if the module is enabled" + nullable: true + type: boolean + + IncludeCorrelationsRestSearchFlag: + nullable: true + type: boolean + + ModelOverridesRestSearchFilter: + $ref: "#/components/schemas/DecayingModelParameters" + + ObjectRelationRestSearchFilter: + description: "Filter by the attribute object relation value" + nullable: true + type: string + example: "filepath" + + ApiError: + type: object + required: + - name + - message + - url + properties: + name: + type: string + message: + type: string + url: + type: string + example: "/attributes" + + UnauthorizedApiError: + type: object + required: + - name + - message + - url + properties: + name: + type: string + example: "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header." + message: + type: string + example: "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header." + url: + type: string + example: "/attributes" + + NotFoundApiError: + type: object + required: + - name + - message + - url + properties: + name: + type: string + example: "Invalid attribute" + message: + type: string + example: "Invalid attribute" + url: + type: string + example: "/attributes/1234" + + parameters: + eventIdParameter: + name: eventId + in: path + description: "UUID or numeric ID of the event" + required: true + schema: + oneOf: + - $ref: "#/components/schemas/EventId" + - $ref: "#/components/schemas/UUID" + + attributeIdParameter: + name: attributeId + in: path + description: "UUID or numeric ID of the attribute" + required: true + schema: + oneOf: + - $ref: "#/components/schemas/AttributeId" + - $ref: "#/components/schemas/UUID" + + tagIdParameter: + name: tagId + in: path + description: Numeric ID of the attribute + required: true + schema: + $ref: "#/components/schemas/TagId" + + tagSearchTermParameter: + name: tagSearchTerm + in: path + description: Tag search term + required: true + schema: + type: string + example: "%tlp%" + + galaxyIdParameter: + name: galaxyId + in: path + description: "UUID or numeric ID of the galaxy" + required: true + schema: + oneOf: + - $ref: "#/components/schemas/GalaxyId" + - $ref: "#/components/schemas/UUID" + + galaxyClusterIdParameter: + name: galaxyClusterId + in: path + description: "UUID or numeric ID of the galaxy cluster" + required: true + schema: + oneOf: + - $ref: "#/components/schemas/GalaxyClusterId" + - $ref: "#/components/schemas/UUID" + + userIdParameter: + name: userId + in: path + description: "Numeric ID of the user" + required: true + schema: + $ref: "#/components/schemas/UserId" + + firstTimeResetParameter: + name: firstTimeReset + in: path + description: "First time reset is set to `1` only for new user registrations." + required: true + schema: + type: string + enum: + - "0" + - "1" + + organisationIdParameter: + name: organisationId + in: path + description: "UUID or numeric ID of the organisation" + required: true + schema: + oneOf: + - $ref: "#/components/schemas/OrganisationId" + - $ref: "#/components/schemas/UUID" + + serverIdParameter: + name: serverId + in: path + description: "UUID or numeric ID of the server" + required: true + schema: + oneOf: + - $ref: "#/components/schemas/ServerId" + - $ref: "#/components/schemas/UUID" + + pullTechniqueParameter: + name: pullTechnique + in: path + description: "Pull technique to be used for pulling events from this instance." + required: true + schema: + type: string + enum: + - "full" + - "incremental" + - "pull_relevant_clusters" + + pushTechniqueParameter: + name: pushTechnique + in: path + description: "Push technique to be used for pushing events to this instance." + required: true + schema: + type: string + enum: + - "full" + - "incremental" + + workerTypeParameter: + name: workerType + in: path + description: "Worker type." + required: true + schema: + type: string + enum: + - "default" + - "email" + - "scheduler" + - "cache" + - "prio" + - "update" + + workerPidParameter: + name: workerPid + in: path + description: "Worker PID." + required: true + schema: + type: string + format: int32 + + settingNameParameter: + name: settingName + in: path + description: "Setting name." + required: true + schema: + type: string + example: "MISP.background_jobs" + + sharingGroupIdParameter: + name: sharingGroupId + in: path + description: "UUID or numeric ID of the sharing group" + required: true + schema: + oneOf: + - $ref: "#/components/schemas/SharingGroupId" + - $ref: "#/components/schemas/UUID" + + feedIdParameter: + name: feedId + in: path + description: "UUID or numeric ID of the feed" + required: true + schema: + oneOf: + - $ref: "#/components/schemas/FeedId" + - $ref: "#/components/schemas/UUID" + + warninglistIdParameter: + name: warninglistId + in: path + description: "Numeric ID of the warninglist" + required: true + schema: + $ref: "#/components/schemas/WarninglistId" + + noticelistIdParameter: + name: noticelistId + in: path + description: "Numeric ID of the noticelist" + required: true + schema: + $ref: "#/components/schemas/NoticelistId" + + sightingIdParameter: + name: sightingId + in: path + description: "UUID or numeric ID of the sighting" + required: true + schema: + $ref: "#/components/schemas/SightingId" + + cacheFeedsScopeParameter: + name: cacheFeedsScope + in: path + description: "Cache feeds strategy" + required: true + schema: + type: string + enum: + - "all" + - "csv" + - "freetext" + + attachTargetIdParameter: + name: attachTargetId + in: path + description: "UUID or numeric ID of the target entity (Event, Attribute or TagCollection)" + required: true + schema: + anyOf: + - $ref: "#/components/schemas/EventId" + - $ref: "#/components/schemas/AttributeId" + - $ref: "#/components/schemas/TagCollectionId" + + attachTargetTypeParameter: + name: attachTargetType + in: path + description: "Type of the target entity to attach to the galaxy cluster." + required: true + schema: + type: string + enum: + - "event" + - "attribute" + - "tag_collection" + + returnFormatParameter: + name: returnFormat + in: query + description: Return type of the restSearch query. + required: true + schema: + type: string + enum: + - json + - xml + - download + - stix + - stix2 + + attributeStatisticsContextParameter: + name: context + in: path + required: true + description: Context of the statistics. + schema: + type: string + default: "type" + enum: + - type + - category + + attributeStatisticsPercentageParameter: + name: percentage + in: path + required: true + description: "`0` to show attribute count, `1` for showing percentages" + schema: + type: integer + default: 0 + + objectIdParameter: + name: objectId + in: path + description: "UUID or numeric ID of the object" + required: true + schema: + oneOf: + - $ref: "#/components/schemas/ObjectId" + - $ref: "#/components/schemas/UUID" + + hardDeleteParameter: + name: objectId + in: path + description: "`1` for hard delete the entity, `0` for soft deletion." + required: true + schema: + type: string + enum: + - "0" + - "1" + + objectTemplateIdParameter: + name: objectTemplateId + in: path + description: "UUID or numeric ID of the object template" + required: true + schema: + oneOf: + - $ref: "#/components/schemas/ObjectTemplateId" + - $ref: "#/components/schemas/UUID" + + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: Authorization + description: | + The authentication of the automation is performed via a secure key available in the MISP UI interface. + Make sure you keep that key secret as it gives access to the entire database! The [API](https://www.circl.lu/doc/misp/GLOSSARY.html#api) + key is available in the event actions menu under automation. + + The authorization is performed by using the following header in the API requests: + + Authorization: YOUR_API_KEY + + > **NOTE**: Since version 2.2 the usage of the authentication key in the URL is deprecated. + Instead, pass the auth key in an Authorization header in the request. The legacy option of having the auth key + in the URL is temporarily still supported but not recommended. + + requestBodies: + AddAttributeRequest: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AttributeNoId" + + EditAttributeRequest: + required: true + content: + application/json: + schema: + type: object + $ref: "#/components/schemas/Attribute" + + RestSearchAttributesRequest: + required: true + content: + application/json: + schema: + type: object + properties: + page: + $ref: "#/components/schemas/PageSearchFilter" + limit: + $ref: "#/components/schemas/LimitSearchFilter" + value: + $ref: "#/components/schemas/AttributeValue" + type: + $ref: "#/components/schemas/AttributeType" + category: + $ref: "#/components/schemas/AttributeCategory" + org: + oneOf: + - $ref: "#/components/schemas/OrganisationId" + - $ref: "#/components/schemas/OrganisationName" + tags: + $ref: "#/components/schemas/TagsRestSearchFilter" + from: + $ref: "#/components/schemas/DateRestSearchFilter" + to: + $ref: "#/components/schemas/DateRestSearchFilter" + last: + $ref: "#/components/schemas/LastRestSearchFilter" + eventid: + $ref: "#/components/schemas/EventId" + withAttachments: + description: "Extends the response with the base64 representation of the attachment, if there is one" + type: boolean + default: false + uuid: + $ref: "#/components/schemas/UUID" + publish_timestamp: + $ref: "#/components/schemas/Timestamp" + published: + $ref: "#/components/schemas/PublishedFlag" + timestamp: + $ref: "#/components/schemas/Timestamp" + attribute_timestamp: + $ref: "#/components/schemas/Timestamp" + enforceWarninglist: + $ref: "#/components/schemas/EnforceWarninglistRestSearchFilter" + to_ids: + $ref: "#/components/schemas/ToIDS" + deleted: + $ref: "#/components/schemas/SoftDeletedFlag" + event_timestamp: + description: "The timestamp at which the event was last modified" + $ref: "#/components/schemas/Timestamp" + threat_level_id: + $ref: "#/components/schemas/ThreatLevelId" + eventinfo: + description: "Quick event description" + type: string + decayingModel: + description: "Specify the decaying model from which the decaying score should be calculated" + type: string + score: + description: "An alias to override on-the-fly the threshold of the decaying model" + type: string + first_seen: + description: "Seen within the last x amount of time, where x can be defined in days, hours, minutes (for example 5d or 12h or 30m)" + type: string + last_seen: + description: "Seen within the last x amount of time, where x can be defined in days, hours, minutes (for example 5d or 12h or 30m)" + type: string + includeEventUuid: + $ref: "#/components/schemas/IncludeEventUUIDRestSearchFlag" + includeEventTags: + $ref: "#/components/schemas/IncludeEventTagsRestSearchFlag" + includeProposals: + $ref: "#/components/schemas/IncludeProposalsRestSearchFlag" + requested_attributes: + $ref: "#/components/schemas/RequestedAttributesRestSearchFilter" + includeContext: + $ref: "#/components/schemas/IncludeContextRestSearchFlag" + headerless: + $ref: "#/components/schemas/HeaderlessRestSearchFlag" + includeWarninglistHits: + $ref: "#/components/schemas/IncludeWarninglistHitsRestSearchFlag" + attackGalaxy: + $ref: "#/components/schemas/AttackGalaxyRestSearchFilter" + object_relation: + $ref: "#/components/schemas/ObjectRelationRestSearchFilter" + includeSightings: + $ref: "#/components/schemas/IncludeSightingDbRestSearchFlag" + includeCorrelations: + $ref: "#/components/schemas/IncludeCorrelationsRestSearchFlag" + modelOverrides: + $ref: "#/components/schemas/ModelOverridesRestSearchFilter" + includeDecayScore: + description: "Include all enabled decaying score" + type: boolean + default: false + includeFullModel: + description: "Include all model information of matching events in the response" + type: boolean + default: false + excludeDecayed: + description: "Should the decayed elements by excluded" + type: boolean + default: false + + AddEventRequest: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/EventNoId" + + EditEventRequest: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/EventNoId" + + SearchEventRequest: + required: true + content: + application/json: + schema: + type: object + properties: + page: + $ref: "#/components/schemas/PageSearchFilter" + limit: + $ref: "#/components/schemas/LimitSearchFilter" + sort: + $ref: "#/components/schemas/SortSearchField" + direction: + $ref: "#/components/schemas/DirectionSearchField" + minimal: + description: "Returns a minimal version of the event, only events with `attributeCount` > 0 will be returned" + type: boolean + nullable: true + default: false + attribute: + description: "Filter events matching the given string with attributes values" + type: string + nullable: true + example: "covert channel" + eventid: + $ref: "#/components/schemas/EventId" + datefrom: + description: "Event creation date is greater or equal" + type: string + nullable: true + format: date + example: "2021-03-05" + dateuntil: + description: "Event creation date is less or equal" + type: string + nullable: true + format: date + example: "2021-03-05" + org: + description: "Filter events by matching an the creator organisation name" + type: string + nullable: true + example: "CIRCL" + eventinfo: + description: "Filter events by matching the event info text" + type: string + nullable: true + example: "Phishing campaing" + tag: + description: "Filter events by matching the event tags with a given tag name" + nullable: true + $ref: "#/components/schemas/TagName" + example: "tlp:white" + tags: + description: "Filter events by matching *any* of the event tags of a given list of tag names" + type: array + nullable: true + items: + $ref: "#/components/schemas/TagName" + example: + - "tlp:amber" + - 'cycat:scope="exploit"' + distribution: + $ref: "#/components/schemas/DistributionLevelId" + sharinggroup: + $ref: "#/components/schemas/SharingGroupId" + analysis: + $ref: "#/components/schemas/AnalysisLevelId" + threatlevel: + $ref: "#/components/schemas/ThreatLevelId" + email: + description: "Filter events by matching the event creator user email" + type: string + nullable: true + format: email + example: "admin@admin.test" + hasproposal: + description: "Filter events by checking if it has attributes with change proposals. Possible values: `0`, `1`" + type: string + nullable: true + example: "1" + timestamp: + description: "Event timestamp greater or equal" + type: string + nullable: true + example: "1" + publish_timestamp: + description: "Event publish timestamp greater or equal" + type: string + nullable: true + example: "1" + + RestSearchEventsRequest: + required: true + content: + application/json: + schema: + type: object + properties: + page: + $ref: "#/components/schemas/PageSearchFilter" + limit: + $ref: "#/components/schemas/LimitSearchFilter" + value: + $ref: "#/components/schemas/AttributeValue" + type: + $ref: "#/components/schemas/AttributeType" + category: + $ref: "#/components/schemas/AttributeCategory" + org: + oneOf: + - $ref: "#/components/schemas/OrganisationId" + - $ref: "#/components/schemas/OrganisationName" + tags: + $ref: "#/components/schemas/TagsRestSearchFilter" + searchall: + description: "Search events by matching any tag names, event descriptions, attribute values or attribute comments" + type: string + example: malware + from: + $ref: "#/components/schemas/DateRestSearchFilter" + to: + $ref: "#/components/schemas/DateRestSearchFilter" + last: + $ref: "#/components/schemas/LastRestSearchFilter" + eventid: + $ref: "#/components/schemas/EventId" + withAttachments: + description: "Extends the response with the base64 representation of the attachment, if there is one" + type: boolean + default: false + metadata: + $ref: "#/components/schemas/MetadataRestSearchFilter" + uuid: + $ref: "#/components/schemas/UUID" + publish_timestamp: + $ref: "#/components/schemas/Timestamp" + timestamp: + $ref: "#/components/schemas/Timestamp" + published: + $ref: "#/components/schemas/PublishedFlag" + enforceWarninglist: + $ref: "#/components/schemas/EnforceWarninglistRestSearchFilter" + sgReferenceOnly: + description: "Will only return the sharing group ID" + type: boolean + requested_attributes: + $ref: "#/components/schemas/RequestedAttributesRestSearchFilter" + includeContext: + $ref: "#/components/schemas/IncludeContextRestSearchFlag" + headerless: + $ref: "#/components/schemas/HeaderlessRestSearchFlag" + includeWarninglistHits: + $ref: "#/components/schemas/IncludeWarninglistHitsRestSearchFlag" + attackGalaxy: + $ref: "#/components/schemas/AttackGalaxyRestSearchFilter" + to_ids: + $ref: "#/components/schemas/ToIDS" + deleted: + description: "Include deleted elements" + $ref: "#/components/schemas/SoftDeletedFlag" + excludeLocalTags: + $ref: "#/components/schemas/ExcludeLocalTagsRestSearchFilter" + date: + $ref: "#/components/schemas/DateRestSearchFilter" + includeSightingdb: + $ref: "#/components/schemas/IncludeSightingDbRestSearchFlag" + tag: + $ref: "#/components/schemas/TagName" + object_relation: + $ref: "#/components/schemas/ObjectRelationRestSearchFilter" + threat_level_id: + $ref: "#/components/schemas/ThreatLevelId" + + SearchGalaxyRequest: + required: true + content: + application/json: + schema: + type: object + properties: + value: + $ref: "#/components/schemas/GalaxyValueSearchFilter" + + ImportGalaxyClusterRequest: + required: true + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/ImportGalaxyClusterItem" + + ExportGalaxyClusterRequest: + content: + application/json: + schema: + type: object + properties: + Galaxy: + type: object + properties: + default: + description: "`true` to filter out galaxy clusters with `default=true` set." + type: boolean + custom: + description: "`true` to filter out galaxy clusters with `default=false` set" + type: boolean + distribution: + $ref: "#/components/schemas/DistributionLevelId" + format: + description: "If set to `misp-galaxy` result set is in the misp-galaxy format." + type: string + enum: + - "default" + - "misp-galaxy" + download: + description: "`true` returns the response as a json file attachment, `false` returns the response in the response body." + type: boolean + + AttachGalaxyClusterRequest: + content: + application/json: + schema: + type: object + properties: + Galaxy: + type: object + properties: + target_id: + description: "Target galaxy cluster to attach." + type: integer + format: int32 + example: 1235 + + SearchGalaxyClustersRequest: + content: + application/json: + schema: + type: object + properties: + context: + type: string + enum: + - "all" + - "default" + - "org" + - "deleted" + searchall: + description: "Search galaxy clusters by matching any value, description, uuid or galaxy elements values." + type: string + example: "botnet" + + AddGalaxyClusterRequest: + content: + application/json: + schema: + $ref: "#/components/schemas/GalaxyCluster" + + EditGalaxyClusterRequest: + content: + application/json: + schema: + $ref: "#/components/schemas/GalaxyCluster" + + AddUserRequest: + content: + application/json: + schema: + $ref: "#/components/schemas/UserNoId" + + EditUserRequest: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + + AddOrganisationRequest: + content: + application/json: + schema: + $ref: "#/components/schemas/OrganisationNoId" + + EditOrganisationRequest: + content: + application/json: + schema: + type: object + properties: + name: + $ref: "#/components/schemas/OrganisationName" + type: + $ref: "#/components/schemas/OrganisationType" + nationality: + type: string + nullable: true + sector: + type: string + nullable: true + contacts: + type: string + nullable: true + description: + type: string + nullable: true + local: + type: boolean + nullable: true + uuid: + type: string + nullable: true + format: uuid + restricted_to_domain: + nullable: true + type: array + items: + type: string + format: hostname + + EditServerSettingRequest: + content: + application/json: + schema: + type: object + properties: + value: + anyOf: + - type: string + - type: boolean + - type: number + - type: object + + ImportServerRequest: + content: + application/json: + schema: + type: object + properties: + name: + $ref: "#/components/schemas/ServerName" + url: + type: string + example: "https://misppriv.circl.lu" + uuid: + $ref: "#/components/schemas/UUID" + authkey: + $ref: "#/components/schemas/AuthKey" + Organisation: + type: object + properties: + name: + $ref: "#/components/schemas/OrganisationName" + + AddSharingGroupRequest: + content: + application/json: + schema: + $ref: "#/components/schemas/SharingGroupNoId" + + EditSharingGroupRequest: + content: + application/json: + schema: + $ref: "#/components/schemas/SharingGroup" + + AddFeedRequest: + content: + application/json: + schema: + type: object + properties: + name: + $ref: "#/components/schemas/FeedName" + provider: + $ref: "#/components/schemas/FeedProvider" + url: + $ref: "#/components/schemas/FeedUrl" + rules: + $ref: "#/components/schemas/FeedRules" + enabled: + $ref: "#/components/schemas/FeedEnabledFlag" + distribution: + $ref: "#/components/schemas/DistributionLevelId" + sharing_group_id: + $ref: "#/components/schemas/SharingGroupId" + tag_id: + $ref: "#/components/schemas/TagId" + source_format: + $ref: "#/components/schemas/FeedSourceFormat" + fixed_event: + $ref: "#/components/schemas/FeedFixedEvent" + delta_merge: + $ref: "#/components/schemas/FeedDeltaMergeFlag" + event_id: + $ref: "#/components/schemas/EventId" + publish: + $ref: "#/components/schemas/PublishedFlag" + override_ids: + $ref: "#/components/schemas/FeedOverrideIDSFlag" + input_source: + $ref: "#/components/schemas/FeedInputSource" + delete_local_file: + $ref: "#/components/schemas/FeedDeleteLocalFileFlag" + lookup_visible: + $ref: "#/components/schemas/FeedLookupVisibleFlag" + headers: + $ref: "#/components/schemas/FeedHeaders" + caching_enabled: + $ref: "#/components/schemas/FeedCachingEnabledFlag" + force_to_ids: + $ref: "#/components/schemas/FeedForceToIDSFlag" + orgc_id: + $ref: "#/components/schemas/OrganisationId" + + EditFeedRequest: + content: + application/json: + schema: + type: object + properties: + id: + $ref: "#/components/schemas/FeedId" + name: + $ref: "#/components/schemas/FeedName" + provider: + $ref: "#/components/schemas/FeedProvider" + url: + $ref: "#/components/schemas/FeedUrl" + rules: + $ref: "#/components/schemas/FeedRules" + enabled: + $ref: "#/components/schemas/FeedEnabledFlag" + distribution: + $ref: "#/components/schemas/DistributionLevelId" + sharing_group_id: + $ref: "#/components/schemas/SharingGroupId" + tag_id: + $ref: "#/components/schemas/TagId" + source_format: + $ref: "#/components/schemas/FeedSourceFormat" + fixed_event: + $ref: "#/components/schemas/FeedFixedEvent" + delta_merge: + $ref: "#/components/schemas/FeedDeltaMergeFlag" + event_id: + $ref: "#/components/schemas/EventId" + publish: + $ref: "#/components/schemas/PublishedFlag" + override_ids: + $ref: "#/components/schemas/FeedOverrideIDSFlag" + input_source: + $ref: "#/components/schemas/FeedInputSource" + delete_local_file: + $ref: "#/components/schemas/FeedDeleteLocalFileFlag" + lookup_visible: + $ref: "#/components/schemas/FeedLookupVisibleFlag" + headers: + $ref: "#/components/schemas/FeedHeaders" + caching_enabled: + $ref: "#/components/schemas/FeedCachingEnabledFlag" + force_to_ids: + $ref: "#/components/schemas/FeedForceToIDSFlag" + orgc_id: + $ref: "#/components/schemas/OrganisationId" + + WarninglistsSearchRequest: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + value: + description: "Search term to be used to match warninglists name, description or type." + type: string + nullable: true + enabled: + type: boolean + nullable: true + + WarninglistsToggleEnableRequest: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + id: + $ref: "#/components/schemas/WarninglistsIdFilter" + name: + $ref: "#/components/schemas/WarninglistsNameFilter" + enabled: + type: boolean + nullable: false + + WarninglistCheckValuesRequest: + content: + application/json: + schema: + type: array + items: + type: string + example: "10.128.0.2" + + ToggleEnableNoticelistRequest: + content: + application/json: + schema: + type: object + properties: + Noticelist: + type: object + properties: + data: + description: "Id of the noticelist to enable/disable." + type: integer + example: 1 + + AddObjectRequest: + content: + application/json: + schema: + type: object + properties: + Attribute: + type: array + items: + type: object + properties: + category: + $ref: "#/components/schemas/AttributeCategory" + value: + $ref: "#/components/schemas/AttributeValue" + to_ids: + $ref: "#/components/schemas/ToIDS" + disable_correlation: + $ref: "#/components/schemas/DisableCorrelationFlag" + distribution: + $ref: "#/components/schemas/DisableCorrelationFlag" + comment: + $ref: "#/components/schemas/AttributeComment" + object_relation: + $ref: "#/components/schemas/ObjectRelation" + + AddTagRequest: + content: + application/json: + schema: + $ref: "#/components/schemas/TagNoId" + + EditTagRequest: + content: + application/json: + schema: + $ref: "#/components/schemas/TagNoId" + + responses: + AttributeResponse: + description: "An attribute" + content: + application/json: + schema: + type: object + properties: + Attribute: + $ref: "#/components/schemas/Attribute" + + AttributeListResponse: + description: "A list of attributes" + content: + application/json: + schema: + $ref: "#/components/schemas/AttributeList" + + DeleteAttributeResponse: + description: "Delete attribute response" + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Attribute deleted. + + AddAttributeTagResponse: + description: "Add attribute tag response" + content: + application/json: + schema: + type: object + properties: + saved: + description: "`true` if the tag was succesfully added, `false` if it failed" + type: boolean + nullable: false + success: + description: "Present if the tag was succesfully added" + type: string + nullable: true + example: "Tag added." + check_publish: + type: boolean + nullable: true + errors: + type: string + nullable: true + example: Tag could not be added. + + RemoveAttributeTagResponse: + description: "Remove attribute tag response" + content: + application/json: + schema: + type: object + properties: + saved: + description: "`true` if the tag was succesfully removed, `false` if it failed" + type: boolean + nullable: false + success: + description: "Present if the tag was succesfully added" + type: string + nullable: true + example: "Tag removed." + check_publish: + type: boolean + nullable: true + errors: + type: string + nullable: true + example: Tag could not be added. + + AttributesRestSearchResponse: + description: "Rest search attributes response" + headers: + X-Result-Count: + $ref: "#/components/headers/X-Result-Count" + X-Export-Module-Used: + $ref: "#/components/headers/X-Export-Module-Used" + X-Response-Format: + $ref: "#/components/headers/X-Response-Format" + content: + application/json: + schema: + type: object + properties: + response: + type: object + properties: + Attribute: + $ref: "#/components/schemas/AttributeRestSearchList" + + AttributeStatisticsResponse: + description: "Attribute statistics response" + content: + application/json: + schema: + $ref: "#/components/schemas/AttributeStatisticsResponse" + + DescribeAttributeTypesResponse: + description: "Describe attribute categories and types response" + content: + application/json: + schema: + $ref: "#/components/schemas/DescribeAttributeTypesResponse" + + AddEventResponse: + description: "A freshly created event" + content: + application/json: + schema: + $ref: "#/components/schemas/CreatedEvent" + + EditEventResponse: + description: "A freshly updated event" + content: + application/json: + schema: + $ref: "#/components/schemas/UpdatedEvent" + + DeleteEventResponse: + description: "Delete event response" + content: + application/json: + schema: + type: object + properties: + saved: + description: "`true` if the event was succesfully deleted, `false` if it failed" + type: boolean + success: + description: "`true` if the event was succesfully deleted, `false` if it failed" + nullable: true + type: boolean + name: + type: string + example: "Event deleted." + message: + type: string + example: "Could not delete Event" + url: + type: string + example: "/events/delete/1" + errors: + description: "Only present if an error occurred when deleting the event" + type: string + nullable: true + example: "Event was not deleted." + + AddEventTagResponse: + description: "Add event tag response" + content: + application/json: + schema: + type: object + properties: + saved: + description: "`true` if the tag was succesfully added, `false` if it failed" + type: boolean + nullable: false + success: + description: "Present if the tag was succesfully added" + type: string + nullable: true + example: "Tag added." + check_publish: + type: boolean + nullable: true + errors: + type: string + nullable: true + example: Tag could not be added. + + RemoveEventTagResponse: + description: "Remove event tag response" + content: + application/json: + schema: + type: object + properties: + saved: + description: "`true` if the tag was succesfully removed, `false` if it failed" + type: boolean + nullable: false + success: + description: "Present if the tag was succesfully added" + type: string + nullable: true + example: "Tag removed." + check_publish: + type: boolean + nullable: true + errors: + type: string + nullable: true + example: Tag could not be added. + + ExtendedEventListResponse: + description: "A list of events with extended properties" + headers: + X-Result-Count: + $ref: "#/components/headers/X-Result-Count" + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/ExtendedEventList" + - $ref: "#/components/schemas/SlimEventList" + + ExtendedEventResponse: + description: "An event with extended properties" + content: + application/json: + schema: + type: object + properties: + Event: + $ref: "#/components/schemas/ExtendedEvent" + + EventsRestSearchResponse: + description: "Rest search events response" + headers: + X-Result-Count: + $ref: "#/components/headers/X-Result-Count" + X-Export-Module-Used: + $ref: "#/components/headers/X-Export-Module-Used" + X-Response-Format: + $ref: "#/components/headers/X-Response-Format" + content: + application/json: + schema: + type: object + properties: + response: + $ref: "#/components/schemas/EventRestSearchList" + + PublishEventResponse: + description: "Publish event response" + content: + application/json: + schema: + type: object + properties: + name: + type: string + example: "Publish" + message: + type: string + example: "Job queued" + url: + type: string + example: "https://misp.local/events/alert/1" + id: + type: string + format: int32 + + UnpublishEventResponse: + description: "Unpublish event response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Event unpublished." + message: + type: string + example: "Event unpublished." + url: + type: string + example: "/events/unpublish/1" + + GalaxyListResponse: + description: "A list of galaxies" + content: + application/json: + schema: + type: array + items: + type: object + properties: + Galaxy: + $ref: "#/components/schemas/Galaxy" + + ExtendedGalaxyResponse: + description: "A extended galaxy response" + content: + application/json: + schema: + $ref: "#/components/schemas/ExtendedGalaxy" + + UpdateGalaxiesResponse: + description: "Update galaxies response" + content: + application/json: + schema: + type: object + properties: + saved: + description: "Present and `true` if the galaxies were succesfully updated." + nullable: true + type: boolean + success: + description: "Present and `true` if the galaxies were succesfully updated." + nullable: true + type: boolean + name: + type: string + example: "Galaxies updated." + message: + type: string + example: "Galaxies updated." + url: + type: string + example: "/galaxies/update" + + DeleteGalaxyResponse: + description: "Delete galaxy response" + content: + application/json: + schema: + type: object + properties: + saved: + description: "Present and `true` if the galaxy was succesfully removed." + nullable: true + type: boolean + success: + description: "Present and `true` if the galaxy was succesfully removed." + nullable: true + type: boolean + name: + type: string + example: "Galaxy deleted" + message: + type: string + example: "Galaxy deleted" + url: + type: string + example: "/galaxies/delete" + + ImportGalaxyClusterResponse: + description: "Import galaxy cluster response" + content: + application/json: + schema: + type: object + properties: + saved: + description: "Present and `true` if the galaxy was succesfully imported." + nullable: true + type: boolean + success: + description: "Present and `true` if the galaxy was succesfully imported." + nullable: true + type: boolean + name: + type: string + example: "'Galaxy clusters imported. 1 imported, 0 ignored, 0 failed." + message: + type: string + example: "'Galaxy clusters imported. 1 imported, 0 ignored, 0 failed." + url: + type: string + example: "/galaxies/import" + + ExportGalaxyClustersResponse: + description: "Export galaxy clusters response" + content: + application/json: + schema: + oneOf: + - type: array + items: + $ref: "#/components/schemas/GalaxyCluster" + - $ref: "#/components/schemas/GalaxyMispFormat" + + AttachGalaxyClusterResponse: + description: "Attach galaxy cluster response" + content: + application/json: + schema: + type: object + properties: + saved: + description: "Present and `true` if the galaxy cluster was succesfully attached." + type: boolean + success: + description: "Status message of the operation." + type: string + example: "Cluster attached." + check_publish: + type: boolean + + GalaxyClusterResponse: + description: "Galaxy cluster by ID response" + content: + application/json: + schema: + type: object + properties: + GalaxyCluster: + $ref: "#/components/schemas/GalaxyCluster" + + ExtendedGalaxyClusterResponse: + description: "Extended galaxy cluster by ID response" + content: + application/json: + schema: + type: object + properties: + GalaxyCluster: + $ref: "#/components/schemas/ExtendedGalaxyCluster" + + GalaxyClusterListResponse: + description: "Get galaxy clusters response" + content: + application/json: + schema: + type: array + items: + type: object + properties: + GalaxyCluster: + $ref: "#/components/schemas/GalaxyCluster" + + PublishGalaxyClusterResponse: + description: "Publish galaxy cluster response" + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: "Publish job queued. Job ID: 4e9d26c275a7b190fcab10029df8c6b6" + + UnpublishGalaxyClusterResponse: + description: "Unpublish galaxy cluster response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "GalaxyCluster unpublished" + message: + type: string + example: "GalaxyCluster unpublished" + url: + type: string + example: "/galaxy_clusters/publish/1" + + DeleteGalaxyClusterResponse: + description: "Delete galaxy cluster response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Galaxy cluster successfuly soft deleted." + message: + type: string + example: "Galaxy cluster successfuly soft deleted." + url: + type: string + example: "/galaxy_clusters/delete/1" + + RestoreGalaxyClusterResponse: + description: "Restore galaxy cluster response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "GalaxyCluster restored" + message: + type: string + example: "GalaxyCluster restored" + url: + type: string + example: "/galaxy_clusters/restore/1" + + ResetUserPasswordResponse: + description: "Reset user password response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: string + example: "New credentials sent." + + UserResponse: + description: "User response" + content: + application/json: + schema: + $ref: "#/components/schemas/User" + + UserListResponse: + description: "User list response" + content: + application/json: + schema: + $ref: "#/components/schemas/UserList" + + ExtendedUserResponse: + description: "Extended user response" + content: + application/json: + schema: + $ref: "#/components/schemas/ExtendedUser" + + DeleteUserResponse: + description: "Delete user response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "User deleted." + message: + type: string + example: "User deleted." + url: + type: string + example: "/admin/users/delete/1" + + OrganisationResponse: + description: "Organisation list response" + content: + application/json: + schema: + $ref: "#/components/schemas/Organisation" + + OrganisationListResponse: + description: "Organisation list response" + content: + application/json: + schema: + $ref: "#/components/schemas/OrganisationList" + + DeleteOrganisationResponse: + description: "Delete organisation response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Organisation deleted" + message: + type: string + example: "Organisation deleted" + url: + type: string + example: "/admin/organisations/delete/1" + + ServerResponse: + description: "Server response" + content: + application/json: + schema: + type: object + properties: + Server: + $ref: "#/components/schemas/Server" + + ServerListResponse: + description: "Server list response" + content: + application/json: + schema: + $ref: "#/components/schemas/ServerList" + + DeleteServerResponse: + description: "Delete server response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Server deleted" + message: + type: string + example: "Server deleted" + url: + type: string + example: "/servers/delete/1" + + PullServerResponse: + description: "Pull server response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Pull queued for background execution. Job ID: 1" + message: + type: string + example: "Pull queued for background execution. Job ID: 1" + url: + type: string + example: "/servers/pull/1" + + PushServerResponse: + description: "Push server response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Push queued for background execution. Job ID: 1" + message: + type: string + example: "Push queued for background execution. Job ID: 1" + url: + type: string + example: "/servers/push/1" + + ServerVersionResponse: + description: "Server version" + content: + application/json: + schema: + type: object + properties: + version: + type: string + example: "2.4.142" + perm_sync: + type: boolean + perm_sighting: + type: boolean + perm_galaxy_editor: + type: boolean + request_encoding: + type: array + items: + type: string + enum: + - "gzip" + - "br" + + ServerPyMISPVersionResponse: + description: "Server PyMISP version" + content: + application/json: + schema: + type: object + properties: + version: + type: string + example: "2.4.142" + + ServerSettingsResponse: + description: "Server settings and diagnostics" + content: + application/json: + schema: + type: object + properties: + version: + type: object + properties: + current: + type: string + example: "v2.4.142" + newest: + type: string + example: "v2.4.142" + upToDate: + type: string + example: "same" + phpSettings: + type: object + properties: + max_execution_time: + $ref: "#/components/schemas/PhpServerSetting" + memory_limit: + $ref: "#/components/schemas/PhpServerSetting" + upload_max_filesize: + $ref: "#/components/schemas/PhpServerSetting" + post_max_size: + $ref: "#/components/schemas/PhpServerSetting" + gpgStatus: + type: string + example: "FAIL: Failed to load GnuPG" + proxyStatus: + type: string + example: "not configured (so not tested)" + zmqStatus: + type: integer + example: 1 + stix: + type: object + properties: + operational: + type: integer + example: 1 + stix: + $ref: "#/components/schemas/ServerPackageVersion" + cybox: + $ref: "#/components/schemas/ServerPackageVersion" + mixbox: + $ref: "#/components/schemas/ServerPackageVersion" + maec: + $ref: "#/components/schemas/ServerPackageVersion" + stix2: + $ref: "#/components/schemas/ServerPackageVersion" + pymisp: + $ref: "#/components/schemas/ServerPackageVersion" + moduleStatus: + type: object + properties: + Enrichment: + type: integer + example: 1 + Import: + type: integer + example: 1 + Export: + type: integer + example: 1 + Cortex: + type: integer + example: 1 + writeableDirs: + type: object + example: + "/tmp": 0 + "/var/www/MISP/app/tmp": 0 + "/var/www/MISP/app/files": 0 + "/var/www/MISP/app/files/scripts/tmp": 0 + writeableFiles: + type: object + example: + "/var/www/MISP/app/Config/config.php": 0 + "/var/www/MISP/.git/ORIG_HEAD": 2 + readableFiles: + type: object + example: + "/var/www/MISP/app/files/scripts/stixtest.py": 0 + dbDiagnostics: + type: object + example: + "admin_settings": + "table": "admin_settings" + "used": "0.03 MB" + "reclaimable": "0 MB" + "data_in_bytes": 16384 + "index_in_bytes": 16384 + "reclaimable_in_bytes": 0 + "allowedlist": + "table": "allowedlist" + "used": "0.02 MB" + "reclaimable": "0 MB" + "data_in_bytes": 16384 + "index_in_bytes": 0 + "reclaimable_in_bytes": 0 + dbSchemaDiagnostics: + type: object + properties: + dataSource: + type: string + example: "Database/Mysql" + actual_db_version: + type: string + example: "68" + checked_table_column: + type: array + items: + type: string + example: "column_name" + diagnostic: + type: object + diagnostic_index: + type: array + items: + type: object + expected_db_version: + type: string + example: "67" + error: + type: string + update_locked: + type: boolean + remaining_lock_time: + type: number + update_fail_number_reached: + type: boolean + indexes: + type: object + example: + "admin_settings": + "id": true + "setting": false + columnPerTable: + type: object + example: + "admin_settings": + - "id" + - "setting" + - "value" + redisInfo: + type: object + example: + "extensionVersion": "5.1.1" + "connection": true + "redis_version": "5.0.7" + "redis_git_sha1": 0 + "redis_git_dirty": 0 + "redis_build_id": "636cde3b5c7a3923" + "redis_mode": "standalone" + "os": "Linux 5.8.0-50-generic x86_64" + "arch_bits": 64 + "multiplexing_api": "epoll" + "atomicvar_api": "atomic-builtin" + "gcc_version": "9.2.1" + "process_id": 1051 + "run_id": "f894944d92c978df93a18821fb5ebe30dfd0b257" + "tcp_port": 6379 + "uptime_in_seconds": 327116 + "uptime_in_days": 3 + "hz": 10 + "configured_hz": 10 + "lru_clock": 10365184 + "executable": "/usr/bin/redis-server" + "config_file": "/etc/redis/redis.conf" + "connected_clients": 18 + "client_recent_max_input_buffer": 2 + "client_recent_max_output_buffer": 0 + "blocked_clients": 0 + "used_memory": 1309488 + "used_memory_human": "1.25M" + "used_memory_rss": 5541888 + "used_memory_rss_human": "5.29M" + "used_memory_peak": 1410464 + "used_memory_peak_human": "1.35M" + "used_memory_peak_perc": "92.84%" + "used_memory_overhead": 1200800 + "used_memory_startup": 796232 + "used_memory_dataset": 108688 + "used_memory_dataset_perc": "21.18%" + "allocator_allocated": 1480176 + "allocator_active": 1896448 + "allocator_resident": 5890048 + "total_system_memory": 33406590976 + "total_system_memory_human": "31.11G" + "used_memory_lua": 41984 + "used_memory_lua_human": "41.00K" + "used_memory_scripts": 0 + "used_memory_scripts_human": "0B" + "number_of_cached_scripts": 0 + "maxmemory": 0 + "maxmemory_human": "0B" + "maxmemory_policy": "noeviction" + "allocator_frag_ratio": 1.28 + "allocator_frag_bytes": 416272 + "allocator_rss_ratio": 3.11 + "allocator_rss_bytes": 3993600 + "rss_overhead_ratio": 0.94 + "rss_overhead_bytes": -348160 + "mem_fragmentation_ratio": 4.24 + "mem_fragmentation_bytes": 4233432 + "mem_not_counted_for_evict": 0 + "mem_replication_backlog": 0 + "mem_clients_slaves": 0 + "mem_clients_normal": 402912 + "mem_aof_buffer": 0 + "mem_allocator": "jemalloc-5.2.1" + "active_defrag_running": 0 + "lazyfree_pending_objects": 0 + "loading": 0 + "rdb_changes_since_last_save": 0 + "rdb_bgsave_in_progress": 0 + "rdb_last_save_time": 1620977919 + "rdb_last_bgsave_status": "ok" + "rdb_last_bgsave_time_sec": 0 + "rdb_current_bgsave_time_sec": -1 + "rdb_last_cow_size": 446464 + "aof_enabled": 0 + "aof_rewrite_in_progress": 0 + "aof_rewrite_scheduled": 0 + "aof_last_rewrite_time_sec": -1 + "aof_current_rewrite_time_sec": -1 + "aof_last_bgrewrite_status": "ok" + "aof_last_write_status": "ok" + "aof_last_cow_size": 0 + "total_connections_received": 289 + "total_commands_processed": 252747 + "instantaneous_ops_per_sec": 7 + "total_net_input_bytes": 12111506 + "total_net_output_bytes": 1232466 + "instantaneous_input_kbps": 0.36 + "instantaneous_output_kbps": 0.03 + "rejected_connections": 0 + "sync_full": 0 + "sync_partial_ok": 0 + "sync_partial_err": 0 + "expired_keys": 17 + "expired_stale_perc": 0 + "expired_time_cap_reached_count": 0 + "evicted_keys": 0 + "keyspace_hits": 70 + "keyspace_misses": 62805 + "pubsub_channels": 0 + "pubsub_patterns": 0 + "latest_fork_usec": 168 + "migrate_cached_sockets": 0 + "slave_expires_tracked_keys": 0 + "active_defrag_hits": 0 + "active_defrag_misses": 0 + "active_defrag_key_hits": 0 + "active_defrag_key_misses": 0 + "role": "master" + "connected_slaves": 0 + "master_replid": "d5e7afcf4fd1a31e539a4eadd5caf2a7da6d121c" + "master_replid2": 0 + "master_repl_offset": 0 + "second_repl_offset": -1 + "repl_backlog_active": 0 + "repl_backlog_size": 1048576 + "repl_backlog_first_byte_offset": 0 + "repl_backlog_histlen": 0 + "used_cpu_sys": 195.014281 + "used_cpu_user": 217.352183 + "used_cpu_sys_children": 0.050885 + "used_cpu_user_children": 0.076436 + "cluster_enabled": 0 + "db0": "keys=15,expires=0,avg_ttl=0" + "db13": "keys=12,expires=4,avg_ttl=21265731140" + finalSettings: + type: array + items: + $ref: "#/components/schemas/MispSetting" + extensions: + type: object + properties: + cli: + type: object + properties: + phpversion: + type: string + example: "7.4.3" + extensions: + type: object + example: + "json": + "web_version": "7.4.3" + "web_version_outdated": false + "cli_version": "7.4.3" + "cli_version_outdated": false + "required": true + "info": null + workers: + type: object + properties: + cache: + $ref: "#/components/schemas/WorkersStatus" + default: + $ref: "#/components/schemas/WorkersStatus" + email: + $ref: "#/components/schemas/WorkersStatus" + prio: + $ref: "#/components/schemas/WorkersStatus" + update: + $ref: "#/components/schemas/WorkersStatus" + scheduler: + $ref: "#/components/schemas/WorkersStatus" + proc_accessible: + type: boolean + controls: + type: boolean + + StartWorkerResponse: + description: "Start worker response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Worker start signal sent" + message: + type: string + example: "Worker start signal sent" + url: + type: string + example: "/servers/startWorker/email" + + StopWorkerResponse: + description: "Stop worker response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Worker stop signal sent" + message: + type: string + example: "Worker stop signal sent" + url: + type: string + example: "/servers/startWorker/1234" + + KillAllWorkersResponse: + description: "Kill all workers response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Killing workers." + message: + type: string + example: "Killing workers." + url: + type: string + example: "/servers/killAllWorkers" + + RestartWorkersResponse: + description: "Restart workers response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Restarting workers." + message: + type: string + example: "Restarting workers." + url: + type: string + example: "/servers/restartWorkers" + + RestartDeadWorkersResponse: + description: "Restart dead workers response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Restarting workers." + message: + type: string + example: "Restarting workers." + url: + type: string + example: "/servers/restartDeadWorkers" + + GetWorkersResponse: + description: "Stop worker response" + content: + application/json: + schema: + type: object + properties: + cache: + $ref: "#/components/schemas/WorkersStatus" + default: + $ref: "#/components/schemas/WorkersStatus" + email: + $ref: "#/components/schemas/WorkersStatus" + prio: + $ref: "#/components/schemas/WorkersStatus" + update: + $ref: "#/components/schemas/WorkersStatus" + scheduler: + $ref: "#/components/schemas/WorkersStatus" + proc_accessible: + type: boolean + controls: + type: boolean + + UpdateServerResponse: + description: "Update server response" + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + anyOf: + - $ref: "#/components/schemas/UpdateServerResultItem" + - type: string + example: "Update failed, you are not on branch" + + CacheServerResponse: + description: "Cache server response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Server caching job initiated." + message: + type: string + example: "Server caching job initiated." + url: + type: string + example: "/servers/cache" + + CreateSyncResponse: + description: "Create server sync" + content: + application/json: + schema: + type: object + properties: + Server: + type: object + properties: + url: + type: string + example: "https://misppriv.circl.lu" + uuid: + $ref: "#/components/schemas/UUID" + authkey: + $ref: "#/components/schemas/AuthKey" + Organisation: + type: object + properties: + name: + $ref: "#/components/schemas/OrganisationName" + uuid: + $ref: "#/components/schemas/UUID" + + GetInstanceUUIDResponse: + description: "Get instance UUID response" + content: + application/json: + schema: + type: object + properties: + uuid: + $ref: "#/components/schemas/UUID" + + GetServerSettingResponse: + description: "Get setting response" + content: + application/json: + schema: + $ref: "#/components/schemas/MispSetting" + + EditServerSettingResponse: + description: "Edit setting response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Field updated" + message: + type: string + example: "Field updated" + url: + type: string + example: "/servers/serverSettingsEdit" + + SharingGroupResponse: + description: "Get sharing group response" + content: + application/json: + schema: + type: object + properties: + SharingGroup: + $ref: "#/components/schemas/SharingGroup" + Organisation: + $ref: "#/components/schemas/Organisation" + SharingGroupOrg: + type: array + items: + $ref: "#/components/schemas/SharingGroupOrganisation" + SharingGroupServer: + type: array + items: + $ref: "#/components/schemas/SharingGroupServer" + editable: + type: boolean + deletable: + type: boolean + + SharingGroupListResponse: + description: "Get sharing groups response" + content: + application/json: + schema: + type: object + properties: + response: + type: array + items: + $ref: "#/components/schemas/SharingGroupListItem" + + DeleteSharingGroupResponse: + description: "Delete sharing group response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "SharingGroup deleted" + message: + type: string + example: "SharingGroup deleted" + url: + type: string + example: "/sharing_groups/delete/1" + + AddOrganisationToSharingGroupResponse: + description: "Add organisation to a sharing group response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Organisation added to the sharing group." + message: + type: string + example: "Organisation added to the sharing group." + url: + type: string + example: "/sharing_groups/addOrg" + + RemoveOrganisationFromSharingGroupResponse: + description: "Remove organisation from a sharing group response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Organisation removed from the sharing group." + message: + type: string + example: "Organisation removed from the sharing group." + url: + type: string + example: "/sharing_groups/removeOrg" + + AddServerToSharingGroupResponse: + description: "Add server to a sharing group response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Server added to the sharing group." + message: + type: string + example: "Server added to the sharing group." + url: + type: string + example: "/sharing_groups/addServer" + + RemoveServerFromSharingGroupResponse: + description: "Remove server from a sharing group response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Server removed from the sharing group." + message: + type: string + example: "Server removed from the sharing group." + url: + type: string + example: "/sharing_groups/removeServer" + + FeedListResponse: + description: "Get feeds response" + content: + application/json: + schema: + type: array + items: + type: object + properties: + Feed: + $ref: "#/components/schemas/Feed" + + FeedResponse: + description: "Get feed response" + content: + application/json: + schema: + type: object + properties: + Feed: + $ref: "#/components/schemas/Feed" + + EnableFeedResponse: + description: "Enable feed response" + content: + application/json: + schema: + type: object + properties: + name: + type: string + example: "Feed enabled." + message: + type: string + example: "Feed enabled." + url: + type: string + example: "/feeds/enable/1" + + DisableFeedResponse: + description: "Disable feed response" + content: + application/json: + schema: + type: object + properties: + name: + type: string + example: "Feed disabled." + message: + type: string + example: "Feed disabled." + url: + type: string + example: "/feeds/disable/1" + + CacheFeedsResponse: + description: "Cache feeds response" + content: + application/json: + schema: + type: object + properties: + name: + type: string + example: "Feed caching job initiated." + message: + type: string + example: "Feed caching job initiated." + url: + type: string + example: "/feeds/cacheFeed" + + FetchFromFeedResponse: + description: "Fetch feed response" + content: + application/json: + schema: + type: object + properties: + result: + type: string + example: "Pull queued for background execution." + + FetchFromAllFeedsResponse: + description: "Fetch all feeds response" + content: + application/json: + schema: + type: object + properties: + result: + type: string + example: "Pull queued for background execution." + + WarninglistListResponse: + description: "Get warninglists response" + content: + application/json: + schema: + type: object + properties: + Warninglists: + type: array + items: + type: object + properties: + Warninglist: + $ref: "#/components/schemas/Warninglist" + + WarninglistToggleEnabledResponse: + description: "Toggle enable warninglists response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: string + example: "1 warninglist(s) disabled" + + WarninglistResponse: + description: "Get warninglists response" + content: + application/json: + schema: + type: object + properties: + Warninglist: + $ref: "#/components/schemas/Warninglist" + + WarninglistMatchListResponse: + description: "List of values matching warninglists response" + content: + application/json: + schema: + type: object + example: + "10.128.0.2": + - "id": "10" + "name": "List of known Wikimedia address ranges" + + UpdateWarninglistsResponse: + description: "List of values matching warninglists response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + nullable: true + type: boolean + name: + type: string + example: "Successfully updated 1 warninglists." + message: + type: string + example: "Successfully updated 1 warninglists." + url: + type: string + example: "/warninglists/update" + + NoticelistListResponse: + description: "Get noticelists response" + content: + application/json: + schema: + type: array + items: + type: object + properties: + Noticelist: + $ref: "#/components/schemas/Noticelist" + + NoticelistResponse: + description: "Get noticelist response" + content: + application/json: + schema: + type: object + properties: + Noticelist: + $ref: "#/components/schemas/Noticelist" + + NoticelistToggleEnableResponse: + description: "Toggle enable noticelist response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: string + example: "Noticelist enabled" + + UpdateNoticelistsResponse: + description: "Toggle enable noticelist response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Successfully updated 1 noticelists." + message: + type: string + example: "Successfully updated 1 noticelists." + url: + type: string + example: "/noticelists/update" + + ObjectResponse: + description: "Object response" + content: + application/json: + schema: + type: object + properties: + Object: + $ref: "#/components/schemas/Object" + + ExtendedObjectResponse: + description: "Extended object response" + content: + application/json: + schema: + type: object + properties: + Object: + $ref: "#/components/schemas/ExtendedObject" + + DeleteObjectResponse: + description: "Delete object response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Object deleted" + message: + type: string + example: "Object deleted" + url: + type: string + example: "/objects/delete/1" + + SightingListResponse: + description: "Get sightings response" + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Sighting" + + SightingResponse: + description: "Add sighting response" + content: + application/json: + schema: + $ref: "#/components/schemas/Sighting" + + DeleteSightingResponse: + description: "Delete sighting response" + content: + application/json: + schema: + type: object + properties: + saved: + type: boolean + success: + type: boolean + name: + type: string + example: "Sighting successfully deleted." + message: + type: string + example: "Sighting successfully deleted." + url: + type: string + example: "/sightings/delete/1" + + TagListResponse: + description: "Tag list response" + content: + application/json: + schema: + type: object + properties: + Tag: + $ref: "#/components/schemas/TagList" + + TagResponse: + description: "Tag response" + content: + application/json: + schema: + $ref: "#/components/schemas/Tag" + + DeleteTagResponse: + description: "Delete tag response" + content: + application/json: + schema: + type: object + properties: + name: + type: string + example: "Tag deleted." + message: + type: string + example: "Tag deleted." + url: + type: string + example: "https://misppriv.circl.lu/tags/delete/1" + + EditTagResponse: + description: "Tag response" + content: + application/json: + schema: + type: object + properties: + Tag: + $ref: "#/components/schemas/Tag" + + SearchTagResponse: + description: "Search tag response" + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/ExtendedTag" + + ApiErrorResponse: + description: "Unexpected API error" + content: + application/json: + schema: + $ref: "#/components/schemas/ApiError" + + NotFoundApiErrorResponse: + description: "The specified resource was not found" + content: + application/json: + schema: + $ref: "#/components/schemas/NotFoundApiError" + + UnauthorizedApiErrorResponse: + description: "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header." + content: + application/json: + schema: + $ref: "#/components/schemas/UnauthorizedApiError" + + headers: + X-Result-Count: + description: Result set count + schema: + type: integer + + X-Export-Module-Used: + description: Export module used + schema: + type: string + enum: + - json + - xml + - download + - stix + - stix2 + + X-Response-Format: + description: Response format + schema: + type: string + enum: + - json + - xml + - download + - stix + - stix2 + +security: + - ApiKeyAuth: [] diff --git a/app/webroot/img/CyCat.ico b/app/webroot/img/CyCat.ico new file mode 100644 index 000000000..2c68805a8 Binary files /dev/null and b/app/webroot/img/CyCat.ico differ diff --git a/app/webroot/js/markdownEditor/event-report.js b/app/webroot/js/markdownEditor/event-report.js index be7a42926..7e9b6d23c 100644 --- a/app/webroot/js/markdownEditor/event-report.js +++ b/app/webroot/js/markdownEditor/event-report.js @@ -362,6 +362,7 @@ function MISPElementSuggestionRule(state) { var blockTokens = state.tokens var tokens, blockToken, currentToken var indexOfAllLines, lineOffset, absoluteLine, relativeIndex + var tokenMap var i, j, l for (i = 0, l = blockTokens.length; i < l; i++) { blockToken = blockTokens[i] @@ -380,7 +381,8 @@ function MISPElementSuggestionRule(state) { blockToken.indexOfAllLines = indexOfAllLines } lineOffset = getLineNumInArrayList(currentToken.content.indexes.start, blockToken.indexOfAllLines.bMarks) - var absoluteLine = blockToken.map[0] + lineOffset + tokenMap = findBackClosestStartLine(blockTokens, i) + var absoluteLine = tokenMap[0] + lineOffset var relativeIndex = currentToken.content.indexes.start - blockToken.indexOfAllLines.bMarks[lineOffset] state.tokens[i].children[j].content.indexes.lineStart = absoluteLine state.tokens[i].children[j].content.indexes.start = relativeIndex @@ -2113,6 +2115,20 @@ function getLineNumInArrayList(index, arrayToSearchInto) { return 0 } +function findBackClosestStartLine(tokens, i) { + if (tokens[i].map !== null) { + return tokens[i].map + } + var token + for (var j = i-1; j >= 0; j--) { + token = tokens[j] + if (token.map !== null) { + return token.map + } + } + return null +} + function parseDestinationValue(str, pos, max) { var level = 0 var lines = 0 diff --git a/app/webroot/js/misp.js b/app/webroot/js/misp.js index 557d10521..e021a138a 100644 --- a/app/webroot/js/misp.js +++ b/app/webroot/js/misp.js @@ -3676,7 +3676,7 @@ function toggleBoolFilter(url, param) { }); if (res[param] !== undefined) { if (param == 'deleted') { - res[param] = res[param] == 0 ? 2 : 0; + res[param] = res[param] == 0 ? 1 : 0; } else { res[param] = res[param] == 0 ? 1 : 0; } @@ -5073,17 +5073,25 @@ function saveDashboardState() { dashBoardSettings.push(temp); } }); - $.ajax({ - data: {value: dashBoardSettings}, - success:function (data, textStatus) { - showMessage('success', 'Dashboard settings saved.'); - }, - error: function (jqXHR, textStatus, errorThrown) { - showMessage('fail', textStatus + ": " + errorThrown); - }, - type: "post", - url: baseurl + '/dashboards/updateSettings', - }); + var url = baseurl + '/dashboards/updateSettings' + fetchFormDataAjax(url, function(formData) { + var $formContainer = $(formData) + $formContainer.find('#DashboardValue').val(JSON.stringify(dashBoardSettings)) + var $theForm = $formContainer.find('form') + xhr({ + data: $theForm.serialize(), + success:function (data) { + showMessage('success', 'Dashboard settings saved.'); + }, + error:function(jqXHR, textStatus, errorThrown) { + showMessage('fail', textStatus + ": " + errorThrown); + }, + beforeSend:function() { + }, + type:"post", + url: $theForm.attr('action') + }); + }) } function updateDashboardWidget(element) { diff --git a/app/webroot/js/redoc.standalone.js b/app/webroot/js/redoc.standalone.js new file mode 100644 index 000000000..a66eeac5c --- /dev/null +++ b/app/webroot/js/redoc.standalone.js @@ -0,0 +1,107 @@ +/*! + * ReDoc - OpenAPI/Swagger-generated API Reference Documentation + * ------------------------------------------------------------- + * Version: "2.0.0-rc.53" + * Repo: https://github.com/Redocly/redoc + */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("null"),function(){try{return require("esprima")}catch(e){}}()):"function"==typeof define&&define.amd?define(["null","esprima"],t):"object"==typeof exports?exports.Redoc=t(require("null"),function(){try{return require("esprima")}catch(e){}}()):e.Redoc=t(e.null,e.esprima)}(this,(function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=219)}([function(e,t,n){"use strict";e.exports=n(293)},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return o})),n.d(t,"__assign",(function(){return i})),n.d(t,"__rest",(function(){return a})),n.d(t,"__decorate",(function(){return s})),n.d(t,"__param",(function(){return l})),n.d(t,"__metadata",(function(){return c})),n.d(t,"__awaiter",(function(){return u})),n.d(t,"__generator",(function(){return p})),n.d(t,"__createBinding",(function(){return f})),n.d(t,"__exportStar",(function(){return d})),n.d(t,"__values",(function(){return h})),n.d(t,"__read",(function(){return m})),n.d(t,"__spread",(function(){return g})),n.d(t,"__spreadArrays",(function(){return v})),n.d(t,"__spreadArray",(function(){return y})),n.d(t,"__await",(function(){return b})),n.d(t,"__asyncGenerator",(function(){return x})),n.d(t,"__asyncDelegator",(function(){return w})),n.d(t,"__asyncValues",(function(){return _})),n.d(t,"__makeTemplateObject",(function(){return O})),n.d(t,"__importStar",(function(){return E})),n.d(t,"__importDefault",(function(){return S})),n.d(t,"__classPrivateFieldGet",(function(){return P})),n.d(t,"__classPrivateFieldSet",(function(){return j})); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function l(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function p(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function g(){for(var e=[],t=0;t1||s(e,t)}))})}function s(e,t){try{(n=o[e](t)).value instanceof b?Promise.resolve(n.value.v).then(l,c):u(i[0][2],n)}catch(e){u(i[0][3],e)}var n}function l(e){s("next",e)}function c(e){s("throw",e)}function u(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function w(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:b(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function _(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function O(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var k=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function E(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&f(t,e,n);return k(t,e),t}function S(e){return e&&e.__esModule?e:{default:e}}function P(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function j(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return B})),n.d(t,"b",(function(){return pt})),n.d(t,"c",(function(){return Re})),n.d(t,"d",(function(){return Je})),n.d(t,"e",(function(){return Xe})),n.d(t,"f",(function(){return wt})),n.d(t,"g",(function(){return Ee})),n.d(t,"h",(function(){return At})),n.d(t,"i",(function(){return H})),n.d(t,"j",(function(){return Ct})),n.d(t,"k",(function(){return dn})),n.d(t,"l",(function(){return bn})),n.d(t,"m",(function(){return Tn})),n.d(t,"n",(function(){return Zt})),n.d(t,"o",(function(){return _e})),n.d(t,"p",(function(){return Bt})),n.d(t,"q",(function(){return Ot})),n.d(t,"r",(function(){return Qe}));function r(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}var z=Symbol("mobx-stored-annotations");function $(e){return Object.assign((function(t,n){U(t,n,e)}),e)}function U(e,t,n){A(e,z)||w(e,z,N({},e[z])),function(e){return"override"===e.annotationType_}(n)||(e[z][t]=n)}var B=Symbol("mobx administration"),q=function(){function e(e){void 0===e&&(e="Atom"),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Fe.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=e}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach((function(e){return e()}))},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach((function(e){return e()}))},t.reportObserved=function(){return ct(this)},t.reportChanged=function(){st(),ut(this),lt()},t.toString=function(){return this.name_},e}(),V=O("Atom",q);function H(e,t,n){void 0===t&&(t=g),void 0===n&&(n=g);var r,o=new q(e);return t!==g&&Tt("onBO",o,t,r),n!==g&&jt(o,n),o}var W={identity:function(e,t){return e===t},structural:function(e,t){return Vn(e,t)},default:function(e,t){return Object.is(e,t)},shallow:function(e,t){return Vn(e,t,1)}};function Y(e,t,n){return Ut(e)?e:Array.isArray(e)?_e.array(e,{name:n}):x(e)?_e.object(e,void 0,{name:n}):k(e)?_e.map(e,{name:n}):E(e)?_e.set(e,{name:n}):e}function Q(e){return e}function G(e,t){return{annotationType_:e,options_:t,make_:K,extend_:X}}function K(e,t){for(var n,o,i,a=!1,u=e.target_,p=null!=(n=null==(o=this.options_)?void 0:o.bound)&&n;u&&u!==c;){var f=s(u,t);if(f){if(u===e.target_||p){var d=J(e,this,t,f);if(!e.defineProperty_(t,d))return;if(a=!0,p)break}if(u!==e.target_){if(kt(f.value)){a=!0;break}var h=J(e,this,t,f,!1);l(u,t,h),a=!0}}u=Object.getPrototypeOf(u)}a?An(e,this,t):(null==(i=e.target_[z])?void 0:i[t])||r(1,this.annotationType_,e.name_+"."+t.toString())}function X(e,t,n,r){var o=J(e,this,t,n);return e.defineProperty_(t,o,r)}function J(e,t,n,r,o){var i,a,s,l,c,u;void 0===o&&(o=rt.safeDescriptors),u=r,t.annotationType_,u.value;var p,f=r.value;(null==(i=t.options_)?void 0:i.bound)&&(f=f.bind(null!=(p=e.proxy_)?p:e.target_));return{value:Ie(null!=(a=null==(s=t.options_)?void 0:s.name)?a:n.toString(),f,null!=(l=null==(c=t.options_)?void 0:c.autoAction)&&l),configurable:!o||e.isPlainObject_,enumerable:!1,writable:!o}}function Z(e,t){return{annotationType_:e,options_:t,make_:ee,extend_:te}}function ee(e,t){for(var n,o=!1,i=e.target_;i&&i!==c;){var a=s(i,t);if(a){if(i!==e.target_){if(zt(a.value)){o=!0;break}var u=ne(e,this,t,a,!1);l(i,t,u)}else{var p=ne(e,this,t,a);if(!e.defineProperty_(t,p))return}o=!0}i=Object.getPrototypeOf(i)}o?An(e,this,t):(null==(n=e.target_[z])?void 0:n[t])||r(1,this.annotationType_,e.name_+"."+t.toString())}function te(e,t,n,r){var o=ne(e,this,t,n);return e.defineProperty_(t,o,r)}function ne(e,t,n,r,o){var i;return void 0===o&&(o=rt.safeDescriptors),i=r,t.annotationType_,i.value,{value:Mt(r.value),configurable:!o||e.isPlainObject_,enumerable:!1,writable:!o}}function re(e,t){return{annotationType_:e,options_:t,make_:oe,extend_:ie}}function oe(e,t){for(var n,o=e.target_;o&&o!==c;){var i=s(o,t);if(i){if(ae(e,this,t,i),!e.defineComputedProperty_(t,N({},this.options_,{get:i.get,set:i.set})))return;return void An(e,this,t)}o=Object.getPrototypeOf(o)}(null==(n=e.target_[z])?void 0:n[t])||r(1,this.annotationType_,e.name_+"."+t.toString())}function ie(e,t,n,r){return ae(e,this,t,n),e.defineComputedProperty_(t,N({},this.options_,{get:n.get,set:n.set}),r)}function ae(e,t,n,r){t.annotationType_,r.get}function se(e,t){return{annotationType_:e,options_:t,make_:le,extend_:ce}}function le(e,t){for(var n,o=e.target_;o&&o!==c;){var i=s(o,t);if(i){var a,l;if(ue(e,this,t,i),!e.defineObservableProperty_(t,i.value,null!=(a=null==(l=this.options_)?void 0:l.enhancer)?a:Y))return;return void An(e,this,t)}o=Object.getPrototypeOf(o)}(null==(n=e.target_[z])?void 0:n[t])||r(1,this.annotationType_,e.name_+"."+t.toString())}function ce(e,t,n,r){var o,i;return ue(e,this,t,n),e.defineObservableProperty_(t,n.value,null!=(o=null==(i=this.options_)?void 0:i.enhancer)?o:Y,r)}function ue(e,t,n,r){t.annotationType_}var pe={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function fe(e){return e||pe}Object.freeze(pe);var de=se("observable"),he=se("observable.ref",{enhancer:Q}),me=se("observable.shallow",{enhancer:function(e,t,n){return null==e||Tn(e)||dn(e)||bn(e)||_n(e)?e:Array.isArray(e)?_e.array(e,{name:n,deep:!1}):x(e)?_e.object(e,void 0,{name:n,deep:!1}):k(e)?_e.map(e,{name:n,deep:!1}):E(e)?_e.set(e,{name:n,deep:!1}):void 0}}),ge=se("observable.struct",{enhancer:function(e,t){return Vn(e,t)?t:e}}),ve=$(de);function ye(e){return!0===e.deep?Y:!1===e.deep?Q:(t=e.defaultDecorator)&&null!=(n=null==(r=t.options_)?void 0:r.enhancer)?n:Y;var t,n,r}function be(e,t,n){if(!y(t))return Ut(e)?e:x(e)?_e.object(e,t,n):Array.isArray(e)?_e.array(e,t):k(e)?_e.map(e,t):E(e)?_e.set(e,t):"object"==typeof e&&null!==e?e:_e.box(e,t);U(e,t,de)}Object.assign(be,ve);var xe,we,_e=a(be,{box:function(e,t){var n=fe(t);return new Me(e,ye(n),n.name,!0,n.equals)},array:function(e,t){var n=fe(t);return(!1===rt.useProxies||!1===n.proxy?zn:rn)(e,ye(n),n.name)},map:function(e,t){var n=fe(t);return new yn(e,ye(n),n.name)},set:function(e,t){var n=fe(t);return new wn(e,ye(n),n.name)},object:function(e,t,n){return It(!1===rt.useProxies||!1===(null==n?void 0:n.proxy)?Sn({},n):function(e,t){var n,r;return h(),e=Sn(e,t),null!=(r=(n=e[B]).proxy_)?r:n.proxy_=new Proxy(e,Wt)}({},n),e,t)},ref:$(he),shallow:$(me),deep:ve,struct:$(ge)}),Oe=re("computed"),ke=re("computed.struct",{equals:W.structural}),Ee=function(e,t){if(y(t))return U(e,t,Oe);if(x(e))return $(re("computed",e));var n=x(t)?t:{};return n.get=e,n.name||(n.name=e.name||""),new $e(n)};Object.assign(Ee,Oe),Ee.struct=$(ke);var Se,Pe=0,je=1,Te=null!=(xe=null==(we=s((function(){}),"name"))?void 0:we.configurable)&&xe,Ae={value:"action",configurable:!0,writable:!1,enumerable:!1};function Ie(e,t,n,r){function o(){return Ce(e,n,t,r||this,arguments)}return void 0===n&&(n=!1),o.isMobxAction=!0,Te&&(Ae.value=e,Object.defineProperty(o,"name",Ae)),o}function Ce(e,t,n,o,i){var a=function(e,t,n,r){0;var o=rt.trackingDerivation,i=!t||!o;st();var a=rt.allowStateChanges;i&&(Ge(),a=Ne(!0));var s=Xe(!0),l={runAsAction_:i,prevDerivation_:o,prevAllowStateChanges_:a,prevAllowStateReads_:s,notifySpy_:!1,startTime_:0,actionId_:je++,parentActionId_:Pe};return Pe=l.actionId_,l}(0,t);try{return n.apply(o,i)}catch(e){throw a.error_=e,e}finally{!function(e){Pe!==e.actionId_&&r(30);Pe=e.parentActionId_,void 0!==e.error_&&(rt.suppressReactionErrors=!0);Le(e.prevAllowStateChanges_),Je(e.prevAllowStateReads_),lt(),e.runAsAction_&&Ke(e.prevDerivation_);0;rt.suppressReactionErrors=!1}(a)}}function Re(e,t){var n=Ne(e);try{return t()}finally{Le(n)}}function Ne(e){var t=rt.allowStateChanges;return rt.allowStateChanges=e,t}function Le(e){rt.allowStateChanges=e}Se=Symbol.toPrimitive;var De,Me=function(e){function t(t,n,r,o,i){var a;return void 0===r&&(r="ObservableValue"),void 0===o&&(o=!0),void 0===i&&(i=W.default),(a=e.call(this,r)||this).enhancer=void 0,a.name_=void 0,a.equals=void 0,a.hasUnreportedChange_=!1,a.interceptors_=void 0,a.changeListeners_=void 0,a.value_=void 0,a.dehancer=void 0,a.enhancer=n,a.name_=r,a.equals=i,a.value_=n(t,void 0,r),a}L(t,e);var n=t.prototype;return n.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},n.set=function(e){this.value_;if((e=this.prepareNewValue_(e))!==rt.UNCHANGED){0,this.setNewValue_(e)}},n.prepareNewValue_=function(e){if(He(this),Yt(this)){var t=Gt(this,{object:this,type:en,newValue:e});if(!t)return rt.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value_,this.name_),this.equals(this.value_,e)?rt.UNCHANGED:e},n.setNewValue_=function(e){var t=this.value_;this.value_=e,this.reportChanged(),Kt(this)&&Jt(this,{type:en,object:this,newValue:e,oldValue:t})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(e){return Qt(this,e)},n.observe_=function(e,t){return t&&e({observableKind:"value",debugObjectName:this.name_,object:this,type:en,newValue:this.value_,oldValue:void 0}),Xt(this,e)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return T(this.get())},n[Se]=function(){return this.valueOf()},t}(q);De=Symbol.toPrimitive;var Fe,ze,$e=function(){function e(e){this.dependenciesState_=Fe.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Fe.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Be(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=ze.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,e.get||r(31),this.derivation=e.get,this.name_=e.name||"ComputedValue",e.set&&(this.setter_=Ie("ComputedValue-setter",e.set)),this.equals_=e.equals||(e.compareStructural||e.struct?W.structural:W.default),this.scope_=e.context,this.requiresReaction_=!!e.requiresReaction,this.keepAlive_=!!e.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){!function(e){if(e.lowestObserverState_!==Fe.UP_TO_DATE_)return;e.lowestObserverState_=Fe.POSSIBLY_STALE_,e.observers_.forEach((function(e){e.dependenciesState_===Fe.UP_TO_DATE_&&(e.dependenciesState_=Fe.POSSIBLY_STALE_,e.onBecomeStale_())}))}(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach((function(e){return e()}))},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach((function(e){return e()}))},t.get=function(){if(this.isComputing_&&r(32,this.name_,this.derivation),0!==rt.inBatch||0!==this.observers_.size||this.keepAlive_){if(ct(this),Ve(this)){var e=rt.trackingContext;this.keepAlive_&&!e&&(rt.trackingContext=this),this.trackAndCompute()&&function(e){if(e.lowestObserverState_===Fe.STALE_)return;e.lowestObserverState_=Fe.STALE_,e.observers_.forEach((function(t){t.dependenciesState_===Fe.POSSIBLY_STALE_?t.dependenciesState_=Fe.STALE_:t.dependenciesState_===Fe.UP_TO_DATE_&&(e.lowestObserverState_=Fe.UP_TO_DATE_)}))}(this),rt.trackingContext=e}}else Ve(this)&&(this.warnAboutUntrackedRead_(),st(),this.value_=this.computeValue_(!1),lt());var t=this.value_;if(qe(t))throw t.cause;return t},t.set=function(e){if(this.setter_){this.isRunningSetter_&&r(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,e)}finally{this.isRunningSetter_=!1}}else r(34,this.name_)},t.trackAndCompute=function(){var e=this.value_,t=this.dependenciesState_===Fe.NOT_TRACKING_,n=this.computeValue_(!0);var r=t||qe(e)||qe(n)||!this.equals_(e,n);return r&&(this.value_=n),r},t.computeValue_=function(e){this.isComputing_=!0;var t,n=Ne(!1);if(e)t=We(this,this.derivation,this.scope_);else if(!0===rt.disableErrorBoundaries)t=this.derivation.call(this.scope_);else try{t=this.derivation.call(this.scope_)}catch(e){t=new Be(e)}return Le(n),this.isComputing_=!1,t},t.suspend_=function(){this.keepAlive_||(Ye(this),this.value_=void 0)},t.observe_=function(e,t){var n=this,r=!0,o=void 0;return Et((function(){var i=n.get();if(!r||t){var a=Ge();e({observableKind:"computed",debugObjectName:n.name_,type:en,object:n,newValue:i,oldValue:o}),Ke(a)}r=!1,o=i}))},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return T(this.get())},t[De]=function(){return this.valueOf()},e}(),Ue=O("ComputedValue",$e);!function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"}(Fe||(Fe={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(ze||(ze={}));var Be=function(e){this.cause=void 0,this.cause=e};function qe(e){return e instanceof Be}function Ve(e){switch(e.dependenciesState_){case Fe.UP_TO_DATE_:return!1;case Fe.NOT_TRACKING_:case Fe.STALE_:return!0;case Fe.POSSIBLY_STALE_:for(var t=Xe(!0),n=Ge(),r=e.observing_,o=r.length,i=0;ir&&(r=s.dependenciesState_)}n.length=o,e.newObserving_=null,i=t.length;for(;i--;){var l=t[i];0===l.diffValue_&&it(l,e),l.diffValue_=0}for(;o--;){var c=n[o];1===c.diffValue_&&(c.diffValue_=0,ot(c,e))}r!==Fe.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}(e),Je(r),o}function Ye(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)it(t[n],e);e.dependenciesState_=Fe.NOT_TRACKING_}function Qe(e){var t=Ge();try{return e()}finally{Ke(t)}}function Ge(){var e=rt.trackingDerivation;return rt.trackingDerivation=null,e}function Ke(e){rt.trackingDerivation=e}function Xe(e){var t=rt.allowStateReads;return rt.allowStateReads=e,t}function Je(e){rt.allowStateReads=e}function Ze(e){if(e.dependenciesState_!==Fe.UP_TO_DATE_){e.dependenciesState_=Fe.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=Fe.UP_TO_DATE_}}var et=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},tt=!0,nt=!1,rt=function(){var e=i();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(tt=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new et).version&&(tt=!1),tt?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new et):(setTimeout((function(){nt||r(35)}),1),new et)}();function ot(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function it(e,t){e.observers_.delete(t),0===e.observers_.size&&at(e)}function at(e){!1===e.isPendingUnobservation_&&(e.isPendingUnobservation_=!0,rt.pendingUnobservations.push(e))}function st(){rt.inBatch++}function lt(){if(0==--rt.inBatch){dt();for(var e=rt.pendingUnobservations,t=0;t0&&at(e),!1)}function ut(e){e.lowestObserverState_!==Fe.STALE_&&(e.lowestObserverState_=Fe.STALE_,e.observers_.forEach((function(e){e.dependenciesState_===Fe.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=Fe.STALE_})))}var pt=function(){function e(e,t,n,r){void 0===e&&(e="Reaction"),void 0===r&&(r=!1),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Fe.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=ze.NONE,this.name_=e,this.onInvalidate_=t,this.errorHandler_=n,this.requiresObservable_=r}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,rt.pendingReactions.push(this),dt())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){st(),this.isScheduled_=!1;var e=rt.trackingContext;if(rt.trackingContext=this,Ve(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(e){this.reportExceptionInDerivation_(e)}}rt.trackingContext=e,lt()}},t.track=function(e){if(!this.isDisposed_){st();0,this.isRunning_=!0;var t=rt.trackingContext;rt.trackingContext=this;var n=We(this,e,void 0);rt.trackingContext=t,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&Ye(this),qe(n)&&this.reportExceptionInDerivation_(n.cause),lt()}},t.reportExceptionInDerivation_=function(e){var t=this;if(this.errorHandler_)this.errorHandler_(e,this);else{if(rt.disableErrorBoundaries)throw e;var n="[mobx] uncaught error in '"+this+"'";rt.suppressReactionErrors||console.error(n,e),rt.globalReactionErrorHandlers.forEach((function(n){return n(e,t)}))}},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(st(),Ye(this),lt()))},t.getDisposer_=function(){var e=this.dispose.bind(this);return e[B]=this,e},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(e){void 0===e&&(e=!1),function(){r("trace() is not available in production builds");for(var e=!1,t=arguments.length,n=new Array(t),o=0;o0||rt.isRunningReactions||ft(ht)}function ht(){rt.isRunningReactions=!0;for(var e=rt.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,o=n.length;r",t,e):v(n)?Ie(t,n,e):y(n)?U(t,n,e?yt:gt):y(t)?$(G(e?"autoAction":"action",{name:t,autoAction:e})):void 0}}var wt=xt(!1);Object.assign(wt,gt);var _t=xt(!0);function Ot(e){return Ce(e.name,!1,e,this,void 0)}function kt(e){return v(e)&&!0===e.isMobxAction}function Et(e,t){var n,r;void 0===t&&(t=p);var o,i=null!=(n=null==(r=t)?void 0:r.name)?n:"Autorun";if(!t.scheduler&&!t.delay)o=new pt(i,(function(){this.track(l)}),t.onError,t.requiresObservable);else{var a=Pt(t),s=!1;o=new pt(i,(function(){s||(s=!0,a((function(){s=!1,o.isDisposed_||o.track(l)})))}),t.onError,t.requiresObservable)}function l(){e(o)}return o.schedule_(),o.getDisposer_()}Object.assign(_t,yt),wt.bound=$(vt),_t.bound=$(bt);var St=function(e){return e()};function Pt(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:St}function jt(e,t,n){return Tt("onBUO",e,t,n)}function Tt(e,t,n,r){var o="function"==typeof r?$n(t,n):$n(t),i=v(r)?r:n,a=e+"L";return o[a]?o[a].add(i):o[a]=new Set([i]),function(){var e=o[a];e&&(e.delete(i),0===e.size&&delete o[a])}}function At(e){!0===e.isolateGlobalState&&function(){if((rt.pendingReactions.length||rt.inBatch||rt.isRunningReactions)&&r(36),nt=!0,tt){var e=i();0==--e.__mobxInstanceCount&&(e.__mobxGlobals=void 0),rt=new et}}();var t,n,o=e.useProxies,a=e.enforceActions;if(void 0!==o&&(rt.useProxies="always"===o||"never"!==o&&"undefined"!=typeof Proxy),"ifavailable"===o&&(rt.verifyProxies=!0),void 0!==a){var s="always"===a?"always":"observed"===a;rt.enforceActions=s,rt.allowStateChanges=!0!==s&&"always"!==s}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach((function(t){t in e&&(rt[t]=!!e[t])})),rt.allowStateReads=!rt.observableRequiresReaction,e.reactionScheduler&&(t=e.reactionScheduler,n=ft,ft=function(e){return t((function(){return n(e)}))})}function It(e,t,n,r){var o=I(t),i=Sn(e,r)[B];st();try{j(o).forEach((function(e){i.extend_(e,o[e],!n||(!(e in n)||n[e]))}))}finally{lt()}return e}function Ct(e,t){return Rt($n(e,t))}function Rt(e){var t,n={name:e.name_};return e.observing_&&e.observing_.length>0&&(n.dependencies=(t=e.observing_,Array.from(new Set(t))).map(Rt)),n}var Nt=0;function Lt(){this.message="FLOW_CANCELLED"}Lt.prototype=Object.create(Error.prototype);var Dt=Z("flow"),Mt=Object.assign((function(e,t){if(y(t))return U(e,t,Dt);var n=e,r=n.name||"",o=function(){var e,t=this,o=arguments,i=++Nt,a=wt(r+" - runid: "+i+" - init",n).apply(t,o),s=void 0,l=new Promise((function(t,n){var o=0;function l(e){var t;s=void 0;try{t=wt(r+" - runid: "+i+" - yield "+o++,a.next).call(a,e)}catch(e){return n(e)}u(t)}function c(e){var t;s=void 0;try{t=wt(r+" - runid: "+i+" - yield "+o++,a.throw).call(a,e)}catch(e){return n(e)}u(t)}function u(e){if(!v(null==e?void 0:e.then))return e.done?t(e.value):(s=Promise.resolve(e.value)).then(l,c);e.then(u,n)}e=n,l(void 0)}));return l.cancel=wt(r+" - runid: "+i+" - cancel",(function(){try{s&&Ft(s);var t=a.return(void 0),n=Promise.resolve(t.value);n.then(g,g),Ft(n),e(new Lt)}catch(t){e(t)}})),l};return o.isMobXFlow=!0,o}),Dt);function Ft(e){v(e.cancel)&&e.cancel()}function zt(e){return!0===(null==e?void 0:e.isMobXFlow)}function $t(e,t){return!!e&&(void 0!==t?!!Tn(e)&&e[B].values_.has(t):Tn(e)||!!e[B]||V(e)||mt(e)||Ue(e))}function Ut(e){return $t(e)}function Bt(e,t,n,r){return v(n)?function(e,t,n,r){return Un(e,t).observe_(n,r)}(e,t,n,r):function(e,t,n){return Un(e).observe_(t,n)}(e,t,n)}function qt(e){switch(e.length){case 0:return rt.trackingDerivation;case 1:return $n(e[0]);case 2:return $n(e[0],e[1])}}function Vt(e,t){void 0===t&&(t=void 0),st();try{return e.apply(t)}finally{lt()}}function Ht(e){return e[B]}var Wt={has:function(e,t){return Ht(e).has_(t)},get:function(e,t){return Ht(e).get_(t)},set:function(e,t,n){var r;return!!y(t)&&(null==(r=Ht(e).set_(t,n,!0))||r)},deleteProperty:function(e,t){var n;return!!y(t)&&(null==(n=Ht(e).delete_(t,!0))||n)},defineProperty:function(e,t,n){var r;return null==(r=Ht(e).defineProperty_(t,n))||r},ownKeys:function(e){return Ht(e).ownKeys_()},preventExtensions:function(e){r(13)}};function Yt(e){return void 0!==e.interceptors_&&e.interceptors_.length>0}function Qt(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),m((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function Gt(e,t){var n=Ge();try{for(var o=[].concat(e.interceptors_||[]),i=0,a=o.length;i0}function Xt(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),m((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function Jt(e,t){var n=Ge(),r=e.changeListeners_;if(r){for(var o=0,i=(r=r.slice()).length;o0?e.map(this.dehancer):e},t.intercept_=function(e){return Qt(this,e)},t.observe_=function(e,t){return void 0===t&&(t=!1),t&&e({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Xt(this,e)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(e){("number"!=typeof e||e<0)&&r("Out of range: "+e);var t=this.values_.length;if(e!==t)if(e>t){for(var n=new Array(e-t),o=0;o0&&Fn(e+t+1)},t.spliceWithArray_=function(e,t,n){var r=this;this.atom_;var o=this.values_.length;if(void 0===e?e=0:e>o?e=o:e<0&&(e=Math.max(0,o+e)),t=1===arguments.length?o-e:null==t?0:Math.max(0,Math.min(t,o-e)),void 0===n&&(n=u),Yt(this)){var i=Gt(this,{object:this.proxy_,type:"splice",index:e,removedCount:t,added:n});if(!i)return u;t=i.removedCount,n=i.added}if(n=0===n.length?n:n.map((function(e){return r.enhancer_(e,void 0)})),this.legacyMode_){var a=n.length-t;this.updateArrayLength_(o,a)}var s=this.spliceItemsIntoValues_(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice_(e,n,s),this.dehanceValues_(s)},t.spliceItemsIntoValues_=function(e,t,n){var r;if(n.length<1e4)return(r=this.values_).splice.apply(r,[e,t].concat(n));var o=this.values_.slice(e,e+t),i=this.values_.slice(e+t);this.values_.length=e+n.length-t;for(var a=0;a2?n-2:0),o=2;o-1&&(this.splice(n,1),!0)}};function an(e,t){"function"==typeof Array.prototype[e]&&(on[e]=t(e))}function sn(e){return function(){var t=this[B];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function ln(e){return function(t,n){var r=this,o=this[B];return o.atom_.reportObserved(),o.dehanceValues_(o.values_)[e]((function(e,o){return t.call(n,e,o,r)}))}}function cn(e){return function(){var t=this,n=this[B];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),o=arguments[0];return arguments[0]=function(e,n,r){return o(e,n,r,t)},r[e].apply(r,arguments)}}an("concat",sn),an("flat",sn),an("includes",sn),an("indexOf",sn),an("join",sn),an("lastIndexOf",sn),an("slice",sn),an("toString",sn),an("toLocaleString",sn),an("every",ln),an("filter",ln),an("find",ln),an("findIndex",ln),an("flatMap",ln),an("forEach",ln),an("map",ln),an("some",ln),an("reduce",cn),an("reduceRight",cn);var un,pn,fn=O("ObservableArrayAdministration",nn);function dn(e){return b(e)&&fn(e[B])}var hn={},mn="add";un=Symbol.iterator,pn=Symbol.toStringTag;var gn,vn,yn=function(){function e(e,t,n){void 0===t&&(t=Y),void 0===n&&(n="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[B]=hn,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=t,this.name_=n,v(Map)||r(18),this.keysAtom_=H("ObservableMap.keys()"),this.data_=new Map,this.hasMap_=new Map,this.merge(e)}var t=e.prototype;return t.has_=function(e){return this.data_.has(e)},t.has=function(e){var t=this;if(!rt.trackingDerivation)return this.has_(e);var n=this.hasMap_.get(e);if(!n){var r=n=new Me(this.has_(e),Q,"ObservableMap.key?",!1);this.hasMap_.set(e,r),jt(r,(function(){return t.hasMap_.delete(e)}))}return n.get()},t.set=function(e,t){var n=this.has_(e);if(Yt(this)){var r=Gt(this,{type:n?en:mn,object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this.updateValue_(e,t):this.addValue_(e,t),this},t.delete=function(e){var t=this;if((this.keysAtom_,Yt(this))&&!Gt(this,{type:"delete",object:this,name:e}))return!1;if(this.has_(e)){var n=Kt(this),r=n?{observableKind:"map",debugObjectName:this.name_,type:"delete",object:this,oldValue:this.data_.get(e).value_,name:e}:null;return Vt((function(){t.keysAtom_.reportChanged(),t.updateHasMapEntry_(e,!1),t.data_.get(e).setNewValue_(void 0),t.data_.delete(e)})),n&&Jt(this,r),!0}return!1},t.updateHasMapEntry_=function(e,t){var n=this.hasMap_.get(e);n&&n.setNewValue_(t)},t.updateValue_=function(e,t){var n=this.data_.get(e);if((t=n.prepareNewValue_(t))!==rt.UNCHANGED){var r=Kt(this),o=r?{observableKind:"map",debugObjectName:this.name_,type:en,object:this,oldValue:n.value_,name:e,newValue:t}:null;0,n.setNewValue_(t),r&&Jt(this,o)}},t.addValue_=function(e,t){var n=this;this.keysAtom_,Vt((function(){var r=new Me(t,n.enhancer_,"ObservableMap.key",!1);n.data_.set(e,r),t=r.value_,n.updateHasMapEntry_(e,!0),n.keysAtom_.reportChanged()}));var r=Kt(this),o=r?{observableKind:"map",debugObjectName:this.name_,type:mn,object:this,name:e,newValue:t}:null;r&&Jt(this,o)},t.get=function(e){return this.has(e)?this.dehanceValue_(this.data_.get(e).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var e=this,t=this.keys();return Wn({next:function(){var n=t.next(),r=n.done,o=n.value;return{done:r,value:r?void 0:e.get(o)}}})},t.entries=function(){var e=this,t=this.keys();return Wn({next:function(){var n=t.next(),r=n.done,o=n.value;return{done:r,value:r?void 0:[o,e.get(o)]}}})},t[un]=function(){return this.entries()},t.forEach=function(e,t){for(var n,r=F(this);!(n=r()).done;){var o=n.value,i=o[0],a=o[1];e.call(t,a,i,this)}},t.merge=function(e){var t=this;return bn(e)&&(e=new Map(e)),Vt((function(){x(e)?P(e).forEach((function(n){return t.set(n,e[n])})):Array.isArray(e)?e.forEach((function(e){var n=e[0],r=e[1];return t.set(n,r)})):k(e)?(e.constructor!==Map&&r(19,e),e.forEach((function(e,n){return t.set(n,e)}))):null!=e&&r(20,e)})),this},t.clear=function(){var e=this;Vt((function(){Qe((function(){for(var t,n=F(e.keys());!(t=n()).done;){var r=t.value;e.delete(r)}}))}))},t.replace=function(e){var t=this;return Vt((function(){for(var n,o=function(e){if(k(e)||bn(e))return e;if(Array.isArray(e))return new Map(e);if(x(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}return r(21,e)}(e),i=new Map,a=!1,s=F(t.data_.keys());!(n=s()).done;){var l=n.value;if(!o.has(l))if(t.delete(l))a=!0;else{var c=t.data_.get(l);i.set(l,c)}}for(var u,p=F(o.entries());!(u=p()).done;){var f=u.value,d=f[0],h=f[1],m=t.data_.has(d);if(t.set(d,h),t.data_.has(d)){var g=t.data_.get(d);i.set(d,g),m||(a=!0)}}if(!a)if(t.data_.size!==i.size)t.keysAtom_.reportChanged();else for(var v=t.data_.keys(),y=i.keys(),b=v.next(),w=y.next();!b.done;){if(b.value!==w.value){t.keysAtom_.reportChanged();break}b=v.next(),w=y.next()}t.data_=i})),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(e,t){return Xt(this,e)},t.intercept_=function(e){return Qt(this,e)},R(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:pn,get:function(){return"Map"}}]),e}(),bn=O("ObservableMap",yn);var xn={};gn=Symbol.iterator,vn=Symbol.toStringTag;var wn=function(){function e(e,t,n){void 0===t&&(t=Y),void 0===n&&(n="ObservableSet"),this.name_=void 0,this[B]=xn,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=n,v(Set)||r(22),this.atom_=H(this.name_),this.enhancer_=function(e,r){return t(e,r,n)},e&&this.replace(e)}var t=e.prototype;return t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.clear=function(){var e=this;Vt((function(){Qe((function(){for(var t,n=F(e.data_.values());!(t=n()).done;){var r=t.value;e.delete(r)}}))}))},t.forEach=function(e,t){for(var n,r=F(this);!(n=r()).done;){var o=n.value;e.call(t,o,o,this)}},t.add=function(e){var t=this;if((this.atom_,Yt(this))&&!Gt(this,{type:mn,object:this,newValue:e}))return this;if(!this.has(e)){Vt((function(){t.data_.add(t.enhancer_(e,void 0)),t.atom_.reportChanged()}));var n=Kt(this),r=n?{observableKind:"set",debugObjectName:this.name_,type:mn,object:this,newValue:e}:null;0,n&&Jt(this,r)}return this},t.delete=function(e){var t=this;if(Yt(this)&&!Gt(this,{type:"delete",object:this,oldValue:e}))return!1;if(this.has(e)){var n=Kt(this),r=n?{observableKind:"set",debugObjectName:this.name_,type:"delete",object:this,oldValue:e}:null;return Vt((function(){t.atom_.reportChanged(),t.data_.delete(e)})),n&&Jt(this,r),!0}return!1},t.has=function(e){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(e))},t.entries=function(){var e=0,t=Array.from(this.keys()),n=Array.from(this.values());return Wn({next:function(){var r=e;return e+=1,rNn){for(var t=Nn;t=0&&r++}t=Hn(t),n=Hn(n);var l="[object Array]"===s;if(!l){if("object"!=typeof t||"object"!=typeof n)return!1;var c=t.constructor,u=n.constructor;if(c!==u&&!(v(c)&&c instanceof c&&v(u)&&u instanceof u)&&"constructor"in t&&"constructor"in n)return!1}if(0===r)return!1;r<0&&(r=-1);i=i||[];var p=(o=o||[]).length;for(;p--;)if(o[p]===t)return i[p]===n;if(o.push(t),i.push(n),l){if((p=t.length)!==n.length)return!1;for(;p--;)if(!e(t[p],n[p],r-1,o,i))return!1}else{var f,d=Object.keys(t);if(p=d.length,Object.keys(n).length!==p)return!1;for(;p--;)if(f=d[p],!A(n,f)||!e(t[f],n[f],r-1,o,i))return!1}return o.pop(),i.pop(),!0}(e,t,n)}function Hn(e){return dn(e)?e.slice():k(e)||bn(e)||E(e)||_n(e)?Array.from(e.entries()):e}function Wn(e){return e[Symbol.iterator]=Yn,e}function Yn(){return this}function Qn(e,t,n){return e.get?Ee:!e.set&&(v(e.value)?(r=e.value,!(o=null==r?void 0:r.constructor)||"GeneratorFunction"!==o.name&&"GeneratorFunction"!==o.displayName?!kt(e.value)&&(n?_t.bound:_t):!zt(e.value)&&Mt):t);var r,o}["Symbol","Map","Set","Symbol"].forEach((function(e){void 0===i()[e]&&r("MobX requires global '"+e+"' to be available or polyfilled")})),"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:function(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}},extras:{getDebugName:Bn},$mobx:B})}).call(this,n(5))},function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,n(5))},function(e,t,n){var r=n(3),o=n(90),i=n(15),a=n(66),s=n(98),l=n(132),c=o("wks"),u=r.Symbol,p=l?u:u&&u.withoutSetter||a;e.exports=function(e){return i(c,e)&&(s||"string"==typeof c[e])||(s&&i(u,e)?c[e]=u[e]:c[e]=p("Symbol."+e)),c[e]}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var l,c=[],u=!1,p=-1;function f(){u&&l&&(u=!1,l.length?c=l.concat(c):p=-1,c.length&&d())}function d(){if(!u){var e=s(f);u=!0;for(var t=c.length;t;){for(l=c,c=[];++p1)for(var n=1;nt.scrollTop+t.clientHeight,s=this.offsetLeft-t.offsetLeftt.scrollLeft+t.clientWidth,c=i&&!a;(i||a)&&e&&(t.scrollTop=this.offsetTop-t.offsetTop-t.clientHeight/2-r+this.clientHeight/2),(s||l)&&e&&(t.scrollLeft=this.offsetLeft-t.offsetLeft-t.clientWidth/2-o+this.clientWidth/2),(i||a||s||l)&&!e&&this.scrollIntoView(c)})},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(29),o=n(15),i=n(150),a=n(17).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});o(t,e)||a(t,e,{value:i.f(e)})}},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"ServerStyleSheet",(function(){return ze})),n.d(t,"StyleSheetConsumer",(function(){return oe})),n.d(t,"StyleSheetContext",(function(){return re})),n.d(t,"StyleSheetManager",(function(){return ue})),n.d(t,"ThemeConsumer",(function(){return Ie})),n.d(t,"ThemeContext",(function(){return Ae})),n.d(t,"ThemeProvider",(function(){return Ce})),n.d(t,"__PRIVATE__",(function(){return Be})),n.d(t,"createGlobalStyle",(function(){return Me})),n.d(t,"css",(function(){return be})),n.d(t,"isStyledComponent",(function(){return x})),n.d(t,"keyframes",(function(){return Fe})),n.d(t,"useTheme",(function(){return Ue})),n.d(t,"version",(function(){return _})),n.d(t,"withTheme",(function(){return $e}));var r=n(82),o=n(0),i=n.n(o),a=n(212),s=n.n(a),l=n(213),c=n(214),u=n(126),p=n(122),f=n.n(p);function d(){return(d=Object.assign||function(e){for(var t=1;t1?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var P=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&S(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var i=r;i=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,i=r;i=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(w))return r}}(n),i=void 0!==o?o.nextSibling:null;r.setAttribute(w,"active"),r.setAttribute("data-styled-version","5.2.3");var a=F();return a&&r.setAttribute("nonce",a),n.insertBefore(r,i),r},$=function(){function e(e){var t=this.element=z(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(c+=e+",")})),r+=""+s+l+'{content:"'+c+'"}/*!sc*/\n'}}}return r}(this)},e}(),W=/(a)(d)/gi,Y=function(e){return String.fromCharCode(e+(e>25?39:97))};function Q(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Y(t%52)+n;return(Y(t%52)+n).replace(W,"$1-$2")}var G=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},K=function(e){return G(5381,e)};function X(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var s=n(i,"."+a,void 0,r);t.insertRules(r,a,s)}o.push(a),this.staticRulesId=a}else{for(var l=this.rules.length,c=G(this.baseHash,n.hash),u="",p=0;p>>0);if(!t.hasNameForId(r,m)){var g=n(u,"."+m,void 0,r);t.insertRules(r,m,g)}o.push(m)}}return o.join(" ")},e}(),ee=/^\s*\/\/.*$/gm,te=[":","[",".","#"];function ne(e){var t,n,r,o,i=void 0===e?v:e,a=i.options,s=void 0===a?v:a,c=i.plugins,u=void 0===c?g:c,p=new l.a(s),f=[],d=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,i,a,s,l,c,u,p){switch(n){case 1:if(0===u&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===c)return r+"/*|*/";break;case 3:switch(c){case 102:case 112:return e(o[0]+r),"";default:return r+(0===p?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){f.push(e)})),h=function(e,r,i){return 0===r&&-1!==te.indexOf(i[n.length])||i.match(o)?e:"."+t};function m(e,i,a,s){void 0===s&&(s="&");var l=e.replace(ee,""),c=i&&a?a+" "+i+" { "+l+" }":l;return t=s,n=i,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),p(a||!i?"":i,c)}return p.use([].concat(u,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,h))},d,function(e){if(-2===e){var t=f;return f=[],t}}])),m.hash=u.length?u.reduce((function(e,t){return t.name||S(15),G(e,t.name)}),5381).toString():"",m}var re=i.a.createContext(),oe=re.Consumer,ie=i.a.createContext(),ae=(ie.Consumer,new H),se=ne();function le(){return Object(o.useContext)(re)||ae}function ce(){return Object(o.useContext)(ie)||se}function ue(e){var t=Object(o.useState)(e.stylisPlugins),n=t[0],r=t[1],a=le(),l=Object(o.useMemo)((function(){var t=a;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),c=Object(o.useMemo)((function(){return ne({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return Object(o.useEffect)((function(){s()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),i.a.createElement(re.Provider,{value:l},i.a.createElement(ie.Provider,{value:c},e.children))}var pe=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=se);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return S(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=se),this.name+e.hash},e}(),fe=/([A-Z])/,de=/([A-Z])/g,he=/^ms-/,me=function(e){return"-"+e.toLowerCase()};function ge(e){return fe.test(e)?e.replace(de,me).replace(he,"-ms-"):e}var ve=function(e){return null==e||!1===e||""===e};function ye(e,t,n,r){if(Array.isArray(e)){for(var o,i=[],a=0,s=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,_e=/(^-|-$)/g;function Oe(e){return e.replace(we,"-").replace(_e,"")}var ke=function(e){return Q(K(e)>>>0)};function Ee(e){return"string"==typeof e&&!0}var Se=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Pe=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function je(e,t,n){var r=e[n];Se(t)&&Se(r)?Te(r,t):e[n]=t}function Te(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(o[n]=e[n]);return o}(t,["componentId"]),i=r&&r+"-"+(Ee(e)?e:Oe(b(e)));return Ne(e,d({},o,{attrs:_,componentId:i}),n)},Object.defineProperty(k,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Te({},e.defaultProps,t):t}}),k.toString=function(){return"."+k.styledComponentId},a&&f()(k,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),k}var Le=function(e){return function e(t,n,o){if(void 0===o&&(o=v),!Object(r.isValidElementType)(n))return S(1,String(n));var i=function(){return t(n,o,be.apply(void 0,arguments))};return i.withConfig=function(r){return e(t,n,d({},o,{},r))},i.attrs=function(r){return e(t,n,d({},o,{attrs:Array.prototype.concat(o.attrs,r).filter(Boolean)}))},i}(Ne,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){Le[e]=Le(e)}));var De=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=X(e),H.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,n,r){var o=r(ye(this.rules,t,n,r).join(""),""),i=this.componentId+e;n.insertRules(i,i,o)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&H.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();function Me(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r"+t+""},this.getStyleTags=function(){return e.sealed?S(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return S(2);var n=((t={})[w]="",t["data-styled-version"]="5.2.3",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=F();return r&&(n.nonce=r),[i.a.createElement("style",d({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new H({isServer:!0}),this.sealed=!1}var t=e.prototype;return t.collectStyles=function(e){return this.sealed?S(2):i.a.createElement(ue,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return S(3)},e}(),$e=function(e){var t=i.a.forwardRef((function(t,n){var r=Object(o.useContext)(Ae),a=e.defaultProps,s=xe(t,r,a);return i.a.createElement(e,d({},t,{theme:s,ref:n}))}));return f()(t,e),t.displayName="WithTheme("+b(e)+")",t},Ue=function(){return Object(o.useContext)(Ae)},Be={StyleSheet:H,masterSheet:ae};t.default=Le}.call(this,n(6))},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){"use strict";var r=n(299),o=n(300);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){o.isString(e)&&(e=b(e));return e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,l=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(c),p=["%","/","?",";","#"].concat(u),f=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(301);function b(e,t,n){if(e&&o.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i127?R+="x":R+=C[N];if(!R.match(d)){var D=A.slice(0,P),M=A.slice(P+1),F=C.match(h);F&&(D.push(F[1]),M.unshift(F[2])),M.length&&(b="/"+M.join(".")+b),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=r.toASCII(this.hostname));var z=this.port?":"+this.port:"",$=this.hostname||"";this.host=$+z,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[_])for(P=0,I=u.length;P0)&&n.host.split("@"))&&(n.auth=T.shift(),n.host=n.hostname=T.shift());return n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!O.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var E=O.slice(-1)[0],S=(n.host||e.host||O.length>1)&&("."===E||".."===E)||""===E,P=0,j=O.length;j>=0;j--)"."===(E=O[j])?O.splice(j,1):".."===E?(O.splice(j,1),P++):P&&(O.splice(j,1),P--);if(!w&&!_)for(;P--;P)O.unshift("..");!w||""===O[0]||O[0]&&"/"===O[0].charAt(0)||O.unshift(""),S&&"/"!==O.join("/").substr(-1)&&O.push("");var T,A=""===O[0]||O[0]&&"/"===O[0].charAt(0);k&&(n.hostname=n.host=A?"":O.length?O.shift():"",(T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=T.shift(),n.host=n.hostname=T.shift()));return(w=w||n.host&&O.length)&&!A&&O.unshift(""),O.length?n.pathname=O.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){var r=n(19),o=n(127),i=n(21),a=n(64),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(i(e),t=a(t,!0),i(n),o)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!o;i--){var a=i>=0?arguments[i]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,o="/"===a.charAt(0))}return(o?"/":"")+(t=n(r(t.split("/"),(function(e){return!!e})),!o).join("/"))||"."},t.normalize=function(e){var i=t.isAbsolute(e),a="/"===o(e,-1);return(e=n(r(e.split("/"),(function(e){return!!e})),!i).join("/"))||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var o=r(e.split("/")),i=r(n.split("/")),a=Math.min(o.length,i.length),s=a,l=0;l=1;--i)if(47===(t=e.charCodeAt(i))){if(!o){r=i;break}}else o=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},t.basename=function(e,t){var n=function(e){"string"!=typeof e&&(e+="");var t,n=0,r=-1,o=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!o){n=t+1;break}}else-1===r&&(o=!1,r=t+1);return-1===r?"":e.slice(n,r)}(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,o=!0,i=0,a=e.length-1;a>=0;--a){var s=e.charCodeAt(a);if(47!==s)-1===r&&(o=!1,r=a+1),46===s?-1===t?t=a:1!==i&&(i=1):-1!==t&&(i=-1);else if(!o){n=a+1;break}}return-1===t||-1===r||0===i||1===i&&t===r-1&&t===n+1?"":e.slice(t,r)};var o="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n(6))},function(e,t,n){var r=n(11);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t,n){"use strict";var r=n(434);function o(e,t,n){if(3===arguments.length)return o.set(e,t,n);if(2===arguments.length)return o.get(e,t);var r=o.bind(o,e);for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i].bind(r,e));return r}e.exports=o,o.get=function(e,t){for(var n=Array.isArray(t)?t:o.parse(t),r=0;re.distance-t.distance),n.map(e=>e.variant)}},function(e,t,n){e.exports=n(297)()},function(e,t,n){var r=n(19),o=n(17),i=n(37);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMappingRef=t.isAbsoluteUrl=t.refBaseName=t.pointerBaseName=t.parsePointer=t.parseRef=t.escapePointer=t.unescapePointer=t.Location=t.isRef=t.joinPointer=void 0;const r=n(18);function o(e,t){return""===e&&(e="#/"),"/"===e[e.length-1]?e+t:e+"/"+t}t.joinPointer=o,t.isRef=function(e){return e&&"string"==typeof e.$ref};class i{constructor(e,t){this.source=e,this.pointer=t}child(e){return new i(this.source,o(this.pointer,(Array.isArray(e)?e:[e]).map(s).join("/")))}key(){return Object.assign(Object.assign({},this),{reportOnKey:!0})}get absolutePointer(){return this.source.absoluteRef+("#/"===this.pointer?"":this.pointer)}}function a(e){return decodeURIComponent(e.replace(/~1/g,"/").replace(/~0/g,"~"))}function s(e){return"number"==typeof e?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}t.Location=i,t.unescapePointer=a,t.escapePointer=s,t.parseRef=function(e){const[t,n]=e.split("#/");return{uri:t||null,pointer:n?n.split("/").map(a).filter(Boolean):[]}},t.parsePointer=function(e){return e.substr(2).split("/").map(a)},t.pointerBaseName=function(e){const t=e.split("/");return t[t.length-1]},t.refBaseName=function(e){const t=e.split(r.sep);return t[t.length-1].split(".")[0]},t.isAbsoluteUrl=function(e){return e.startsWith("http://")||e.startsWith("https://")},t.isMappingRef=function(e){return e.startsWith("#")||e.startsWith("https://")||e.startsWith("./")||e.startsWith("../")||e.indexOf("/")>-1}},function(e,t,n){var r=n(3),o=n(24),i=n(15),a=n(87),s=n(88),l=n(38),c=l.get,u=l.enforce,p=String(String).split("String");(e.exports=function(e,t,n,s){var l,c=!!s&&!!s.unsafe,f=!!s&&!!s.enumerable,d=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof t||i(n,"name")||o(n,"name",t),(l=u(n)).source||(l.source=p.join("string"==typeof t?t:""))),e!==r?(c?!d&&e[t]&&(f=!0):delete e[t],f?e[t]=n:o(e,t,n)):f?e[t]=n:a(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||s(this)}))},function(e,t){e.exports=!1},function(e,t,n){var r=n(29),o=n(3),i=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?i(r[e])||i(o[e]):r[e]&&r[e][t]||o[e]&&o[e][t]}},function(e,t,n){var r=n(3);e.exports=r},function(e,t,n){var r=n(17).f,o=n(15),i=n(4)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNamedType=t.normalizeTypes=t.mapOf=t.listOf=void 0,t.listOf=function(e){return{name:e+"_List",properties:{},items:e}},t.mapOf=function(e){return{name:e+"_Map",properties:{},additionalProperties:()=>e}},t.normalizeTypes=function(e,t={}){const n={};for(const t of Object.keys(e))n[t]=Object.assign(Object.assign({},e[t]),{name:t});for(const e of Object.values(n))r(e);return n;function r(e){if(e.additionalProperties&&(e.additionalProperties=o(e.additionalProperties)),e.items&&(e.items=o(e.items)),e.properties){const n={};for(const[r,i]of Object.entries(e.properties))n[r]=o(i),t.doNotResolveExamples&&i&&i.isExample&&(n[r]=Object.assign(Object.assign({},i),{resolvable:!1}));e.properties=n}}function o(e){if("string"==typeof e){if(!n[e])throw new Error("Unknown type name found: "+e);return n[e]}return"function"==typeof e?(t,n)=>o(e(t,n)):e&&e.name?(r(e=Object.assign({},e)),e):e&&e.directResolveAs?Object.assign(Object.assign({},e),{directResolveAs:o(e.directResolveAs)}):e}},t.isNamedType=function(e){return"string"==typeof(null==e?void 0:e.name)}},function(e,t,n){var r,o,i;o=[t],void 0===(i="function"==typeof(r=function(e){"use strict";e.__esModule=!0;var t={},n=Object.prototype.hasOwnProperty,r=function(e){var r=arguments.length<=1||void 0===arguments[1]?t:arguments[1],o=r.cache||{};return function(){for(var t=arguments.length,i=Array(t),a=0;a2?r:e).apply(void 0,o)}}e.memoize=a,e.debounce=s,e.bind=l,e.default={memoize:a,debounce:s,bind:l}})?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){var r=n(85),o=n(49);e.exports=function(e){return r(o(e))}},function(e,t,n){"use strict";(function(e){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +var r=n(321),o=n(322),i=n(155);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return $(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return j(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var i,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=n;is&&(n=s-l),i=n;i>=0;i--){for(var p=!0,f=0;fo&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function S(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:c>223?3:c>191?2:1;if(o+p<=n)switch(p){case 1:c<128&&(u=c);break;case 2:128==(192&(i=e[o+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(l=(15&c)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,p=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=p}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},l.prototype.compare=function(e,t,n,r,o){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),u=e.slice(t,n),p=0;po)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return O(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function P(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function C(e,t,n,r,o,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function L(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,i){return i||L(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function M(e,t,n,r,i){return i||L(e,0,n,8),o.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},l.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||C(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||C(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||C(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||C(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||C(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||C(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);C(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);C(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||C(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||C(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||C(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||C(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function B(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(5))},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){var r=n(19),o=n(63),i=n(37),a=n(33),s=n(64),l=n(15),c=n(127),u=Object.getOwnPropertyDescriptor;t.f=r?u:function(e,t){if(e=a(e),t=s(t,!0),c)try{return u(e,t)}catch(e){}if(l(e,t))return i(!o.f.call(e,t),e[t])}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r,o,i,a=n(223),s=n(3),l=n(12),c=n(24),u=n(15),p=n(89),f=n(65),d=n(50),h=s.WeakMap;if(a){var m=p.state||(p.state=new h),g=m.get,v=m.has,y=m.set;r=function(e,t){return t.facade=e,y.call(m,e,t),t},o=function(e){return g.call(m,e)||{}},i=function(e){return v.call(m,e)}}else{var b=f("state");d[b]=!0,r=function(e,t){return t.facade=e,c(e,b,t),t},o=function(e){return u(e,b)?e[b]:{}},i=function(e){return u(e,b)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){var r=n(92),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(21),o=n(229),i=n(39),a=n(54),s=n(230),l=n(231),c=function(e,t){this.stopped=e,this.result=t};e.exports=function(e,t,n){var u,p,f,d,h,m,g,v=n&&n.that,y=!(!n||!n.AS_ENTRIES),b=!(!n||!n.IS_ITERATOR),x=!(!n||!n.INTERRUPTED),w=a(t,v,1+y+x),_=function(e){return u&&l(u),new c(!0,e)},O=function(e){return y?(r(e),x?w(e[0],e[1],_):w(e[0],e[1])):x?w(e,_):w(e)};if(b)u=e;else{if("function"!=typeof(p=s(e)))throw TypeError("Target is not iterable");if(o(p)){for(f=0,d=i(e.length);d>f;f++)if((h=O(e[f]))&&h instanceof c)return h;return new c(!1)}u=p.call(e)}for(m=u.next;!(g=m.call(u)).done;){try{h=O(g.value)}catch(e){throw l(u),e}if("object"==typeof h&&h&&h instanceof c)return h}return new c(!1)}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,n){"use strict";var r=n(55),o=n(72),i=n(8);function a(e,t,n){var r=[];return e.include.forEach((function(e){n=a(e,t,n)})),e[t].forEach((function(e){n.forEach((function(t,n){t.tag===e.tag&&t.kind===e.kind&&r.push(n)})),n.push(e)})),n.filter((function(e,t){return-1===r.indexOf(t)}))}function s(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach((function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new o("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")})),this.compiledImplicit=a(this,"implicit",[]),this.compiledExplicit=a(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function r(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e=t)throw new Error("Cannot access property/index "+r+" levels up, current level is "+t);return n[t-r]}if(r>t)throw new Error("Cannot access data "+r+" levels up, current level is "+t);if(i="data"+(t-r||""),!o)return i}for(var s=i,c=o.split("/"),u=0;u=p.reach);O+=_.value.length,_=_.next){var k=_.value;if(n.length>t.length)return;if(!(k instanceof o)){var E,S=1;if(y){if(!(E=i(w,O,t,v)))break;var P=E.index,j=E.index+E[0].length,T=O;for(T+=_.value.length;P>=T;)_=_.next,T+=_.value.length;if(T-=_.value.length,O=T,_.value instanceof o)continue;for(var A=_;A!==n.tail&&(Tp.reach&&(p.reach=N);var L=_.prev;C&&(L=s(n,L,C),O+=C.length),l(n,L,S);var D=new o(f,g?r.tokenize(I,g):I,b,I);_=s(n,L,D),R&&s(n,_,R),S>1&&e(t,n,a,_.prev,O,{cause:f+","+h,reach:N})}}}}}(e,u,t,u.head,0),function(e){var t=[],n=e.head.next;for(;n!==e.tail;)t.push(n.value),n=n.next;return t}(u)},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(n&&n.length)for(var o,i=0;o=n[i++];)o(t)}},Token:o};function o(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function i(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function a(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function s(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function l(e,t,n){for(var r=t.next,o=0;o"+i.content+""},!e.document)return e.addEventListener?(r.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),o=n.language,i=n.code,a=n.immediateClose;e.postMessage(r.highlight(i,r.languages[o],o)),a&&e.close()}),!1),r):r;var c=r.util.currentScript();function u(){r.manual||r.highlightAll()}if(c&&(r.filename=c.src,c.hasAttribute("data-manual")&&(r.manual=!0)),!r.manual){var p=document.readyState;"loading"===p||"interactive"===p&&c&&c.defer?document.addEventListener("DOMContentLoaded",u):window.requestAnimationFrame?window.requestAnimationFrame(u):window.setTimeout(u,16)}return r}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{}); +/** + * Prism: Lightweight, robust, elegant syntax highlighting + * + * @license MIT + * @author Lea Verou + * @namespace + * @public + */e.exports&&(e.exports=n),void 0!==t&&(t.Prism=n),n.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/,name:/[^\s<>'"]+/}},cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^$/i;var o={"included-cdata":{pattern://i,inside:r}};o["language-"+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:o},n.languages.insertBefore("markup","cdata",i)}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:RegExp("[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),string:{pattern:t,greedy:!0},property:/(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,important:/!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),e.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/(^|["'\s])style\s*=\s*(?:"[^"]*"|'[^']*')/i,lookbehind:!0,inside:{"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{style:{pattern:/(["'])[\s\S]+(?=["']$)/,lookbehind:!0,alias:"language-css",inside:e.languages.css},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},"attr-name":/^style/i}}},n.tag))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|(?:get|set)(?=\s*[\[$\w\xA0-\uFFFF])|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-flags":/[a-z]+$/,"regex-delimiter":/^\/|\/$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}}}),n.languages.markup&&n.languages.markup.tag.addInlined("script","javascript"),n.languages.js=n.languages.javascript,function(){if("undefined"!=typeof self&&self.Prism&&self.document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e=window.Prism,t={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},n='pre[data-src]:not([data-src-status="loaded"]):not([data-src-status="loading"])',r=/\blang(?:uage)?-([\w-]+)\b/i;e.hooks.add("before-highlightall",(function(e){e.selector+=", "+n})),e.hooks.add("before-sanity-check",(function(r){var o=r.element;if(o.matches(n)){r.code="",o.setAttribute("data-src-status","loading");var a=o.appendChild(document.createElement("CODE"));a.textContent="Loading…";var s=o.getAttribute("data-src"),l=r.language;if("none"===l){var c=(/\.(\w+)$/.exec(s)||[,"none"])[1];l=t[c]||c}i(a,l),i(o,l);var u=e.plugins.autoloader;u&&u.loadLanguages(l);var p=new XMLHttpRequest;p.open("GET",s,!0),p.onreadystatechange=function(){var t,n;4==p.readyState&&(p.status<400&&p.responseText?(o.setAttribute("data-src-status","loaded"),a.textContent=p.responseText,e.highlightElement(a)):(o.setAttribute("data-src-status","failed"),p.status>=400?a.textContent=(t=p.status,n=p.statusText,"✖ Error "+t+" while fetching file: "+n):a.textContent="✖ Error: File does not exist or is empty"))},p.send(null)}})),e.plugins.fileHighlight={highlight:function(t){for(var r,o=(t||document).querySelectorAll(n),i=0;r=o[i++];)e.highlightElement(r)}};var o=!1;e.fileHighlight=function(){o||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),o=!0),e.plugins.fileHighlight.highlight.apply(this,arguments)}}function i(e,t){var n=e.className;n=n.replace(r," ")+" language-"+t,e.className=n.replace(/\s+/g," ").trim()}}()}).call(this,n(5))},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){e.exports={}},function(e,t,n){var r=n(49);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r,o=n(21),i=n(228),a=n(93),s=n(50),l=n(131),c=n(86),u=n(65),p=u("IE_PROTO"),f=function(){},d=function(e){return"