-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(contrib/fvuls) Add commands to obtained CPE information of network devices by executing snmp2cpe and upload to Fvuls server #1721
Conversation
…fix_scanner_version
contrib/future-vuls/pkg/cpe/cpe.go
Outdated
) | ||
|
||
type createPseudoServerInput struct { | ||
APIKey string `json:"api_key"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use camel case
contrib/future-vuls/pkg/cpe/cpe.go
Outdated
return cpeDetail.Server.ServerName, nil | ||
} | ||
|
||
func sentHTTPRequest(req *http.Request, token string, proxy string) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sendHTTPRequest
contrib/future-vuls/cmd/main.go
Outdated
fmt.Printf("%v", err) | ||
os.Exit(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for exiting without returning err?
contrib/future-vuls/cmd/main.go
Outdated
fmt.Printf("%v", err) | ||
os.Exit(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for exiting without returning err?
contrib/future-vuls/cmd/main.go
Outdated
fmt.Printf("%v", err) | ||
os.Exit(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for exiting without returning err?
refactor --------- Co-authored-by: 和田皓翔 <wadahiroka@192.168.0.6>
fix --------- Co-authored-by: Sadayuki Matsuno <sadayuki.matsuno@gmail.com> Co-authored-by: 和田皓翔 <wadahiroka@192.168.0.6>
What did you implement:
There are two commands.
future-vuls discover
- Explore hosts within the CIDR range using the ping command
- Exec snmp2cpe(#1625) to active hosts to obtain CPE
Commands running internally
snmp2cpe v2c {IPAddr} public | snmp2cpe convert
- Describe the information including CPE on the found hosts in a toml-formatted file.
Structure of toml-formatted file
- Default output file is discover_list.toml
- If the file already exists, append the newly found host to the toml-formatted file. Old files are renamed with a timestamp.
ex.) 20230912161058_discover_list.toml
future-vuls add-cpe
Upload CPE information on the specified(FvulsSync is true and UUID is obtained) hosts to Fvuls
- Create pseudo server to Fvuls to obtain uuid and upload CPE to Fvuls
- Default output file is discover_list.toml
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
discover_list.toml
Checklist:
You don't have to satisfy all of the following.
make fmt
make test
Is this ready for review?: YES
Reference