This repository was archived by the owner on Dec 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Added support for hostname in Waflog and Weblog #90
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,15 +41,19 @@ SessionFixationScoreThreshold = 5 | |
| SQLInjectionScoreThreshold = 5 | ||
| XSSScoreThreshold = 5 | ||
|
|
||
| #Only use address (IPV4 address) OR hostname (ip or hostname) not BOTH | ||
| [weblog] | ||
| name = "weblogs" | ||
| address = "address" | ||
| hostname = "hostname" | ||
| port = 514 | ||
| format = '''{\"type\":\"req\",\"service_id\":\"%{req.service_id}V\",\"request_id\":\"%{req.http.fastly-soc-x-request-id}V\",\"start_time\":\"%{time.start.sec}V\",\"fastly_info\":\"%{fastly_info.state}V\",\"datacenter\":\"%{server.datacenter}V\",\"client_ip\":\"%a\",\"req_method\":\"%m\",\"req_uri\":\"%{cstr_escape(req.url)}V\",\"req_h_host\":\"%{cstr_escape(req.http.Host)}V\",\"req_h_user_agent\":\"%{cstr_escape(req.http.User-Agent)}V\",\"req_h_accept_encoding\":\"%{cstr_escape(req.http.Accept-Encoding)}V\",\"req_header_bytes\":\"%{req.header_bytes_read}V\",\"req_body_bytes\":\"%{req.body_bytes_read}V\",\"waf_logged\":\"%{waf.logged}V\",\"waf_blocked\":\"%{waf.blocked}V\",\"waf_failures\":\"%{waf.failures}V\",\"waf_executed\":\"%{waf.executed}V\",\"anomaly_score\":\"%{waf.anomaly_score}V\",\"sql_injection_score\":\"%{waf.sql_injection_score}V\",\"rfi_score\":\"%{waf.rfi_score}V\",\"lfi_score\":\"%{waf.lfi_score}V\",\"rce_score\":\"%{waf.rce_score}V\",\"php_injection_score\":\"%{waf.php_injection_score}V\",\"session_fixation_score\":\"%{waf.session_fixation_score}V\",\"http_violation_score\":\"%{waf.http_violation_score}V\",\"xss_score\":\"%{waf.xss_score}V\",\"resp_status\":\"%{resp.status}V\",\"resp_bytes\":\"%{resp.bytes_written}V\",\"resp_header_bytes\":\"%{resp.header_bytes_written}V\",\"resp_body_bytes\":\"%{resp.body_bytes_written}V\"}''' | ||
|
|
||
| #Only use address (IPV4 address) OR hostname (ip or hostname) not BOTH | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. space here too. |
||
| [waflog] | ||
| name = "waflogs" | ||
| address = "address" | ||
| hostname = "hostname" | ||
| port = 514 | ||
| format = '''{\"type\":\"waf\",\"request_id\":\"%{req.http.fastly-soc-x-request-id}V\",\"rule_id\":\"%{waf.rule_id}V\",\"severity\":\"%{waf.severity}V\",\"anomaly_score\":\"%{waf.anomaly_score}V\",\"logdata\":\"%{json.escape(waf.logdata)}V\",\"waf_message\":\"%{json.escape(waf.message)}V\"}''' | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ import ( | |
| "time" | ||
|
|
||
| "github.com/BurntSushi/toml" | ||
| "github.com/sethvargo/go-fastly/fastly" | ||
| "github.com/fastly/go-fastly/fastly" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is really unrelated. please move it to a different commit or a separate pr. |
||
| "gopkg.in/alecthomas/kingpin.v2" | ||
| "gopkg.in/resty.v1" | ||
| ) | ||
|
|
@@ -110,6 +110,7 @@ type owaspSettings struct { | |
| type WeblogSettings struct { | ||
| Name string | ||
| Address string | ||
| Hostname string | ||
| Port uint | ||
| Tlscacert string | ||
| Tlshostname string | ||
|
|
@@ -130,6 +131,7 @@ type VCLSnippetSettings struct { | |
| type WaflogSettings struct { | ||
| Name string | ||
| Address string | ||
| Hostname string | ||
| Port uint | ||
| Tlscacert string | ||
| Tlshostname string | ||
|
|
@@ -392,6 +394,7 @@ func fastlyLogging(client fastly.Client, serviceID string, config TOMLConfig, ve | |
| Version: version, | ||
| Name: config.Weblog.Name, | ||
| Address: config.Weblog.Address, | ||
| Hostname: config.Weblog.Hostname, | ||
| Port: config.Weblog.Port, | ||
| UseTLS: fastly.CBool(true), | ||
| IPV4: config.Weblog.Address, | ||
|
|
@@ -414,6 +417,7 @@ func fastlyLogging(client fastly.Client, serviceID string, config TOMLConfig, ve | |
| Version: version, | ||
| Name: config.Waflog.Name, | ||
| Address: config.Waflog.Address, | ||
| Hostname: config.Waflog.Hostname, | ||
| Port: config.Waflog.Port, | ||
| UseTLS: fastly.CBool(true), | ||
| IPV4: config.Waflog.Address, | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space to keep the style and be inline with the rest of the comments