Highlighted
Contributor.
Contributor.
362 views

PAM report template issue

i am trying to add this script to the report template to send email . I took it from the documentation but it is not working.

any help to solve this issue? please i need steps also 

this is the script :

<%!
my @lvl0;
my @lvl1;
my @lvl2;
my @lvl3;
my @gt0;
my @gt5;
my @gt10;
my @gt20;
%>
<%
my @audit_records = @{$tokens->{'AuditRecords'}->{'AuditRecord'}} if (defined($tokens->{'AuditRecords'}) && defined($tokens->{'AuditRecords'}-
>{'AuditRecord'}));
foreach my $ar (@audit_records) { my $age = $ar->{'age'};
my $lvl = $ar->{'level'};

if ($age > 5 && $age < 10) { push(@gt5,$ar);
} elsif ($age >= 10 && $age < 20) {

push(@gt10,$ar);
} elsif ($age >= 20) { push(@gt20,$ar);
} else { push(@gt0,$ar);
}
if ($lvl == 1) { push(@lvl1,$ar);
} elsif ($lvl == 2) { push(@lvl2,$ar);
} elsif ($lvl >= 3) { push(@lvl3,$ar);
} else { push(@lvl0,$ar);
}
}
%>
<%
my $total = @audit_records; if ($total > 0) {
%>
<style type="text/css">
<!--
.style1 { color: #000000;
font-family: Arial, Helvetica, sans-serif; font-size: 12px;
}
.style2 { color: #000000;
font-family: Arial, Helvetica, sans-serif; font-size: 12px;
font-weight:bold;
}
.style4 { color: #000000
}
-->
</style>
<p class="style1"> Hello $User.ACT_FULL_NAME.value$,<br/>
<br/>
This is an automated event notification email from the Compliance Auditor. <br/>
<br/>

It is the responsibility of management to log into the Compliance Auditor each day and review their team's keystroke logs. <br/> <br/>

Please log on to the Compliance Auditor at your earliest convenience using this link: <a href="https://admin.company.com">https://admin.company.com</a>
</p>

<%
my $gt0 = @gt0;
%>
<span class="style2">Events &lt; 5 days old (<%= "$gt0" %>)</span>
<table border="1">
<tr class="style1">
<td>Time</td>
<td>User</td>
<td>Run As</td>
<td>Host</td>

<td>Command</td>
</tr>
<%
foreach my $ar (@gt0) {
my $cmd = $ar->{'cmdctrl'}->{'cmd'};
my $usr = $ar->{'cmdctrl'}->{'user'};
my $ras = $ar->{'cmdctrl'}->{'runAs'};
my $hst = $ar->{'cmdctrl'}->{'host'};
my $tme = $ar->{'cmdctrl'}->{'time'};
$tme = localtime($tme);
%>
<tr class="style1">
<td><%= "$tme" %></td>
<td><%= "$usr" %></td>
<td><%= "$ras" %></td>
<td><%= "$hst" %></td>
<td><%= "$cmd" %></td>
</tr>
<%
}
%>
</table>
<br/>

<%
my $gt5 = @gt5;
%>
<span class="style2">Events &gt; 5 days old (<%= "$gt5" %>)</span>
<table border="1">
<tr class="style1">
<td>Time</td>
<td>User</td>
<td>Run As</td>
<td>Host</td>
<td>Command</td>
</tr>
<%
foreach my $ar (@gt5) {
my $cmd = $ar->{'cmdctrl'}->{'cmd'};
my $usr = $ar->{'cmdctrl'}->{'user'};
my $ras = $ar->{'cmdctrl'}->{'runAs'};
my $hst = $ar->{'cmdctrl'}->{'host'};
my $tme = $ar->{'cmdctrl'}->{'time'};
$tme = localtime($tme);
%>
<tr class="style1">
<td><%= "$tme" %></td>
<td><%= "$usr" %></td>
<td><%= "$ras" %></td>
<td><%= "$hst" %></td>
<td><%= "$cmd" %></td>
</tr>
<%
}
%>
</table>
<br/>

<%
my $gt10 = @gt10;

%>
<span class="style2">Events &gt; 10 days old (<%= "$gt10" %>)</span>
<table border="1">
<tr class="style1">
<td>Time</td>
<td>User</td>
<td>Run As</td>
<td>Host</td>
<td>Command</td>
</tr>
<%
foreach my $ar (@gt10) {
my $cmd = $ar->{'cmdctrl'}->{'cmd'};
my $usr = $ar->{'cmdctrl'}->{'user'};
my $ras = $ar->{'cmdctrl'}->{'runAs'};
my $hst = $ar->{'cmdctrl'}->{'host'};
my $tme = $ar->{'cmdctrl'}->{'time'};
$tme = localtime($tme);
%>
<tr class="style1">
<td><%= "$tme" %></td>
<td><%= "$usr" %></td>
<td><%= "$ras" %></td>
<td><%= "$hst" %></td>
<td><%= "$cmd" %></td>
</tr>
<%
}
%>
</table>
<br/>

<%
my $gt20 = @gt20;
%>
<span class="style2">Events &gt; 20 days old (<%= "$gt20" %>)</span>
<table border="1">
<tr class="style1">
<td>Time</td>
<td>User</td>
<td>Run As</td>
<td>Host</td>
<td>Command</td>
</tr>
<%
foreach my $ar (@gt20) {
my $cmd = $ar->{'cmdctrl'}->{'cmd'};
my $usr = $ar->{'cmdctrl'}->{'user'};
my $ras = $ar->{'cmdctrl'}->{'runAs'};
my $hst = $ar->{'cmdctrl'}->{'host'};
my $tme = $ar->{'cmdctrl'}->{'time'};
$tme = localtime($tme);
%>
<tr class="style1">
<td><%= "$tme" %></td>
<td><%= "$usr" %></td>
<td><%= "$ras" %></td>

<td><%= "$hst" %></td>
<td><%= "$cmd" %></td>
</tr>
<%
}
%>
</table>
<br/>

<p class="style2">Total Events = <%= $total %></p>

<%
}
%>

0 Likes
5 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: PAM report template issue

Are you adding this report template to the Command Control Console or the Compliance Auditor Console?

Would you also provide the link to documentation where you grabbed this report template?

Also what version of PAM are you using here?
0 Likes
Highlighted
Contributor.
Contributor.

Re: PAM report template issue

hi
i am adding it to the compliance auditor but it display nothing please can you post me any updated one
i am using pam 3.7 version
thank you
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: PAM report template issue

I had the same issue using the script you posted here, but the preview rendered fine when using the script provided by our PAM 3.7 documentation. So try copying from this source as a test:
https://www.netiq.com/documentation/privileged-account-manager-37/npam_admin/data/compliance_auditor_reports.html#bjglbli
0 Likes
Highlighted
Contributor.
Contributor.

Re: PAM report template issue

Thank you for your help. i want to ask you one more question, the level of the risk in the compliance auditor doesnt change. can you help me to fix it as i put the risk level to 9 in the command risk and still not working.

thank you 

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: PAM report template issue

Updating the Command Risk level should apply to any new sessions/commands, but it won't retroactively update existing conditions.. So it won't go back and update Compliance Auditor Records as those are an audit of conditions as they were configured at the time. So if you set Command Risk to a higher level for a particular command, then initiate a new session and execute that "risky" command and it should be evaluated for that and eventually pulled into the Compliance Auditor based on the Audit Rule schedule.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.