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

233 commits

Author SHA1 Message Date
Sascha L. Teichmann
dd1e38fc0c Merge branch 'main' into checker-timerange-report 2023-08-16 17:47:27 +02:00
Sascha L. Teichmann
7bab18fc41
Checker: ignore advisories by given patterns
* Ignore advisories in checker.
---------

Co-authored-by: JanHoefelmeyer <hoefelmeyer.jan@gmail.com>
2023-08-16 17:22:19 +02:00
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
Sascha L. Teichmann
873eb4879b Add time range to checker report. 2023-08-02 20:01:04 +02:00
Sascha L. Teichmann
98bf2990ae Ignore advisories in checker. 2023-08-01 21:38:55 +02:00
Sascha L. Teichmann
1d9969162f Fix version config and make aggreator use new command line parser. 2023-07-30 22:37:32 +02:00
Sascha L. Teichmann
5e5074fbf1 Add time range to checker. 2023-07-26 13:34:15 +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
95bd705036 Factor command line parsing into an internal package for reuse. 2023-07-24 23:25:16 +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
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
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
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
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
Sascha L. Teichmann
65536f51a4 Break overly long lines. Use defined constants for TLP levels. 2023-06-23 11:40:09 +02:00
JanHoefelmeyer
a02d9c36a7 Add check for should-be-access-protected advisories for not-authorized client. 2023-06-23 11:03:22 +02:00
JanHoefelmeyer
55f6a48db1 Remove solved TODO 2023-06-22 14:48:34 +02:00
Sascha L. Teichmann
daa4a6bf7a Add TODO for fulfilling requierement 4 2023-06-22 14:46:06 +02:00
Sascha L. Teichmann
594e6b4b0d Try to minimize redundant downloads. 2023-06-22 14:28:45 +02:00
JanHoefelmeyer
7dc1a6530e add badProviderMetadata to rules 2023-06-22 13:27:48 +02:00
JanHoefelmeyer
d393a42d61 Formatting permission check 2023-06-21 16:21:23 +02:00
JanHoefelmeyer
248e0a52a4 Enable Req 5 in rules.go 2023-06-21 15:38:40 +02:00
JanHoefelmeyer
ed26e8e41d Add Tests for Requirements 4 and 5 2023-06-21 15:35:00 +02:00
Sascha L. Teichmann
20bf16bd4f Add stubs for missing rule checks of providers. 2023-06-19 17:49:35 +02:00
Sascha L. Teichmann
421a05d421 Ignore domain not having roles. 2023-06-19 13:49:31 +02:00
JanHoefelmeyer
d5589a018d Change roliecheck.go: Now check whether no summary label exist, instead of incorrectly checking whether one exists 2023-06-16 17:15:39 +02:00
Sascha L. Teichmann
2ec8be4e8c Instantiate label checker only once. 2023-06-16 15:11:07 +02:00
JanHoefelmeyer
8d269ce106 No longer require optional distribution section in advisory to extract TLP label 2023-06-16 14:10:54 +02:00
JanHoefelmeyer
5614939562 Add offending file to error message for Requirements 16/17 2023-06-15 14:55:20 +02:00
Sascha L. Teichmann
a9dcfc26f3 Break some overly long lines. 2023-06-15 14:45:30 +02:00
Sascha L. Teichmann
c6d0e9a9e2 Utilize new set type more. 2023-06-15 14:35:51 +02:00
Sascha L. Teichmann
71a3c3a13b Unify camel case spelling of message tracking. 2023-06-15 14:18:46 +02:00
Sascha L. Teichmann
b5d1924d3f Resolve TODOs concerning rule checking. 2023-06-15 14:16:07 +02:00
Sascha L. Teichmann
3e5137dd2f Add missing error check. 2023-06-15 13:56:10 +02:00
Sascha L. Teichmann
172c1cd85c Factored out set checks 2023-06-15 13:50:11 +02:00
JanHoefelmeyer
f74c5123c2 Add comments to categoryCheck and serviceCheck, add evaluation of category document contents 2023-06-15 11:47:26 +02:00
JanHoefelmeyer
d91af558ce Add ROLIE category document check for existence 2023-06-15 11:05:37 +02:00
JanHoefelmeyer
051de5194d implement rolieServiceReporter 2023-06-14 15:27:59 +02:00
JanHoefelmeyer
380ccfdf5a Add fetch of service category document from pmd url 2023-06-14 15:18:48 +02:00