Class AbstractSNPGuestWrapper
java.lang.Object
com.suse.coco.module.snpguest.execution.AbstractSNPGuestWrapper
- Direct Known Subclasses:
SNPGuestWrapperVer07Below,SNPGuestWrapperVer09Above
Wrapper to execute the command line tool SNPGuest.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor.protectedAbstractSNPGuestWrapper(Runtime runtimeIn) Constructor to specify a runtime. -
Method Summary
Modifier and TypeMethodDescriptiondisplayReport(Path report) Display the attestation report.protected ProcessOutputexecuteProcess(String... command) Executes a commandline processabstract ProcessOutputfetchVCEK(EpycGeneration generation, Path certsDir, Path report) Fetch the VCEK from the KDS.private StringgetOutput(InputStream stream, org.apache.logging.log4j.Marker logMarker) abstract ProcessOutputverifyAttestation(EpycGeneration generation, Path certsDir, Path report) Verify the attestation report.verifyCertificates(Path certsDir) Verify the certificate chain.
-
Field Details
-
STDOUT_MARKER
protected static final org.apache.logging.log4j.Marker STDOUT_MARKER -
STDERR_MARKER
protected static final org.apache.logging.log4j.Marker STDERR_MARKER -
logger
protected final org.apache.logging.log4j.Logger logger -
SNPGUEST
-
runtime
-
-
Constructor Details
-
AbstractSNPGuestWrapper
protected AbstractSNPGuestWrapper()Default constructor. -
AbstractSNPGuestWrapper
Constructor to specify a runtime. For unit testing.- Parameters:
runtimeIn- the runtime used to execute processes
-
-
Method Details
-
fetchVCEK
public abstract ProcessOutput fetchVCEK(EpycGeneration generation, Path certsDir, Path report) throws ExecutionException Fetch the VCEK from the KDS.- Parameters:
generation- Specify the processor model for the certificate chain.certsDir- Directory to store the certificates inreport- Path to attestation report to use to request VCEK- Returns:
- the exit code of the fetching process
- Throws:
ExecutionException- when an error happens during the process execution
-
verifyCertificates
Verify the certificate chain.- Parameters:
certsDir- Path to directory containing certificate chain- Returns:
- the exit code of the verification process
- Throws:
ExecutionException- when an error happens during the process execution
-
verifyAttestation
public abstract ProcessOutput verifyAttestation(EpycGeneration generation, Path certsDir, Path report) throws ExecutionException Verify the attestation report.- Parameters:
generation- Specify the processor model for the certificate chain.certsDir- Path to directory containing VCEK.report- Path to attestation report to use for validation.- Returns:
- the exit code of the verification process
- Throws:
ExecutionException- when an error happens during the process execution
-
displayReport
Display the attestation report.- Parameters:
report- Path to attestation report to use for validation.- Returns:
- the exit code of the verification process
- Throws:
ExecutionException- when an error happens during the process execution
-
executeProcess
Executes a commandline process- Parameters:
command- the command line to execute- Returns:
- the exit code returned by the process
- Throws:
ExecutionException- when an error happens during the process execution
-
getOutput
private String getOutput(InputStream stream, org.apache.logging.log4j.Marker logMarker) throws IOException - Throws:
IOException
-