Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I wonder if there's some way to access the task-specific context parameters defined in Job Conductor, for auditing reasons.
Apparently, the values are stored encrypted in the TAC DB, and I couldn't figure out how to decrypt them. Also, direct access to the TAC DB might not be available. However, those parameters are accessible in a non-encrypted manner from the GUI, so I should be able to somehow access them programmatically. Unfortunately, the metaServlet JSON API doesn't provide an action to get those parameters, I can only set them using createTask or updateTask.
So, any suggestions?
Hello,
Thanks for posting your issue here.
We have redirected your issue to our TAC experts and will keep you posted.
Best regards
Sabrina
Hi,
now we have no metaservlet operation to do this call. I think we can extend listTasks operation for this. Please create TMC new feature in Talend jira.
Thanks,
Yuri
If you have access to the database behind tac then you can use the following Java code to decrypt the values.
The column that holds the actual values:
talend_tac.executiontaskjobprm.defaultvalue
The Java Code:
String paramString = context.prompt;
System.out.println(paramString);
// This was working with 5.4 and 5.6 I had to decrypt the org.talend.utils package, and under that there was this security.AES.class which contains this code
byte[] KeyValues = { -87, -101, -56, 50, 86, 53, -29, 3 };
Cipher ecipher;
Cipher dcipher;
String str = System.getProperty("os.name");
boolean bool = false;
if (str != null) {
bool = str.contains("SunOS");
}
Provider localProvider = null;
if (bool) {
localProvider = Security.getProvider("SunJCE");
}
KeyGenerator localKeyGenerator = null;
SecureRandom localSecureRandom = null;
if (bool) {
localKeyGenerator = KeyGenerator.getInstance("AES", localProvider);
} else {
localKeyGenerator = KeyGenerator.getInstance("AES");
}
localSecureRandom = SecureRandom.getInstance("SHA1PRNG");
localSecureRandom.setSeed(KeyValues);
localKeyGenerator.init(128, localSecureRandom);
SecretKey localSecretKey = localKeyGenerator.generateKey();
if (bool) {
ecipher = Cipher.getInstance("AES", localProvider);
dcipher = Cipher.getInstance("AES", localProvider);
} else {
ecipher = Cipher.getInstance("AES");
dcipher = Cipher.getInstance("AES");
}
ecipher.init(1, localSecretKey);
dcipher.init(2, localSecretKey);
//This is where we have the magic happening:
byte[] arrayOfByte = Base64.decodeBase64(paramString.getBytes("UTF8"));
arrayOfByte = dcipher.doFinal(arrayOfByte);
String retStr = new String(arrayOfByte, "UTF8");
System.out.println(retStr);
I also needed a library to make this work (commons-codec-1.7)
Hi Team,
Are there ways to decrypt those context values from TAC DB.
Both "originalvalue" and "defaultvalue" from table executiontaskjobprm and "contextvalues" from table executiontaskhistory all are encryption columns.
Regards,
Prasanna
Thanks for your quick reply
I am looking forward to extract these information from TAC DB ( MySql) directly.