Skip to content

Conversation

@Ash-exp
Copy link
Contributor

@Ash-exp Ash-exp commented Mar 28, 2023

Description

Here. we are removing argocd server call dependencies for App resources (Manifest, Event, Terminal, Logs). But with existing kubelink APIs we are only checking helm deployment resource access whereas this api is being used in devtron apps and now will be used for gitops deployed resources too.
Here I have updated with conditional rbac depending on where the call came from and enforcing the rbac policies accordingly.

Set in default deployment type as GitOps if InternalUse is not configured.

Fix #3537

This will go along with PR #devtron-labs/dashboard#882

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Tested For Devtron App
    • Helm Deployed
    • GitOps Deployed
    • Resource Browser
  • Tested For Helm App
    • Helm Deployed
    • GitOps Deployed
    • Resource Browser
  • Tested For External Helm App

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • 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.
  • I have added all the required unit/api test cases.

Does this PR introduce a user-facing change?


@Ash-exp Ash-exp added the bug Something isn't working label Mar 28, 2023
@Ash-exp Ash-exp self-assigned this Mar 28, 2023
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 3, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
9.3% 9.3% Duplication

@Ash-exp Ash-exp requested a review from prakash100198 May 15, 2023 11:13
v, vars := r.URL.Query(), mux.Vars(r)
request := &ResourceRequestBean{}
podName := vars["podName"]
/*sinceSeconds, err := strconv.Atoi(v.Get("sinceSeconds"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove these comments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was already there prior my development. Should I remove !!

if appId != "" {
// Validate App Type
appType, err := strconv.Atoi(v.Get("appType"))
if err != nil || appType < DevtronAppType || appType > HelmAppType {
Copy link
Contributor

Choose a reason for hiding this comment

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

please use !=, and at subsequent places

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented 👍

prakarsh-dt and others added 7 commits June 13, 2023 10:45
* acd app delete with non-cascade

* handled DeleteErrorResponse length error

* added go routine

* argo non-casecade delete for helm and devtron app

* fix: api response for cluster connection error

* fix: nil pointer for cluster details

* fix: updated test interface for pipeline

* fix: non-cascade delete condition

* fix: forceDelete and cascadeDelete validation

* fix: delete response for force delete req

* fix: added clusterName to res

* fix: added clusterName to cluster-conn api resp

* fix: updated non-cascade api resp

* fix: updated non-cascade api err return

* fix: updated chart list delete bug

* fix: installed app delete bug

* fix: installed app noncascade delete bug

* fix: helm release force delete

* fix: appstore release force delete

* fix: appstore deployment list response

* fix: bulk delete deployment api condition

* fixed typo and response message

* fix: bulk delete cd pipeline api payload

* fix: logger and conditional chain

* updated wire

* modifed cluster services
@gitguardian
Copy link

gitguardian bot commented Jun 21, 2023

⚠️ GitGuardian has uncovered 2 secrets 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 secrets in your pull request
GitGuardian id Secret Commit Filename
141558 Generic High Entropy Secret 7bbd2a7 scripts/devtron-reference-helm-charts/cronjob-chart_1-5-0/env-values.yaml View secret
2763127 Generic High Entropy Secret 7bbd2a7 scripts/devtron-reference-helm-charts/cronjob-chart_1-5-0/secrets-test-values.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 secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  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.

Our GitHub checks need improvements? Share your feedbacks!

prakash100198
prakash100198 previously approved these changes Jun 21, 2023
@Ash-exp Ash-exp changed the title fix: Argocd rbac policy enforcement for kubelink APIs fix: Remove argocd server calls for Application resources (Manifest, Event, Logs, Terminal) Jun 21, 2023
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 18 Code Smells

No Coverage information No Coverage information
24.2% 24.2% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@Ash-exp Ash-exp merged commit f69fccd into main Jun 21, 2023
@Ash-exp Ash-exp deleted the fix-argocd-rbac-kubelink branch June 21, 2023 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: No RBAC enforcement for deployed application/chart resources (manifest/event/log/terminal)

6 participants