Commit Graph

84 Commits (791dc9deabd2d7fdfd7c371331eb557d14782372)

Author SHA1 Message Date
Jakub Onderka 935437d1bc chg: [internal] Invalid message for UUID contains that UUID must be RFC 4122 compliant 2020-09-18 10:56:28 +02:00
Jakub Onderka 0e916bd364 chg: [internal] Ensure that UUID is always lowecase and real UUID 2020-09-08 10:47:28 +02:00
Jakub Onderka f0f826841e fix: [security] Sharing groups for objects respect permissions 2020-08-05 12:39:11 +02:00
mokaddem 60a9707808
fix: [sharingGroup:captureSharingGroup] Fix failing capture in case of
roaming mode

- The server list check was incorrect
- When capturing, roaming mode was always defaulted to false
- The logs could not be written due to non-initialized class
2020-07-02 15:31:47 +02:00
iglocska 4e0ef6f28e
new: [internal] cache the sharing group access lookups
- should reduce the number of queries drastically for events heavy on object/attribute level sharing groups
2020-04-30 08:29:17 +02:00
mokaddem e9dc28fda7
chg: [sharingGroup:capture] Prevent capture of SG in some specific
cases - Need more testing

Should fix #5784
2020-04-20 08:51:01 +02:00
iglocska 78f3f68127
chg: [internal] Sharing group loader was grabbing organisations one by one, refactored
- simply fetch all org objects for the ACL checks in one shot instead of doing it on demand
  - has no real performance impact even on large sharing instances
  - reduces the number of queries greatly making debugging easier
2019-11-11 08:11:36 +01:00
Richard van den Berg 7417f9d6a0 Check if Organisation index exists, fixes #4809 2019-10-09 02:22:18 +02:00
iglocska 6b58b51bd3
fix: [Sharing groups] Various fixes to align the reported local instance URL as the external_baseurl if set, as opposed to always using the baseurl, fixes #4982 2019-08-13 13:00:24 +02:00
Christophe Vandeplas 67efc70bf5 fix: [style] consistent space indentation 2019-02-10 13:08:55 +01:00
iglocska 2d0259ce13 fix: [CS] coding standards script re-run 2018-11-23 14:11:33 +01:00
iglocska 7c34e9bbee fix: [sync] Fixed an issue preventing sharing group distributed data from being pushed 2018-11-15 14:57:41 +01:00
iglocska abbc036436 fix: [sharing groups] Fixed several sharing group issues preventing proper editing of events with SGs
- include the uuid and modified time in the sharing group
- fix the incorrectly embedded organisation object
2018-11-07 16:06:49 +01:00
iglocska e419c80e9e fix: [internal] Sharing group capturing fixed, fixes #3573
- As reported by @eCrimeLabs
2018-10-18 20:12:24 +02:00
iglocska 543fccdc58 fix: [api] Sharing group organisations not iterated if they don't exist 2018-10-04 22:48:50 +02:00
iglocska 1a5f764048 new: [internal] Added caching to the sharing group organisations 2018-10-01 14:49:12 +02:00
iglocska a81894f14c chg: [CS] Changed to PSR-2
- to make contributions easier, adopted PSR-2
- used php-cs-fixer to rework the style
- *sniff sniff* Goodbye tab indentation
2018-07-19 11:48:22 +02:00
iglocska cfba36dba5 new: [internal] Added convenience method to find the ID of an SG via it's UUID 2018-06-17 23:35:38 +02:00
iglocska bf4abdba14 fix: [sg bug] Fixed a bug where a user that should be allowed to extend a sharing group is blocked if they are also a sync user
- conditions requires that the sharing group has been synchronised from a remote by a different sync user
2018-06-14 12:29:49 +02:00
iglocska 9760f1144f new: New APIs to add/remove orgs and servers from sharing groups, fixes #2888
- added functions to manage the additions/removals of objects from sharing groups
- the following APIs are included:
  - /sharingGroups/addOrg/[sg_id]/[org_id]/[extend]
  - /sharingGroups/removeOrg/[sg_id]/[org_id]
  - /sharingGroups/addServer/[sg_id]/[server_id]/[all_orgs]
  - /sharingGroups/removeServer/[sg_id]/[server_id]

- All parameters are optional and can instead be passed as JSON objects such as:

  {
    "org_uuid": "55f6ea5e-2c60-40e5-964f-47a8950d210f",
    "sg_id": "49",
    "extend": 1
  }

- The API is extremely flexible with how to name objects, the following parameters are allowed:
  - Organisations:
    - org_id (The organisation's local instance ID)
    - org_uuid (The organisation's global UUID)
    - org_name (The organisation's identifier as known to the curent instance)
  - Server:
    - server_id (The server's local instance ID)
    - server_url (The URL of the server)
    - server_name (The local name of the server as assigned when adding the server)

The sharing groups can also be addressed by ID or UUID.
2018-02-02 08:46:14 +01:00
iglocska 7f29a9a74b fix: Fixed a set of issues with sharing groups that lead to synced events not saving/updating 2018-01-18 23:34:04 +01:00
iglocska b3d3640e13 new: Expose the Sharing Groups to the API, fixes #2767
- Add/Edit/Index/View now exposed to the API
- rework of the sharing group capturing process
- fix to an issue that could potentially block sharing groups from being synced (the creator org of the sharing group wasn't directly exposed and an edit to the organisation's UUID after creating the SG could make the SG non-syncable)

- various fixes to edge cases
- descriptors to the add/edit APIs via restresponse

- Operation "Just relaxing and looking at stuff for the baby online" - the x-mas covert development patch(tm)
2017-12-27 15:32:38 +01:00
iglocska 05a89f5e87 Merge branch '2.4' into feature/tag_filter_rework 2017-11-30 22:28:35 +01:00
iglocska da66c8ff30 fix: Fixed an issue where sharing groups were not properly attached to events for sync users, potentially fixes #2653 2017-11-30 22:25:23 +01:00
iglocska ebcc62c9bd fix: Ambiguity removed from some sharing group related queries 2017-11-30 10:17:05 +01:00
iglocska 1e61074115 fix: Relaxed UUID4 requirement for UUID validation
- we shouldn't enforce anything beyond the basic format
2017-06-12 22:39:02 +02:00
iglocska 924a960a8f fix: Invalid key lookup for roaming in checkIfServerInSG() 2017-04-10 15:36:44 +02:00
iglocska c305891693 fix: Fixed a small issue that could lead to a failed event push using sharing groups 2017-04-06 16:10:06 +02:00
Iglocska 3142f05e69 fix: Added a fallback for no active flag being set on sharing group capture 2016-09-19 14:29:06 +02:00
Andreas Ziegler 25e52a6786 chg: remove some references to variables 2016-09-15 17:08:58 +02:00
Andreas Ziegler cf2f0dc625 chg: remove some obsolete code 2016-09-01 05:15:36 +02:00
iglocska 822b0bf8fa chg: Cleanup of the controllers and models
- removed incorrect, useless boiler plate comments
- kept useful comments intact
- added some missing line breaks to make the codebase a bit more uniform
- removed some obviously obsolete TODO comments
2016-08-25 11:38:37 +02:00
Andreas Ziegler cffcfa81d7 chg: remove whitespace (space/tab) from empty lines 2016-08-22 02:52:51 +02:00
Iglocska 1540405e3e fix: Fix to the 2.4.49 SG upgrade
- was incorrectly changing the org_id of the synced sharing group instead of adding the org to the distribution list
2016-07-25 12:44:26 +02:00
Iglocska e96ba2334c fix: fixed a typo in the sharing group model 2016-07-18 12:21:48 +02:00
Iglocska 0a50b71abe Merge branch '2.4' of https://github.com/MISP/MISP into 2.4 2016-07-18 00:35:08 +02:00
Iglocska 0fcf90a926 chg: Added the sharing group roaming setting to various parts of the application
- sharing group add/edit
- summary view
- push rule checks
2016-07-18 00:13:12 +02:00
Iglocska 313aba17cb fix: Several fixes to the sharing group behavious
- New setting roaming:
  - Until now, users could unselect "Limit instances to which data in this sharing group should be pushed to"
  - This lead to no servers added to the distribution list, and MISP would simply determine, based on the sync rules, whether the host organisation of the remote instance is eligible for the event
  - This works well in most cases, but in some cases, the local instance is not kept after a sync (aliases for the local instance baseurl vs remote instance's view of the url)
  - In these cases the sharing groups ended up being "unlimited", which was not the intent
  - Generally this shouldn't cause any issues as MISP still requires the sync link's organisation to be directly contained in an SG before it would push the event further
  - However, introducing the roaming setting this can be more clearly defined
  - By default, sharing groups are set to non roaming

- Some further fixes to the sharing group update procedure for 2.4.49

- Update the roaming status of existing sharing groups. Local sharing groups with no instances attached will become roaming by default, all others are assumed to be non-roaming
2016-07-17 12:00:20 +02:00
Iglocska 835694c814 fix: Add own org of sync user to the Sharing group if the sync user is in no way contained in the sharing group.
- This situation should normally only occur during a pull when the remote end has a sharing group that allows access for all local orgs
2016-07-16 21:12:33 +02:00
Iglocska dd4e968319 fix: Progress on the sharing group fix for pulled server based sharing groups 2016-07-15 23:24:27 +02:00
Steve Fossen 33f3f32fed rename to php variables match sql model
causing sync to fail, when new sharing groups are created.
2016-07-12 09:44:12 -07:00
Iglocska 9522c96d54 Revert "Revert "chg: remove obsolete uuid() wrapper""
This reverts commit bae6eadfe7.
2016-07-11 00:59:47 +02:00
Iglocska bae6eadfe7 Revert "chg: remove obsolete uuid() wrapper"
This reverts commit 77ca0f8dd4.
2016-07-08 14:50:00 +02:00
Andreas Ziegler 77ca0f8dd4 chg: remove obsolete uuid() wrapper 2016-07-07 15:13:16 +02:00
Andreas Ziegler 4e8248176b chg: remove obsolete code 2016-06-27 18:01:37 +02:00
Andreas Ziegler f007ae0f3f fix: add missing return statement 2016-06-07 01:10:20 +02:00
Andreas Ziegler 7cadf8340c remove space after unset before opening brace 2016-06-04 15:45:57 +02:00
Andreas Ziegler 8f9e152d8c add space before opening curly brackets 2016-06-04 15:45:11 +02:00
Andreas Ziegler 0fe692c56a remove whitespace at end of line 2016-06-04 01:10:45 +02:00
Andreas Ziegler 898ea1d97c remove whitespace (space/tab) from empty lines 2016-06-04 01:08:16 +02:00