From efce5c17bc7ccd25593d415796361417e02a88e3 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 25 May 2022 22:03:57 -0400 Subject: [PATCH 1/6] Update to setup-java version 3; transition from 'adopt' to 'temurin' The landing page for the setup-java action states the following: > NOTE: Adopt OpenJDK got moved to Eclipse Temurin and won't be updated > anymore. It is highly recommended to migrate workflows from adopt to > temurin to keep receiving software and security updates. See more > details in the Good-bye AdoptOpenJDK post. References: * https://github.com/actions/setup-java/#supported-distributions * https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/ Signed-off-by: Alex Nelson (cherry picked from commit 2b15709ff1713f64d3487d0c34078e4b63504f9b) (cherry picked from commit bb099dee3e9f8aabc87a2a4068e3dc7a9fda6338) --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 379d3575..f2d0fdd1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,9 +27,9 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/setup-java@v3 with: - distribution: 'adopt' + distribution: 'temurin' java-version: '8' - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 From 17a67a3f4fc3f26be5c2fe849384bd41e816437a Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 25 May 2022 22:06:06 -0400 Subject: [PATCH 2/6] Transition from Java 8 to 11 With the current version of `rdf-toolkit-action`, this is expected to cause a CI failure due to an `rdf-toolkit.jar` incompatibility. A release coming soon for `rdf-toolkit-action` will update the `.jar` file used. Signed-off-by: Alex Nelson (cherry picked from commit 282468fc828995f2109d27d5e03d78f371779c1e) (cherry picked from commit d3aa360a9f8b92b0c1c496250e426a4938ce7c75) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2d0fdd1..186338aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: '8' + java-version: '11' - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: From 917f2f7bc031e3bf1211344a94383293ffa76c43 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Wed, 1 Jun 2022 18:42:34 -0400 Subject: [PATCH 3/6] Update jar file references to retrieve rdf-toolkit 1.11.0 References: * https://github.com/ucoProject/UCO/issues/373 Signed-off-by: Alex Nelson (cherry picked from commit 844b59cafac6fac324bbc170ba5c54a4d8ba1e34) --- lib/Makefile | 4 ++-- lib/rdf-toolkit.jar.sha512 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index b65d1ff7..ed8b7ca8 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -35,10 +35,10 @@ rdf-toolkit.jar: # Try retrieval from Github, then from files.caseontology.org. wget \ --output-document $@_ \ - https://github.com/trypuz/openfibo/blob/1f9ab415e8ebd131eadcc9b0fc46241adeeb0384/etc/serialization/rdf-toolkit.jar?raw=true \ + https://jenkins.edmcouncil.org/view/rdf-toolkit/job/rdf-toolkit-build/lastSuccessfulBuild/artifact/target/rdf-toolkit.jar \ || wget \ --output-document $@_ \ - http://files.caseontology.org/rdf-toolkit.jar + https://files.caseontology.org/rdf-toolkit-1.11.0.jar test \ "x$$(openssl dgst -sha512 $@_ | awk '{print($$NF)}')" \ == \ diff --git a/lib/rdf-toolkit.jar.sha512 b/lib/rdf-toolkit.jar.sha512 index 4c4f5e0d..39fbb645 100644 --- a/lib/rdf-toolkit.jar.sha512 +++ b/lib/rdf-toolkit.jar.sha512 @@ -1 +1 @@ -24890b4aa484a46803841fbe5938daf60bf2d0889c0e231102c033d71cb84a2bfa8b44419df3ad896d833609afddd4b3910d2ce28660b3350cca22bea0770dad +8131e5515da63f099a89a3ce2c7587fb6b228f1ec7c5eb49ff35710509e8511921bfc847e182ee994e575b1f7895c04ae5bed7e1b7826bb32c9475b43b74dc17 From f19694c490bf799bdec30bef7a847f8d7acc0d04 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Sat, 28 May 2022 11:57:53 -0400 Subject: [PATCH 4/6] Normalize RDF lists in observable.ttl The version of rdf-toolkit run by the pre-commit hook now handles an RDF list differently than the prior version of rdf-toolkit. This commit is a mechanically-produced result. References: * https://github.com/ucoProject/UCO/issues/373 Signed-off-by: Alex Nelson (cherry picked from commit ab0aff871f772814131a59398e8a081204f7d666) (cherry picked from commit a77e4e9ad77b6d84a3245102eb4c8a4a0b1d41ac) --- ontology/observable/observable.ttl | 374 +++++++---------------------- 1 file changed, 86 insertions(+), 288 deletions(-) diff --git a/ontology/observable/observable.ttl b/ontology/observable/observable.ttl index 4a25d2eb..5c6b20e3 100644 --- a/ontology/observable/observable.ttl +++ b/ontology/observable/observable.ttl @@ -4474,39 +4474,16 @@ observable:NetworkSocketAddressFamily a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "af_appletalk" ; - rdf:rest [ - a rdf:List ; - rdf:first "af_bth" ; - rdf:rest [ - a rdf:List ; - rdf:first "af_inet" ; - rdf:rest [ - a rdf:List ; - rdf:first "af_inet6" ; - rdf:rest [ - a rdf:List ; - rdf:first "af_ipx" ; - rdf:rest [ - a rdf:List ; - rdf:first "af_irda" ; - rdf:rest [ - a rdf:List ; - rdf:first "af_netbios" ; - rdf:rest [ - a rdf:List ; - rdf:first "af_unspec" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; + owl:oneOf ( + "af_appletalk" + "af_bth" + "af_inet" + "af_inet6" + "af_ipx" + "af_irda" + "af_netbios" + "af_unspec" + ) ; ] ; . @@ -4514,107 +4491,33 @@ observable:NetworkSocketProtocolFamily a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "pf_appletalk" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_ash" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_atmpvc" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_atmsvc" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_ax25" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_bluetooth" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_bridge" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_decnet" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_econet" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_inet" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_inet6" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_ipx" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_irda" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_key" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_netbeui" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_netlink" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_netrom" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_packet" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_pppox" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_rose" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_route" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_security" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_sna" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_wanpipe" ; - rdf:rest [ - a rdf:List ; - rdf:first "pf_x25" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; + owl:oneOf ( + "pf_appletalk" + "pf_ash" + "pf_atmpvc" + "pf_atmsvc" + "pf_ax25" + "pf_bluetooth" + "pf_bridge" + "pf_decnet" + "pf_econet" + "pf_inet" + "pf_inet6" + "pf_ipx" + "pf_irda" + "pf_key" + "pf_netbeui" + "pf_netlink" + "pf_netrom" + "pf_packet" + "pf_pppox" + "pf_rose" + "pf_route" + "pf_security" + "pf_sna" + "pf_wanpipe" + "pf_x25" + ) ; ] ; . @@ -4622,27 +4525,13 @@ observable:NetworkSocketType a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "sock_dgram" ; - rdf:rest [ - a rdf:List ; - rdf:first "sock_raw" ; - rdf:rest [ - a rdf:List ; - rdf:first "sock_rdm" ; - rdf:rest [ - a rdf:List ; - rdf:first "sock_seqpacket" ; - rdf:rest [ - a rdf:List ; - rdf:first "sock_stream" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; - ] ; - ] ; + owl:oneOf ( + "sock_dgram" + "sock_raw" + "sock_rdm" + "sock_seqpacket" + "sock_stream" + ) ; ] ; . @@ -5365,59 +5254,21 @@ observable:RegistryDatatype a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "reg_binary" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_dword" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_dword_big_endian" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_expand_sz" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_full_resource_descriptor" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_invalid_type" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_link" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_multi_sz" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_none" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_qword" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_resource_list" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_resource_requirements_list" ; - rdf:rest [ - a rdf:List ; - rdf:first "reg_sz" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; + owl:oneOf ( + "reg_binary" + "reg_dword" + "reg_dword_big_endian" + "reg_expand_sz" + "reg_full_resource_descriptor" + "reg_invalid_type" + "reg_link" + "reg_multi_sz" + "reg_none" + "reg_qword" + "reg_resource_list" + "reg_resource_requirements_list" + "reg_sz" + ) ; ] ; . @@ -7378,19 +7229,11 @@ observable:WindowsPEBinaryType a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "dll" ; - rdf:rest [ - a rdf:List ; - rdf:first "exe" ; - rdf:rest [ - a rdf:List ; - rdf:first "sys" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; + owl:oneOf ( + "dll" + "exe" + "sys" + ) ; ] ; . @@ -7922,27 +7765,13 @@ observable:WindowsServiceStartType a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "service_auto_start" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_boot_start" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_demand_start" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_disabled" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_system_alert" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; - ] ; - ] ; + owl:oneOf ( + "service_auto_start" + "service_boot_start" + "service_demand_start" + "service_disabled" + "service_system_alert" + ) ; ] ; . @@ -7950,35 +7779,15 @@ observable:WindowsServiceStatus a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "service_continue_pending" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_pause_pending" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_paused" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_running" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_start_pending" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_stop_pending" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_stopped" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; - ] ; + owl:oneOf ( + "service_continue_pending" + "service_pause_pending" + "service_paused" + "service_running" + "service_start_pending" + "service_stop_pending" + "service_stopped" + ) ; ] ; . @@ -7986,23 +7795,12 @@ observable:WindowsServiceType a rdfs:Datatype ; owl:equivalentClass [ a rdfs:Datatype ; - owl:oneOf [ - a rdf:List ; - rdf:first "service_file_system_driver" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_kernel_driver" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_win32_own_process" ; - rdf:rest [ - a rdf:List ; - rdf:first "service_win32_share_process" ; - rdf:rest rdf:nil ; - ] ; - ] ; - ] ; - ] ; + owl:oneOf ( + "service_file_system_driver" + "service_kernel_driver" + "service_win32_own_process" + "service_win32_share_process" + ) ; ] ; . From e06efe3b45dc0d36bea87d16c160b307ca73ac08 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Thu, 2 Jun 2022 09:42:06 -0400 Subject: [PATCH 5/6] Retrieve file only from redistribution point This prevents a potential build failure scenario where rdf-toolkit issues a release and suddenly all CI pinned to 1.11.0's SHA-512 fails. References: * https://github.com/ucoProject/UCO/issues/373 Reported-by: Paul Brandt Signed-off-by: Alex Nelson (cherry picked from commit b6f1ce0deec5bb36ea3bd124d9fcdefa5a3132bc) --- lib/Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index ed8b7ca8..d42bde08 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -32,13 +32,10 @@ all: \ # content will be written there." rdf-toolkit.jar: test -r rdf-toolkit.jar.sha512 - # Try retrieval from Github, then from files.caseontology.org. + # Try retrieval from files.caseontology.org. wget \ --output-document $@_ \ - https://jenkins.edmcouncil.org/view/rdf-toolkit/job/rdf-toolkit-build/lastSuccessfulBuild/artifact/target/rdf-toolkit.jar \ - || wget \ - --output-document $@_ \ - https://files.caseontology.org/rdf-toolkit-1.11.0.jar + https://files.caseontology.org/rdf-toolkit-1.11.0.jar test \ "x$$(openssl dgst -sha512 $@_ | awk '{print($$NF)}')" \ == \ From 2fa9ad639fdc781129ecd9de1dd991a98449db31 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Thu, 2 Jun 2022 09:42:47 -0400 Subject: [PATCH 6/6] Reduce documentation of re-build cleanups References: * https://github.com/ucoProject/UCO/issues/373 Signed-off-by: Alex Nelson (cherry picked from commit e04a980856212e583b2d0efea702456bb0510d91) --- lib/Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index d42bde08..70a60eeb 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -26,12 +26,9 @@ all: \ # confirmed before moving file into position. (This practice will # probably require frequent updates, unless a signed checksum for the # jar can be retrieved somehow.) -# In case there are concerns on potentially multiple writes to the same -# file, the documentation for wget's "--output-document file" flag notes -# that "... file will be truncated immediately, and all downloaded -# content will be written there." rdf-toolkit.jar: test -r rdf-toolkit.jar.sha512 + rm -f $@_ # Try retrieval from files.caseontology.org. wget \ --output-document $@_ \