Skip to content

Add workload.yaml descriptors for OpenChoreo source builds#431

Open
isala404 wants to merge 2 commits intoOpenDIF:mainfrom
isala404:add-workload-descriptors
Open

Add workload.yaml descriptors for OpenChoreo source builds#431
isala404 wants to merge 2 commits intoOpenDIF:mainfrom
isala404:add-workload-descriptors

Conversation

@isala404
Copy link

Summary

  • Adds workload.yaml OpenChoreo descriptors for all 8 components: audit-service, consent-engine, orchestration-engine, policy-decision-point, portal-backend, admin-portal, consent-portal, and member-portal
  • Each descriptor defines endpoints, inter-service connections, environment configuration, and secret references following the openchoreo.dev/v1alpha1 API
  • Orchestration engine includes a mounted config.json file for runtime configuration

Test plan

  • Validate YAML syntax for all 8 descriptors
  • Verify endpoint ports match actual service configurations
  • Confirm secret key references align with existing secret definitions
  • Test deployment with OpenChoreo controller

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the deployability and management of several core services and portals within the OpenChoreo platform by introducing dedicated workload.yaml descriptors. These new configurations standardize how these components interact, manage secrets, and expose endpoints, streamlining their integration into the OpenChoreo ecosystem. Additionally, a minor adjustment was made to the portal backend's database migration settings.

Highlights

  • OpenChoreo Descriptors: Added workload.yaml OpenChoreo descriptors for eight components: audit-service, consent-engine, orchestration-engine, policy-decision-point, portal-backend, admin-portal, consent-portal, and member-portal.
  • Configuration Details: Each descriptor defines endpoints, inter-service connections, environment configurations, and secret references following the openchoreo.dev/v1alpha1 API.
  • Orchestration Engine Specifics: The orchestration engine's descriptor includes a mounted config.json file for runtime configuration.
  • Database Configuration: Modified the GORM database configuration in portal-backend to disable foreign key constraint checks during migration.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • audit-service/workload.yaml
    • Added a new OpenChoreo workload descriptor.
  • exchange/consent-engine/workload.yaml
    • Added a new OpenChoreo workload descriptor.
  • exchange/orchestration-engine/workload.yaml
    • Added a new OpenChoreo workload descriptor, including a mounted config.json file.
  • exchange/policy-decision-point/workload.yaml
    • Added a new OpenChoreo workload descriptor.
  • portal-backend/v1/database.go
    • Updated GORM configuration to disable foreign key constraint checks during migration.
  • portal-backend/workload.yaml
    • Added a new OpenChoreo workload descriptor.
  • portals/admin-portal/workload.yaml
    • Added a new OpenChoreo workload descriptor.
  • portals/consent-portal/workload.yaml
    • Added a new OpenChoreo workload descriptor.
  • portals/member-portal/workload.yaml
    • Added a new OpenChoreo workload descriptor.
Activity
  • No specific activity (comments, reviews, progress) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces workload.yaml descriptors for eight services. A critical vulnerability has been identified: multiple components have database SSL disabled in production-like environments, and the portal backend is configured with a 'fail-open' authorization mode. Additionally, the review found several critical and high-severity issues including hardcoded placeholder secrets in portal-backend/workload.yaml, the use of internal-only Kubernetes service URLs in frontend portal configurations (which will break user authentication), configurations that will likely lead to non-functional portals, and brittle service-to-service communication due to hardcoded URLs. Addressing these points will improve the security, correctness, and maintainability of the services.

Comment on lines +66 to +69
- name: ASGARDEO_CLIENT_SECRET
value: placeholder
- name: CHOREO_PDP_CONNECTION_CHOREOAPIKEY
value: placeholder
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The environment variables ASGARDEO_CLIENT_SECRET and CHOREO_PDP_CONNECTION_CHOREOAPIKEY are hardcoded with the value "placeholder". This is a critical security vulnerability. Secrets must not be hardcoded in configuration files. They should be injected securely at runtime by referencing a Kubernetes secret, similar to how database credentials are handled in this file. The secret names and keys in the suggestion below are examples and should be adjusted to match your actual secret definitions.

    - name: ASGARDEO_CLIENT_SECRET
      valueFrom:
        secretKeyRef:
          name: ndx-asgardeo-secrets
          key: client-secret
    - name: CHOREO_PDP_CONNECTION_CHOREOAPIKEY
      valueFrom:
        secretKeyRef:
          name: ndx-pdp-secrets
          key: api-key

Comment on lines +28 to +29
- name: VITE_IDP_BASE_URL
value: http://thunder-service.thunder.svc.cluster.local:8090
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The VITE_IDP_BASE_URL is hardcoded to a Kubernetes internal service URL (http://thunder-service.thunder.svc.cluster.local:8090). This URL is not accessible from a user's browser, which will prevent authentication from working. This variable must be set to the public-facing URL of the identity provider.

      value: "https://your-public-idp.com" # Replace with the actual public URL

Comment on lines +33 to +34
- name: VITE_BASE_URL
value: http://thunder-service.thunder.svc.cluster.local:8090
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The VITE_BASE_URL for the IDP is hardcoded to a Kubernetes internal service URL (http://thunder-service.thunder.svc.cluster.local:8090). This URL is not accessible from a user's browser, which will prevent authentication from working. This variable must be set to the public-facing URL of the identity provider.

      value: "https://your-public-idp.com" # Replace with the actual public URL

Comment on lines +28 to +29
- name: VITE_BASE_URL
value: http://thunder-service.thunder.svc.cluster.local:8090
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The VITE_BASE_URL for the IDP is hardcoded to a Kubernetes internal service URL (http://thunder-service.thunder.svc.cluster.local:8090). This URL is not accessible from a user's browser, which will prevent authentication from working. This variable must be set to the public-facing URL of the identity provider.

      value: "https://your-public-idp.com" # Replace with the actual public URL

Comment on lines +58 to +59
- name: AUTHORIZATION_MODE
value: fail_open_admin
Copy link
Contributor

Choose a reason for hiding this comment

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

security-high high

The authorization mode is set to fail_open_admin. "Fail-open" is a security anti-pattern where access is granted if the authorization check fails or cannot be completed. In a security-sensitive application, the system should always "fail-closed," denying access by default if an error occurs during the authorization process to prevent unauthorized access.

Comment on lines +27 to +40
- name: VITE_CONSENT_ENGINE_URL
value: ""
- name: VITE_API_URL
value: ""
- name: VITE_CLIENT_ID
value: NDX_CONSENT_PORTAL
- name: VITE_BASE_URL
value: http://thunder-service.thunder.svc.cluster.local:8090
- name: VITE_SCOPE
value: "openid profile email"
- name: VITE_SIGN_IN_REDIRECT_URL
value: ""
- name: VITE_SIGN_OUT_REDIRECT_URL
value: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Several configuration variables (VITE_CONSENT_ENGINE_URL, VITE_API_URL, VITE_SIGN_IN_REDIRECT_URL, VITE_SIGN_OUT_REDIRECT_URL) are set to empty strings. This will likely render the portal non-functional. These values must be configured with appropriate URLs for the portal to work correctly. For example, VITE_API_URL should be populated using the NDX_PORTAL_BACKEND_URL from the connection definition, and the redirect URLs must be set to the portal's public address.

Comment on lines +22 to +35
- name: VITE_API_URL
value: ""
- name: VITE_LOGS_URL
value: ""
- name: VITE_CLIENT_ID
value: NDX_MEMBER_PORTAL
- name: VITE_BASE_URL
value: http://thunder-service.thunder.svc.cluster.local:8090
- name: VITE_SCOPE
value: "openid profile email groups"
- name: VITE_SIGN_IN_REDIRECT_URL
value: ""
- name: VITE_SIGN_OUT_REDIRECT_URL
value: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Several configuration variables (VITE_API_URL, VITE_LOGS_URL, VITE_SIGN_IN_REDIRECT_URL, VITE_SIGN_OUT_REDIRECT_URL) are set to empty strings. This will likely render the portal non-functional. These values must be configured with appropriate URLs for the portal to work correctly. For example, VITE_API_URL should be populated using the NDX_PORTAL_BACKEND_URL from the connection definition, and the redirect URLs must be set to the portal's public address.

Comment on lines +53 to +54
- name: DB_SSLMODE
value: disable
Copy link
Contributor

Choose a reason for hiding this comment

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

security-medium medium

The database SSL mode is explicitly disabled (DB_SSLMODE: disable) while the environment is set to production. This is a significant security risk as it allows for potential eavesdropping and man-in-the-middle attacks on sensitive data. It is strongly recommended to enable SSL for all database connections in production.

      value: require

Comment on lines +48 to +49
- name: DB_SSLMODE
value: disable
Copy link
Contributor

Choose a reason for hiding this comment

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

security-medium medium

The database SSL mode is explicitly disabled (DB_SSLMODE: disable) while the environment is set to production. This is a significant security risk as it allows for potential eavesdropping and man-in-the-middle attacks on sensitive data. Please enable SSL for the database connection.

      value: require

Comment on lines +54 to +55
- name: DB_SSLMODE
value: disable
Copy link
Contributor

Choose a reason for hiding this comment

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

security-medium medium

The database SSL mode is explicitly disabled (DB_SSLMODE: disable). Disabling SSL for database connections is a security risk as it allows for potential eavesdropping and man-in-the-middle attacks on sensitive data. In any environment handling sensitive data, SSL should be enabled. Please enable SSL for this connection.

      value: require

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant