Skip to content

Commit

Permalink
Update sshd lens for additional list (#806)
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-re-imprivata authored Mar 12, 2023
1 parent 9350256 commit bb9a701
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lenses/sshd.aug
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module Sshd =
let indent = del /[ \t]*/ " "

let key_re = /[A-Za-z0-9]+/
- /MACs|Match|AcceptEnv|Subsystem|Ciphers|((GSSAPI|)Kex|HostKey|CASignature)Algorithms|PubkeyAcceptedKeyTypes|(Allow|Deny)(Groups|Users)/i
- /MACs|Match|AcceptEnv|Subsystem|Ciphers|((GSSAPI|)Kex|HostKey|CASignature|PubkeyAccepted)Algorithms|PubkeyAcceptedKeyTypes|(Allow|Deny)(Groups|Users)/i

let comment = Util.comment
let comment_noindent = Util.comment_noindent
Expand Down Expand Up @@ -124,12 +124,14 @@ module Sshd =
let casignaturealgorithms = list /CASignatureAlgorithms/i "CASignatureAlgorithms"

let pubkeyacceptedkeytypes = list /PubkeyAcceptedKeyTypes/i "PubkeyAcceptedKeyTypes"

let pubkeyacceptedalgorithms = list /PubkeyAcceptedAlgorithms/i "PubkeyAcceptedAlgorithms"

let entry = accept_env | allow_groups | allow_users
| deny_groups | subsystem | deny_users
| macs | ciphers | kexalgorithms | hostkeyalgorithms
| gssapikexalgorithms | casignaturealgorithms
| pubkeyacceptedkeytypes | other_entry
| pubkeyacceptedkeytypes | pubkeyacceptedalgorithms | other_entry

let condition_entry =
let k = /[A-Za-z0-9]+/ in
Expand Down
9 changes: 8 additions & 1 deletion lenses/tests/test_sshd.aug
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,14 @@ Match Group \"Domain users\"

(* Test: Sshd.lns
Parse Ciphers, KexAlgorithms, HostKeyAlgorithms as lists (GH issue #69)
Parse GSSAPIKexAlgorithms, PubkeyAcceptedKeyTypes, CASignatureAlgorithms as lists (GH PR #721) *)
Parse GSSAPIKexAlgorithms, PubkeyAcceptedKeyTypes, CASignatureAlgorithms as lists (GH PR #721)
Parse PubkeyAcceptedAlgorithms as a list (GH issue #804) *)
test Sshd.lns get "Ciphers [email protected],[email protected],aes256-ctr,aes128-ctr
KexAlgorithms diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1
HostKeyAlgorithms [email protected],[email protected],ssh-ed25519,ssh-rsa
GSSAPIKexAlgorithms gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-
PubkeyAcceptedKeyTypes ecdsa-sha2-nistp256,[email protected],ecdsa-sha2-nistp384
PubkeyAcceptedAlgorithms ecdsa-sha2-nistp256,[email protected],ecdsa-sha2-nistp384
CASignatureAlgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521\n" =
{ "Ciphers"
{ "1" = "[email protected]" }
Expand Down Expand Up @@ -135,6 +137,11 @@ CASignatureAlgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp52
{ "2" = "[email protected]" }
{ "3" = "ecdsa-sha2-nistp384" }
}
{ "PubkeyAcceptedAlgorithms"
{ "1" = "ecdsa-sha2-nistp256" }
{ "2" = "[email protected]" }
{ "3" = "ecdsa-sha2-nistp384" }
}
{ "CASignatureAlgorithms"
{ "1" = "ecdsa-sha2-nistp256" }
{ "2" = "ecdsa-sha2-nistp384" }
Expand Down

0 comments on commit bb9a701

Please sign in to comment.