public override void DependencyViolationReported(DependencyViolationEventData data) { if (data.ViolatorPipId == m_pip.PipId || data.RelatedPipId == m_pip.PipId) { m_sections.Add( m_html.CreateBlock( "Dependecy Violation", m_html.CreateRow("Violator", data.ViolatorPipId), m_html.CreateRow("Related", data.RelatedPipId), m_html.CreateEnumRow("ViolationType", data.ViolationType), m_html.CreateEnumRow("AccessLevel", data.AccessLevel), m_html.CreateRow("Path", data.Path))); } }
/// <summary> /// Override event to capture its data and store it in the protobuf /// </summary> public override void DependencyViolationReported(DependencyViolationEventData data) { var value = data.ToDependencyViolationReportedEvent(WorkerID.Value, PathTable, m_nameExpander); var key = new EventKey { EventTypeID = Xldb.Proto.ExecutionEventId.DependencyViolationReported, ViolatorPipID = data.ViolatorPipId.Value }; var keyArr = key.ToByteArray(); var valueArr = value.ToByteArray(); WriteToDb(keyArr, valueArr, XldbDataStore.EventColumnFamilyName); AddToDbStorageDictionary(DBStoredTypes.DependencyViolationReported, keyArr.Length + valueArr.Length); }
public override void DependencyViolationReported(DependencyViolationEventData data) { if (!IsFailedPipOrDependency(data.ViolatorPipId)) { // Only record inputs for failed pips or their transitive dependencies return; } // Contains : ReportedProcesses (process chain), // ReportedFileAccesses, WhitelistedReportedFileAccesses, ProcessDetouringStatuses if (m_pipDependencyViolationEventData.TryGetValue(data.ViolatorPipId, out var entry)) { entry.Add(data); } else { entry = new List <DependencyViolationEventData>() { data }; m_pipDependencyViolationEventData.Add(data.ViolatorPipId, entry); } }
/// <inheritdoc/> public override void DependencyViolationReported(DependencyViolationEventData data) { // JavaScript projects are scheduled with allowed undeclared source reads mode on // So any undeclared violation manifests as a write on an undeclared source read if (data.ViolationType != Scheduler.FileMonitoringViolationAnalyzer.DependencyViolationType.WriteInUndeclaredSourceRead) { return; } // Put together the project that reads (without a declaration) - as the key - from all the projects that write - as the value - var reader = (Process)PipGraph.GetPipFromPipId(data.ViolatorPipId); var writer = (Process)PipGraph.GetPipFromPipId(data.RelatedPipId); if (m_missingDependencies.TryGetValue(reader, out var writers)) { writers.Add(writer); } else { m_missingDependencies[reader] = new HashSet <Process> { writer }; } }
/// <nodoc /> public static DependencyViolationReportedEvent ToDependencyViolationReportedEvent(this DependencyViolationEventData data, uint workerID, PathTable pathTable, NameExpander nameExpander) { return(new DependencyViolationReportedEvent() { WorkerID = workerID, ViolatorPipID = data.ViolatorPipId.Value, RelatedPipID = data.RelatedPipId.Value, ViolationType = (FileMonitoringViolationAnalyzer_DependencyViolationType)(data.ViolationType + 1), AccessLevel = (FileMonitoringViolationAnalyzer_AccessLevel)(data.AccessLevel + 1), Path = data.Path.ToAbsolutePath(pathTable, nameExpander) }); }
/// <inheritdoc /> public virtual void DependencyViolationReported(DependencyViolationEventData data) { ReportUnhandledEvent(data); }
/// <nodoc /> public static Xldb.DependencyViolationReportedEvent ToDependencyViolationReportedEvent(this DependencyViolationEventData data, uint workerID, PathTable pathTable) { var Uuid = Guid.NewGuid().ToString(); return(new Xldb.DependencyViolationReportedEvent() { UUID = Uuid, WorkerID = workerID, ViolatorPipID = data.ViolatorPipId.Value, RelatedPipID = data.RelatedPipId.Value, ViolationType = (Xldb.FileMonitoringViolationAnalyzer_DependencyViolationType)data.ViolationType, AccessLevel = (Xldb.FileMonitoringViolationAnalyzer_AccessLevel)data.AccessLevel, Path = data.Path.ToAbsolutePath(pathTable) }); }