]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Add new incidences docs, and missing dot and comma (related to #28)
authorpcarana <pc.moreno2099@gmail.com>
Thu, 26 Mar 2020 01:16:15 +0000 (19:16 -0600)
committerpcarana <pc.moreno2099@gmail.com>
Thu, 26 Mar 2020 01:16:15 +0000 (19:16 -0600)
docs/incidence.md
examples/config.json
man/fort.8
src/crypto/hash.c
src/incidence/incidence.c

index e086baf6b1daf636fbb80da1a346dc9a3d3f9753..16e8aaafc1a09d9064de620fe1cf76054ca3b7a4 100644 (file)
@@ -11,6 +11,8 @@ title: Incidence
 3. [Incidence types](#incidence-types)
        1. [Signed Object's hash algorithm has NULL object as parameters](#signed-objects-hash-algorithm-has-null-object-as-parameters)
        2. [Object isn't DER encoded](#object-isnt-der-encoded)
+       3. [File listed at manifest doesn't exist](#file-listed-at-manifest-doesnt-exist)
+       4. [File hash listed at manifest doesn't match the actual file hash](#file-hash-listed-at-manifest-doesnt-match-the-actual-file-hash)
 
 ## Introduction
 
@@ -43,7 +45,7 @@ Some incidences are `ignore`d by default, because they stem from bad practices (
 
 ## Incidence types
 
-Presently, there is only a pair of incidence types defined. This list might evolve further over time, depending on the state of the global RPKI and user demand.
+Presently, there are a few incidences defined. This list might evolve further over time, depending on the state of the global RPKI and user demand.
 
 ### Signed Object's hash algorithm has NULL object as parameters
 
@@ -107,3 +109,50 @@ If not `ignore`d, Fort will report this incidence with the following error messa
 ```
 <log level>: <offending file name>: '<object>' isn't DER encoded
 ```
+
+### File listed at manifest doesn't exist
+
+- **Name:** `incid-file-at_mft-not-found`
+- **Default action:** `error`
+
+[RFC 6486 section 6.1](https://tools.ietf.org/html/rfc6486#section-6.1) considers this scenario:
+
+```
+   2. {..} If there exist files at the publication point that do not appear
+      on any manifest, or files listed in a manifest that do not appear
+      at the publication point, then see Section 6.5, but still continue
+      with the following test.
+```
+
+If there's a missing file, it could be a publisher error or even an attack against the publication point (see [section 6.5](https://tools.ietf.org/html/rfc6486#section-6.5)).
+
+By default, Fort validator will handle this as an error, thus discarding the manifest file.
+
+When the incidence is not `ignore`d, Fort will report it with the following message:
+
+```
+<log level>: <manifest file name>: File '<file name>' listed at manifest doesn't exist.
+```
+
+### File hash listed at manifest doesn't match the actual file hash
+
+- **Name:** `incid-file-at-mft-hash-not-match`
+- **Default action:** `error`
+
+[RFC 6486 section 6.1](https://tools.ietf.org/html/rfc6486#section-6.1) considers this scenario:
+
+```
+   4. {..} If the computed hash value of a file listed on the manifest does
+      not match the hash value contained in the manifest, then see
+      Section 6.6.
+```
+
+It's up to a local policy to discard these files (and the rest of the manifest files) or trust in them (see [section 6.6](https://tools.ietf.org/html/rfc6486#section-6.6)).
+
+By default, Fort validator will discard such files and the manifest as well.
+
+When the incidence is not `ignore`d, Fort will report it with the following message:
+
+```
+<log level>: <manifest file name>: File '<file name>' does not match its manifest hash.
+```
index 75e275002690056fac82fb93548b0697ff60aa00..7de9eacf2ef65979fa580a061326bdfdb47db804 100644 (file)
     {
       "name": "incid-obj-not-der-encoded",
       "action": "ignore"
+    },
+    {
+      "name": "incid-file-at_mft-not-found",
+      "action": "error"
+    },
+    {
+      "name": "incid-file-at-mft-hash-not-match",
+      "action": "error"
     }
   ],
   "output": {
index 3b308636dc1f83ce81958479f6d35150dbda353c..f9d87ba01aefc426a6348dda506859b1683e6c1a 100644 (file)
@@ -155,14 +155,21 @@ nothing happened.
 happened.
 .RE
 .P
-By default, all the incidences have an action of \fIignore\fR. Currently there
-are two registered incidences:
+Currently these are the registered incidences, each with a distinct
+\fBaction\fR configured by default.
 .RS 4
 .br
 \fIincid-hashalg-has-params\fR (Signed Object's hash algorithm has NULL object
-as parameters).
+as parameters). [Default action: \fBignore\fR]
 .br
-\fIincid-obj-not-der-encoded\fR (Object isn't DER encoded).
+\fIincid-obj-not-der-encoded\fR (Object isn't DER encoded). [Default action:
+\fBignore\fR]
+.br
+\fIincid-file-at_mft-not-found\fR (File listed at manifest doesn't exist).
+[Default action: \fBerror\fR]
+.br
+\fIincid-file-at-mft-hash-not-match\fR (File hash listed at manifest doesn't
+match the actual file hash). [Default action: \fBerror\fR]
 .RE
 .P
 More information about incidences can be consulted at FORT's web docs.
index 6a8366b21cc82fcdb38bf0b6087f236929ddeb07..53ec81ed61dd8c76145c928bffd2e296b3f8f1da 100644 (file)
@@ -129,7 +129,7 @@ hash_validate_mft_file(char const *algorithm, struct rpki_uri *uri,
 
                if (error == EACCES || error == ENOENT) {
                        if (incidence(INID_MFT_FILE_NOT_FOUND,
-                           "File '%s' listed at manifest doesn't exist",
+                           "File '%s' listed at manifest doesn't exist.",
                            uri_get_printable(uri)))
                                return -EINVAL;
 
index b916395a7afd8be8aaa1165492006c9cd9d9a90a..fe71afa363042737c057447eb21e7eb0fbc7fa3c 100644 (file)
@@ -33,13 +33,13 @@ static struct incidence incidences[__INID_MAX] = {
                INID_MFT_FILE_NOT_FOUND,
                "incid-file-at_mft-not-found",
                "File listed at manifest doesn't exist",
-               INAC_ERROR
+               INAC_ERROR,
        },
        {
                INID_MFT_FILE_HASH_NOT_MATCH,
                "incid-file-at-mft-hash-not-match",
                "File hash listed at manifest doesn't match the actual file hash",
-               INAC_ERROR
+               INAC_ERROR,
        },
 };