Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rbac related bug fixing which biforcates the apps and jobs permission #5110

Open
wants to merge 42 commits into
base: main
Choose a base branch
from

Conversation

Kishan789dev
Copy link

@Kishan789dev Kishan789dev commented May 13, 2024

Fixes #4846

Desription

fixed the issue related user permission ,user having permisssion for the view only was able to create app/job

Checklist:

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.

-->


Kishan789dev and others added 22 commits May 14, 2024 03:21
* terminate operation before sync

* using method for checking manual sync

* terminating only in case of error

* handling termination error

* updating sync function
…4978)

* introuddced api token versioning

* fix

* reverted wire_gen

* migration udpated and minor refactor

* refactor

* moved const from apiToken pkg to user

* reverted wire_gen

* refactor

* reverted wire_gen

* concurrency case handled

* fix

* commented wherever necessary

* refactor

* fix

* refactor

* refactor

* wip

* refactor

* added comments and minor refactor

* refactor

* refactoring

* fix

* added comments around cyclic import

* added few more comments

* sql script no updated
* introduction to feasibility

* moved feasibility in trigger/devtronApps

* feasibility refactorings

* refactoring and feasibility manager

* removing vulnerability changes

* vulnerability checks retract

* dry run removed

* dry run checks removed

* refactoring

* removing unnecessary code

* comments

* trigger request
* Changes made in the doc according to the newer version

* Revert "Changes made in the doc according to the newer version"

This reverts commit 1f4d806.

* created a doc for the newer version of the plugin

* added the pass/fail condition

* corrected mistakes
* Update DockerfileEA

* Update Dockerfile
* Changes made in the doc according to the newer version

* Revert "Changes made in the doc according to the newer version"

This reverts commit 1f4d806.

* created a doc for the newer version of the plugin

* added the pass/fail condition

* corrected mistakes

* added the new doc in the index file
…cronjob template charts (#5016)

* handle for wrong format of k8s version in semvercompare func in cronjob template charts

* TestStripPrereleaseFromK8sVersion UT's added

* constants added

* incorporated code review changes

* merge main
* Add files via upload

CD plugin

* Update 238_devtron_CD_trigger_v1.0.0.up.sql

* Rename 231_devtron_CD_trigger_v1.0.0.down.sql to 238_devtron_CD_trigger_v1.0.0.down.sql

* Rename 231_devtron_CD_trigger_v1.0.0.up.sql to 238_devtron_CD_trigger_v1.0.0.up.sql

* Update 238_devtron_CD_trigger_v1.0.0.up.sql

* Update 238_devtron_CD_trigger_v1.0.0.up.sql

* Update 238_devtron_CD_trigger_v1.0.0.up.sql

* Rename 238_devtron_CD_trigger_v1.0.0.down.sql to 240_devtron_CD_trigger_v1.0.0.down.sql

* Rename 238_devtron_CD_trigger_v1.0.0.up.sql to 240_devtron_CD_trigger_v1.0.0.up.sql

---------

Co-authored-by: Prakarsh <71125043+prakarsh-dt@users.noreply.github.com>
* closing channel after write operation

* removing close

* using buffered channel

* wip: making done channel bufferred

* terminal racecondition and deadlock fix

* wire run

* removing done send call

* updating bound channel send function
* git material flow added in transaction

* wire refactored

* code review comments incorporated

* code review comments incorporated

* code review comments incorporated
* wip

* error handling done

* fix

---------

Co-authored-by: ayushmaheshwari <ayush@devtron.ai>
* feat: Plugin to trigger Devtron Job (#5052)

* Update 241_devtronJobTrigger.up.sql
* handle context cancelled and deadline exceeded in fetch resource tree api

* handle context cancelled and deadline exceeded error for resource tree fetch api for acd deployment

* handle context cancelled and deadline exceeded error sync argo app with normal refresh

* revert TIMEOUT_IN_SECONDS

* revert bean TimeoutSlow param

* fix
* cherry-pick

* incorporating feedbacks
jatin-jangir-0220 and others added 10 commits May 14, 2024 03:41
* Update azure-devops-issue-sync.yml

* Update chart-sync.yaml

* Update create-release.yml

* Update enterprise-repo-sync.yaml

* Update pager-duty-issue-escalate.yaml

* Update update-release-notes.yml

* Update chart-sync.yaml

* Update create-release.yml

* Update enterprise-repo-sync.yaml

* Update update-release-notes.yml

* Update enterprise-repo-sync.yaml

---------

Co-authored-by: Prakarsh <71125043+prakarsh-dt@users.noreply.github.com>
Co-authored-by: Shivam Nagar <124123645+Shivam-nagar23@users.noreply.github.com>
* added sql for relese feat

* updated sql script no

* renamed sql files

* updated schema for release & release track

* fixes in schema

* updated schema

* made changes in old schemas

* enum correction

* minor change in script

* sql script update

* updated script

* updated sql script no

* exposed release resource

* updated sql script no

* updated release catalog data

* added rescind status change policy handling

* renaming policy json field

* updated schema ordering

* updated global policy version

* updated policy json

* prod bug fix

* updated policy lock status

* added action check policy release

* wip

* updated policy for release status

* updated down sql

* updated sql script no.

* fixed autocorrect issues

* added first released on key for release

* updated task run migration

* Added task run down migration

* sql script change

* updated policy for action check - instruction patch

* fixed schema merge conflict

---------

Co-authored-by: Shivam-nagar23 <shivam@devtron.ai>
@Kishan789dev Kishan789dev changed the title Rback related bug Rback related bug fixing May 13, 2024
@devtron-labs devtron-labs deleted a comment from sonarcloud bot May 13, 2024
Copy link

PR is not linked to any issue, please make the corresponding changes in the body.

Copy link

PR is not linked to any issue, please make the corresponding changes in the body.


} else {
appRbacOk = handler.enforcer.Enforce(token, casbin.ResourceApplications, casbin.ActionTrigger, appObject)
}
if !appRbacOk {
handler.Logger.Debug(fmt.Errorf("unauthorized user"), "Unauthorized User", http.StatusForbidden)
common.WriteJsonResp(w, err, "Unauthorized User", http.StatusForbidden)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only valid for devtron applications, should skip for jobs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from line ~610 to 633

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes incorporated

Copy link

gitguardian bot commented May 22, 2024

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
10190660 Triggered Generic Password 8581fbe tests/integrationTesting/devtron-secret.yaml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@Kishan789dev Kishan789dev changed the title Rback related bug fixing Rbac related bug fixing which biforcates the apps and jobs permission May 22, 2024
Copy link

sonarcloud bot commented May 22, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
29.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: [Prod]Able to trigger jobs with "View only" permission