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

784 commits

Author SHA1 Message Date
Sascha L. Teichmann
d42db07bec
Fix version config and make aggreator use new command line parser. (#416)
* Fix version config and make aggreator use new command line parser.

* Replace old error check with check from the library.
2023-08-15 17:54:56 +02:00
JanHoefelmeyer
8aed2c034e
Merge pull request #414 from csaf-poc/checker-interval
Checker: Make time range configurable to check advisories from
2023-07-28 09:53:41 +02:00
JanHoefelmeyer
505693b3f0 Merge branch 'main' into checker-interval 2023-07-28 09:51:18 +02:00
JanHoefelmeyer
bb0df4cd55 Merge branch 'main' into checker-interval 2023-07-28 09:44:24 +02:00
JanHoefelmeyer
8a9dd6e842
Merge pull request #413 from csaf-poc/downloader-interval
Downloader: Make time range configurable to download advisories from
2023-07-28 09:43:49 +02:00
JanHoefelmeyer
2271c50ee7 Merge branch 'main' into downloader-interval 2023-07-28 09:38:13 +02:00
JanHoefelmeyer
690efbe075
Merge pull request #412 from csaf-poc/checker-cfg-toml
Add TOML config to checker
2023-07-28 08:19:23 +02:00
Sascha L. Teichmann
ac8d8a9196 Improve wording of docs a bit. 2023-07-26 13:46:13 +02:00
Sascha L. Teichmann
5e5074fbf1 Add time range to checker. 2023-07-26 13:34:15 +02:00
Sascha L. Teichmann
125028773f go-flag needs its own Unmarshaler. 2023-07-26 12:06:16 +02:00
Sascha L. Teichmann
1d892ff681 Fix docs. 2023-07-26 11:07:30 +02:00
Sascha L. Teichmann
eade9f7ae4 Fixed switched time.Parse args. 2023-07-26 10:52:20 +02:00
Sascha L. Teichmann
5e6fb8241c Prettifying docs 2023-07-26 04:28:42 +02:00
Sascha L. Teichmann
975e350510 Prettifying docs 2023-07-26 04:27:04 +02:00
Sascha L. Teichmann
1f301b6301 Prettifying docs 2023-07-26 04:25:45 +02:00
Sascha L. Teichmann
9e665a2fa1 Adjust docs 2023-07-26 04:18:54 +02:00
Sascha L. Teichmann
204ddb5a96 Use changes.csv instead of index.txt when using dir bases provider to make date filtering possible. 2023-07-26 03:56:05 +02:00
Sascha L. Teichmann
0ad4ed9e36 Expose logging as field in AdvisoryFileProcessor to shrink constructor signature. 2023-07-26 03:31:00 +02:00
Sascha L. Teichmann
f8c3741d12 Remove stray field in config. 2023-07-26 03:29:13 +02:00
Sascha L. Teichmann
de0599ebe3 Add time interval filtering to downloader. 2023-07-26 03:22:33 +02:00
Sascha L. Teichmann
0e297fc616 Add internal model for time ranges. 2023-07-26 02:22:45 +02:00
Sascha L. Teichmann
31a37a4daf Don't use default in command line args. 2023-07-25 11:59:11 +02:00
Sascha L. Teichmann
655b8f4db1 Be more rigid specifying format in config file. 2023-07-25 11:32:18 +02:00
Sascha L. Teichmann
1bdaf5854a Fallback to default config files if no config file was given. 2023-07-25 10:53:18 +02:00
Sascha L. Teichmann
9697e99d86 Improve comment 2023-07-25 00:17:44 +02:00
Sascha L. Teichmann
19433856ca Adjusted docs. 2023-07-24 23:42:21 +02:00
Sascha L. Teichmann
95bd705036 Factor command line parsing into an internal package for reuse. 2023-07-24 23:25:16 +02:00
Sascha L. Teichmann
27ec66353c Merge branch 'main' into checker-cfg-toml 2023-07-20 11:07:32 +02:00
Sascha L. Teichmann
81ead2776b
Use TOML as config file format in downloader (#405)
* Use TOML as config file format.

* Parse command line a second time if config file was loaded.

* Handle default values correctly.

* Use same names for config file options and command line options.
2023-07-20 11:05:20 +02:00
Sascha L. Teichmann
bfcf98464f Load config from TOML file 2023-07-20 01:33:58 +02:00
Sascha L. Teichmann
12ad7706e3 Rename opts to cfg 2023-07-20 01:16:05 +02:00
Sascha L. Teichmann
0d17db0c59 Move options to separate file. 2023-07-19 23:39:52 +02:00
Sascha L. Teichmann
8630e8bac2
Add support for config files in downloader. (#404)
* Add support for config files in downloader.

* Add no-ini for the version flag, too.

* Add config file options in doc to downloader.
2023-07-19 10:49:17 +02:00
JanHoefelmeyer
de27a668d1
Complete requirement 4 (ROLIE) (#391)
* Create dummy structure to uniquely identify each advisory

* Remove dummy values, remove unused variable for now

* Formatting

* Add Evaluation of whether a white Advisory is access protected and add it to the respective slice, implement functionality

* Initialize p.whiteAdvisories before using it, stop sorting if no Client was used

* Ammend rules to include requirement 4, warning instead of error if white advisory is found protected, use badWhitePermissions.use()

* Formatting

* Fix typo: avaible -> available

* Improve check on whether building identifier failed

* Move extracting of tlp labels and related functions from processor to roliecheck

* Create Labelchecker and check access of white advisories regardless of whether ROLIE feeds exist. Only check Ranks if ROLIE feeds are used

* Formatting

* Do not use label checker as a pointer.

* Rename label checker

* Add XXX to questionable code.

* Simplify checking white advisories.

* Improve error message if no checks for accessibility of white advisories were done

* Extract TLP label directly without extractTLP function, consistent plural in error message

* Add comments and check type assertion in tlp label extraction.

* Move check for white advisories to label checker.

* Improve methods naming an comments.

* Address a few review questions.

* Move functionality of checkProtection fully into evaluateTLP

* Add comments and warn only if we are in a white feed or in a dirlisting.

---------

Co-authored-by: JanHoefelmeyer <Jan Höfelmeyer jhoefelmeyer@intevation.de>
Co-authored-by: JanHoefelmeyer <hoefelmeyer.jan@gmail.com>
Co-authored-by: Sascha L. Teichmann <sascha.teichmann@intevation.de>
2023-07-13 22:22:11 +02:00
JanHoefelmeyer
f05bcd3642
Add info for Req 8-10 if direct url was given and as such no checks were performed. (#401)
* Add info for Req 8-10 if direct url was given and as such no checks were performed.

* Update cmd/csaf_checker/processor.go

Co-authored-by: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com>

* Break overly long lines

---------

Co-authored-by: JanHoefelmeyer <hoefelmeyer.jan@gmail.com>
Co-authored-by: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com>
2023-07-13 15:59:23 +02:00
JanHoefelmeyer
aeeb169111
Allow http redirects (#400)
* Fix HTTP Header redirects causing the checker to fail a domain

* Slightly clarify comment

* Formatting

---------

Co-authored-by: JanHoefelmeyer <hoefelmeyer.jan@gmail.com>
2023-07-07 14:02:58 +02:00
Sascha L. Teichmann
b423eed4e9
Dont use string comparison to rank labels. (#393) 2023-07-06 12:34:52 +02:00
JanHoefelmeyer
4d68662913
Merge pull request #390 from csaf-poc/fix_access_check
Check for advisoryLabel instead of feedlabel
2023-07-06 09:38:49 +02:00
Sascha L. Teichmann
fddc363344 Follow Go naming conventions for receivers. 2023-07-05 22:40:52 +02:00
Sascha L. Teichmann
a95ff9faf0 Fixed handling of unauthorited HTTP client, too. 2023-07-05 22:38:00 +02:00
JanHoefelmeyer
d8ad56956d Check for advisoryLabel instead of feedlabel 2023-07-05 13:32:53 +02:00
Sascha L. Teichmann
8032d47b50
Use Set type (#388)
* Use util.Set type.

* Caught another set usage.
2023-07-04 13:00:01 +02:00
Sascha L. Teichmann
be3dfcd542
Update third party libraries. (#389) 2023-07-04 12:59:29 +02:00
JanHoefelmeyer
f97891c283
Improve error message if filename does not match document/tracking/id and let it be reported by the proper reporter (#382)
* Improve error message if filename does not match document/tracking/id and let it be reported by the proper reporter

* style: remove unnecessary "\n"

* style: convert space to tab to calm linter

---------

Co-authored-by: JanHoefelmeyer <hoefelmeyer.jan@gmail.com>
Co-authored-by: JanHoefelmeyer <Jan Höfelmeyer jhoefelmeyer@intevation.de>
Co-authored-by: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com>
2023-06-30 23:36:54 +02:00
JanHoefelmeyer
b61912410a
Empty rolie (#357)
* Create ROLIE feed if summaries are empty

* Formatting, Remove sorting of 0 elements

* Handle minimum entry length error as warning in checker

* Use empty array instead of creating an empty array to reference

* Change schema to allow for empty entry arrays

* Use https://raw.githubusercontent.com/oasis-tcs/csaf/81b2663697958bc5f85d14372712a40028fb8338/csaf_2.0/json_schema/ROLIE_feed_json_schema.json as schema for ROLIE feeds

* Change label name from empty to undefined

* Change default of create_service_document for csaf_provider to true

* Config

* Count entries in csaf-checker, warn if there are none.

* Add Comments to csaf/rolie.go's CountEntries function

* Delete index.txt and changes.csv in aggregator if there are no entries.

* Create an empty ROLIE feed document when setting up folders during create

* nit: set update time stamp in structure init.

* Instantiate label checker only once.

* Ignore domain not having roles.

* provider: Create empty entry section in ROLIE feed.

* Stop check for domain if PMD check fails

* Add missing continue statement

* Report missing ROLIE feed entries in ROLIE feed, not Provider Metadata

* Do not ommit empty entries in ROLIE feeds.

* Fixed error handling problem introduced by faulty merge. Removed unused errStop handling while there.

---------

Co-authored-by: JanHoefelmeyer <hoefelmeyer.jan@gmail.com>
Co-authored-by: Sascha L. Teichmann <sascha.teichmann@intevation.de>
Co-authored-by: JanHoefelmeyer <Jan Höfelmeyer jhoefelmeyer@intevation.de>
2023-06-30 23:34:43 +02:00
JanHoefelmeyer
540d02d367
Merge pull request #373 from csaf-poc/role-requirements
Role requirements 11-14 or 15-17
2023-06-28 09:24:36 +02:00
JanHoefelmeyer
04c11d7922 formatting 2023-06-27 10:05:49 +02:00
JanHoefelmeyer
c1765e6967
Update cmd/csaf_checker/roliecheck.go
Fix typo in roliecheck.go comment

Co-authored-by: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com>
2023-06-27 09:59:15 +02:00
JanHoefelmeyer
569822486b
Update docs/csaf_checker.md
Fix wrong keyword in checker docs

Co-authored-by: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com>
2023-06-27 09:58:38 +02:00
Sascha L. Teichmann
65536f51a4 Break overly long lines. Use defined constants for TLP levels. 2023-06-23 11:40:09 +02:00