future-architect / vuls

Agent-less vulnerability scanner for Linux, FreeBSD, Container, WordPress, Programming language libraries, Network devices
https://vuls.io/
GNU General Public License v3.0
10.8k stars 1.16k forks source link

refactor(report/s3): remove deprecated method for s3 endpoint #1967

Closed MaineK00n closed 3 weeks ago

MaineK00n commented 3 weeks ago

What did you implement:

The method currently used to configure S3 endpoints is deprecated. https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/config#WithEndpointResolverWithOptions

Refer to the following to set up the S3 BaseEndpoint. https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/endpoints/

Type of change

How Has This Been Tested?

setup

$ docker run --rm --name minio -p 9000:9000 -p 9001:9001 quay.io/minio/minio server /data --console-address ":9001"
$ docker exec -it minio bash
bash-5.1# mc config host add local http://localhost:9000 minioadmin minioadmin
bash-5.1# mc mb local/vuls
bash-5.1# mc anonymous set public local/vuls

run

$ cat config.toml
[aws]
s3Endpoint = "http://localhost:9000"
region = "us-east-1"
credentialProvider = "anonymous"
s3Bucket = "vuls"
s3UsePathStyle = true

$ vuls report --to-s3

$ docker exec -it minio bash
bash-5.1# mc ls local/vuls/2024-06-12T18:36:18+09:00/
[2024-06-17 09:25:32 UTC]   226B STANDARD pseudo_short.txt

Checklist:

You don't have to satisfy all of the following.

Is this ready for review?: YES

Reference