-
Notifications
You must be signed in to change notification settings - Fork 61
Access Control Easy to Circumvent #743
Comments
/start |
Tips:
|
@seprintour curious to know your input on the proposed solution. I didn't do research on this and I am not confident that it is the best approach. rfc @ubiquity/software-development |
I wonder if the bot should automatically resets non-admin's label update. |
@seprintour I think we should figure out a good strategy before you start coding. |
Yea, not coding yet.. Trying to hotfix the forum issue. Sent a DM |
I haven't found @seprintour to be in any of them.
|
I temporarily added @seprintour as a collaborator on that specific repo to push some hotfixes to the CI on Although collaborators are more trusted positions, projects should still be able to set fine grained permissions i.e. like our |
Do you have any updates @seprintour? If you would like to release the bounty back to the DevPool, please comment |
📌 |
@pavlovcik I am going to do some research and write it down here as it comes to mind
Once the bot sees that the issue once has the label and it was removed by someone who's not one of these two roles.. It rejects permit generation any way. rfc @rndquu |
Can't we simply reject editing labels for all roles unless the role is:
? |
We can't really directly intercept the Github UI actions and reject it, all we can do is create a reaction after the webhook is triggered that would permission-gate the action that is forbidden for the bot. |
I still don't understand what exactly you edited here As far as I understand here is what happened:
Could you describe what label exactly did you edit and what was the exact flow? |
I was already a collaborator
|
This is possible only if you're a member or collaborator, so this is not that big of an issue I guess. Normally we should be able to trust members. |
Same comment I made when the issue was raised, it's not really a vulnerability but if its a feature needed here.. Only way to go around it is a reaction once an unauthorized collaborator edits a label |
This doesn't seem like a very elegant solution, but it is fairly secure: All future permits on that repository will throw an error explaining the situation, ideally explaining that the collaborator changed from X to Y label (only concerning pricing related labels defined in our config) and require some type of manual approval (i.e. command invocation) from an admin. In this scenario, if it is still not authorized, then the admin should change the label back from Y to X and the bot should re-allow permits to be generated. |
Elegant solutions will be to directly intercept this event but unfortunately we can't do that, is there any other way we can do this that doesn't involve attaching a label that the bot acts on? Rfc |
Well I was thinking that the bot will check the last updated time of a dependent label and if it was between the time the issue was started and completed. This implies that one of the dependent labels was tampered with while a task was being worked on. Example:
I just asked ChatGPT and we might be able to leverage the audit log.
But I have a feeling we will need to manually track these things with our bot and the database. |
We can see when last a label was edited but it doesn't keep track of who edited.. Perhaps we can save that to the db when the event is triggered and do the check when the issue is closed |
I think there's supposed to be a field for repository |
Using this command (callable by admin) would just approve the change for the specific repo and enable all permits been held by the recent change to be generated Should we limit the approve command to just admin? and what if the admin want to decline the request and roll back. Maybe we can make it ( We can also pass the id of the change like this |
Default state is
Also for the access control we should let those with delegated access change the types of labels. See point 4 under Notes
Normal users aren't meant to have access to the database so I don't see how they can find out the id of the change |
I'd still leave the id, because this event occurs completely outside and issue or a comment.. It cannot just send a random comment anywhere and it cannot reply. So to work without the ID, it needs to have an issue where it failed to generate a permit, and perhaps among the reason for failure.. I can attach the |
Or we can just search for changes by label. using the label on the issue that was just closed.. would be a better approach |
Just needs to check at permit generation time inside of the issue for any unauthorized changes. When an issue is closed as complete inside of that closed event context we have the labels and the issue. From there we check the labels and see if any were tampered with. |
@pavlovcik check this out Seprintour-Test/test#43 (comment) Does the error message work? |
Ready for review @pavlovcik |
Task Assignee Reward[ CLAIM 600 WXDAI ]
If you've enjoyed your experience in the DevPool, we'd appreciate your support. Follow Ubiquity on GitHub and star this repo. Your endorsement means the world to us and helps us grow!We are excited to announce that the DevPool and UbiquiBot are now available to partners! Our ideal collaborators are globally distributed crypto-native organizations, who actively work on open source on GitHub, and excel in research & development. If you can introduce us to the repository maintainers in these types of companies, we have a special bonus in store for you! |
The bot clearly states that the assignee does not have access to set the
Priority
label, thus funding the bounty. However, it appears that they were able to edit an invalid label that was already on the issue, and rename it to a valid label to generate a payment permit.Proposed Solution
If anybody but an
admin
orbilling_manager
updates pricing related labels, then anadmin
orbilling_manager
must manually re-allow automatic payment permit generation. This state should be saved in our database.The bot will check the last updated time of a dependent (pricing related) label and if it was between the time the issue was started and completed. This implies that one of the dependent labels was tampered with while a task was being worked on.
Example:
Priority: 4 (Urgent)
andTime: <1 Hour
updated
column forPriority: 4 (Urgent)
Priority: 4 (Urgent)
label was last modified, by an unauthorized contributor, on 2 October.Priority: 4 (Urgent)
being modified after the task was started, the bot refuses to generate the permit and explains the situation.Notes
admin
orbilling_manager
should change the label back from Y to X and the bot should re-allow permits to be generated./approve
foradmins
, andbilling_managers
which will "approve" in the database see below./allow set-priority @seprintour true
and if seprintour changed the priority label, it should be approved implicitly.Unauthorized label changes table
Originally posted by @ubiquibot[bot] in ubiquity/ubiquibot-telegram#4 (comment)
Task checklist
/approve
command (i feel like this part of the proposal can be refined... rfc!)The text was updated successfully, but these errors were encountered: