Skip to content

Commit

Permalink
Merge pull request #44 from f5devcentral/1.3
Browse files Browse the repository at this point in the history
1.3
  • Loading branch information
DumpySquare authored Jul 18, 2023
2 parents 76d85eb + b671d04 commit 2727cdd
Show file tree
Hide file tree
Showing 39 changed files with 14,268 additions and 44,907 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:
- name: get extension version
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV

- name: build test qkview
run: echo "QKVIEW=$(npx ts-node src/makeQkview.ts)" >> $GITHUB_ENV

# https://github.com/marketplace/actions/changelog-reader
- name: Get Changelog Entry
id: changelog_reader
Expand All @@ -69,7 +72,7 @@ jobs:
tag: v${{ env.PACKAGE_VERSION }}
name: ${{ env.PACKAGE_NAME }}
body: "${{ steps.changelog_reader.outputs.changes }}"
artifacts: ${{ env.PACKAGE_NAME }}
artifacts: ${{ env.PACKAGE_NAME }},${{ env.QKVIEW }}
draft: false
prerelease: false

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ tmp_*
*AppDataRoamingnpm
# private folder for tests
/private/
settings.json
*.ucs
*.qkview
# exclude the xml to json stats output
Expand Down
13 changes: 12 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"name": "Debug current test",
"type": "node",
"request": "launch",
"runtimeVersion": "16.20.0",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"-r",
Expand All @@ -19,6 +18,18 @@
],
"internalConsoleOptions": "neverOpen",
},
{
"type": "chrome",
"request": "launch",
"name": "Launch report1.html",
"file": "${workspaceFolder}/report1.html"
},
{
"type": "chrome",
"request": "launch",
"name": "Launch 2report1.html",
"url": "http://127.0.0.1:3000/report1.html"
},
{
"type": "node",
"request": "launch",
Expand Down
34 changes: 34 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"peacock.color": "#614b46",
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#026e5f",
"activityBar.activeBorder": "#e762fc",
"activityBar.background": "#026e5f",
"activityBar.foreground": "#e7e7e7",
"activityBar.inactiveForeground": "#e7e7e799",
"activityBarBadge.background": "#e762fc",
"activityBarBadge.foreground": "#15202b",
"statusBar.background": "#013c34",
"statusBar.foreground": "#e7e7e7",
"statusBarItem.hoverBackground": "#026e5f",
"titleBar.activeBackground": "#013c34",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#013c3499",
"titleBar.inactiveForeground": "#e7e7e799",
"sash.hoverBorder": "#026e5f",
"statusBarItem.remoteBackground": "#013c34",
"statusBarItem.remoteForeground": "#e7e7e7",
"commandCenter.border": "#e7e7e799"
},
"peacock.remoteColor": "#013c34",
"livePreview.defaultPreviewPath": "/report1.html"
}
29 changes: 25 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,39 @@ All notable changes to the corkscrew rpm will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

---

## [Unreleased]

### Added

- [RFE] dig ssl profiles and cipher groups #43 (pending/researching)

### Changed

- [RFE] include xml stats in extraction #15 (researching)
- main README.md/documentation updates
- main README.md/documentation updates (pending)

### Fixed



---

## [1.3.0] - (07.11.2023)

### Added

- generate and add test qkview to releases for consumption in vscode-f5 extension
- [RFE] include xml stats in extraction #15
- initial xml stats rank system to show top 10 VS and GSLB
- includes other stats for irule, asm and some lists of objects that have no stats
- initial report builder (html report) testing/dev
- full license parsing

### Fixed

- added more catch statements to prevent errors (and log them) from total failures

---

## [1.2.0] - (06.19.2023)
Expand All @@ -32,14 +53,14 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

## [1.1.3] - (05.25.2023)

### Changed
### Fixed

- [BUG] more snatpool abstraction bug/tweaks
- log error when app abstraction encounters error

## [1.1.2] - (05.25.2023)

### Changed
### Fixed

- [BUG] snatpool abstraction broken #36

Expand Down
84 changes: 84 additions & 0 deletions RANKING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@

# Ranking



stat_module.xml

## notes


```bash
[
'virtual_server_stat', // general vs stats
'virtual_server_cpu_stat', // vs cpu stats
'gtm_wideip_stat', // gtm wideip stats
'profile_clientssl_stat',
'plane_cpu_stat',
'rule_stat',
'asm_cpu_util_stats',
'asm_learning_suggestions_stats',
'asm_enforced_entities_stats',
]
```

## Ranking system

Top N = 10
key = virtual server name

```yaml
virtual_server_stat:
- clientside.pkts_in
- clientside.bytes_in
- clientside.pkts_out
- clientside.bytes_out
- clientside.max_conns
- clientside.tot_conns
- clientside.cur_conns
```
Step 1: Sort/Collect top 10 VS from each of the seven stats above
- Each VS will be scored; 10 for #1, 9 for #2, and 1 for #10 (last)
- Every item in each top list gets a score just for getting on the list
Step 2: Collect Scores
- Create new table adding up the scores to produce a rank
- third column providing reasons for rank
- [[clientside.pkts_in, 6], [clientside.bytes_in, 5], [clientside.max_conns, 1], [clientside.tot_conns, 2]]
### virtual_server_stat
```json
{
columns: [
{id: 'name', name: 'Name'},
{id: 'clientside.pkts_in', name: 'Packets In'},
{id: 'clientside.bytes_in', name: 'Bytes In'},
{id: 'clientside.pkts_out', name: 'Packets Out'},
{id: 'clientside.bytes_out', name: 'Bytes Out'},
{id: 'clientside.max_conns', name: 'Max Connections'},
{id: 'clientside.tot_conns', name: 'Total Connections'},
{id: 'clientside.cur_conns', name: 'Current Connections'},
],
search: true,
sort: true,
data: Object.values(data.virtual_server_stat)
}
```


### virtual_server_cpu_stat

```json
{
columns: [
{id: 'name', name: 'Name'},
{id: 'avg_5sec', name: 'Average - 5 sec'},
{id: 'avg_1min', name: 'Average - 1 min'},
{id: 'avg_5min', name: 'Average - 5 min'}
],
search: true,
sort: true,
data: Object.values(data.virtual_server_cpu_stat)
}
```
62 changes: 62 additions & 0 deletions co-pilot_irules_examples.irul
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
### co-pilot irules examples

# create an irule to redirect http to https
cat <<EOF > /config/http_to_https_redirect.irule
when HTTP_REQUEST {
HTTP::respond 301 Location "https://[getfield [HTTP::host] : 1][HTTP::uri]"
}


# create an irule to filter based on source ip, use a data group to store the ip addresses
cat <<EOF > /config/ip_filter.irule
when HTTP_REQUEST {
if { [class match [IP::client_addr] equals ip_filter] } {
HTTP::respond 403 content "Access Denied"
}
}


# create an irule to direct traffic to a pool based on the host header
cat <<EOF > /config/host_pool.irule
when HTTP_REQUEST {

# log the host header and source ip and uri
log local0. "host: [HTTP::host] ip: [IP::client_addr] uri: [HTTP::uri]"

if { [HTTP::host] equals "www.example.com" } {
pool www.example.com
}
elseif { [HTTP::host] equals "www.example2.com" } {
pool www.example2.com
}
else {
pool www.example.com
}
}

# create an irule to log all client and server side connections details
cat <<EOF > /config/connection_logging.irule
when CLIENT_ACCEPTED {
log local0. "client accepted: [IP::client_addr]:[TCP::client_port]"
}

when CLIENT_CLOSED {
log local0. "client closed: [IP::client_addr]:[TCP::client_port]"
}

when SERVER_CONNECTED {
log local0. "server connected: [IP::server_addr]:[TCP::server_port]"
}

when SERVER_CLOSED {
log local0. "server closed: [IP::server_addr]:[TCP::server_port]"
}

when HTTP_REQUEST {
log local0. "http request: [IP::client_addr]:[TCP::client_port] -> [IP::server_addr]:[TCP::server_port] [HTTP::method] [HTTP::host][HTTP::uri]"
}

when HTTP_RESPONSE {
log local0. "http response: [IP::server_addr]:[TCP::server_port] -> [IP::client_addr]:[TCP::client_port] [HTTP::status] [HTTP::reason]"
}

Loading

0 comments on commit 2727cdd

Please sign in to comment.