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

Configurable SSH cipher suite #913

Merged
merged 7 commits into from
Oct 21, 2017
Merged

Configurable SSH cipher suite #913

merged 7 commits into from
Oct 21, 2017

Conversation

spacetourist
Copy link
Contributor

As requested, merging change from Gogs.io

@lunny lunny added this to the 1.1.0 milestone Feb 12, 2017
@lunny lunny added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Feb 12, 2017
@lunny
Copy link
Member

lunny commented Feb 12, 2017

LGTM

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Feb 12, 2017
conf/app.ini Outdated
@@ -110,6 +110,8 @@ SSH_PORT = 22
SSH_LISTEN_PORT = %(SSH_PORT)s
; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
SSH_ROOT_PATH =
; Choose the ciphers to support for SSH connections
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make it clear that this only affects Built-In SSH-server

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

; For built-in SSH server only, choose the ciphers to support for SSH connections,
; for system SSH this setting has no effect

routers/init.go Outdated
ssh.Listen(setting.SSH.ListenHost, setting.SSH.ListenPort)
log.Info("SSH server started on %s:%v", setting.SSH.ListenHost, setting.SSH.ListenPort)
ssh.Listen(setting.SSH.ListenHost, setting.SSH.ListenPort, setting.SSH.ServerCiphers)
log.Info("SSH server started on %s:%v. Cipher list (%v)", setting.SSH.ListenHost, setting.SSH.ListenPort, setting.SSH.ServerCiphers)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ListenPort should use %d not %v

@bkcsoft
Copy link
Member

bkcsoft commented Feb 12, 2017

Not exactly happy about having configs that only affect the build-in server, but for this it's hard to do otherwise 🙁

routers/init.go Outdated
@@ -75,7 +75,7 @@ func GlobalInit() {
checkRunMode()

if setting.InstallLock && setting.SSH.StartBuiltinServer {
ssh.Listen(setting.SSH.ListenHost, setting.SSH.ListenPort)
log.Info("SSH server started on %s:%v", setting.SSH.ListenHost, setting.SSH.ListenPort)
ssh.Listen(setting.SSH.ListenHost, setting.SSH.ListenPort, setting.SSH.ServerCiphers)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use tabs for indentation

@aaronjwood
Copy link

Can I suggest that you prioritize AES-GCM above everything else? I think an authenticated encryption mode should be first on everyone's list.

It might be nice to prevent the use of the arcfour suites entirely. Since most modern chips have the AES-NI instruction set to accelerate AES operations most people would see better performance too.

@lunny
Copy link
Member

lunny commented Feb 14, 2017

@aaronjwood Yes. I think the default values should be security enough.

@lunny lunny added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Feb 24, 2017
@lunny
Copy link
Member

lunny commented Feb 24, 2017

It seems no response here, let's move it to v1.2

@lunny lunny modified the milestones: 1.2.0, 1.1.0 Feb 24, 2017
@evantbyrne
Copy link

evantbyrne commented Feb 25, 2017

According to the Go SSH documentation on ssh.Config,

// The allowed cipher algorithms. If unspecified then a sensible
// default is used.
Ciphers []string

So it might be best to leave that ini option undefined by default, unless this cipher set differs from the default Go one and there is a specific rationale for such.

@@ -618,6 +619,7 @@ please consider changing to GITEA_CUSTOM`)
}

SSH.RootPath = path.Join(homeDir, ".ssh")
SSH.ServerCiphers = sec.Key("SSH_SERVER_CIPHERS").Strings(",")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires a default value?

@strk
Copy link
Member

strk commented Mar 16, 2017

It's somewhat ironic that Gogs is ahead of the community fork made to speed things up...
How about reviewers are less picky unless they have time to fix things themselves ?
I'll start with my LGTM here

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 16, 2017
@lunny
Copy link
Member

lunny commented Mar 17, 2017

As @evantbyrne said, keep the default as Go did maybe a good choice. @spacetourist maybe you can change this?

@sapk
Copy link
Member

sapk commented Apr 27, 2017

Any news ?

@lunny
Copy link
Member

lunny commented Apr 27, 2017

If @evantbyrne no response. I think maintainers could do something.
I think this PR needs two fixes:

  1. add more comment as @cdslashetc said.
  2. change the default value as @evantbyrne said

@sapk
Copy link
Member

sapk commented Apr 27, 2017

  • fix indentation

@lunny lunny modified the milestones: 1.3.0, 1.2.0 Apr 28, 2017
@lafriks
Copy link
Member

lafriks commented Oct 18, 2017

@bkcsoft @ethantkoenig fixed

@codecov-io
Copy link

codecov-io commented Oct 18, 2017

Codecov Report

Merging #913 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #913   +/-   ##
=======================================
  Coverage   26.91%   26.91%           
=======================================
  Files          87       87           
  Lines       17286    17286           
=======================================
  Hits         4652     4652           
  Misses      11955    11955           
  Partials      679      679

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 985a395...3b66029. Read the comment docs.

@lafriks lafriks removed the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Oct 19, 2017
@lafriks
Copy link
Member

lafriks commented Oct 21, 2017

Make LG-TM work again

@lafriks lafriks merged commit 7131c7d into go-gitea:master Oct 21, 2017
@ncwgf
Copy link

ncwgf commented Oct 21, 2017

This patch will report below error using SSH to git fetch who is not from fresh install
because conf/app.ini missed config SSH_SERVER_CIPHERS
problem solved by manually copy the setting from this commit to conf/app.ini

git fetch gitea
FATAL ERROR: Couldn't agree a client-to-server cipher (available: )
fatal: Could not read from remote repository.

@lunny lunny mentioned this pull request Oct 22, 2017
@tgurr tgurr mentioned this pull request Jan 10, 2020
2 tasks
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.