mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-01-29 15:44:14 +00:00
Two of the policy files were missing [no ci]
This commit is contained in:
parent
6c3a1b26bc
commit
d008f2d2f9
@ -0,0 +1,12 @@
|
|||||||
|
package hirs.attestationca.persist.entity.manager;
|
||||||
|
|
||||||
|
import hirs.attestationca.persist.entity.userdefined.PolicySettings;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface PolicyRepository extends JpaRepository<PolicySettings, UUID> {
|
||||||
|
// PolicySettings findByName(String name);
|
||||||
|
}
|
@ -0,0 +1,123 @@
|
|||||||
|
package hirs.attestationca.persist.entity.userdefined;
|
||||||
|
|
||||||
|
import hirs.attestationca.persist.entity.UserDefinedEntity;
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class represents Supply Chain policy. Supply Chain Policy identifies the methods in
|
||||||
|
* SupplyChainValidator that should be used in order to validate a supply chain.
|
||||||
|
* By default, the policy does not enable any validations.
|
||||||
|
*/
|
||||||
|
@Table(name = "PolicySettings")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class PolicySettings extends UserDefinedEntity {
|
||||||
|
/**
|
||||||
|
* Name of the default Supply Chain Policy.
|
||||||
|
*/
|
||||||
|
public static final String DEFAULT_POLICY = "Default Supply Chain Policy";
|
||||||
|
/**
|
||||||
|
* Number of days in 10 years.
|
||||||
|
*/
|
||||||
|
public static final String TEN_YEARS = "3651";
|
||||||
|
/**
|
||||||
|
* Number of days in 1 year.
|
||||||
|
*/
|
||||||
|
public static final String YEAR = "365";
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default false")
|
||||||
|
private boolean ecValidationEnabled = false;
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default false")
|
||||||
|
private boolean pcValidationEnabled = false;
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default false")
|
||||||
|
private boolean pcAttributeValidationEnabled = false;
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default false")
|
||||||
|
private boolean firmwareValidationEnabled = false;
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default false")
|
||||||
|
private boolean utcValidationEnabled = false;
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default false")
|
||||||
|
private boolean expiredCertificateValidationEnabled = false;
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default false")
|
||||||
|
private boolean replaceEC = false;
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default true")
|
||||||
|
private boolean issueAttestationCertificate = true;
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default true")
|
||||||
|
private boolean issueDevIdCertificate = true;
|
||||||
|
|
||||||
|
@Column(nullable = false)
|
||||||
|
private String validityDays = TEN_YEARS;
|
||||||
|
|
||||||
|
@Column(nullable = false)
|
||||||
|
private String devIdValidityDays = TEN_YEARS;
|
||||||
|
|
||||||
|
@Column(nullable = false)
|
||||||
|
private String reissueThreshold = YEAR;
|
||||||
|
|
||||||
|
@Column(nullable = false)
|
||||||
|
private String devIdReissueThreshold = YEAR;
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default false")
|
||||||
|
private boolean generateOnExpiration = false;
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default false")
|
||||||
|
private boolean devIdExpirationFlag = false;
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default false")
|
||||||
|
private boolean ignoreImaEnabled = false;
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default false")
|
||||||
|
private boolean ignoretBootEnabled = false;
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default false")
|
||||||
|
private boolean linuxOs = false;
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default true")
|
||||||
|
private boolean ignoreGptEnabled = true;
|
||||||
|
|
||||||
|
@Column(nullable = false, columnDefinition = "boolean default false")
|
||||||
|
private boolean ignoreOsEvtEnabled = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default constructor necessary for Hibernate.
|
||||||
|
*/
|
||||||
|
protected PolicySettings() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor used to initialize PolicySettings object.
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
* A name used to uniquely identify and reference the Supply Chain policy.
|
||||||
|
*/
|
||||||
|
public PolicySettings(final String name) {
|
||||||
|
super(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor used to initialize PolicySettings object.
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
* A name used to uniquely identify and reference the supply chain policy.
|
||||||
|
* @param description
|
||||||
|
* Optional description of the policy that can be added by the user
|
||||||
|
*/
|
||||||
|
public PolicySettings(final String name, final String description) {
|
||||||
|
super(name, description);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user