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

48 commits

Author SHA1 Message Date
Sascha L. Teichmann
12ad7706e3 Rename opts to cfg 2023-07-20 01:16:05 +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
8032d47b50
Use Set type (#388)
* Use util.Set type.

* Caught another set usage.
2023-07-04 13:00:01 +02:00
JanHoefelmeyer
ed26e8e41d Add Tests for Requirements 4 and 5 2023-06-21 15:35:00 +02:00
Sascha L. Teichmann
71a3c3a13b Unify camel case spelling of message tracking. 2023-06-15 14:18:46 +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
Sascha L. Teichmann
8d45525e7f Made reporters 1-based to easy lookup. 2023-06-13 15:51:16 +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
JanHoefelmeyer
c3ef8e604c Give out warning instead of info if any of the provider-metadata.json lookups could not be performed. 2023-06-06 13:20:14 +02:00
Bernhard E. Reiter
cf49c7e414
Fix go.mod and internal dependencies (#371)
* Use a "/v2" in the module path to match the git version tag which
   lead with a 2. Change all mention of the module as dependency
   internally as well.
2023-06-05 10:24:35 +02:00
Sascha L. Teichmann
1dab0cc9ff Move code to more suited place. 2023-05-15 14:29:47 +02:00
Sascha L. Teichmann
9ac902347c Fix revive 2023-05-15 13:54:21 +02:00
JanHoefelmeyer
aeff511895 Add reporters for missing requirements and their respective report functions 2023-05-15 13:49:27 +02:00
Sascha L. Teichmann
c263391821
Be more verbose in case of signature check failures (#361)
* Simplify handling of signature keys. Be more verbose in case of signature check failures.

* Fixed check for having no OpenPGP loaded
2023-05-05 15:02:53 +02:00
JanHoefelmeyer
3590cf1ef2
Rephrase csaf validation result (#356)
* Rephrase csaf validation result

* Change Checker report depending on whether and how a remote validator was used.

* Formatting

* Improve code readability

---------

Co-authored-by: JanHoefelmeyer <hoefelmeyer.jan@gmail.com>
Co-authored-by: Sascha L. Teichmann <sascha.teichmann@intevation.de>
2023-03-30 19:09:51 +02:00
Sascha L. Teichmann
ffb29f5ba4 Replace 'confirming filename' with 'conforming filename' 2023-02-03 16:21:15 +01:00
Sascha L. Teichmann
e998133429 Update cmd/csaf_checker/reporters.go
Co-authored-by: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com>
2023-02-02 17:17:50 +01:00
Sascha L. Teichmann
7a5f8701bd Improve reported text a bit. 2023-02-02 17:17:50 +01:00
Sascha L. Teichmann
8425644886 Add new requirement sections 1 and 2 to report 2023-02-02 17:17:50 +01:00
JanHoefelmeyer
3bb8ea0019
Improve checker regarding PMD location problems
* Change checking to test for Security, wellknown and DNS requirement at once and only throws error if all three fail.
* Use security.txt parser from csaf/util to extract provider url.
* Improve code comments and messages for the reports.

Co-authored-by: Jan Höfelmeyer <Jan Höfelmeyer jhoefelmeyer@intevation.de>
Co-authored-by: Sascha L. Teichmann <sascha.teichmann@intevation.de>
Co-authored-by: Bernhard Reiter <bernhard@intevation.de>
2022-08-26 13:31:56 +02:00
JanHoefelmeyer
a84afa35cd
improve error message for requirement 9 (#243)
* Improve phrasing to be more clear about that the test
  was not performed if we had found not provider-metadata.json.
2022-07-21 12:48:48 +02:00
JanHoefelmeyer
c00b8b37bb
Trimmed redirects (#230)
* Changes phrasing of redirects to be clearer. Now omits redirects if they are already listed as part of a larger redirect chain

* Rebuilt how the redirection string is built. Now checks for duplicate redirections after all redirections have been read

* Fixes intendation error

* Fixed redirect output.

* Fixed recording redirects.

Co-authored-by: Jan Höfelmeyer <Jan Höfelmeyer jhoefelmeyer@intevation.de>
Co-authored-by: Sascha L. Teichmann <sascha.teichmann@intevation.de>
2022-07-15 07:39:06 +02:00
JanHoefelmeyer
73e216eccc
reporters.go update (#211)
* updates phrasing of error message if processor does not check security.txt due to an earlier error

* Fixes typo in error message

Co-authored-by: Jan Höfelmeyer <Jan Höfelmeyer jhoefelmeyer@intevation.de>
2022-07-11 12:30:24 +02:00
JanHoefelmeyer
640ef64df9
Changes phrasing of output from csaf_checker if security.txt was found (#196)
Co-authored-by: Jan Höfelmeyer <Jan Höfelmeyer jhoefelmeyer@intevation.de>
2022-06-23 11:07:02 +02:00
Sascha L. Teichmann
c09e5f66f3
Add type to checker messages
* Add a type to checker messages, so the results can be interpreted better.
   Especially the difference between warning and errors can be used.
2022-06-09 12:26:19 +02:00
Sascha L. Teichmann
d779a3fd7e
Merge pull request #135 from csaf-poc/link-checker
Link checker
2022-05-17 17:26:35 +02:00
Bernhard Reiter
2cfb4b8e49
Fix DNS path check
* Make it dynamic by the domain given for the check.
 * Change reporting text to be more clear about which is the dynamic
   part (in lack of direct access to the path which was checked.)
2022-05-17 15:34:39 +02:00
Sascha L. Teichmann
3bbd37c441 Implemented links on directory listings checking 2022-05-17 01:22:30 +02:00
Fadi Abbud
72e6df2987 Rename some variables 2022-05-04 15:39:22 +02:00
Fadi Abbud
a69d35ab3c Add code documentation 2022-05-04 15:31:26 +02:00
Fadi Abbud
ea9c6b4502 Implement more tests for checker
* Implement testing if the provider-metadata.json is under
/.well-known/csaf/ available.
* Implement testing if the DNS is available and serves the
provider-metadata.json
2022-05-04 15:23:03 +02:00
Sascha L. Teichmann
3df91fa051
Type messages of a checker topic to avoid code duplication 2022-04-22 12:02:21 +02:00
Bernhard Reiter
cbb41588ea
Fix minor typos in code comments 2022-04-21 15:40:56 +02:00
Fadi Abbud
9e2a9d7fad Code documentation and fix typo 2022-03-08 17:31:13 +01:00
Fadi Abbud
aa60e8f245 Add some code documentation 2022-03-04 16:04:21 +01:00
Sascha L. Teichmann
7841d78bb8 removed unnecessary assignments. 2022-03-03 12:21:16 +01:00
Bernhard Reiter
bfa5e787a2
Improve checker's reporting texts
* Remove minor typos.
 * Go upper case for HTTPS as this is more common.
 * Make texts indicating a good result start with somethink else
   than "No", this removes an indirection in thinking and also offers
   a visible difference.
 * Bump copyright year to 2022.
 * Do PGP to "public OpenPGP keys" while at the reporters.go file
   while at it (to make merging easier).
 * Use an explicit message to indicate that a check is not done because
   of a missing implementation.
2022-03-03 11:55:03 +01:00
Sascha L. Teichmann
9adab13948 Do not report success on checks which were not performed.
Second part of the Fix of issue #24.
2022-01-12 19:48:33 +01:00
Sascha L. Teichmann
da9bee4ff5 Implemented one folder per year requirement. 2021-12-16 15:17:38 +01:00
Sascha L. Teichmann
c334c0aa76 Fixed typo in spelling changes.csv. 2021-12-16 14:22:57 +01:00
Sascha L. Teichmann
deaf8a5722 Cross validate where CSAFs where found. 2021-12-16 02:59:33 +01:00
Sascha L. Teichmann
8e16650512 Implemented changes.csv check. 2021-12-16 01:17:23 +01:00
Sascha L. Teichmann
57f8f06257 Implemented index.txt check 2021-12-16 00:43:50 +01:00
Sascha L. Teichmann
30789e60d5 Call the checks again. 2021-12-15 21:22:38 +01:00
Sascha L. Teichmann
d201cda542 Renamed checks to reporters. 2021-12-15 20:18:49 +01:00
Renamed from cmd/csaf_checker/checks.go (Browse further)