A Web Tab allows a user to view a web service that is hosted externally from Vault. This page describes an example use case of an integration between Vault and an external system.
The Vault Kanban Board project provides sample code and Vault Configuration. Additionally, this project gives step-by-step instructions on how to set up the following Amazon Web Services (AWS) components and Vault configuration:
-
Amazon Web Services
- Amazon Cloudfront
- Amazon S3 Bucket
- Amazon API Gateway
- Amazon Lambda
-
Vault
- Web Tab
A system administrator needs an easy way to track proposed access for new users in Vault. This includes prioritization, different types of security profiles, and user types. The configured web tabs allows the use of a Kanban board to enable drag and drop functionality to update Access Request records, instead of editing and saving the actual record in Vault.
- An AWS account. If you don't have one sign up for an account at AWS Free Tier.
- Download the executable jar file.
- Import Vault Package to create necessary components.
- Install Nodejs and Yarn package manager. Depending on the installation, the following command may need to be executed in the /frontend folder:
yarn add env-cmd
The project contains a Vault Packages (VPK) in the "deploy-vpk" directory with the necessary configuration and Vault Java SDK code.
Note: An executable jar file is present in the project, so this step is only needed if additional changes were made within the code and compilation and packaging is necessary.
- Open the terminal and navigate to /vault-kanban-board/backend/ folder.
- Execute the following for either sandbox or production: mvn clean compile package.
- Once the packaging has completed, take note of the vault-kanban-board-0.1.jar file that was generated and that is located in the /vault-kanban-board/backend/target/ folder.
- In the Amazon S3 console, click Create bucket.
- Configure the S3 bucket:
- For Bucket name, enter vsdk-kanban-board-aws-s3-bucket.
- For Region, choose your Region.
- For Default encryption, enable Server-side encryption and select Amazon S3 key (SSE-S3) for Encryption key type.
- Leave the other configuration settings to their default values and click Create Bucket.
- Record the bucket name for future reference.
- In the Amazon CloudFront console, click Create distribution.
- Configure the CloudFront distribution:
- For Origin domain, enter the name of the previously created S3 bucket name.
- For Name, enter vsdk-kanban-board-aws-distribution.
- For S3 bucket access, select Yes use OAI (bucket can restrict access to only CloudFront) and configure the OAI:
- For Origin access identity, click Create new OAI. For the name, enter vsdk-kanban-board-aws-oai.
- For Bucket policy, select Yes, update the bucket policy.
- In the Default cache behavior section and Viewer subsection, for Viewer protocol policy, click Redirect HTTP to HTTPS.
- Leave the other configuration settings to their default values and click Create distribution.
- Once the distribution has been created and is active, click the Invalidations tab.
- Click Create invalidation.
- In the Add object paths, add "/*".
- Click Create invalidation.
- Record the Distribution domain name in the General tab for future use.
- In the Amazon Lambda console, click Create Function.
- Configure the Lambda function:
- Ensure Author from scratch is selected.
- For Function name, enter vsdk-kanban-board-aws-lambda.
- For Runtime, select Java 8 on Amazon Linux 2.
- Leave the other configuration settings to their default values and click Create function.
- Once the function has been successfully created, click on +Add trigger in the Function Overview section.
- Configure the trigger:
- For Trigger configuration, select a source of API Gateway.
- For Intent, select Create a new API.
- For API type, select HTTP API.
- For Security, select Open.
- Under additional settings, enable Cross-origin resource sharing(CORS).
- Under additional settings, enter $default for the Deployment stage name.
- Leave the other configuration settings to their default values and click Add.
- In the Code tab, next to the Code source section label, for Upload from select .zip or .jar file.
- Click Upload and select the vault-kanban-board-0.2.jar file provided or one that was previously packaged.
- Click Save.
- In the Runtime settings section, click Edit
- For the Handler field, replace the existing value with com.veeva.vault.handler.LambdaHandler::handleRequest
- In the Configuration tab, navigate to the Environment variables section and click Edit.
- Configure the environment variable:
- Click Add environment variable with the Key as LOG_LEVEL and Value as INFO
- Leave all other environment variable settings to their default values and click Save.
- Within the same Configuration tab, navigate to the Triggers section.
- Click the API Gateway record.
- Within the API Gateway record page, navigate to the Develop section and click the CORS sub-section.
- In the Configure CORS section, click Configure.
- Configure the following sections:
- In the Access-Control-Allow-Origin field, add * and http://localhost:3000 values.
- In the Access-Control-Allow-Headers field, add accept, access-control-allow-origin, authorization, and content-type values.
- In the Access-Control-Allow-Methods field, add * value.
- Within the API Gateway record page, navigate to the Develop section and click the Integrations sub-section.
- Select the Manage integrations tab, and click your AWS Lambda integration.
- Click Edit, and under Advanced Settings set the Payload format version to 2.0.
- Click Save, then close out of the API Gateway and Lambda Function.
- In the env files, replace {INSERT_API_GATEWAY_DNS} with the API endpoint of the previously created AWS API Gateway. This can be found on the Triggers section of your Lambda function, labeled "API endpoint" for the specific API Gateway you created.
- Open terminal and navigate to /vault-kanban-board/frontend/
- To build the environment execute the following command:
- For sandbox deployments use:
yarn build:sbx
- For production deployments use:
yarn build
- For sandbox deployments use:
- Once the build execution has completed, there will be a new folder created name vault-kanban-board/frontend/build.
- Navigate to the previously created AWS S3 Bucket.
- Click the Upload button in the Objects tab.
- Click Add files, and select all the single files in the /build folder.
- Click Add folder and select the static folder within the /build folder.
- Click Upload.
- Log in to your Vault environment and click on the gear icon to go to the Admin side of your Vault.
- Navigate to Configuration > Tabs and expand the Access Request Admin tab section.
- For Dashboard: Prioritization, Dashboard: Security Profiles, and Dashboard: User Type, click Edit and replace the {CloudFront URL} with the CloudFront Distribution domain name that was previously recorded.
Additional reference documents can be found on our Developer Portal and in our Javadocs.