Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config_examples/waflyctl.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,19 @@ SessionFixationScoreThreshold = 5
SQLInjectionScoreThreshold = 5
XSSScoreThreshold = 5

#Only use address (IPV4 address) OR hostname (ip or hostname) not BOTH
Copy link
Copy Markdown
Member

@fgsch fgsch Jun 14, 2019

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

[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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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\"}'''

Expand Down
6 changes: 5 additions & 1 deletion waflyctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"time"

"github.com/BurntSushi/toml"
"github.com/sethvargo/go-fastly/fastly"
"github.com/fastly/go-fastly/fastly"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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"
)
Expand Down Expand Up @@ -110,6 +110,7 @@ type owaspSettings struct {
type WeblogSettings struct {
Name string
Address string
Hostname string
Port uint
Tlscacert string
Tlshostname string
Expand All @@ -130,6 +131,7 @@ type VCLSnippetSettings struct {
type WaflogSettings struct {
Name string
Address string
Hostname string
Port uint
Tlscacert string
Tlshostname string
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down