Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSS0200 and DSS0205 uss_qualifier checks to verify ASTM F3548-21 #508

Closed
mickmis opened this issue Feb 13, 2024 · 1 comment
Closed

DSS0200 and DSS0205 uss_qualifier checks to verify ASTM F3548-21 #508

mickmis opened this issue Feb 13, 2024 · 1 comment
Assignees
Labels
automated-testing Related to automated testing tools enhancement New feature or request P1 High priority

Comments

@mickmis
Copy link
Contributor

mickmis commented Feb 13, 2024

As part of #274, we should check DSS0200 and DSS0205.

DSS0205: Proposed approach

Require that the host and port of the DSS instance's CockroachDB is provided in the DSSInstanceSpecification.
Use those with the psycopg library to attempt to establish a connection to the DB, and validate that the connection attempts fails with the correct error message.
Relying on the error message is not great, but from my fiddling it looks like there is no specific error code that is returned. Given that those error messages originate from the underlying libpq, those should be relatively stable, but it's not impossible

Attempt unencrypted connection

Attempt connection with sslmode="disable", if the connection attempt does not fail with the error message node is running secure mode, SSL connection required the check fails.

Attempt encrypted connection with obsolete TLS version

Attempt connection with sslmode="require" and ssl_max_protocol_version="TLSv1.1", if the connection attempt does not fail with the error message invalid SSL protocol version range the check fails.

DSS0200

This is about authentication. It does seem more complicated to test, so suggestions are welcome.

@mickmis mickmis added enhancement New feature or request automated-testing Related to automated testing tools P1 High priority labels Feb 13, 2024
@mickmis mickmis self-assigned this Feb 13, 2024
@BenjaminPelletier
Copy link
Member

For both authentication (DSS0200) and encryption (DSS0205), I would expect the only likely way an InterUSS DSS implementation could fail to meet these requirements is if a CockroachDB node were in insecure mode. In insecure mode, neither authentication nor encryption are in place, so I would try to detect whether any nodes were in insecure mode and fail both of these requirements if any nodes were found to be in that mode. I believe attempting to connect with psychopg should be a good way to detect insecure mode, but if we use that approach, we should verify (once, manually) that connection is indeed possible to a node in insecure mode. Another possible way to detect insecure mode could be to use the cockroach binary, but I don't know that that has any advantages over psychopg connection attempts.

To perform any kind of operations on CRDB nodes, I think we'll need to make a new resource describing where to find the nodes to test. Note that this resource should be optional because some hypothetical system may use a non-InterUSS DSS which isn't backed by CockroachDB.

The other two means of verifying encryption (sslmode="disable" and attempting TLSv1.1) sound good as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automated-testing Related to automated testing tools enhancement New feature or request P1 High priority
Projects
Status: Done
Development

No branches or pull requests

2 participants