Skip to content

Commit ff85d01

Browse files
authored
Merge pull request #41 from osspkg/dev
refactoring
2 parents 42e55ce + a94a31e commit ff85d01

38 files changed

+500
-333
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
go: [ '1.17', '1.18', '1.19' ]
14+
go: [ '1.23.6' ]
1515
steps:
1616
- uses: actions/checkout@v3
1717

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

.github/workflows/codeql.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.gitignore

100644100755
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1+
.tools/
2+
bin/
3+
vendor/
4+
build/
5+
.idea/
6+
.vscode/
7+
coverage.txt
8+
coverage.out
19
*.exe
10+
*.exe~
211
*.dll
312
*.so
413
*.dylib
14+
*.db
15+
*.db-journal
16+
*.mmdb
517
*.test
618
*.out
7-
*.lock
8-
*.log
9-
.DS_Store
10-
.glide
11-
.idea
12-
.vscode
13-
.tools
14-
vendor/
15-
build/
19+
.env

.golangci.yml

Lines changed: 176 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,68 @@
1+
12
run:
2-
concurrency: 1
3-
deadline: 2m
3+
go: "1.23"
4+
concurrency: 4
5+
timeout: 5m
6+
tests: false
47
issues-exit-code: 1
5-
tests: true
6-
skip-files:
7-
- easyjson
8+
modules-download-mode: readonly
89

910
issues:
1011
exclude-use-default: false
12+
max-issues-per-linter: 100
13+
max-same-issues: 4
14+
new: false
15+
exclude-files:
16+
- ".+_test.go"
17+
exclude-dirs:
18+
- "vendor$"
1119

1220
output:
13-
format: colored-line-number
14-
print-issued-lines: true
15-
print-linter-name: true
21+
formats:
22+
- format: line-number
23+
sort-results: true
1624

1725
linters-settings:
1826
govet:
1927
check-shadowing: true
20-
golint:
21-
min-confidence: 0.8
28+
enable:
29+
- asmdecl
30+
- assign
31+
- atomic
32+
- atomicalign
33+
- bools
34+
- buildtag
35+
- cgocall
36+
- composites
37+
- copylocks
38+
- deepequalerrors
39+
- errorsas
40+
- findcall
41+
- framepointer
42+
- httpresponse
43+
- ifaceassert
44+
- loopclosure
45+
- lostcancel
46+
- nilfunc
47+
- nilness
48+
- printf
49+
- reflectvaluecompare
50+
- shadow
51+
- shift
52+
- sigchanyzer
53+
- sortslice
54+
- stdmethods
55+
- stringintconv
56+
- structtag
57+
- testinggoroutine
58+
- tests
59+
- unmarshal
60+
- unreachable
61+
- unsafeptr
62+
- unusedresult
63+
- unusedwrite
64+
disable:
65+
- fieldalignment
2266
gofmt:
2367
simplify: true
2468
errcheck:
@@ -28,24 +72,140 @@ linters-settings:
2872
min-complexity: 30
2973
misspell:
3074
locale: US
31-
gosimple:
32-
go: "1.16"
33-
checks: ["all"]
3475
prealloc:
3576
simple: true
3677
range-loops: true
37-
for-loops: false
78+
for-loops: true
79+
unparam:
80+
check-exported: false
81+
gci:
82+
skip-generated: true
83+
custom-order: false
84+
gosec:
85+
includes:
86+
- G101 # Look for hard coded credentials
87+
- G102 # Bind to all interfaces
88+
- G103 # Audit the use of unsafe block
89+
- G104 # Audit errors not checked
90+
- G106 # Audit the use of ssh.InsecureIgnoreHostKey
91+
- G107 # Url provided to HTTP request as taint input
92+
- G108 # Profiling endpoint automatically exposed on /debug/pprof
93+
- G109 # Potential Integer overflow made by strconv.Atoi result conversion to int16/32
94+
- G110 # Potential DoS vulnerability via decompression bomb
95+
- G111 # Potential directory traversal
96+
- G112 # Potential slowloris attack
97+
- G113 # Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772)
98+
- G114 # Use of net/http serve function that has no support for setting timeouts
99+
- G201 # SQL query construction using format string
100+
- G202 # SQL query construction using string concatenation
101+
- G203 # Use of unescaped data in HTML templates
102+
- G204 # Audit use of command execution
103+
- G301 # Poor file permissions used when creating a directory
104+
- G302 # Poor file permissions used with chmod
105+
- G303 # Creating tempfile using a predictable path
106+
- G304 # File path provided as taint input
107+
- G305 # File traversal when extracting zip/tar archive
108+
- G306 # Poor file permissions used when writing to a new file
109+
- G307 # Deferring a method which returns an error
110+
- G401 # Detect the usage of DES, RC4, MD5 or SHA1
111+
- G402 # Look for bad TLS connection settings
112+
- G403 # Ensure minimum RSA key length of 2048 bits
113+
- G404 # Insecure random number source (rand)
114+
- G501 # Import blocklist: crypto/md5
115+
- G502 # Import blocklist: crypto/des
116+
- G503 # Import blocklist: crypto/rc4
117+
- G504 # Import blocklist: net/http/cgi
118+
- G505 # Import blocklist: crypto/sha1
119+
- G601 # Implicit memory aliasing of items from a range statement
120+
excludes:
121+
- G101 # Look for hard coded credentials
122+
- G102 # Bind to all interfaces
123+
- G103 # Audit the use of unsafe block
124+
- G104 # Audit errors not checked
125+
- G106 # Audit the use of ssh.InsecureIgnoreHostKey
126+
- G107 # Url provided to HTTP request as taint input
127+
- G108 # Profiling endpoint automatically exposed on /debug/pprof
128+
- G109 # Potential Integer overflow made by strconv.Atoi result conversion to int16/32
129+
- G110 # Potential DoS vulnerability via decompression bomb
130+
- G111 # Potential directory traversal
131+
- G112 # Potential slowloris attack
132+
- G113 # Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772)
133+
- G114 # Use of net/http serve function that has no support for setting timeouts
134+
- G201 # SQL query construction using format string
135+
- G202 # SQL query construction using string concatenation
136+
- G203 # Use of unescaped data in HTML templates
137+
- G204 # Audit use of command execution
138+
- G301 # Poor file permissions used when creating a directory
139+
- G302 # Poor file permissions used with chmod
140+
- G303 # Creating tempfile using a predictable path
141+
- G304 # File path provided as taint input
142+
- G305 # File traversal when extracting zip/tar archive
143+
- G306 # Poor file permissions used when writing to a new file
144+
- G307 # Deferring a method which returns an error
145+
- G401 # Detect the usage of DES, RC4, MD5 or SHA1
146+
- G402 # Look for bad TLS connection settings
147+
- G403 # Ensure minimum RSA key length of 2048 bits
148+
- G404 # Insecure random number source (rand)
149+
- G501 # Import blocklist: crypto/md5
150+
- G502 # Import blocklist: crypto/des
151+
- G503 # Import blocklist: crypto/rc4
152+
- G504 # Import blocklist: net/http/cgi
153+
- G505 # Import blocklist: crypto/sha1
154+
- G601 # Implicit memory aliasing of items from a range statement
155+
exclude-generated: true
156+
severity: medium
157+
confidence: medium
158+
concurrency: 12
159+
config:
160+
global:
161+
nosec: true
162+
"#nosec": "#my-custom-nosec"
163+
show-ignored: true
164+
audit: true
165+
G101:
166+
pattern: "(?i)passwd|pass|password|pwd|secret|token|pw|apiKey|bearer|cred"
167+
ignore_entropy: false
168+
entropy_threshold: "80.0"
169+
per_char_threshold: "3.0"
170+
truncate: "32"
171+
G104:
172+
fmt:
173+
- Fscanf
174+
G111:
175+
pattern: "http\\.Dir\\(\"\\/\"\\)|http\\.Dir\\('\\/'\\)"
176+
G301: "0750"
177+
G302: "0600"
178+
G306: "0600"
179+
180+
lll:
181+
line-length: 130
182+
tab-width: 1
183+
staticcheck:
184+
go: "1.15"
185+
# SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
186+
# Default: ["*"]
187+
checks: [ "*", "-SA1019" ]
38188

39189
linters:
40190
disable-all: true
41191
enable:
42192
- govet
43193
- gofmt
44-
# - errcheck
194+
- errcheck
45195
- misspell
46196
- gocyclo
47197
- ineffassign
48198
- goimports
49-
- gosimple
199+
- nakedret
200+
- unparam
201+
- unused
50202
- prealloc
203+
- durationcheck
204+
- staticcheck
205+
- makezero
206+
- nilerr
207+
- errorlint
208+
- bodyclose
209+
- gosec
210+
- lll
51211
fast: false

0 commit comments

Comments
 (0)