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

744 commits

Author SHA1 Message Date
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
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
9967bfffe6 Amend checker docs to explain why authorization for RED/AMBER advisories needs to be genuine 2023-06-22 13:46:16 +02:00
JanHoefelmeyer
18732f26ba Amend checker docs to explain why authorization for RED/AMBER advisories needs to be genuine 2023-06-22 13:45:34 +02:00
JanHoefelmeyer
7dc1a6530e add badProviderMetadata to rules 2023-06-22 13:27:48 +02:00
tschmidtb51
60760ee868
Merge pull request #378 from csaf-poc/fix-v2-version
Burn v2 version into binaries.
2023-06-22 00:42:03 +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
813c083198 Burn v2 version into binaries. 2023-06-20 12:52:49 +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
JanHoefelmeyer
d7fb52b735 check whether rolie service document contains all feeds 2023-06-14 14:37:09 +02:00
Sascha L. Teichmann
fd374b30b6 Load ROLIE service by library function. 2023-06-14 12:56:55 +02:00
JanHoefelmeyer
719ecaea76 Add Requirements 18-20 to rules.go 2023-06-14 10:16:31 +02:00
JanHoefelmeyer
87dbb5674b Add badROLIEservice to processor 2023-06-14 09:50:12 +02:00
JanHoefelmeyer
f4f3efb197 Add function to load ROLIE service document 2023-06-14 09:46:42 +02:00
JanHoefelmeyer
7139f4dfa9 correct typos 2023-06-14 09:04:29 +02:00
Sascha L. Teichmann
8d45525e7f Made reporters 1-based to easy lookup. 2023-06-13 15:51:16 +02:00
Sascha L. Teichmann
51035c0dc9 Add comment 2023-06-13 13:34:35 +02:00
Sascha L. Teichmann
7501c60bf4 Implement rule depending error check. 2023-06-13 13:28:01 +02:00
Sascha L. Teichmann
c7453a6448 Be more precise with conditional rules. 2023-06-13 12:25:19 +02:00
JanHoefelmeyer
7eae607810
Merge pull request #370 from csaf-poc/fix-pmd-crash
Fix pmd crash
2023-06-09 13:17:42 +02:00
Sascha L. Teichmann
55540a32e0
Simplified requirement 15 (#369)
* Add badROLIEfeed as Topic Message

* Use badROLIEfeed to guarantee existant TLP labels White, Green or unlabeled. (Test not implemented)

* syntax

* Formatting

* Add Tlp check, completion struct

* Add mismatch to completion, add function checkCompletion to fill mismatch and also give an error if invalid tlp levels have been used

* formatting

* Add function to remove incomplete csaf feeds from list of complete csaf feeds for a given tlp level

* Add checkSummary function that checks whether a given feed would qualify as summary feed between all currently checked feeds

* Add completed check of tlp levels

* Add checks for correct hashes and signatures in ROLIE feed

* formatting

* Add rolieFeedReporter functionality

* fix typo

* Add todo, add return values to functions

* Switch error, ... return value so error returns last

* Fix typo

* Remove hash/sig checks that don't work, improve ROLIE message

* Add handling for advisories without tlp level

* Formatting

* Clean up rolie checks.

* Started with simplifying rolie checking

* Every ROLIE with data should have a summary.

* Clean up ROLIE feed label checker.

* if no TLP level can be extracted, return Unlabeled, not WHITE

* Add handling of advisories whose tlp exists, but has no label

* Also check TLP Red for completeness

* Only remove advisory from remain when it has exactly the right tlp color.

* Fix import in new rolie feed checker.

* Update comment to reflect current functionality

* Accept advisory of lesser tlp color in feed as completing.

* Collect advisory labels from advisories.

* Clarify that if no summary feed was found, it may exist but be either not listed or not accessible.

* Do not clone advisory lookup before.

* Move rolie check code to respective file.

---------

Co-authored-by: JanHoefelmeyer <Jan Höfelmeyer jhoefelmeyer@intevation.de>
Co-authored-by: JanHoefelmeyer <hoefelmeyer.jan@gmail.com>
2023-06-08 18:16:56 +02:00