Questo contenuto non è disponibile nella lingua selezionata.
14.6. Securely Accessing Maven Repositories
Overview Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
In a Fabric environment, you can implement basic authentication for secure access to Maven repositories. To do this, you add some configuration settings to the
default
container profile.
Obtain encrypted Maven passwords Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
The
default
profile has the maven-settings.xml
template file and the maven-settings-secure.xml
template file. You need to update these files to specify encrypted Maven passwords. Before you can do that, you must obtain an encryption of the master Maven password and and an encryption of the ordinary Maven password as follows:
- Invoke the
fabric:maven-password
command to view Maven security settings:JBossFuse:karaf@root> fabric:maven-password Maven security configuration in Fabric environment defined in io.fabric8.maven and io.fabric8.agent PID. Security settings file: /data/servers/jboss-fuse-6.3.0.redhat-311/etc/maven-settings-security.xml Encrypted Maven master password: {PMFs1x/vuOMHhjzIZpzst/d5Kpna+WqNu3P15ZcIP8g=}
JBossFuse:karaf@root> fabric:maven-password Maven security configuration in Fabric environment defined in io.fabric8.maven and io.fabric8.agent PID. Security settings file: /data/servers/jboss-fuse-6.3.0.redhat-311/etc/maven-settings-security.xml Encrypted Maven master password: {PMFs1x/vuOMHhjzIZpzst/d5Kpna+WqNu3P15ZcIP8g=}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Decrypt the master Maven password that is in the security settings:
JBossFuse:karaf@root> fabric:maven-password -d Maven security configuration in Fabric environment defined in io.fabric8.maven and io.fabric8.agent PID. Security settings file: /data/servers/jboss-fuse-6.3.0.redhat-311/etc/maven-settings-security.xml Decrypted Maven master password: fabric:changeit
JBossFuse:karaf@root> fabric:maven-password -d Maven security configuration in Fabric environment defined in io.fabric8.maven and io.fabric8.agent PID. Security settings file: /data/servers/jboss-fuse-6.3.0.redhat-311/etc/maven-settings-security.xml Decrypted Maven master password: fabric:changeit
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Obtain an encryption for the master Maven password by entering it twice at the prompts:
JBossFuse:karaf@root> fabric:maven-password --encrypt-master-password Master Maven password: Verify master Maven password: Encrypted master Maven password to use in security-settings.xml: {94gq/tbm0IYHZl4M6BstgfnY/iErAy+GKlfXiptLL/Q=}
JBossFuse:karaf@root> fabric:maven-password --encrypt-master-password Master Maven password: Verify master Maven password: Encrypted master Maven password to use in security-settings.xml: {94gq/tbm0IYHZl4M6BstgfnY/iErAy+GKlfXiptLL/Q=}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Obtain an encryption for the regular Maven password:
JBossFuse:karaf@root> fabric:maven-password --encrypt-password Looking up master Maven password in /data/servers/jboss-fuse-6.3.0.redhat-311/etc/maven-settings-security.xml... Done! Maven password: Verify Maven password: Encrypted Maven password to use in settings.xml for server and proxy authentication: {WCUxIVlatO4HZG2xrqtVBziJIeDTTuVK1oCNEA2eKEQ=}
JBossFuse:karaf@root> fabric:maven-password --encrypt-password Looking up master Maven password in /data/servers/jboss-fuse-6.3.0.redhat-311/etc/maven-settings-security.xml... Done! Maven password: Verify Maven password: Encrypted Maven password to use in settings.xml for server and proxy authentication: {WCUxIVlatO4HZG2xrqtVBziJIeDTTuVK1oCNEA2eKEQ=}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
To securely access Maven repositories in a Fabric environment:
- Obtain an encrypted master Maven password and an encrypted regular Maven password, as described in the previous section.
- In the
default
profile, configureio.fabric8.agent.properties/org.ops4j.pax.url.mvn.repositories
as follows:org.ops4j.pax.url.mvn.repositories= http://localhost:8081/repository/maven-releases@id=nexus
org.ops4j.pax.url.mvn.repositories= http://localhost:8081/repository/maven-releases@id=nexus
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - In the
default
profile, edit themaven-settings.xml
file to specify the encrypted regular Maven password. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - In the
default
profile, edit themaven-settings-security.xml
file to specify the encrypted master Maven password. For example:<settingsSecurity> <master>{94gq/tbm0IYHZl4M6BstgfnY/iErAy+GKlfXiptLL/Q=}</master> </settingsSecurity>
<settingsSecurity> <master>{94gq/tbm0IYHZl4M6BstgfnY/iErAy+GKlfXiptLL/Q=}</master> </settingsSecurity>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Refresh the
default
profile so thatfabric-agent
uses the updated configuration:profile-refresh default
profile-refresh default
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart the
fabric-maven
bundle so that the updates are available to the Maven URI handler and to thefabric-maven-proxy
bundle:bundle:stop io.fabric8.fabric-maven bundle:start io.fabric8.fabric-maven
bundle:stop io.fabric8.fabric-maven bundle:start io.fabric8.fabric-maven
Copy to Clipboard Copied! Toggle word wrap Toggle overflow