LogoLogo
Login to CortexBook a DemoCortex Academycortex.io
  • Cortex Docs
  • Cortex Quick Start
  • Ingesting data into Cortex
    • Managing Entities
      • Adding entities
        • Add services
        • Add domains
        • Add teams
        • Add custom entity types
        • Defining dependencies
      • Entity details page
      • Defining ownership
      • Defining relationship types
      • Grouping entities
      • Adding external documentation
      • Adding Deploy data
      • Adding custom data
      • Viewing discovered entities
      • Archiving entities
      • Relationship graph
      • Using On-call Assistant for incidents
      • Managing Terraform infra in Cortex
    • Managing Catalogs
    • Integrations
      • Internally hosted integrations
      • ArgoCD
      • AWS
      • Azure DevOps
      • Azure Resources
      • BambooHR
      • Bitbucket
      • BugSnag
      • Buildkite
      • Checkmarx
      • CircleCI
      • ClickUp
      • Codecov
      • Coralogix
      • Custom webhook integrations
      • Datadog
      • Dynatrace
      • Entra ID (Azure AD)
      • FireHydrant
      • GitHub
      • GitLab
      • Google
      • Grafana
      • incident.io
      • Instana
      • Jenkins
      • Jira
      • Kubernetes
      • LaunchDarkly
      • Lightstep
      • Mend
      • Microsoft Teams
      • New Relic
      • Okta
      • Opsgenie
      • PagerDuty
      • Prometheus
      • Rollbar
      • Rootly
      • Sentry
      • ServiceNow
      • Slack
      • Snyk
      • SonarQube
      • Splunk Observability Cloud (SignalFx)
      • Splunk On-Call (VictorOps)
      • Sumo Logic
      • Veracode
      • Wiz
      • Workday
      • xMatters
  • Scorecards
    • Initiatives and Action items
      • Creating issues based on Initiatives
    • Scorecard rule exemptions
    • Scorecard rule filters
    • Scorecard examples
    • Scorecards as code
  • Reports
    • Executive report
    • All Scorecards report
    • Bird's eye report
    • Progress report
    • Report card
  • Eng Intelligence
    • Custom Metrics
    • Jira Metrics
    • Metrics Explorer (Beta)
  • Cortex Query Language (CQL)
    • Using CQL reports
    • Using JQ in Cortex
  • Workflows
    • Creating a Workflow
      • Workflows as code
    • Blocks
    • Running a Workflow
    • Registering a Scaffolder template
      • Scaffolder advanced usage
    • Using a Workflow to sync in ArgoCD
    • Kicking off a Jenkins pipeline in a Workflow
    • Calling internal service endpoints in a Workflow
  • Plugins
    • Creating a plugin
      • Creating a plugin proxy
    • Migrating Backstage plugins to Cortex
  • Engineering homepage
  • Workspace Settings
    • Using GitOps for Cortex
      • GitOps logs
    • Managing users
      • Roles and permissions
        • Custom roles
        • Team ownership entity editing
      • Configuring SSO
        • Microsoft Entra ID
        • Google
        • Other OIDC providers
        • Okta
          • Okta SCIM
      • Configuring identity mappings
      • Onboarding management
    • API keys, secrets, and tokens
      • Secrets
      • Personal tokens
    • Audit logs
    • Entity settings
      • Data verification
      • Auto archiving entities
    • IP allowlist
    • Notifications
      • Notification logs
    • Customizing your workspace
    • Using search in Cortex
  • Cortex API
    • REST API operations
      • API Keys
      • Audit Logs
      • Catalog Entities
      • Custom Data
        • Custom Data (Advanced)
      • Custom Events
      • Custom Metrics
      • Dependencies
      • Deploys
      • Discovery Audit
      • Docs
      • Eng Intel: User Labels
      • Entity Relationship Types (Beta)
      • Entity Relationships (Beta)
      • Entity Types
      • GitOps Logs
      • Groups
      • Initiatives
      • Integrations APIs
        • Azure Active Directory (Entra ID) API
        • Azure Resources API
        • AWS API
        • Azure DevOps API
        • CircleCI API
        • Coralogix API
        • Datadog API
        • GitHub API
        • GitLab API
        • incident.io API
        • LaunchDarkly API
        • New Relic API
        • PagerDuty API
        • Prometheus API
        • SonarQube API
      • IP Allowlist
      • Notification Logs
      • On call
      • Packages
      • Plugins
      • Queries
      • SCIM
      • Scorecards
      • Secrets
      • Team Hierarchies
      • Teams
      • Workflows
Powered by GitBook
On this page
  • Considerations
  • How to create a plugin proxy
  • Example plugin proxy configuration
  • Manage plugin proxies
  • Edit a proxy
  • Delete a proxy

Was this helpful?

Export as PDF
  1. Plugins
  2. Creating a plugin

Creating a plugin proxy

Last updated 2 months ago

Was this helpful?

To access authenticated external APIs with your , you can configure a plugin proxy.

Plugin proxies try to match incoming requests against configured URL prefixes and apply rules to those requests (such as adding headers) before propagating the request to the specified downstream URL. Header rules have access to secrets via Mustache-like templating for easy authentication.

Plugin proxies must be explicitly associated with a particular plugin in the plugin configuration; once specified, all proxyFetch requests made by that plugin will use the proxy. If no proxy is defined for a plugin, no special logic will apply and requests will be propagated to downstream URLs without modification.

Considerations

When creating a plugin proxy, consider the following:

  • If there are multiple matching URL prefixes with overlapping header keys, the more specific (i.e. longer) prefix rules will be used.

  • If a request from the plugin is invoked with header keys that overlap the proxy ruleset, the request-specific header values will be used.

How to create a plugin proxy

Users with the Edit plugin proxies permission can create a plugin proxy.

  1. If you are using a proxy with sensitive information, such as an access token, first follow the for your proxy.

  2. Navigate to Plugins. In the upper right corner, click Create proxy.

  3. Configure the proxy:

    • Proxy name: Enter a human-readable name for the proxy.

    • Path: This field is automatically populated based on the name. It is a unique identifier for the proxy.

    • URL prefixes: Click Add URL to configure URL prefixes to apply rules to requests going through this proxy. All requests passing through this proxy that match the URL prefix will have a set of rules applied.

      • Header: Optionally configure a header for the URL.

        • If you are using a proxy with sensitive information, you can use Mustache-like templating to reference a global secret by tag, e.g., {{secrets.my_auth_token}}.

  4. Click Create proxy.

Example plugin proxy configuration

{
  "id": "22",
  "tag": "github",
  "urlConfigurations": {
    "https://api.github.com": {
      "headers": [
        ,
        { "key": "Authorization", "value": "Bearer {}" }
      ]
    }
  }
}

Example plugin code

import  from "@cortexapps/plugin-core";

const getGithubReleases = async (ownerName: string, repoName: string) => {
  const githubReleases = await fetch(`http://api.github.com/repo/$/$/releases`);
  return githubReleases.json();
};

In this scenario, the request to fetch GitHub requests will be sent with the X-GitHub-API-Version and Authorization headers, with the Authorization header value interpolated to include the github_read_token secret if it exists in your Cortex workspace.

Manage plugin proxies

Edit a proxy

  1. In the row containing the proxy, click the 3 dots icon.

  2. In the dropdown that appears, click Edit proxy.

  3. Make any desired changes, then click Save proxy.

Delete a proxy

  1. In the row containing the proxy, click the 3 dots icon.

  2. In the dropdown that appears, click Delete proxy.

  3. In the confirmation modal, click Delete.

See a sample plugin proxy configuration and sample plugin code below under .

You can view your plugin proxies in Plugins under the .

Navigate to Plugins then click the .

Navigate to Plugins then click the .

plugin
steps to create a secret
Proxies tab
Proxies tab
Proxies tab
Example plugin proxy configuration