Пример #1
0
 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)));
     }
 }
Пример #2
0
        /// <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);
        }
Пример #3
0
        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
                };
            }
        }
Пример #5
0
 /// <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)
     });
 }
Пример #6
0
 /// <inheritdoc />
 public virtual void DependencyViolationReported(DependencyViolationEventData data)
 {
     ReportUnhandledEvent(data);
 }
Пример #7
0
        /// <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)
            });
        }