data-model icon indicating copy to clipboard operation
data-model copied to clipboard

Create `FirewallRule` entity class

Open ndowmon opened this issue 4 years ago • 3 comments

Historically, Firewall Rules have been created as edges between Firewalls and "The Internet". Properties such as Allow/Deny, startIp/endIp, protocol, etc. have been properties on these edges, and to query in J1QL, one must build a query like FIND Firewall THAT (ALLOWS|DENIES) as firewallRule * return firewallRule.*.

Firewall rules aren't always related to Firewalls, though, as is the case with Azure SQL Servers (who have firewall rules with fewer properties, omitting Allows/Denies, Protocol, and other typical properties). I think it would be best to create a FirewallRule entity class.

ndowmon avatar Mar 24 '21 15:03 ndowmon

do you think we could accomplish this by expanding or changing Rules and RuleSets instead?

mknoedel avatar Mar 24 '21 15:03 mknoedel

@ndowmon I'd like to clarify goals and non goals:

  1. Non-goal: Avoid relationships for obtaining properties in a query/question.
  2. Goal: Support ingesting rules for host-based firewalls, where there is no entity to represent the Firewall. That is, there is only the entity representing the host/service where the rules are evaluated, but it doesn't makes sense to add the class Firewall to that entity.
  3. Goal: Support a J1 query that shows which cloud services, hosts, or the Internet can access the protected host/service.

do you think we could accomplish this by expanding or changing Rules and RuleSets instead?

Those do seem like they could be a good fit for 2 above. What would the J1QL look like, do you think @ndowmon, to accomplish 3 (assuming that is a goal)?

aiwilliams avatar Mar 24 '21 17:03 aiwilliams

I want to bump this one again. Lots of entities in Azure support host-based firewall rules, and a lot of queries of security importance rely on being able to ID these firewall rules.

ndowmon avatar May 17 '21 16:05 ndowmon