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

32 commits

Author SHA1 Message Date
JanHoefelmeyer
39a29e39f1 Change Licenses from MIT to Apache 2.0 2024-04-22 13:11:30 +02:00
Sascha L. Teichmann
7a8cdb6d19
Lift distribution from v2 to v3. (#467)
* v2 -> v3

* Increase version within Makefile

---------

Co-authored-by: JanHoefelmeyer <hoefelmeyer.jan@gmail.com>
2023-09-27 15:46:57 +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
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
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
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
d393a42d61 Formatting permission check 2023-06-21 16:21:23 +02:00
JanHoefelmeyer
ed26e8e41d Add Tests for Requirements 4 and 5 2023-06-21 15:35:00 +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
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
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
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
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
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