kubearmor / KubeArmor

Runtime Security Enforcement System. Workload hardening/sandboxing and implementing least-permissive policies made easy leveraging LSMs (BPF-LSM, AppArmor).
https://kubearmor.io/
Apache License 2.0
1.47k stars 338 forks source link

Making a github bot to improve our repo's workflow #1082

Open PrimalPimmy opened 1 year ago

PrimalPimmy commented 1 year ago

Feature Request

Short Description

Making use of github bots to automate some of our maintainer tasks/checks.

Describe the solution you'd like

Having Kubearmor's own github bot would help us in automating tasks like assigning new contributors, similar to this https://github.com/k8s-ci-robot, or the bot I made/used at tremor.rs project

I want people to suggest what they think could be automated in our workflow here :D

Ankurk99 commented 1 year ago

Few things which comes to my mind:

  1. automatically assign the PR to be reviewed by atleast one of the maintainers (can be taken from suggested reviewers)
  2. Basic checks - Whether DCO check is passed, if it's failing go-lint, go-sec or any other test and comment with asking the contributor to kindly address these. But this warning should be given only once and after some time interval threshold (after maybe 15 min of failing the test) because many a times it's a developing PR.
  3. mark a PR as stale after some time of inactivity (45 days?)
PrimalPimmy commented 1 year ago

I dont have the bandwidth for this rn, anyone can feel free to pick this up!

Amishakumari544 commented 1 year ago

I would like to work on this issue @nyrahul

Ankurk99 commented 1 year ago

@Amishakumari544 Thanks for taking this up. Feel free to ask for any doubts here or on KubeArmor slack.

akashsawan1 commented 1 year ago

Hey, @Amishakumari544 are you still working on this issue? If not, Can I take up this issue? I am new to this space , would be more happy to learn and contribute

sarthakkathpalia commented 1 year ago

@Ankurk99 @PrimalPimmy wanted to ask if this is still needed? If yes, then wanted to work on this, though don't have much idea about it. Searched about GitHub bots but found quite less resources. Would be great if you can guide a little :)

PrimalPimmy commented 1 year ago

hey @Amishakumari544 are you still working on this issue? If not, I'll assign it to someone else.

Amishakumari544 commented 1 year ago

you can :)

pmuls99 commented 1 year ago

Hi everybody. I am interested in working on this issue. @sarthakkathpalia have you started working on this? If yes, I would love to join you.

rootxrishabh commented 1 year ago

Hi @Ankurk99 I would like to work on this, I am thinking of using the probot framework. Keeping in mind the requirements you mentioned.

rakshitgondwal commented 1 year ago

Are you still working on this? @rootxrishabh If no, then I'd like to take this up.

rootxrishabh commented 1 year ago

Hi @rakshitgondwal , yes I am working on this : )

Ankurk99 commented 1 year ago

Hey @rootxrishabh, any update on this? Do you need any help?

rootxrishabh commented 1 year ago

Hey @Ankurk99, I have completed implementing the functionalities, however as I remember we wanted a workflow file for this rather than a standalone bot. How can I deploy the app on GitHub action?

rootxrishabh commented 1 year ago

Hey guys, I am getting this error when testing the workflow created for this issue. It seems like when a PR is made from a fork certain jobs fail when acts on the PR itself.

Error: Unhandled error: HttpError: Resource not accessible by integration

For reference

rootxrishabh commented 10 months ago

PR reviewer Stale PR/Issues (For example) Failing checks (I couldn't find an existing bot for this but we already have an action here that works) @daemon1024

Pushkarm029 commented 9 months ago

@rootxrishabh are you currently working on this?

rootxrishabh commented 9 months ago

Hey @Pushkarm029! We are currently looking to implement different github apps for different tasks due to permission issues of github(as seen in PR github actions). If you have a different approach in mind, we'd be eager to hear that as well : )

Pushkarm029 commented 9 months ago

image I tried implementing the mark pr stale feature in my repo. At first, it gave the same error, but changing it to Read and write permissions from Read repository contents and packages permissions in repo settings fixed it.

cc @rootxrishabh

rootxrishabh commented 9 months ago

I have been reading a bit about GitHub token permissions. The concern was that as actions run on the PR fork(untrusted) and not upstream, providing action tokens with write permissions might result in malicious code execution. But I think GitHub blog on workflow security addresses the safety concerns as well the hazardous cases and ensure that until the workflow does not interact with the PR code, we can safely grant token write permissions for our use. @Pushkarm029 Thank you for bringing this to our attention : ) @daemon1024 If all looks ok then we can proceed with the PR.

rootxrishabh commented 9 months ago

Also, as the workflow processes user input, we will need to implement input sanitation as mentioned here.

Manik2708 commented 1 month ago

Hi @rootxrishabh! Why the PR is not merged? I would be happy to know if I can contribute to this!