{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Edge/API Management /
avatar image
0
Question by daniel.biales · Jun 15, 2017 at 08:13 PM · 667 Views mavencontinuous-integrationencrypted kvmconfig files

Encrypted KVM with Maven-Config-Plugin

I am trying to create an encrypted KVM with the apigee-config-maven-plugin. I have setup the edge.json file but I don't want to store my kvm value in clear text. I am using bamboo and have a secret management plugin that gives me bamboo variables with my secret value, is there a way that the edge.json file can replace the values with bamboo variables or do I need to write a script for it?

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

1 Answer

  • Sort: 
avatar image
3
Best Answer

Answer by Sai Saran Vaidyanathan   · Jun 15, 2017 at 08:44 PM

HI @daniel.biales

I am afraid this is not possible within the config-plugin. What you can do is pass that variable as an argument to the maven command and then use the maven-replacer-plugin to replace the value in your edge.json to the variable passed in the maven command

<plugin>
  <groupId>com.google.code.maven-replacer-plugin</groupId>
  <artifactId>replacer</artifactId>
  <version>1.5.2</version>
  <executions>
    <execution>
      <phase>process-resources</phase>
      <goals>
        <goal>replace</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <basedir>${project.root.dir}</basedir> <!--Source directory-->
    <includes>
      <include>edge.json</include> <!--path to the edge.json -->
    </includes>
    <replacements>
      <replacement>
        <token>dummy</token> <!--Put a dummy token in your edge.json -->
        <value>${secretValue}</value> <!--Value passed as argument -->
      </replacement>
    </replacements>
  </configuration>
</plugin>

Your maven command will look like this

mvn apigee-config:kvms -Ptest -Dapigee.config.options=create -DsecretValue=secret

This is just an example. Let me know if this works.

Comment
Add comment Show 4 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image daniel.biales · Jun 19, 2017 at 05:51 PM 0
Link

would I add the dummy token to the edge.json like so?

{
  "name": "encrypted-proxy-kvm",
  "encrypted":true,
  "entry": [
    {
      "name": "MESSAGE",
      "value": "dummy"
    }
  ]
}
avatar image Sai Saran Vaidyanathan ♦ daniel.biales   · Jun 19, 2017 at 07:55 PM 0
Link

Yes - the replacer plugin will find this file and the corresponding token, replace with the value mentioned in the pom.

avatar image daniel.biales · Jun 19, 2017 at 08:38 PM 0
Link

Awesome this worked great. I actually ended up adding a task that ran

com.google.code.maven-replacer-plugin:replacer:replace

before running

mvn apigee-config:kvms -Ptest-Dapigee.config.options=update

This was more flexible because then I only need to edit my pom.xml file if I need to add more encrypted values, I won't need to also edit my deploy plan.

Thank you very much for the help!

avatar image Sai Saran Vaidyanathan ♦ daniel.biales   · Jun 19, 2017 at 10:27 PM 0
Link

Glad it worked !!!

Yes, thats the beauty.. Also if you are invoking the script using the lifecycle, you can invoke the pom using the standard maven lifecycle - so this replacer gets executed first and then the configurations.

Follow this Question

Answers Answers and Comments

47 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

SoapUI-Test cases running before deployment using maven plugin 1 Answer

Getting error while trying multiple proxy deployment using maven plugin 2 Answers

401 Unauthorized error when deploying via Maven Plugin 1 Answer

Maven deployment plugin NullPointerException 1 Answer

maven build error 9 Answers

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges