Skip to content

Commit 105e94f

Browse files
committed
Add some initial compromise indicators
1 parent eb7eef7 commit 105e94f

11 files changed

+568
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313

1414
# Dependency directories (remove the comment below to include it)
1515
# vendor/
16+
17+
# added by lint-install
18+
out/

.golangci.yml

+207
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
run:
2+
# The default runtime timeout is 1m, which doesn't work well on Github Actions.
3+
timeout: 4m
4+
5+
# NOTE: This file is populated by the lint-install tool. Local adjustments may be overwritten.
6+
linters-settings:
7+
cyclop:
8+
# NOTE: This is a very high transitional threshold
9+
max-complexity: 37
10+
package-average: 34.0
11+
skip-tests: true
12+
13+
gocognit:
14+
# NOTE: This is a very high transitional threshold
15+
min-complexity: 98
16+
17+
dupl:
18+
threshold: 200
19+
20+
goconst:
21+
min-len: 4
22+
min-occurrences: 5
23+
ignore-tests: true
24+
25+
gosec:
26+
excludes:
27+
- G107 # Potential HTTP request made with variable url
28+
- G204 # Subprocess launched with function call as argument or cmd arguments
29+
- G404 # Use of weak random number generator (math/rand instead of crypto/rand
30+
31+
errorlint:
32+
# these are still common in Go: for instance, exit errors.
33+
asserts: false
34+
35+
exhaustive:
36+
default-signifies-exhaustive: true
37+
38+
nestif:
39+
min-complexity: 8
40+
41+
nolintlint:
42+
require-explanation: true
43+
allow-unused: false
44+
require-specific: true
45+
46+
revive:
47+
ignore-generated-header: true
48+
severity: warning
49+
rules:
50+
- name: atomic
51+
- name: blank-imports
52+
- name: bool-literal-in-expr
53+
- name: confusing-naming
54+
- name: constant-logical-expr
55+
- name: context-as-argument
56+
- name: context-keys-type
57+
- name: deep-exit
58+
- name: defer
59+
- name: range-val-in-closure
60+
- name: range-val-address
61+
- name: dot-imports
62+
- name: error-naming
63+
- name: error-return
64+
- name: error-strings
65+
- name: errorf
66+
- name: exported
67+
- name: identical-branches
68+
- name: if-return
69+
- name: import-shadowing
70+
- name: increment-decrement
71+
- name: indent-error-flow
72+
- name: indent-error-flow
73+
- name: package-comments
74+
- name: range
75+
- name: receiver-naming
76+
- name: redefines-builtin-id
77+
- name: superfluous-else
78+
- name: struct-tag
79+
- name: time-naming
80+
- name: unexported-naming
81+
- name: unexported-return
82+
- name: unnecessary-stmt
83+
- name: unreachable-code
84+
- name: unused-parameter
85+
- name: var-declaration
86+
- name: var-naming
87+
- name: unconditional-recursion
88+
- name: waitgroup-by-value
89+
90+
staticcheck:
91+
go: "1.16"
92+
93+
unused:
94+
go: "1.16"
95+
96+
output:
97+
sort-results: true
98+
99+
linters:
100+
disable-all: true
101+
enable:
102+
- asciicheck
103+
- bodyclose
104+
- cyclop
105+
- deadcode
106+
- dogsled
107+
- dupl
108+
- durationcheck
109+
- errcheck
110+
- errname
111+
- errorlint
112+
- exhaustive
113+
- exportloopref
114+
- forcetypeassert
115+
- gocognit
116+
- goconst
117+
- gocritic
118+
- godot
119+
- gofmt
120+
- gofumpt
121+
- gosec
122+
- goheader
123+
- goimports
124+
- goprintffuncname
125+
- gosimple
126+
- govet
127+
- ifshort
128+
- importas
129+
- ineffassign
130+
- makezero
131+
- misspell
132+
- nakedret
133+
- nestif
134+
- nilerr
135+
- noctx
136+
- nolintlint
137+
- predeclared
138+
# disabling for the initial iteration of the linting tool
139+
# - promlinter
140+
- revive
141+
- rowserrcheck
142+
- sqlclosecheck
143+
- staticcheck
144+
- structcheck
145+
- stylecheck
146+
- thelper
147+
- tparallel
148+
- typecheck
149+
- unconvert
150+
- unparam
151+
- unused
152+
- varcheck
153+
- wastedassign
154+
- whitespace
155+
156+
# Disabled linters, due to being misaligned with Go practices
157+
# - exhaustivestruct
158+
# - gochecknoglobals
159+
# - gochecknoinits
160+
# - goconst
161+
# - godox
162+
# - goerr113
163+
# - gomnd
164+
# - lll
165+
# - nlreturn
166+
# - testpackage
167+
# - wsl
168+
# Disabled linters, due to not being relevant to our code base:
169+
# - maligned
170+
# - prealloc "For most programs usage of prealloc will be a premature optimization."
171+
# Disabled linters due to bad error messages or bugs
172+
# - tagliatelle
173+
174+
issues:
175+
# Excluding configuration per-path, per-linter, per-text and per-source
176+
exclude-rules:
177+
- path: _test\.go
178+
linters:
179+
- dupl
180+
- errcheck
181+
- forcetypeassert
182+
- gocyclo
183+
- gosec
184+
- noctx
185+
186+
- path: .*cmd.*
187+
linters:
188+
- noctx
189+
190+
- path: main\.go
191+
linters:
192+
- noctx
193+
194+
- path: .*cmd.*
195+
text: "deep-exit"
196+
197+
- path: main\.go
198+
text: "deep-exit"
199+
200+
# This check is of questionable value
201+
- linters:
202+
- tparallel
203+
text: "call t.Parallel on the top level as well as its subtests"
204+
205+
# Don't hide lint issues just because there are many of them
206+
max-same-issues: 0
207+
max-issues-per-linter: 0

Makefile

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# BEGIN: lint-install .
2+
# http://github.com/tinkerbell/lint-install
3+
4+
.PHONY: lint
5+
lint: _lint
6+
7+
LINT_ARCH := $(shell uname -m)
8+
LINT_OS := $(shell uname)
9+
LINT_OS_LOWER := $(shell echo $(LINT_OS) | tr '[:upper:]' '[:lower:]')
10+
LINT_ROOT := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
11+
12+
# shellcheck and hadolint lack arm64 native binaries: rely on x86-64 emulation
13+
ifeq ($(LINT_OS),Darwin)
14+
ifeq ($(LINT_ARCH),arm64)
15+
LINT_ARCH=x86_64
16+
endif
17+
endif
18+
19+
LINTERS :=
20+
FIXERS :=
21+
22+
GOLANGCI_LINT_CONFIG := $(LINT_ROOT)/.golangci.yml
23+
GOLANGCI_LINT_VERSION ?= v1.43.0
24+
GOLANGCI_LINT_BIN := out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(LINT_ARCH)
25+
$(GOLANGCI_LINT_BIN):
26+
mkdir -p out/linters
27+
rm -rf out/linters/golangci-lint-*
28+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b out/linters $(GOLANGCI_LINT_VERSION)
29+
mv out/linters/golangci-lint $@
30+
31+
LINTERS += golangci-lint-lint
32+
golangci-lint-lint: $(GOLANGCI_LINT_BIN)
33+
$(GOLANGCI_LINT_BIN) run
34+
35+
FIXERS += golangci-lint-fix
36+
golangci-lint-fix: $(GOLANGCI_LINT_BIN)
37+
$(GOLANGCI_LINT_BIN) run --fix
38+
39+
.PHONY: _lint $(LINTERS)
40+
_lint: $(LINTERS)
41+
42+
.PHONY: fix $(FIXERS)
43+
fix: $(FIXERS)
44+
45+
# END: lint-install .

go.mod

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module github.com/tstromberg/ioc-bench
2+
3+
go 1.17
4+
5+
require (
6+
github.com/bobesa/go-domain-util v0.0.0-20190911083921-4033b5f7dd89 // indirect
7+
github.com/go-ini/ini v1.62.0 // indirect
8+
github.com/go-logr/logr v1.2.0 // indirect
9+
github.com/go-sqlite/sqlite3 v0.0.0-20180313105335-53dd8e640ee7 // indirect
10+
github.com/godbus/dbus v4.1.0+incompatible // indirect
11+
github.com/gonuts/binary v0.2.0 // indirect
12+
github.com/keybase/go-keychain v0.0.0-20200502122510-cda31fe0c86d // indirect
13+
github.com/likexian/doh-go v0.6.4 // indirect
14+
github.com/likexian/gokit v0.21.11 // indirect
15+
github.com/otiai10/copy v1.7.0 // indirect
16+
github.com/zalando/go-keyring v0.1.0 // indirect
17+
github.com/zellyn/kooky v0.0.0-20210408152652-87b89e95f98f // indirect
18+
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect
19+
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102 // indirect
20+
golang.org/x/sys v0.0.0-20201107080550-4d91cf3a1aaf // indirect
21+
golang.org/x/text v0.3.4 // indirect
22+
k8s.io/klog/v2 v2.40.1 // indirect
23+
)

go.sum

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
github.com/bobesa/go-domain-util v0.0.0-20190911083921-4033b5f7dd89 h1:2pkAuIM8OF1fy4ToFpMnI4oE+VeUNRbGrpSLKshK0oQ=
2+
github.com/bobesa/go-domain-util v0.0.0-20190911083921-4033b5f7dd89/go.mod h1:/09nEjna1UMoasyyQDhOrIn8hi2v2kiJglPWed1idck=
3+
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
4+
github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U=
5+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7+
github.com/go-ini/ini v1.62.0 h1:7VJT/ZXjzqSrvtraFp4ONq80hTcRQth1c9ZnQ3uNQvU=
8+
github.com/go-ini/ini v1.62.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
9+
github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE=
10+
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
11+
github.com/go-sqlite/sqlite3 v0.0.0-20180313105335-53dd8e640ee7 h1:ow5vK9Q/DSKkxbEIJHBST6g+buBDwdaDIyk1dGGwpQo=
12+
github.com/go-sqlite/sqlite3 v0.0.0-20180313105335-53dd8e640ee7/go.mod h1:JxSQ+SvsjFb+p8Y+bn+GhTkiMfKVGBD0fq43ms2xw04=
13+
github.com/godbus/dbus v4.1.0+incompatible h1:WqqLRTsQic3apZUK9qC5sGNfXthmPXzUZ7nQPrNITa4=
14+
github.com/godbus/dbus v4.1.0+incompatible/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw=
15+
github.com/gonuts/binary v0.2.0 h1:caITwMWAoQWlL0RNvv2lTU/AHqAJlVuu6nZmNgfbKW4=
16+
github.com/gonuts/binary v0.2.0/go.mod h1:kM+CtBrCGDSKdv8WXTuCUsw+loiy8f/QEI8YCCC0M/E=
17+
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
18+
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
19+
github.com/keybase/go-keychain v0.0.0-20200502122510-cda31fe0c86d h1:gVjhBCfVGl32RIBooOANzfw+0UqX8HU+yPlMv8vypcg=
20+
github.com/keybase/go-keychain v0.0.0-20200502122510-cda31fe0c86d/go.mod h1:W6EbaYmb4RldPn0N3gvVHjY1wmU59kbymhW9NATWhwY=
21+
github.com/keybase/go.dbus v0.0.0-20200324223359-a94be52c0b03/go.mod h1:a8clEhrrGV/d76/f9r2I41BwANMihfZYV9C223vaxqE=
22+
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
23+
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
24+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
25+
github.com/likexian/doh-go v0.6.4 h1:UnTrIVAOwkBvKU6qOt2W3C5yC9/YO02UVPPcN26iZDY=
26+
github.com/likexian/doh-go v0.6.4/go.mod h1:9jHpL/WPYmOM8+93RwXDf5TpZZwQjHrmIglXmjHpLlA=
27+
github.com/likexian/gokit v0.21.11 h1:tBA2U/5e9Pq24dsFuDZ2ykjsaSznjNnovOOK3ljU1ww=
28+
github.com/likexian/gokit v0.21.11/go.mod h1:0WlTw7IPdiMtrwu0t5zrLM7XXik27Ey6MhUJHio2fVo=
29+
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
30+
github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE=
31+
github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U=
32+
github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE=
33+
github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs=
34+
github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo=
35+
github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc=
36+
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
37+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
38+
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
39+
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
40+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
41+
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
42+
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
43+
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
44+
github.com/zalando/go-keyring v0.1.0 h1:ffq972Aoa4iHNzBlUHgK5Y+k8+r/8GvcGd80/OFZb/k=
45+
github.com/zalando/go-keyring v0.1.0/go.mod h1:RaxNwUITJaHVdQ0VC7pELPZ3tOWn13nr0gZMZEhpVU0=
46+
github.com/zellyn/kooky v0.0.0-20210408152652-87b89e95f98f h1:Oxzmfe0Xoum87EDOWZkTZKVkhDnArW8t1OQ3KnYT600=
47+
github.com/zellyn/kooky v0.0.0-20210408152652-87b89e95f98f/go.mod h1:QM4+3a3KkwFXtuTz+w41LBKU+MW7KecHBn0bNalcPKA=
48+
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
49+
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
50+
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
51+
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=
52+
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
53+
golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
54+
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
55+
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
56+
golang.org/x/net v0.0.0-20191116160921-f9c825593386 h1:ktbWvQrW08Txdxno1PiDpSxPXG6ndGsfnJjRRtkM0LQ=
57+
golang.org/x/net v0.0.0-20191116160921-f9c825593386/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
58+
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102 h1:42cLlJJdEh+ySyeUUbEQ5bsTiq8voBeTuweGVkY6Puw=
59+
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
60+
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
61+
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
62+
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
63+
golang.org/x/sys v0.0.0-20201107080550-4d91cf3a1aaf h1:kt3wY1Lu5MJAnKTfoMR52Cu4gwvna4VTzNOiT8tY73s=
64+
golang.org/x/sys v0.0.0-20201107080550-4d91cf3a1aaf/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
65+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
66+
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
67+
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
68+
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
69+
golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc=
70+
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
71+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
72+
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
73+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
74+
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
75+
gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
76+
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
77+
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
78+
k8s.io/klog/v2 v2.40.1 h1:P4RRucWk/lFOlDdkAr3mc7iWFkgKrZY9qZMAgek06S4=
79+
k8s.io/klog/v2 v2.40.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=

0 commit comments

Comments
 (0)