mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-02-20 01:36:15 +00:00
Updated event log measurements to pass in the overall result status. However display isn't printing out correctly.
This commit is contained in:
parent
218002a3c2
commit
9c060dec55
@ -369,7 +369,7 @@ public class SupplyChainValidationServiceImpl implements SupplyChainValidationSe
|
||||
.getHardwareInfo().getManufacturer();
|
||||
String model = device.getDeviceInfo()
|
||||
.getHardwareInfo().getProductName();
|
||||
ReferenceManifest validationObject = null;
|
||||
ReferenceManifest validationObject;
|
||||
Set<BaseReferenceManifest> baseReferenceManifests = null;
|
||||
BaseReferenceManifest baseReferenceManifest = null;
|
||||
ReferenceManifest supportReferenceManifest = null;
|
||||
@ -388,7 +388,7 @@ public class SupplyChainValidationServiceImpl implements SupplyChainValidationSe
|
||||
}
|
||||
}
|
||||
|
||||
validationObject = baseReferenceManifest;
|
||||
validationObject = measurement;
|
||||
String failedString = "";
|
||||
if (baseReferenceManifest == null) {
|
||||
failedString = "Base Reference Integrity Manifest\n";
|
||||
@ -548,6 +548,9 @@ public class SupplyChainValidationServiceImpl implements SupplyChainValidationSe
|
||||
+ "%s for %s can not be found", failedString, manufacturer));
|
||||
}
|
||||
|
||||
EventLogMeasurements eventLog = (EventLogMeasurements) measurement;
|
||||
eventLog.setOverallValidationResult(fwStatus.getAppStatus());
|
||||
this.referenceManifestManager.update(eventLog);
|
||||
return buildValidationRecord(SupplyChainValidation.ValidationType.FIRMWARE,
|
||||
fwStatus.getAppStatus(), fwStatus.getMessage(), validationObject, level);
|
||||
}
|
||||
@ -620,9 +623,11 @@ public class SupplyChainValidationServiceImpl implements SupplyChainValidationSe
|
||||
LOGGER.error(ex);
|
||||
}
|
||||
|
||||
eventLog.setOverallValidationResult(fwStatus.getAppStatus());
|
||||
this.referenceManifestManager.update(eventLog);
|
||||
quoteScv = buildValidationRecord(SupplyChainValidation
|
||||
.ValidationType.FIRMWARE,
|
||||
fwStatus.getAppStatus(), fwStatus.getMessage(), sRim, level);
|
||||
fwStatus.getAppStatus(), fwStatus.getMessage(), eventLog, level);
|
||||
|
||||
// Generate validation summary, save it, and return it.
|
||||
List<SupplyChainValidation> validations = new ArrayList<>();
|
||||
|
@ -506,6 +506,7 @@ public class ReferenceManifestDetailsPageController
|
||||
data.put("baseId", "");
|
||||
data.put("rimType", measurements.getRimType());
|
||||
data.put("hostName", measurements.getDeviceName());
|
||||
data.put("validationResult", measurements.getOverallValidationResult());
|
||||
|
||||
if (measurements.getDeviceName() != null) {
|
||||
digestRecords = referenceDigestManager
|
||||
|
@ -52,7 +52,7 @@
|
||||
{
|
||||
data: 'id',
|
||||
orderable: false,
|
||||
searchable:false,
|
||||
searchable: false,
|
||||
render: function(data, type, full, meta) {
|
||||
// Set up a delete icon with link to handleDeleteRequest().
|
||||
// sets up a hidden input field containing the ID which is
|
||||
|
@ -25,7 +25,7 @@
|
||||
<c:set var="supportRimHashInvalidText" value="Support RIM hash not valid!"/>
|
||||
<div id="certificate-details-page" class="container-fluid">
|
||||
<c:choose>
|
||||
<c:when test="${initialData.rimType=='Support'}">
|
||||
<c:when test="${initialData.rimType=='Support' || (initialData.rimType=='Measurement' && initialData.validationResult=='PASS')}">
|
||||
<div class="row">
|
||||
<div class="col-md-1 col-md-offset-1"><span class="colHeader">Base RIM</span></div>
|
||||
<div id="baseRim" class="col col-md-8">
|
||||
@ -236,7 +236,7 @@
|
||||
</div>
|
||||
<div class="col-md-a col-md-offset-1"><span class="colHeader">${initialData.events.size()} entries</span></div>
|
||||
</c:when>
|
||||
<c:when test="${initialData.rimType=='Measurement'}">
|
||||
<c:when test="${initialData.rimType=='Measurement' && initialData.validationResult=='FAIL'}">
|
||||
<div style="display: inline">
|
||||
<div class="row">
|
||||
<div class="col-md-1 col-md-offset-1"><span class="colHeader">Base/Support</span></div>
|
||||
|
@ -10,6 +10,8 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import java.io.IOException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.cert.CertificateException;
|
||||
@ -29,6 +31,8 @@ public class EventLogMeasurements extends ReferenceManifest {
|
||||
@Column
|
||||
@JsonIgnore
|
||||
private int pcrHash = 0;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private AppraisalStatus.Status overallValidationResult = AppraisalStatus.Status.FAIL;
|
||||
|
||||
/**
|
||||
* This class enables the retrieval of SupportReferenceManifest by their attributes.
|
||||
@ -171,4 +175,20 @@ public class EventLogMeasurements extends ReferenceManifest {
|
||||
public void setPcrHash(final int pcrHash) {
|
||||
this.pcrHash = pcrHash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for the overall validation result for display purposes.
|
||||
* @return the result status
|
||||
*/
|
||||
public AppraisalStatus.Status getOverallValidationResult() {
|
||||
return overallValidationResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for the overall validation result for display purposes.
|
||||
* @param overallValidationResult the current status for this validation.
|
||||
*/
|
||||
public void setOverallValidationResult(final AppraisalStatus.Status overallValidationResult) {
|
||||
this.overallValidationResult = overallValidationResult;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user