4using System.Threading.Tasks;
62 DateTime UtcNow = DateTime.UtcNow;
65 KeyValuePair<string, object>[] Properties =
new KeyValuePair<string, object>[]
69 new KeyValuePair<string, object>(
"Timestamp", UtcNow),
70 new KeyValuePair<string, object>(
"Expires", Expires),
71 new KeyValuePair<string, object>(
"Vector", await this.vector.EvaluateAsync(
Variables,
string.Empty)),
72 new KeyValuePair<string, object>(
"Protocol", await this.protocol.EvaluateAsync(
Variables,
string.Empty)),
73 new KeyValuePair<string, object>(
"Classification", await this.classification.EvaluateAsync(
Variables,
string.Empty)),
74 new KeyValuePair<string, object>(
"Code", await this.code.EvaluateAsync(
Variables,
string.Empty)),
75 new KeyValuePair<string, object>(
"Message", await this.message.EvaluateAsync(
Variables,
string.Empty)),
80 "Waher.Service.IoTBroker.WebServices.Agent.Intelligence.Information",
81 Guid.NewGuid(), Properties);
85 foreach (KeyValuePair<string, object> P
in await this.
EvaluateTags(State))
88 new KeyValuePair<string, object>[]
90 new KeyValuePair<string, object>(
"Name", P.Key),
91 new KeyValuePair<string, object>(
"Value", P.Value)
95 Result[
"Tags"] =
Tags.ToArray();
108 DateTime UtcNow = DateTime.UtcNow;
110 StringBuilder sb =
new StringBuilder();
111 string RemoteEndpoint = State.
Request.RemoteEndPoint.RemovePortNumber();
114 sb.AppendLine(RemoteEndpoint);
122 s = await this.vector.EvaluateAsync(
Variables,
string.Empty);
124 if (!
string.IsNullOrEmpty(s))
127 s = await this.protocol.EvaluateAsync(
Variables,
string.Empty);
129 if (!
string.IsNullOrEmpty(s))
132 s = await this.classification.EvaluateAsync(
Variables,
string.Empty);
134 if (!
string.IsNullOrEmpty(s))
137 s = await this.code.EvaluateAsync(
Variables,
string.Empty);
139 if (!
string.IsNullOrEmpty(s))
142 s = await this.message.EvaluateAsync(
Variables,
string.Empty);
144 if (!
string.IsNullOrEmpty(s))
147 string Key = sb.ToString();
149 if (State.TryGetCachedObject(Key, out
GenericObject[] Result))
162 !(TagsObj is Array TagsArray))
167 Dictionary<string, object> ObjTags =
new Dictionary<string, object>();
169 foreach (
object Item
in TagsArray)
173 !(NameObj is
null) &&
174 ItemObj.TryGetFieldValue(
"Value", out
object ValueObj))
176 ObjTags[NameObj.ToString()] = ValueObj;
182 foreach (KeyValuePair<string, object> P
in Tags)
184 if (!ObjTags.TryGetValue(P.Key, out
object Value))
192 if (!(Value is
null))
198 else if (!P.Value.Equals(Value))
Durationing point (Duration) attribute
Represents a case-insensitive string.
Static interface for database persistence. In order to work, a database provider has to be assigned t...
static Task< IEnumerable< object > > Find(string Collection, params string[] SortOrder)
Finds objects in a given collection.
This filter selects objects that conform to all child-filters provided.
This filter selects objects that have a named field equal to a given value.
This filter selects objects that have a named field greater or equal to a given value.
Generic object. Contains a sequence of properties.
bool TryGetFieldValue(string PropertyName, out object Value)
Gets the value of a field or property of the object, given its name.
A chunked list is a linked list of chunks of objects of type T .
void AddRange(IEnumerable< T > Collection)
Adds a range of elements (last) to the list.
void Add(T Item)
Adds an item to the collection.
T[] ToArray()
Returns an array containing all elements of the collection.
Abstract base class for Web Application Firewall Open Intelligence actions.
async Task< GenericObject[]> FindObjects(ProcessingState State)
Finds any Open Intelligence records matching the parameters of the action.
WafActionOpenIntelligence(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
Abstract base class for Web Application Firewall Open Intelligence actions.
WafActionOpenIntelligence()
Abstract base class for Web Application Firewall Open Intelligence actions.
async Task< GenericObject > EvaluateObject(ProcessingState State)
Evaluates an object reference from the attributes of the action.
Contains the current state of a review process.
Variables Variables
Set of variables.
void AddToCache(string Key, object Value)
Adds a value to the cache.
HttpRequest Request
Current HTTP Request
Abstract base class for Web Application Firewall actions.
WebApplicationFirewall Document
Web Application Firewall document.
static readonly TimeSpan fiveMinutes
Five minutes time span.
Web Application Firewall for HttpServer.
Represents a duration value, as defined by the xsd:duration data type: http://www....
static readonly Duration Zero
Zero value