1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Add user-agent documentation

This commit is contained in:
koplas 2024-07-31 11:00:40 +02:00
parent 0ab851a874
commit 3a67fb5210
No known key found for this signature in database
2 changed files with 20 additions and 6 deletions

View file

@ -30,9 +30,12 @@ Help Options:
Will check all given _domains_, by trying each as a CSAF provider. Will check all given _domains_, by trying each as a CSAF provider.
If no user agent is specified with `--header=user-agent:custom-agent/1.0` then the default agent in the form of `csaf-distribution/version` is sent.
If a _domain_ starts with `https://` it is instead considered a direct URL to the `provider-metadata.json` and checking proceeds from there. If a _domain_ starts with `https://` it is instead considered a direct URL to the `provider-metadata.json` and checking proceeds from there.
If no config file is explictly given the follwing places are searched for a config file: If no config file is explictly given the follwing places are searched for a config file:
``` ```
~/.config/csaf/checker.toml ~/.config/csaf/checker.toml
~/.csaf_checker.toml ~/.csaf_checker.toml
@ -41,6 +44,7 @@ csaf_checker.toml
with `~` expanding to `$HOME` on unixoid systems and `%HOMEPATH` on Windows systems. with `~` expanding to `$HOME` on unixoid systems and `%HOMEPATH` on Windows systems.
Supported options in config files: Supported options in config files:
``` ```
output = "" output = ""
format = "json" format = "json"
@ -61,6 +65,7 @@ Usage example:
`./csaf_checker example.com -f html --rate=5.3 -H apikey:SECRET -o check-results.html` `./csaf_checker example.com -f html --rate=5.3 -H apikey:SECRET -o check-results.html`
Each performed check has a return type of either 0,1 or 2: Each performed check has a return type of either 0,1 or 2:
``` ```
type 0: success type 0: success
type 1: warning type 1: warning
@ -73,13 +78,13 @@ The option `timerange` allows to only check advisories from a given time
interval. It can only be given once. See the interval. It can only be given once. See the
[downloader documentation](csaf_downloader.md#timerange-option) for details. [downloader documentation](csaf_downloader.md#timerange-option) for details.
You can ignore certain advisories while checking by specifying a list You can ignore certain advisories while checking by specifying a list
of regular expressions[^1] to match their URLs by using the `ignorepattern` of regular expressions[^1] to match their URLs by using the `ignorepattern`
option. option.
E.g. `-i='.*white.*' -i='*.red.*'` will ignore files which URLs contain E.g. `-i='.*white.*' -i='*.red.*'` will ignore files which URLs contain
the sub strings **white** or **red**. the sub strings **white** or **red**.
In the config file this has to be noted as: In the config file this has to be noted as:
``` ```
ignorepattern = [".*white.*", ".*red.*"] ignorepattern = [".*white.*", ".*red.*"]
``` ```
@ -88,7 +93,7 @@ ignorepattern = [".*white.*", ".*red.*"]
The `role` given in the `provider-metadata.json` is not The `role` given in the `provider-metadata.json` is not
yet considered to change the overall result, yet considered to change the overall result,
see https://github.com/csaf-poc/csaf_distribution/issues/221 . see <https://github.com/csaf-poc/csaf_distribution/issues/221> .
If a provider hosts one or more advisories with a TLP level of AMBER or RED, then these advisories must be access protected. If a provider hosts one or more advisories with a TLP level of AMBER or RED, then these advisories must be access protected.
To check these advisories, authorization can be given via custom headers or certificates. To check these advisories, authorization can be given via custom headers or certificates.

View file

@ -1,4 +1,5 @@
## csaf_downloader ## csaf_downloader
A tool to download CSAF documents from CSAF providers. A tool to download CSAF documents from CSAF providers.
### Usage ### Usage
@ -39,6 +40,8 @@ Help Options:
Will download all CSAF documents for the given _domains_, by trying each as a CSAF provider. Will download all CSAF documents for the given _domains_, by trying each as a CSAF provider.
If no user agent is specified with `--header=user-agent:custom-agent/1.0` then the default agent in the form of `csaf-distribution/version` is sent.
If a _domain_ starts with `https://` it is instead considered a direct URL to the `provider-metadata.json` and downloading procedes from there. If a _domain_ starts with `https://` it is instead considered a direct URL to the `provider-metadata.json` and downloading procedes from there.
Increasing the number of workers opens more connections to the web servers Increasing the number of workers opens more connections to the web servers
@ -47,6 +50,7 @@ However, since this also increases the load on the servers, their administrators
have taken countermeasures to limit this. have taken countermeasures to limit this.
If no config file is explictly given the follwing places are searched for a config file: If no config file is explictly given the follwing places are searched for a config file:
``` ```
~/.config/csaf/downloader.toml ~/.config/csaf/downloader.toml
~/.csaf_downloader.toml ~/.csaf_downloader.toml
@ -56,6 +60,7 @@ csaf_downloader.toml
with `~` expanding to `$HOME` on unixoid systems and `%HOMEPATH` on Windows systems. with `~` expanding to `$HOME` on unixoid systems and `%HOMEPATH` on Windows systems.
Supported options in config files: Supported options in config files:
``` ```
# directory # not set by default # directory # not set by default
insecure = false insecure = false
@ -90,6 +95,7 @@ option.
E.g. `-i='.*white.*' -i='*.red.*'` will ignore files which URLs contain E.g. `-i='.*white.*' -i='*.red.*'` will ignore files which URLs contain
the sub strings **white** or **red**. the sub strings **white** or **red**.
In the config file this has to be noted as: In the config file this has to be noted as:
``` ```
ignorepattern = [".*white.*", ".*red.*"] ignorepattern = [".*white.*", ".*red.*"]
``` ```
@ -106,6 +112,7 @@ into a given intervall. There are three possible notations:
and 'y' for years are recognized. In these cases only integer and 'y' for years are recognized. In these cases only integer
values are accepted without any fractions. values are accepted without any fractions.
Some examples: Some examples:
- `"3h"` means downloading the advisories that have changed in the last three hours. - `"3h"` means downloading the advisories that have changed in the last three hours.
- `"30m"` .. changed within the last thirty minutes. - `"30m"` .. changed within the last thirty minutes.
- `"3M2m"` .. changed within the last three months and two minutes. - `"3M2m"` .. changed within the last three months and two minutes.
@ -116,6 +123,7 @@ into a given intervall. There are three possible notations:
E.g. `"2006-01-02"` means that all files between 2006 January 2nd and now going to being E.g. `"2006-01-02"` means that all files between 2006 January 2nd and now going to being
downloaded. downloaded.
Accepted patterns are: Accepted patterns are:
- `"2006-01-02T15:04:05Z"` - `"2006-01-02T15:04:05Z"`
- `"2006-01-02T15:04:05+07:00"` - `"2006-01-02T15:04:05+07:00"`
- `"2006-01-02T15:04:05-07:00"` - `"2006-01-02T15:04:05-07:00"`
@ -134,6 +142,7 @@ into a given intervall. There are three possible notations:
All interval boundaries are inclusive. All interval boundaries are inclusive.
#### Forwarding #### Forwarding
The downloader is able to forward downloaded advisories and their checksums, The downloader is able to forward downloaded advisories and their checksums,
OpenPGP signatures and validation results to an HTTP endpoint. OpenPGP signatures and validation results to an HTTP endpoint.
The details of the implemented API are described [here](https://github.com/mfd2007/csaf_upload_interface). The details of the implemented API are described [here](https://github.com/mfd2007/csaf_upload_interface).