public class ScapManager extends BaseManager
Constructor and Description |
---|
ScapManager() |
Modifier and Type | Method and Description |
---|---|
static DataResult |
allScans(Server server)
Show brief results of all scans for given system
|
static java.lang.Boolean |
deleteScan(java.lang.Long xid)
Delete given XccdfTestResult together with stored files
|
static java.lang.Long |
deleteScansInSet(java.lang.Iterable<XccdfTestResultDto> set)
Delete XccdfTestResults specified by set.
|
static void |
ensureAvailableToUser(User user,
java.lang.Long testResultId)
Check if the user has permission to see the XCCDF scan.
|
static java.util.List<XccdfIdentDto> |
identsPerRuleResult(java.lang.Long ruleResultId)
Show xccdf:ident results for given rule-result
|
static boolean |
isAvailableToUser(User user,
java.lang.Long testResultId)
Checks if the user has permission to see the XCCDF scan.
|
static boolean |
isScapEnabled(Server server,
User user)
Returns the given system is scap enabled.
|
static java.util.List<XccdfTestResultDto> |
latestTestResultByServerId(User user,
java.lang.Long systemId)
Show brief results of all scans accessible by user.
|
static DataResult |
latestTestResultByUser(User user)
Show brief results of all scans accessible by user.
|
static java.lang.Long |
previousComparableTestResult(java.lang.Long testResultId)
Get a TestResult with metadata similar to the given.
|
static XccdfRuleResultDto |
ruleResultById(java.lang.Long ruleResultId)
Get xccdf:rule-result by id
|
static java.util.List<XccdfRuleResultDto> |
ruleResultsPerScan(java.lang.Long testResultId)
Show xccdf:rule-result results for given test
|
static java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
ruleResultTypeLabels()
Return list of possible results of xccdf:rule evaluation
|
static DataResult<XccdfTestResultDto> |
scansInSet(User user,
java.lang.String setLabel)
Show brief results of scans in given set
|
static DataResult |
scapCapableSystemsInSsm(User scheduler)
Show scap capable systems which are currently in SSM
|
static ScapAction |
scheduleXccdfEvalInSsm(User scheduler,
java.lang.String path,
java.lang.String parameters,
java.util.Date earliest)
Schedule scap.xccdf_eval action for systems in user's SSM.
|
static DataResult |
searchByIdentIds(java.util.Map inParams,
java.util.List<java.lang.Long> identIds,
boolean returnTestResults)
Get xccdf:rule-result-s or xccdf:TestResult-s by ident's ids
|
static DataResult |
systemsInSsmAndScapCapability(User scheduler)
Show systems in SSM and their true/false scap capability
|
makeDataResult, makeDataResult, makeDataResult, makeDataResult, makeDataResultNoPagination, makeDataResultNoPagination, processListControl, processPageControl
public static boolean isScapEnabled(Server server, User user)
server
- The system for which to seach scap capabilityuser
- The user requesting to view the systempublic static DataResult latestTestResultByUser(User user)
user
- The user requesting.public static java.util.List<XccdfTestResultDto> latestTestResultByServerId(User user, java.lang.Long systemId)
user
- The user requesting the data.systemId
- The id of systempublic static DataResult allScans(Server server)
server
- The system for which to searchpublic static DataResult<XccdfTestResultDto> scansInSet(User user, java.lang.String setLabel)
user
- The user owning the setsetLabel
- The label of the setpublic static java.util.List<XccdfRuleResultDto> ruleResultsPerScan(java.lang.Long testResultId)
testResultId
- of XccdfTestResult of the test for which to searchpublic static XccdfRuleResultDto ruleResultById(java.lang.Long ruleResultId)
ruleResultId
- of the XccdfRuleResultpublic static java.lang.Long previousComparableTestResult(java.lang.Long testResultId)
testResultId
- referential TestResultpublic static DataResult searchByIdentIds(java.util.Map inParams, java.util.List<java.lang.Long> identIds, boolean returnTestResults)
inParams
- direct parameters for query.
user_id is the only compulsoryidentIds
- list of xccdf:ident idsreturnTestResults
- what to return
(true - list of testresults, false - list of rule-results)public static java.util.List<XccdfIdentDto> identsPerRuleResult(java.lang.Long ruleResultId)
ruleResultId
- of XccdfRuleResultDtopublic static DataResult scapCapableSystemsInSsm(User scheduler)
scheduler
- user requesting the systemspublic static DataResult systemsInSsmAndScapCapability(User scheduler)
scheduler
- user requesting the systemspublic static ScapAction scheduleXccdfEvalInSsm(User scheduler, java.lang.String path, java.lang.String parameters, java.util.Date earliest)
scheduler
- user which commits the schedulepath
- path to xccdf document on systems file systemparameters
- additional parameters for xccdf scanearliest
- time of earliest action occurencepublic static void ensureAvailableToUser(User user, java.lang.Long testResultId)
user
- User being checked.testResultId
- ID of XCCDF scan being checked.LookupException
- if user cannot access the scan.public static java.util.List<java.util.Map<java.lang.String,java.lang.String>> ruleResultTypeLabels()
public static boolean isAvailableToUser(User user, java.lang.Long testResultId)
user
- User being checked.testResultId
- ID of the XCCDF scan being checked.public static java.lang.Long deleteScansInSet(java.lang.Iterable<XccdfTestResultDto> set)
set
- Set of TestResults to deletepublic static java.lang.Boolean deleteScan(java.lang.Long xid)
xid
- ID of TestResult to delete