Global Navigation

  • Products
  • Overview
  • Getting Started
  • Guides
  • Resources
  • Console

Table of Contents

  • Introduction
    • App Builder Overview
    • What is App Builder
    • Business Case
    • FAQ
    • Community
  • Quick Start
    • App Builder Getting Started
      • Setting Up
      • Creating your First App
      • Publishing Your App
      • Troubleshooting
    • Runtime Getting Started
      • Overview
      • Activations
      • Deploy
      • Entities
      • How Runtime Works
      • Resources
      • Setup
      • Understanding Runtime
  • Develop
    • References
    • App Builder Guides
      • Architecture Overview
        • App Hooks
        • Introduction to React Spectrum
        • Using SDKs
      • Application State
      • Application Logging
        • Azure Log Analytics
        • New Relic
        • Splunk Cloud
        • Splunk Enterprise
      • Configuration
        • Webpack Configuration
      • Deployment
        • CI/CD for App Builder Apps
        • Credential Rotation
        • Setting Response Headers
      • Development
      • Distribution
      • Events
        • Webhooks
      • Exc App
        • Interfaces
          • Modules
          • Page ObjectWithHref
          • Page ObjectWithPath
          • Page PageAPI
          • Page PageAPIProperties
          • Runtime
          • TopBar Callback
          • TopBar CustomFeedbackConfig
          • TopBar CustomSearchConfig
          • TopBar ExternalFeedbackConfig
          • TopBar HelpCenterFeedbackConfig
          • TopBar Solution
          • TopBar TopBarAPI
          • TopBar TopBarAPIProperties
          • User UserAPI
          • User UserInfo
        • Migrate App to Exp Cloud SPA
        • Modules
          • Page
          • TopBar
          • User
      • Extensions
        • Extension Migration Guide
      • Optimization
      • Security
        • Understanding Authentication
      • Telemetry
    • Runtime Guides
      • Contribution Guide
      • Asynchronous Calls
      • Creating Actions
      • Creating REST APIs
      • CI/CD Pipeline
      • Debugging
      • Logging & Monitoring
      • Reference Docs
        • API Reference
        • CLI Usage
        • Configuring Proxy
        • Environment Variables
        • Feeds
        • Multiple Regions
        • Packages
        • Prepackages
        • Runtimes
        • Sequences & Compositions
        • Triggers & Rules
        • WSK Usage
      • Security General
      • Securing Web Actions
      • System Settings
      • Throughput Tuning
      • Tools
        • CLI Install
      • Troubleshooting
      • Using Packages
      • Using Runtime
    • Contribution Guide
  • Learning
    • Asset Compute Worker PS API
      • Requirements
      • Lesson 1: Create an app from Asset Compute template
      • Lesson 2: Configure the app
      • Lesson 3: Develop worker calling Photoshop API
      • Lesson 4: Integrate worker in AEMaaCS
      • Well done
    • Barcode Reader
      • Requirements
      • Lesson 1: Bootstrap a Headless App
      • Lesson 2: Writing a Serverless Action
      • Lesson 3: Unit and E2E Tests
      • Well done
    • Blog Articles
      • Blog Articles
    • CI/CD
      • Requirements
      • Lesson 1: Setup CI/CD
      • Lesson 2: Monitoring CI/CD
      • Lesson 3: Custom CI/CD workflow
      • Well done
    • Cron Jobs
      • Requirements
      • Lesson 1: Bootstrap a Headless App
      • Lesson 2: Set up Alarm Feed with Trigger and Rule
      • Lesson 3: Types of Alarm Feed
      • Well done
    • Custom Asset Compute Worker
      • Requirements
      • How AEM as Cloud assets works
      • Architecture of our worker
      • Configure services
      • Local environment setup
      • Implement the worker
      • Test the worker
      • Setup AEM to use the worker
      • Well Done
    • Customer Dashboard
      • Requirements
      • Lesson 1: Create a New App Builder App from Campaign Standard Template
      • Lesson 2: Explore the App Builder App
      • Lesson 3: Run the App Builder App Locally
      • Lesson 4: List All Customer Profiles on the UI
      • Lesson 5: Add Personalized Promotion Emails Triggering
      • Well Done
    • Debugging
      • Requirements
      • Lesson 1: Getting familiar with Debugger
      • Lesson 2: Debugging Application Code
      • Lesson 3: Managing Application Logs
      • Well Done
    • Event Driven
      • Requirements
      • Lesson 1: Create a New App Builder App from Template
      • Lesson 2: Register the App as Event Provider
      • Lesson 3: Fire an Event
      • Lesson 4: Consume Events
      • Well Done
    • Events Runtime
      • Requirements
      • Lesson 1: Step by Step Guide
      • Lesson 2: Verify the result
      • Well done
    • Journaling Events
      • Requirements
      • Lesson 1: Create an Event Provider using App Builder
      • Lesson 2: Create the Event Consumer using Journaling API
      • Lesson 3: End to end test
      • Well done
    • Sample Apps
      • Code Snippets
        • Caching HTTP responses
        • App Builder Files SDK
        • App Builder State SDK
        • I/O Events handler
        • Real-time data from Adobe Analytics API 1.4
    • Spectrum Introduction
      • Lesson 1: What is Spectrum ?
      • Lesson 2: Using Spectrum CSS
      • Lesson 3: Using React Spectrum
      • Lesson 4: Using React Spectrum in App Builder
      • Well done
    • Todo App
      • Requirements
      • Lesson 1: Create a New App Builder App with the React Spectrum template
      • Lesson 2: Setup Runtime actions
      • Lesson 3: Setup the CreateTodoList component
      • Lesson 4: Setup the Todo component
      • Lesson 5: Setup the TodoList component
      • Lesson 6: Bringing the pieces together to build the App
      • Well done
    • Videos
      • Overview
        • Introducing App Builder
        • Getting Started
        • Architecture
        • A Full Security Overview
        • User Journey
      • Exploring
        • Projects and Workspaces
        • React Spectrum
        • Custom Events
        • CI/CD
        • Debugging
        • Learning Resources
        • Dashboard Case Study
        • ODE Case Study
        • Deep Dive Use Cases
        • Live Wired Sneak
        • Softcrylic Partner Showcase
      • Developers Live
        • App Builder Deep Dive
        • Asset Compute Service Extensibility
        • Extend Adobe Experience Cloud
  1. Products
  2. Overview
  3. Guides
  4. Develop
  5. Runtime Guides
  6. Reference Docs
  7. Configuring Proxy

Configuring a Secure Proxy

For security reasons, Runtime does not expose egress IPs. Customers who need a way to secure communication with downstream services using IP whitelisting can use a proxy between their backend service and I/O Runtime.

This can be done by adding a proxy component (in this example, an AWS EC2 instance running nginx). The proxy component will have a fixed IP address, so using an IP allowlist can secure the backend service. Communication between I/O Runtime and the proxy component will be secured via mutual TLS (mTLS) communication.

The following steps outline how to:

  • Configure the NGINX proxy component to support mutual TLS (mTLS)
  • Configure an AppBuilder action to use mTLS to securely communicate with the proxy component

An EC2 instance with NGINX installed is a prerequisite for configuring this proxy. The official NGINX documentation has more information.

  1. Verify SSH connectivity to the EC2 instance. (screenshot of terminal/template cmd)

    ssh -i <your-key.pem> ec2-user@<EC2-IPAddress>
    
  2. Generate certificates needed for mTLS (link out to example-mtls project for generating secrets)

    • Generate mtls_server.key/.crt

      openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout mtls_server.key -out mtls_server.crt
      
    • Generate mtls_client.key/.crt

      openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout mtls_client.key -out mtls_client.crt
      
  3. Use the referenced file mtls.conf.example and replace DESTINATION_HOST with the final destination you would like to proxy to. For example, if your target host is api.myhost.com you would search for this line:

    proxy_pass https://DESTINATION_HOST
    

    Then make the replacement:

    proxy_pass https://api.myhost.com
    

    Save the resulting file locally as mtls.conf, in the same folder as your certificates.

  4. Copy sample NGINX configuration to EC2 instance with updated placeholder details. (terminal screenshots for scp cmds)

    1. First copy files to home folder:

      scp -i <your-key.pem> mtls_server.key mtls_server.crt mtls_client.key mtls_client.crt mtls.conf ec2-user@<EC2-IPAddress>:~/
      
    2. Then move them into place, while connected via SSH to the ec2 instance:

      sudo mv ~/mtls* /etc/nginx/conf.d/
      
  5. Restart nginx

  6. Verify you can connect via curl locally from the ec2 instance:

    $ curl -ki --cert /etc/nginx/conf.d/mtls_client.crt --key /etc/nginx/conf.d/mtls_client.key https://localhost/
    
    • To preserve your changes, you may create an AMI from your running AWS instance.
  7. In your AppBuilder app, you will need to make changes to wire the mTLS client key and certificate.

    • .env: Add the following lines with paths to your mtls client certificate files.

      ## Support mTLS
      __AIO_MTLS_CERT=(cat /path/to/mtls_client.crt)
      __AIO_MTLS_KEY=(cat /path/to/mtls_client.key)
      
    • app.config.yaml: Add the following default parameters pointing to the environment variables.

      inputs:
          __AIO_MTLS_CERT: $__AIO_MTLS_CERT
          __AIO_MTLS_KEY: $__AIO_MTLS_KEY
      
  8. In your action code, you can reference these environment variables when making an HTTP request to the proxy component (replace the PROXY_ENDPOINT with your AWS EC2 hostname/IP):

    // configure the client side of mTLS
    const options = {
        cert: params.__AIO_MTLS_CERT,
        key:  params.__AIO_MTLS_KEY,
        rejectUnauthorized: false, // in test, if you're working with self-signed certificates
        keepAlive: false, // switch to true if you're making a lot of calls from this client
    };
    
    const sslConfiguredAgent = new https.Agent(options);
    
    try {
        // Replace the `PROXY_ENDPOINT` with your AWS EC2 hostname/IP
        const url = "https://PROXY_ENDPOINT/path/to/resource?param=value"
    
        console.log(`Making call to: [${url}]`);
        // make the request just as you would normally ...
        const response = await fetch(url, {
        agent: sslConfiguredAgent, // ... but add the agent we initialised
        });
    
        const responseBody = await response.text();
    
        // handle the response as you would see fit
        console.log(responseBody);
        return { statusCode: 200, body: { resp: responseBody }};
    } catch (error) {
        // return the error
        console.log(error);
        return { statusCode: 418, body: { error: error }};
    }
    
  9. Deploy your application to I/O Runtime via aio app deploy and test out the setup by invoking your action.

Next steps

Return to the Runtime Reference Documentation Index.

Return to the Guides Index.