Commit graph

1054 commits

Author SHA1 Message Date
Dennis Potman
cf75263d1d Add a test that validates that a plain message is not read by a remote reader in case payload/submsg/rtps encryption or signing is enabled
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
9ba54c70e7 Don't accept plain payload in case payload encryption or payload signing is enabled in the security settings. And fixed a typo in writer not allowed message
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
6185a5ab2a Add a test to validate that a non-secure participant can connect with a secure participant that allows unauthenticated participants. The non-secure pp should only be able to read data for a topic that is not secured
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
2fc2cdc225 Enable matching local non-secure participants with remote secure participants that allow unauthenticated participants
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
155f8c059d Add read-write protection tests
Introduced a test that checks for the correct matching behavious for  combinations
of the read/write access control settings in the governance xml (enable read/write
access control in the topic rules) and in the permissions xml (the publish/subscribe
grants for a topic).

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
45adb6f0c7 Extend access-control tests with validate_local_permissions
Add validate_local_permissions to the set of access control plugin
hooks tests, and add discovery_protection_enabled as an additional
parameter for the access control hook tests.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
0348bb2741 Security liveliness protection tests
Add testing liveness protection to the existing discovery protection
test. The test checks if the P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER
is using the encode_decode_submessage function of the crypto plugin
to secure liveliness messages.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
231d820052 Add security encoding-mismatch test
A test that checks that the security handshake fails in case of non-matching
encoding settings in the governance xml. All combinations of values for
rtps, discovery and liveliness protection are checked. For meta-data and
payload encoding, this test checks that a reader and writer do not connect
in case of non-matching values.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
9f261423e3 Add tests for discovery protection
Adding a test that checks the effects of using different configuration settings
for discovery protection. This test set uses the cryptography wrapper to count
the number of invocations of the encode and decode functions during a session
and checks the counts with the expected values.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
fd27604a26 Add crypto token exchange test
Introduced a test that checks if all crypto tokens send by a node are
received correctly by the remote node. To support this test, the crypto
wrapper plugin is extended with a token_log mode, that stores all tokens
that are exchanged after the security handshake is finished.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
eboasson
82af49172d
Merge pull request #511 from eboasson/security
Merge master into security
2020-05-12 19:00:52 +02:00
Prasanna Bhat
9df768b0f3 Fix PR comments
Signed-off-by: Prasanna Bhat <prasanna.yoga@gmail.com>
2020-05-12 06:49:42 +05:30
Prasanna Bhat
8776c3213b Add README.md, which describes the usage of docker scripts
Signed-off-by: Prasanna Bhat <prasanna.yoga@gmail.com>
2020-05-12 06:49:34 +05:30
Prasanna Bhat
8fc3f4bc71 Add build scripts & docker scripts
Signed-off-by: Prasanna Bhat <prasanna.yoga@gmail.com>
2020-05-12 06:48:09 +05:30
Erik Boasson
364f1ce39c Bump version number to 0.7.0
Signed-off-by: Erik Boasson <eb@ilities.com>
2020-05-11 15:06:40 +02:00
Erik Boasson
2da100a3c7 Merge remote-tracking branch 'upstream/master' into security 2020-05-11 15:05:46 +02:00
Marcel Jordense
e1899df62d Fix incorrect type of include_optional_fields config parameter
Signed-off-by: Marcel Jordense <marcel.jordense@adlinktech.com>
2020-05-11 15:03:20 +02:00
Marcel Jordense
860f261dc6 Correct generation of the crypto key
Signed-off-by: Marcel Jordense <marcel.jordense@adlinktech.com>
2020-05-11 15:03:20 +02:00
Marcel Jordense
720c8f8fbf Correct security (de)serialization of QosProperty contained in c.data field of handshake token
Signed-off-by: Marcel Jordense <marcel.jordense@adlinktech.com>
2020-05-11 15:03:20 +02:00
Marcel Jordense
623a5c02bd Correct handshake tokens verification w.r.t. optional fields
Signed-off-by: Marcel Jordense <marcel.jordense@adlinktech.com>
2020-05-11 15:03:20 +02:00
Erik Boasson
96248d1e6d Bump version number in preparation for 0.6.0
Signed-off-by: Erik Boasson <eb@ilities.com>
2020-05-08 10:09:11 +02:00
Erik Boasson
3c1b14e6cb Fix paths in documentation generation
Signed-off-by: Erik Boasson <eb@ilities.com>
2020-05-08 10:09:11 +02:00
Erik Boasson
f8ed1f4adf Minor README updates
Signed-off-by: Erik Boasson <eb@ilities.com>
2020-05-08 10:09:11 +02:00
Jeroen Koekkoek
45a5030683
Add instructions for Android (#506)
* Add instructions for Android

Co-authored-by: eboasson <eb@ilities.com>
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2020-05-06 12:53:56 +02:00
Erik Boasson
209edf0efb Fix config typos in source and regenerate
Signed-off-by: Erik Boasson <eb@ilities.com>
2020-04-28 18:44:54 +02:00
Oliver Kellogg
1890322d4e Fix some typos in files:
README.md
docs/dev/{modules,logging,debugging}.md
docs/manual/{config,options,GettingStartedGuide/helloworld_indepth}.rst
src/idlc/src/org/eclipse/cyclonedds/compilers/IdlcCmdOptions.java

Signed-off-by: Oliver Kellogg <okellogg@users.sourceforge.net>
2020-04-28 18:44:54 +02:00
Dennis Potman
4ac06895f0 Fix format strings for handle_not_allowed calls and add format attribute check
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-22 17:41:27 +02:00
Dennis Potman
2aa0195d53 Log category for not-allowed message depends on topic discovery protection state
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-22 17:41:27 +02:00
Dennis Potman
b86e8ce0d3 Refactoring logic in q_omg_security_check_remote_reader_permissions
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-22 17:41:27 +02:00
Dennis Potman
7e6039763b Replace pp null check by assert in dds_create_writer and dds_create_reader, and rewrite logic in q_omg_security_check_remote_writer_permissions
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-22 17:41:27 +02:00
Dennis Potman
e8c349f96d Fix condition for setting identity subject in remote rights
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-22 17:41:27 +02:00
Dennis Potman
19bc6f33cc Access control tests
Add test cases for the join_access_control governance setting and for
the access control plugin check_create_ and check_remote_ hooks,
using a wrapper plugin that simulates failure for each of these,
to test the DDSI integration with the access control plugin.
This commit also contains fixes for:
- an assert on DDS_RETCODE_OK in dds_create_reader and
dds_create_writer that cased the application to terminate in case
creation of a reader or writer is not allowed by security
- do not match a proxy reader that has the 'relay_only' set to
true, which is currently unsupported

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-22 17:41:27 +02:00
Michael Dodson
004932817e align buffer chunks to sizeof(void*) instead of hard coding 8 bytes
Signed-off-by:  Michael Gary Dodson <md403@cam.ac.uk>
2020-04-21 12:59:06 +02:00
Erik Boasson
080514d45a Remove redundant check for endpoint GUID in SEDP
The conversion of incoming discovery data (in "parameter list" format)
check for the presence of the entity GUID parameter for the particular
type of endpoint and use it as the key field in subsequent processing.
If the parameter is absent, deserialisation fails and the handlers are
never called and the old check is therefore no longer necessary.

Signed-off-by: Erik Boasson <eb@ilities.com>
2020-04-21 09:12:22 +02:00
Erik Boasson
d22032c946 Restore SEDP tracing format
Signed-off-by: Erik Boasson <eb@ilities.com>
2020-04-21 09:12:22 +02:00
Dennis Potman
e8dfbabd0c Add locking when intializing remote key material
The initialization of remote participant's key material was not protected
by the remote_participant_crypto lock, which could result in using partially
initialized remote key material. This caused intermittent test failures
with assertions on key_size in crypto_cipher_decrypt_data. This commit fixes
this issue by adding locking for the remote key material.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 18:05:06 +02:00
Dennis Potman
c89f858b73 Fix memory leak that can occur when decoding rtps message with origin authentication being used
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Dennis Potman
680c2ebf8c Call delete_proxy_participant_by_guid with implicit flag set when revoking permission or identity
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Dennis Potman
dae562c602 Improve delays/timing in permissions_expiry_multiple test
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Dennis Potman
bfb48e6e58 Address issues from review: replaced proxypp_pp_unrelate by deleting the (proxy)participant and added a code comment with the rationale for this approach
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Dennis Potman
5e721c99e5 Change test timing and time-outs in access-control and authentication
expiry tests and add timestamps to test logging to get more stable
test results on Travis and enable analysing timeing issues.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Dennis Potman
e3056402fc Implement on_revoke_identity_cb
Impement the revoke identity callback in ddsi that is called when
the identity certificate of a participant expires. In case the
identity handle that expires is from a local participant, all
proxy pp connections will be dropped for this participant. In case
the identity that expires is from a remote participant, the
corresponding proxy participant is deleted.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Dennis Potman
736d0a027a Add access control tests for permissions expiry and move some reused test
functions to common utils file.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Dennis Potman
d53cdce8fe Access Control on_revoke_permissions implementation in DDSI
Implement handler for access control on_revoke_permissions. This callback
function disconnects and deletes all proxy participant that are using the
revoked permissions handle (in case of remote permissions expire) and
proxy participant that are connected with a participant for which the
permissions expire (local permissions expire).

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Dennis Potman
e6500b6528 Add domaingv pointer to security plugins, as a preparation for supporting the permissions_expiry callback (which needs the gv to enumerate participants.
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Dennis Potman
a6a9d1f7c1 Security core tests: new tests and refactoring
Refactoring security core tests and adding more tests:
- Dynamically generate ca and identity certificates in authentication tests, so that certificate expiry is tested.
Added writing/reading samples to these tests to ensure that nodes can (or cannot) communicate in a specific test case
- Secure communication tests: improved the validation of encryption in wrapper
- Added test for access control plugin settings
- Replaced the in-code test identities (and included ca private keys), added an additional identity

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Michael Dodson
b513eaac00 add freebsd support
Including FreeBSD in preprocessor conditionals for APPLE fixes issues with UDP make_socket, as described in issue #488.

Signed-off-by:  Michael Gary Dodson <md403@cam.ac.uk>
2020-04-16 09:06:08 +02:00
Marcel Jordense
534eac2a11 Remove temporarily stored crypto handles and tokens after entities are matched
Signed-off-by: Marcel Jordense <marcel.jordense@adlinktech.com>
2020-04-12 09:24:44 +02:00
Dan Rose
b46bd7ffff Document previously undocumented changes from 0.5.1
Signed-off-by: Dan Rose <dan@digilabs.io>
2020-04-10 16:57:24 +02:00
Dan Rose
40549783d9 Add changelog file from content in github releases
Signed-off-by: Dan Rose <dan@digilabs.io>
2020-04-10 16:57:24 +02:00