f5devcentral / f5-automation-config-converter

Convert BIG-IP configs to AS3 and DO declarations
https://clouddocs.f5.com/products/extensions/f5-automation-config-converter/latest/
Apache License 2.0
35 stars 13 forks source link

[RFE] Add passphrase handling for ssl profiles #53

Closed makagonr closed 3 years ago

makagonr commented 3 years ago

Is your feature request related to a problem? Please describe.

I am not able to convert profiles that contain passphrases

Describe the solution you'd like

I would like to add passphrase handling the same way as you did for passwords inside monitors

Additional context

diff --git a/src/maps/custom/profile.js b/src/maps/custom/profile.js
index 01d5541..d28e332 100644
--- a/src/maps/custom/profile.js
+++ b/src/maps/custom/profile.js
@@ -673,6 +673,7 @@ module.exports = {
                     if (rootObjKeys.includes('clientCertificate')) newObj[certName].certificate = { bigip: rootObj.clientCertificate };
                     if (rootObjKeys.includes('chain') && rootObj.chain !== 'none') newObj[certName].chainCA = { bigip: rootObj.chain };
                     if (rootObjKeys.includes('key')) newObj[certName].privateKey = { bigip: rootObj.key };
+                    if (rootObjKeys.includes('passphrase')) newObj[certName].passphrase = buildProtectedObj(rootObj.passphrase);
                 }

                 const cert = loadCertsAndKeys(rootObj.clientCertificate, loc, file);
@@ -759,6 +760,7 @@ module.exports = {
                             if (certConfKeys.includes('cert')) newObj[certName].certificate = { bigip: certConf.cert };
                             if (certConfKeys.includes('chain')) newObj[certName].chainCA = { bigip: certConf.chain };
                             if (certConfKeys.includes('key')) newObj[certName].privateKey = { bigip: certConf.key };
+                            if (certConfKeys.includes('passphrase')) newObj[certName].passphrase = buildProtectedObj(certConf.passphrase);
                         }
                         certRef = certRef.replace('.crt', '');
                     }
mdditt2000 commented 3 years ago

CHARON-452 filed for internal tracking!

mdditt2000 commented 3 years ago

Resolved