-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: servicenow-devops-plugin
Problem
== Inline Script Block
Line: 20
----
<script type="text/javascript">
// Function to update the textarea content based on dropdown selection
function updateContent(selectedOption) {
var contentArea = document.getElementById("securityAttributeJson");
if(!contentArea || !(contentArea instanceof Element))
return;
// Update content based on selected option
if (selectedOption === "Veracode") {
contentArea.value = '{"scanner": "Veracode", "applicationName": "", "buildVersion": "", "securityToolId": ""}';
} else if (selectedOption === "Checkmarx One") {
contentArea.value = '{"scanner": "Checkmarx One", "projectName": "", "projectId": "", "scanId": "", "securityToolId": ""}';
} else if (selectedOption === "Checkmarx SAST") {
contentArea.value = '{"scanner": "Checkmarx SAST", "projectId": "", "securityToolId": ""}';
} else if (selectedOption === "Others") {
contentArea.value = '{"scanner": "", "securityToolId": ""}';
}
}
updateContent("Veracode");
</script>
----
Solution
https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks