Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Docs and minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
fgsch committed Nov 1, 2018
1 parent a221507 commit 8e9309f
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 28 deletions.
16 changes: 11 additions & 5 deletions Documentation/BUILD.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Build
- install [Go](https://golang.org/doc/install)
- `cd /waflyctl`
- `go get github.com/BurntSushi/toml github.com/sethvargo/go-fastly/fastly gopkg.in/alecthomas/kingpin.v2 gopkg.in/resty.v1`
- `go build waflyctl.go`
- `./waflyctl`

Install [Go](https://golang.org/doc/install) and run the following
commands:

```
cd waflyctl
go get github.com/BurntSushi/toml github.com/sethvargo/go-fastly/fastly \
gopkg.in/alecthomas/kingpin.v2 gopkg.in/resty.v1
go build waflyctl.go
./waflyctl
```
24 changes: 13 additions & 11 deletions Documentation/EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
# Examples

Replace <service_id> and <configuration_set_id> where appropriate.

## Provision a Service with OWASP rule set
`./waflyctl --apikey $FASTLY_TOKEN --serviceid BtYEP3WtWse5mGznpxxxx --tags OWASP`
`waflyctl --apikey $FASTLY_TOKEN --serviceid <service_id> --tags OWASP`

## Add three rules to block mode on a Service with a WAF provisioned
`./waflyctl --apikey $FASTLY_TOKEN --serviceid BtYEP3WtWmx5mGznpxxxx --rules 1010010,931100,931110 --action block`
`waflyctl --apikey $FASTLY_TOKEN --serviceid <service_id> --rules 1010010,931100,931110 --action block`

## Delete a WAF previously provisioned
`./waflyctl --apikey $FASTLY_TOKEN --serviceid 7YCnicdpjTvxR2JdzNxxxx --delete`
`waflyctl --apikey $FASTLY_TOKEN --serviceid <service_id> --delete`

## Customer with PerimeterX bot protection
`./waflyctl --apikey $FASTLY_TOKEN --domain myexample.com --with-perimeterx`
`waflyctl --apikey $FASTLY_TOKEN --domain myexample.com --with-perimeterx`

## Only edit OWASP object base on what it is set on the config file
`./waflyctl --apikey $FASTLY_TOKEN --domain myexample.com --owasp`
`waflyctl --apikey $FASTLY_TOKEN --domain myexample.com --owasp`

## Disable a WAF, stop it for blocking traffic if something goes horribly wrong

## Listing all configuration sets available on the fastly platform
`./waflyctl --apikey $FASTLY_TOKEN --serviceid 7YCnicdpjTvxR2JdzNxxxx --list-configuration-sets`
`waflyctl --apikey $FASTLY_TOKEN --serviceid <service_id> --list-configuration-sets`

## Listing all rules available under a configuration set
`./waflyctl --apikey $FASTLY_TOKEN --serviceid 7YCnicdpjTvxR2JdzNxxxx --list-all-rules 552NEtnDyzucKd3vTjLgFC`
`waflyctl --apikey $FASTLY_TOKEN --serviceid <service_id> --list-all-rules <configuration_set_id>`

## Listing all rules and their status for a service
`./waflyctl --apikey $FASTLY_TOKEN --serviceid 7YCnicdpjTvxR2JdzNxxxx --list-rules`
`waflyctl --apikey $FASTLY_TOKEN --serviceid <service_id> --list-rules`

## Set all rules of publisher owasp to logging
`./waflyctl --apikey $FASTLY_TOKEN --serviceid 7YCnicdpjTvxR2JdzNAKCj --publisher owasp --action log`
`waflyctl --apikey $FASTLY_TOKEN --serviceid <service_id> --publisher owasp --action log`

## Disable WAF in case of an emergency
`./waflyctl --apikey $FASTLY_TOKEN --serviceid 7YCnicdpjTvxR2JdzNAKCj --status disable`
`waflyctl --apikey $FASTLY_TOKEN --serviceid <service_id> --status disable`

## Customer with shielding
`./waflyctl --apikey $FASTLY_TOKEN --serviceid 2mvVrPMLDWSaZzCZIpbcUI --enable-logs-only --with-shielding`
`waflyctl --apikey $FASTLY_TOKEN --serviceid <service_id> --enable-logs-only --with-shielding`
21 changes: 16 additions & 5 deletions Documentation/INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# Requirements
- Have a Fastly API Key in-hand with edit privileges
- Have a service behind Fastly
- Have WAF be enabled for your account

* Have a Fastly API Key in-hand with edit privileges
* Have a service behind Fastly
* Have WAF enabled for your account

# Installation
- `brew install fastly/tap/waflyctl`
- grab a copy of the [config](https://github.com/fastly/waflyctl/blob/master/config_examples/waflyctl.toml.example) file and place it under `~/.waflyctl.toml` where the tool defaults to.

To install the latest release in macOS:

* brew install fastly/tap/waflyctl

Alternatively, to use unreleased code from the master branch:

* brew install --HEAD fastly/tap/waflyctl

You will also need to grab a copy of the
[config](https://github.com/fastly/waflyctl/blob/master/config_examples/waflyctl.toml.example)
file and place it under `~/.waflyctl.toml` where the tool defaults to.
9 changes: 5 additions & 4 deletions Documentation/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
## Overview

1. OS name and version.
2. GO version
3. Description of the problem. What is happening that shouldn't?
4. Description of the expected behaviour.
5. Exact steps to reproduce the error.
2. `go version` output
3. `waflyctl --version` in recent releases or `brew info waflyctl` output.
4. Description of the problem. What is happening that shouldn't?
5. Description of the expected behaviour.
6. Exact steps to reproduce the error.

## Additional Information:

Expand Down
2 changes: 1 addition & 1 deletion Documentation/OPENING-ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Issues can be opened using github's tracker. You can see a explanation [here](ht
Issues are for tracking broken functionality and are intended for managing development work to address these.

If you have an issue with usage or need general assistance using this module,
or Fastly in general please use the [support infomation](../README.md#support).
or Fastly in general please use the [support information](../README.md#support).

This describes what content should be added to a issue to help with an
expedient resolution.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Flags:
delimited fashion. Overwrites tags defined in
config file. Example:
wordpress,language-php,drupal.
--with-perimeterx Enable if the customer has perimeterX enabled on
--with-perimeterx Enable if the customer has PerimeterX enabled on
the service as well as WAF. Helps fix null value
logging.
--with-shielding Enable if the customer has shielding enabled on the
Expand Down
2 changes: 1 addition & 1 deletion waflyctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -2015,7 +2015,7 @@ var (
serviceID = app.Flag("serviceid", "Service ID to Provision.").String()
status = app.Flag("status", "Disable or Enable the WAF. A disabled WAF will not block any traffic. In addition disabling a WAF does not change rule statuses on its configure policy. One of: disable, enable.").Enum("disable", "enable")
tags = app.Flag("tags", "Which rules tags to add to the ruleset in a comma delimited fashion. Overwrites tags defined in config file. Example: wordpress,language-php,drupal.").String()
withPX = app.Flag("with-perimeterx", "Enable if the customer has perimeterX enabled on the service as well as WAF. Helps fix null value logging.").Bool()
withPX = app.Flag("with-perimeterx", "Enable if the customer has PerimeterX enabled on the service as well as WAF. Helps fix null value logging.").Bool()
withShielding = app.Flag("with-shielding", "Enable if the customer has shielding enabled on the service. Helps fix multiple events with duplicate request IDs.").Bool()
)

Expand Down

0 comments on commit 8e9309f

Please sign in to comment.