-
Notifications
You must be signed in to change notification settings - Fork 16
Feature/332 kms key auth #363
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
Open
thijshberg
wants to merge
39
commits into
development
Choose a base branch
from
feature/332-kms-key-auth
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
cd276df
Add Key Management Store to the SSH capability
thijshberg 710414a
Added example for the ssh KMS
thijshberg 1d4f04d
Added REST API for SSH key management
thijshberg 17c7372
Added key management unit tests
thijshberg 2fcaeae
Improve example deployment
thijshberg b769c8a
Added helper script for KMS example setup
thijshberg a5c2a7d
Updated linting errors
thijshberg 23ab281
Removed a public-private mixup
thijshberg dc1e841
Removed lint error
thijshberg 3feb02f
Fixed the logger level configuration
thijshberg 64e631a
Changed KMS to use database backend
thijshberg c052902
Updated ssh-kms deployment and added ci
thijshberg a05aac0
Updated ci build to properly fetch keys
thijshberg 8683e42
Smaller fixes from review
thijshberg ef7f712
Fixed name clash
thijshberg b0a72b1
More capitalization errors
thijshberg 62aa23e
Fixing lint errors
thijshberg 92008b0
Removed cached keys
thijshberg 6494b02
Revert "Fixed the logger level configuration"
MaartendeKruijf 07c3e8a
Reverted: In memory database changes
MaartendeKruijf cb99818
Moved to temporary package
MaartendeKruijf db8895c
Reverted Mongo changes
MaartendeKruijf 7bb61ce
renamed key management
MaartendeKruijf 1cdf219
Allowed any creation for collection in mongo anticipating refactor
MaartendeKruijf 108c9f7
Ad-Hoc collection creation
MaartendeKruijf 75acb49
Updated stray go.mod
MaartendeKruijf 80fd9bd
Refactored key management test
MaartendeKruijf b1d4a11
Refactored KMS test
MaartendeKruijf 2bb3924
Moved test-keys keymanagement to test/kms
MaartendeKruijf aede936
Initialisation cleanups
MaartendeKruijf 0ab2479
Updated docs api spec
MaartendeKruijf f8f09e7
Fixed a typo in the path
MaartendeKruijf 85aa98a
Fixed error if KMS is unset that SOARCA would crash
MaartendeKruijf d7aeaa5
Added the ENABLE_SSH_KMS flag into the logic
MaartendeKruijf 815f1de
Introduced KMS interfaces
MaartendeKruijf 1e30472
Changed ssh capability dependency to IKms
MaartendeKruijf a915709
Changed keymanagement api to IKeyManagementApi
MaartendeKruijf 2a869a5
Updated api description
MaartendeKruijf 85d62e4
Added info log to keymanagement
MaartendeKruijf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| FROM ubuntu:latest | ||
|
|
||
| RUN apt update && apt install openssh-server sudo -y | ||
|
|
||
| RUN sudo useradd -m sshtest | ||
|
|
||
| RUN ssh-keygen -q -N "" -f /test | ||
|
|
||
| RUN mkdir -p /home/sshtest/.ssh/ | ||
|
|
||
| RUN cat /test.pub > /home/sshtest/.ssh/authorized_keys | ||
|
|
||
| RUN echo "PasswordAuthentication no" >> /etc/ssh/sshd_config | ||
|
|
||
| RUN echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config | ||
|
|
||
| RUN sudo service ssh start | ||
|
|
||
| EXPOSE 22 | ||
|
|
||
| CMD ["sudo","/usr/sbin/sshd","-D"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| services: | ||
| ssh_kms_server: | ||
| container_name: ssh_kms_server | ||
| build: | ||
| dockerfile: Dockerfile | ||
| ports: | ||
| - 2223:22 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| { | ||
| "type": "playbook", | ||
| "spec_version": "cacao-2.0", | ||
| "id": "playbook--300270f9-0e64-42c8-93cc-0927edbe3ae7", | ||
| "name": "Example ssh", | ||
| "description": "This playbook demonstrates ssh functionality", | ||
| "playbook_types": [ | ||
| "notification" | ||
| ], | ||
| "created_by": "identity--96abab60-238a-44ff-8962-5806aa60cbce", | ||
| "created": "2023-11-20T15:56:00.123456Z", | ||
| "modified": "2023-11-20T15:56:00.123456Z", | ||
| "valid_from": "2023-11-20T15:56:00.123456Z", | ||
| "valid_until": "2123-11-20T15:56:00.123456Z", | ||
| "priority": 1, | ||
| "severity": 1, | ||
| "impact": 1, | ||
| "labels": [ | ||
| "soarca", | ||
| "ssh", | ||
| "example" | ||
| ], | ||
| "authentication_info_definitions": { | ||
| "user-auth--b7ddc2ea-9f6a-4e82-8eaa-be202e942090": { | ||
| "type": "user-auth", | ||
| "kms":true, | ||
| "kms_key_identifier": "test", | ||
| "username": "linuxserver.io" | ||
| } | ||
| }, | ||
| "agent_definitions": { | ||
| "soarca--00010001-1000-1000-a000-000100010001": { | ||
| "type": "soarca", | ||
| "name": "soarca-ssh" | ||
| } | ||
| }, | ||
| "target_definitions": { | ||
| "ssh--1c3900b4-f86b-430d-b415-12312b9e31f4": { | ||
| "type": "ssh", | ||
| "name": "system 1", | ||
| "address": { | ||
| "ipv4": [ | ||
| "127.0.0.1" | ||
| ] | ||
| }, | ||
| "port": "2223", | ||
| "authentication_info": "user-auth--b7ddc2ea-9f6a-4e82-8eaa-be202e942090" | ||
| } | ||
| }, | ||
| "external_references": [ | ||
| { | ||
| "name": "TNO COSSAS", | ||
| "description": "TNO COSSAS", | ||
| "source": "TNO COSSAS", | ||
| "url": "https://cossas-project.org" | ||
| } | ||
| ], | ||
| "workflow_start": "start--9e7d62b2-88ac-4656-94e1-dbd4413ba008", | ||
| "workflow_exception": "end--a6f0b81e-affb-4bca-b4f6-a2d5af908958", | ||
| "workflow": { | ||
| "start--9e7d62b2-88ac-4656-94e1-dbd4413ba008": { | ||
| "type": "start", | ||
| "name": "Start ssh example", | ||
| "on_completion": "action--eb9372d4-d524-49fc-bf24-be26ea084779" | ||
| }, | ||
| "action--eb9372d4-d524-49fc-bf24-be26ea084779": { | ||
| "type": "action", | ||
| "name": "Execute command", | ||
| "description": "Execute command specified in variable", | ||
| "on_completion": "action--88f4c4df-fa96-44e6-b310-1c06d193ea55", | ||
| "commands": [ | ||
| { | ||
| "type": "ssh", | ||
| "command": "__command__:value" | ||
| } | ||
| ], | ||
| "targets": [ | ||
| "ssh--1c3900b4-f86b-430d-b415-12312b9e31f4" | ||
| ], | ||
| "agent": "soarca--00010001-1000-1000-a000-000100010001", | ||
| "step_variables": { | ||
| "__command__": { | ||
| "type": "string", | ||
| "value": "ls -la", | ||
| "constant": true | ||
| } | ||
| } | ||
| }, | ||
| "action--88f4c4df-fa96-44e6-b310-1c06d193ea55": { | ||
| "type": "action", | ||
| "name": "Touch file", | ||
| "description": "Touch file at path specified by variable", | ||
| "on_completion": "end--a6f0b81e-affb-4bca-b4f6-a2d5af908958", | ||
| "commands": [ | ||
| { | ||
| "type": "ssh", | ||
| "command": "touch __path__:value" | ||
| } | ||
| ], | ||
| "targets": [ | ||
| "ssh--1c3900b4-f86b-430d-b415-12312b9e31f4" | ||
| ], | ||
| "agent": "soarca--00010001-1000-1000-a000-000100010001", | ||
| "step_variables": { | ||
| "__path__": { | ||
| "type": "string", | ||
| "value": "touchy", | ||
| "constant": true | ||
| } | ||
| } | ||
| }, | ||
| "end--a6f0b81e-affb-4bca-b4f6-a2d5af908958": { | ||
| "type": "end", | ||
| "name": "End Flow" | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.