Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Filebeat] Add fortinet/firewall network direction override based on interface #23072

Merged

Conversation

andrewstucki
Copy link

@andrewstucki andrewstucki commented Dec 10, 2020

What does this PR do?

This is pretty similar to the other PRs that allow override based off zone, such as #23066. However, since fortinet doesn't ship zone information, this uses the interface instead.

Additionally, I found some values in the utm source that were setting network.direction to "outgoing"/"incoming", so I normalized those.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Dec 10, 2020
@andrewstucki
Copy link
Author

Since there's no way of overriding the config on a per golden file basis. Here's a diff to demonstrate this working:

With the following configuration change

diff --git a/x-pack/filebeat/module/fortinet/firewall/manifest.yml b/x-pack/filebeat/module/fortinet/firewall/manifest.yml
index f76743d96..8c2459c00 100644
--- a/x-pack/filebeat/module/fortinet/firewall/manifest.yml
+++ b/x-pack/filebeat/module/fortinet/firewall/manifest.yml
@@ -10,7 +10,9 @@ var:
   - name: input
     default: udp
   - name: internal_interfaces
+    default: [ "wan1" ] # I want it backwards for effect
   - name: external_interfaces
+    default: [ "LAN" ] # I want it backwards for effect

 ingest_pipeline:
   - ingest/pipeline.yml

We see the following change:

         "log.offset": 2683,
         "message": "Web.Client: HTTPS.BROWSER,",
         "network.application": "HTTPS.BROWSER",
-        "network.direction": "outbound",
+        "network.direction": "inbound",
         "network.iana_number": "6",
         "network.protocol": "ssl",
         "observer.egress.interface.name": "wan1",

@elasticmachine
Copy link
Collaborator

elasticmachine commented Dec 10, 2020

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #23072 updated

  • Start Time: 2020-12-10T20:31:57.566+0000

  • Duration: 56 min 49 sec

Test stats 🧪

Test Results
Failed 0
Passed 2422
Skipped 261
Total 2683

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 2422
Skipped 261
Total 2683

@andrewstucki andrewstucki merged commit 5a03647 into elastic:master Dec 10, 2020
@andrewstucki andrewstucki deleted the fortinet-firewall-directions branch December 10, 2020 21:57
andrewstucki pushed a commit to andrewstucki/beats that referenced this pull request Dec 10, 2020
…interface (elastic#23072)

* [Filebeat] Add fortinet/firewall network direction override based on interface

* Add changelog entry

* Don't override categorization if no interface name is set

(cherry picked from commit 5a03647)
andrewstucki pushed a commit that referenced this pull request Dec 11, 2020
…irection override based on interface (#23085)

* [Filebeat] Add fortinet/firewall network direction override based on interface (#23072)

* [Filebeat] Add fortinet/firewall network direction override based on interface

* Add changelog entry

* Don't override categorization if no interface name is set

(cherry picked from commit 5a03647)

* Fix up changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants