ubicloud/lib
Daniel Farina a37e5f3020 Fix private key format of SshKey generation
Previously, this program generated private SSH key blobs that worked
with net-ssh but not with openssh/libcrypto.

You can reproduce pre-patch like so:

    load 'lib/ssh_key.rb'
    File.write('/tmp/test.key', SshKey.generate.private_key, perm: 0600)
    system('ssh-add /tmp/test.key')

It'll write:

    Error loading key "/tmp/test.key": error in libcrypto

And after the patch, it writes:

    Identity added: /tmp/test.key (/tmp/test.key)

There were three deviations where net-ssh has more relaxed
requirements than openssh/libcrypto, all of which needed to be
addressed to load the generated key text with `ssh`:

1. The comment field in private keys is required.
2. Padding bytes must be set to values one through eight *in binary.*
3. The public key data must be encapsulated in another SSH bitstring,
   including the public key type before the payload.

Regarding the third point, the system maintains three representations
of each public key: one in the `public_key` column in ASCII, and two
within the openssh private key blob. The two copies in the private key
blob are mandated by the openssh format. The separate ASCII column
enables SQL-based auditing of non-sensitive public key copies without
requiring application-level decryption, making it easier to track
which keys are intended to be active at any time, by digesting them
and matching them with the same digests reported by OpenSSH in logs.
2025-07-14 18:14:37 -07:00
..
hosting Replace references of HetznerHost with HostProvider 2025-01-31 14:24:34 +01:00
kubernetes Create Services LB as part of Kubernetes Cluster creation 2025-06-27 15:12:38 +03:00
minio Add S3 integration to postgres timeline for backup/restore 2025-06-16 16:28:46 +02:00
validation Make unit optional for PG configs with units 2025-07-08 19:58:58 +05:30
victoria_metrics Use cert_store in VictoriaMetrics client 2025-06-02 21:11:45 +02:00
access_control_model_tag.rb Avoid explicitly casting string arrays used for = ANY/!= ALL 2025-04-30 06:05:53 +09:00
authorization.rb Avoid explicitly casting string arrays used for = ANY/!= ALL 2025-04-30 06:05:53 +09:00
billing_rate.rb Change rubocop TargetRubyVersion to 3.4 2025-04-26 06:51:19 +09:00
casting_config_helpers.rb Increase Config test coverage and delete unused lines 2023-08-07 01:05:05 +03:00
clog.rb Make clog.rb require sequel/model 2024-11-22 08:42:42 -08:00
cloudflare_client.rb Manage setup/destroy of the repository's blob storage. 2024-06-28 10:06:23 +03:00
clover_error.rb Move DependencyError into its own file 2024-12-31 11:25:47 -08:00
content_generator.rb Use Postgres family options in content generator 2025-07-01 00:24:58 +03:00
dependency_error.rb Move DependencyError into its own file 2024-12-31 11:25:47 -08:00
email_renderer.rb Make EmailRenderer a Roda app using the mailer plugin 2025-02-05 10:16:51 -08:00
free_quota.rb Change rubocop TargetRubyVersion to 3.4 2025-04-26 06:51:19 +09:00
github.rb Separate family and vCPUs in runner label configs 2025-06-11 14:43:10 +03:00
health_monitor_methods.rb Split ResourceMethods, SemaphoreMethods, and HealthMonitorMethods into separate files in lib 2024-12-31 11:25:47 -08:00
invoice_generator.rb Create billing info as needed for discount code 2025-05-09 11:26:34 -04:00
metrics.rb Show softirq usage in PostgreSQL metrics dashboard 2025-07-09 06:14:48 +03:00
metrics_target_methods.rb Use respective service project as metrics storage destination 2025-05-13 12:06:39 +05:30
metrics_target_resource.rb Use local VictoriaMetrics instance during development 2025-05-28 13:04:58 +05:30
monitorable_resource.rb Reduce logging for up resources 2024-06-07 10:36:23 +02:00
net_addr_sequel.rb Better NetAddr/Sequel integration 2025-06-12 07:32:57 +09:00
option.rb Add us-east-1 and us-east-2 2025-07-11 15:26:00 +02:00
option_tree_generator.rb Introduce OptionTreeGenerator 2024-12-09 06:30:01 +01:00
pagination.rb Have Pagination#paginated_result take serializer argument 2025-05-20 05:49:38 +09:00
resource_methods.rb Add ResourceMethods plugin encrypted_columns argument 2025-07-09 05:45:18 +09:00
runpod_client.rb Client for RunPod Rest API 2025-05-23 09:28:10 +02:00
sem_snap.rb Make Semaphore.incr use a single query 2025-06-04 05:26:37 +09:00
semaphore_methods.rb Convert SemaphoreMethods to Sequel plugin 2025-07-09 00:42:44 +09:00
ssh_key.rb Fix private key format of SshKey generation 2025-07-14 18:14:37 -07:00
system_parser.rb Change rubocop TargetRubyVersion to 3.4 2025-04-26 06:51:19 +09:00
thread_printer.rb Improve thread dump reporting 2025-01-25 15:44:27 -08:00
ubi_cli.rb Add CLI support for listing KubernetesClusters 2025-07-02 10:34:03 +02:00
util.rb Move tag_specifications to Util 2025-07-07 10:52:33 +03:00
validation.rb Clover: remove max_ios_per_sec. 2025-06-24 20:30:51 -07:00