本文整理汇总了Java中de.hshannover.f4.trust.ifmapj.metadata.Significance类的典型用法代码示例。如果您正苦于以下问题:Java Significance类的具体用法?Java Significance怎么用?Java Significance使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Significance类属于de.hshannover.f4.trust.ifmapj.metadata包,在下文中一共展示了Significance类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mapSignificance
import de.hshannover.f4.trust.ifmapj.metadata.Significance; //导入依赖的package包/类
private Significance mapSignificance(RiskfactorLevel riskFactor) {
switch (riskFactor) {
case Critical:
return Significance.critical;
case High:
return Significance.critical;
case Medium:
return Significance.important;
case Low:
return Significance.important;
case None:
return Significance.informational;
default:
return Significance.informational;
}
}
示例2: performAction
import de.hshannover.f4.trust.ifmapj.metadata.Significance; //导入依赖的package包/类
@Override
public void performAction(PatternRule rule, RuleMatch result) {
if (rule.getId() == result.getRuleId()) {
LOGGER.debug("Performing PublishEventAction for rule: " + rule.getId());
if (result.getPublishVertex() == null) {
LOGGER.warn("Publish not successful, PublishVertex is null for rule " + rule.getId());
return;
}
Identifier id = convertVertex(result.getPublishVertex());
if (id == null) {
LOGGER.warn("Publish not successful, converting the PublishVertex of rule " + rule.getId()
+ " to an ifmapj Identifier failed. Check above for other log entries.");
return;
}
Document updateEvent = mMf.createEvent(rule.getDescription(), result.getResultGraph().getLastUpdated()
.toString(), "GPM", 100, 100, Significance.critical, EventType.cve, "",
ResultUtil.buildRecommendation(rule.getRecommendation(), result), "");
PublishRequest update = Requests.createPublishReq();
update.addPublishElement(Requests.createPublishUpdate(id, updateEvent));
IfmapPublishUtil.publish(update);
boolean isPolicyPublisherEnabled = mConfig.getBoolean("irongpm.publisher.policy.enabled", false);
if (isPolicyPublisherEnabled) {
try {
PolicyPublisher.publishAction(rule, result);
} catch (IfmapErrorResult | IfmapException e) {
LOGGER.warn("Error at publishing pattern to matched identifier-link: " + e.getMessage());
}
}
} else {
LOGGER.warn("Failed performing action since rule (" + rule.getId() + ") and result (" + result.getRuleId()
+ ") id's did not match!");
}
}
示例3: performAction
import de.hshannover.f4.trust.ifmapj.metadata.Significance; //导入依赖的package包/类
@Override
public void performAction(PatternRule rule, RuleMatch result) {
if (rule.getId() == result.getRuleId()) {
LOGGER.debug("Performing UnexpectedBehaviorAction for rule: " + rule.getId());
if (result.getPublishVertex() == null) {
LOGGER.warn("Publish not successful, PublishVertex is null for rule " + rule.getId());
return;
}
Identifier id = convertVertex(result.getPublishVertex());
if (id == null) {
LOGGER.warn("Publish not successful, converting the PublishVertex of rule " + rule.getId()
+ " to an ifmapj Identifier failed. Check above for other log entries.");
return;
}
Document updateUnexpectedBehavior = mMf.createUnexpectedBehavior(result.getResultGraph().getLastUpdated()
.toString(), "GPM", 100, 100, Significance.critical, rule.getDescription());
PublishRequest update = Requests.createPublishReq();
update.addPublishElement(Requests.createPublishUpdate(id, updateUnexpectedBehavior));
IfmapPublishUtil.publish(update);
boolean isPolicyPublisherEnabled = mConfig.getBoolean("irongpm.publisher.policy.enabled", false);
if (isPolicyPublisherEnabled) {
try {
PolicyPublisher.publishAction(rule, result);
} catch (IfmapErrorResult | IfmapException e) {
LOGGER.warn("Error at publishing pattern to matched identifier-link: " + e.getMessage());
}
}
} else {
LOGGER.warn("Failed performing action since rule (" + rule.getId() + ") and result (" + result.getRuleId()
+ ") id's did not match!");
}
}
示例4: createEventDocument
import de.hshannover.f4.trust.ifmapj.metadata.Significance; //导入依赖的package包/类
private Document createEventDocument() {
return mMetadataFactory.createEvent(
"event42",
"2010-04-21T16:11:09Z",
"discovererId",
1,
1,
Significance.critical,
EventType.cve,
"",
"42",
"CVE-2011-0997");
}
示例5: createEvent
import de.hshannover.f4.trust.ifmapj.metadata.Significance; //导入依赖的package包/类
public static Document createEvent(String name, String discoveredTime, String discovererId, Integer magnitude,
Integer confidence, Significance significance, EventType type, String otherTypeDefinition,
String information, String vulnerabilityUri, Date timestamp) {
Document doc = IFMAP_METADATA_FACTORY.createEvent(name, discoveredTime, discovererId, magnitude, confidence,
significance, type, otherTypeDefinition, information, vulnerabilityUri);
setDocumentXmlAttributes(doc, timestamp);
return doc;
}
示例6: CreateEvent
import de.hshannover.f4.trust.ifmapj.metadata.Significance; //导入依赖的package包/类
public static Document CreateEvent(String name, String discoveredTime, String discovererId, Integer magnitude,
Integer confidence, Significance significance, EventType type, String otherTypeDefinition,
String information, String vulnerabilityUri, Date timestamp) {
return MetadataMock.createEvent(name, discoveredTime, discovererId, magnitude, confidence, significance, type,
otherTypeDefinition, information, vulnerabilityUri, timestamp);
}
示例7: CreateUnexpectedBehavior
import de.hshannover.f4.trust.ifmapj.metadata.Significance; //导入依赖的package包/类
public static Document CreateUnexpectedBehavior(String discoveredTime, String discovererId, Integer magnitude,
Integer confidence, Significance significance, String type, Date timestamp) {
return MetadataMock.createUnexpectedBehavior(discoveredTime, discovererId, magnitude, confidence, significance,
type, timestamp);
}
示例8: createUnexpectedBehavior
import de.hshannover.f4.trust.ifmapj.metadata.Significance; //导入依赖的package包/类
public static Document createUnexpectedBehavior(String discoveredTime, String discovererId, Integer magnitude,
Integer confidence, Significance significance, String type, Date timestamp) {
Document doc = IFMAP_METADATA_FACTORY.createUnexpectedBehavior(discoveredTime, discovererId, magnitude, confidence, significance, type);
setDocumentXmlAttributes(doc, timestamp);
return doc;
}