Documentation ¶
Overview ¶
Package datafeed provides NVD data feed synchronization for nvdsync.
Designed for https://nvd.nist.gov/vuln/data-feeds.
Copyright (c) Facebook, Inc. and its affiliates.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const Version = "1.0"
Version of nvdsync/datasync.
Variables ¶
var SupportedCPE = map[string]CPE{
"cpe-2.2.xml.gz": cpe22xmlGz,
"cpe-2.2.xml.zip": cpe22xmlZip,
"cpe-2.3.xml.gz": cpe23xmlGz,
"cpe-2.3.xml.zip": cpe23xmlZip,
}
SupportedCPE contains all supported CPE data feeds indexed by name.
var SupportedCVE = map[string]CVE{
"cve-1.2.xml.gz": cve12xmlGz,
"cve-1.2.xml.zip": cve12xmlZip,
"cve-2.0.xml.gz": cve20xmlGz,
"cve-2.0.xml.zip": cve20xmlZip,
"cve-1.0.json.gz": cve10jsonGz,
"cve-1.0.json.zip": cve10jsonZip,
"cve-1.1.json.gz": cve11jsonGz,
"cve-1.1.json.zip": cve11jsonZip,
}
SupportedCVE contains all supported CVE feeds indexed by name.
Functions ¶
func SetUserAgent ¶
SetUserAgent sets the value of User-Agent HTTP header for the client
Types ¶
type SourceConfig ¶
type SourceConfig struct { Scheme string `envconfig:"NVDSYNC_SCHEME" default:"https"` Host string `envconfig:"NVDSYNC_HOST" default:"nvd.nist.gov"` CVEFeedPath string `envconfig:"NVDSYNC_CVE_FEED_PATH" default:"/feeds/{{.Encoding}}/cve/{{.Version}}/"` CPEFeedPath string `envconfig:"NVDSYNC_CPE_FEED_PATH" default:"/feeds/xml/cpe/dictionary/"` }
SourceConfig is the configuration of the NVD data feed source.
func NewSourceConfig ¶
func NewSourceConfig() *SourceConfig
NewSourceConfig creates and initializes a new SourceConfig with values from envconfig.
func (*SourceConfig) AddFlags ¶
func (src *SourceConfig) AddFlags(fs *flag.FlagSet)
AddFlags adds SourceConfig flags to the given FlagSet.
type Sync ¶
type Sync struct { Feeds []Syncer Source *SourceConfig LocalDir string }
Sync provides full synchronization between remote and local data feeds.