diff --git a/roles/ssh_hardening/meta/argument_specs.yml b/roles/ssh_hardening/meta/argument_specs.yml index ad95e387..d1d415a3 100644 --- a/roles/ssh_hardening/meta/argument_specs.yml +++ b/roles/ssh_hardening/meta/argument_specs.yml @@ -365,3 +365,6 @@ argument_specs: default: sandbox description: Specifies whether sshd separates privileges by creating an unprivileged child process to deal with incoming network traffic. + ssh_forward_agent: + default: 'no' + description: Enables the ssh forward agent for the Cli if set to 'yes' diff --git a/roles/ssh_hardening/templates/openssh.conf.j2 b/roles/ssh_hardening/templates/openssh.conf.j2 index e8c91145..170321ae 100644 --- a/roles/ssh_hardening/templates/openssh.conf.j2 +++ b/roles/ssh_hardening/templates/openssh.conf.j2 @@ -90,7 +90,9 @@ StrictHostKeyChecking ask {% endif %} # Disable agent forwarding, since local agent could be accessed through forwarded connection. -ForwardAgent no + +ForwardAgent {{ ((ssh_forward_agent) if ssh_forward_agent is defined else 'no')}} + # Disable X11 forwarding, since local X11 display could be accessed through forwarded connection. ForwardX11 no