Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
IsEncrypted.cs
1using System.Threading.Tasks;
2using System.Xml;
5
7{
12 {
13 private readonly int minSecurityStrength;
14
18 public IsEncrypted()
19 : base()
20 {
21 }
22
29 public IsEncrypted(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
30 : base(Xml, Parent, Document)
31 {
32 this.minSecurityStrength = XML.Attribute(Xml, "minSecurityStrength", 0);
33 }
34
38 public override string LocalName => nameof(IsEncrypted);
39
47 public override WafAction Create(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document) => new IsEncrypted(Xml, Parent, Document);
48
54 public override Task<WafResult?> Review(ProcessingState State)
55 {
56 if (State.Request.Encrypted && State.Request.CipherStrength >= this.minSecurityStrength)
57 return this.ReviewChildren(State);
58 else
59 return Task.FromResult<WafResult?>(null);
60 }
61 }
62}
Helps with common XML-related tasks.
Definition: XML.cs:21
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Definition: XML.cs:1062
Checks if the request is encrypted.
Definition: IsEncrypted.cs:12
override WafAction Create(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
Creates a WAF action from its XML definition.
override Task< WafResult?> Review(ProcessingState State)
Reviews the processing state, and returns a WAF result, if any.
Definition: IsEncrypted.cs:54
override string LocalName
XML Local Name for the XML element defining the action.
Definition: IsEncrypted.cs:38
IsEncrypted(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
Checks if the request is encrypted.
Definition: IsEncrypted.cs:29
IsEncrypted()
Checks if the request is encrypted.
Definition: IsEncrypted.cs:18
Abstract base class for Web Application Firewall comparisons.
Definition: WafComparison.cs:9
Contains the current state of a review process.
HttpRequest Request
Current HTTP Request
Abstract base class for Web Application Firewall actions.
Definition: WafAction.cs:17
WebApplicationFirewall Document
Web Application Firewall document.
Definition: WafAction.cs:60
async Task< WafResult?> ReviewChildren(ProcessingState State)
Reviews the processing state, and returns a WAF result, if any.
Definition: WafActions.cs:72
Web Application Firewall for HttpServer.
WafResult
Actions that a Web Server can take after reviewing a request.