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

Get a certificate signed for hostname (next phase of the GCE deployer) #901

Open
cliveb opened this issue Jan 19, 2017 · 19 comments
Open

Get a certificate signed for hostname (next phase of the GCE deployer) #901

cliveb opened this issue Jan 19, 2017 · 19 comments

Comments

@cliveb
Copy link

cliveb commented Jan 19, 2017

BWO user concerned security discussions with MPL:

"Next phase of the deployer, i.e. it will provide you with a hostname as well, so you'll get a certificate signed for that very hostname instead of one signed for localhost, as it does now. Actually, I don't see why we couldn't deploy that version of it now, at least behind an experimental flag. I'll try to get it done asap, and report back here."

Was: “Your connection is not private"
NET::ERR_CERT_AUTHORITY_INVALID

Now: "This site can’t provide a secure connection"
ERR_SSL_PROTOCOL_ERROR

Please see my Camlistore GCE for test

Search for experimental deployer code

@mpl
Copy link
Contributor

mpl commented Jan 19, 2017

The URL you're giving in the report above has an IP address, not a host name.

You need to go in your google cloud console for your project, to the page for your instance. There you should look for the "camlistore-hostname" variable in the custom metadata section.
The Camlistore instance running at this host name should have a valid HTTPS certificate.

@cliveb
Copy link
Author

cliveb commented Jan 19, 2017

I tried "camlistore-hostname" but not working. Has a different message:

This site can’t be reached

"Took too long to respond.
Try:
Checking the connection
Checking the proxy and the firewall
Running Connectivity Diagnostics
ERR_CONNECTION_TIMED_OUT"

--//--
"The Camlistore instance running at this host name should have a valid HTTPS certificate"

I don't see any sign of the HTTPS certificate. let me know if you need a screen shot via google docs to your gmail.

@mpl
Copy link
Contributor

mpl commented Jan 19, 2017

What's the IP address you see for your camlistore-server instance in the google cloud console?

I mean, in your first post you gave 104.154.23.135 , but our DNS says that 09a2499a.camlistore.net resolves to 104.197.84.88, so there's already some fishy discrepancy there.

@cliveb
Copy link
Author

cliveb commented Jan 19, 2017

VM instances: View serial port.

[25231.525301] accounts-from-metadata[3001]: INFO Did not grant admin access to clive_boulton. /etc/sudoers not found.
[25239.997081] locksmithd[1565]: [etcd.service etcd2.service] are inactive
[25239.997634] locksmithd[1565]: Unlocking old locks failed: [etcd.service etcd2.service] are inactive. Retrying in 5m0s.
[25364.084083] update_engine[917]: I0119 22:46:44.738595 917 prefs.cc:51] certificate-report-to-send-update not present in /var/lib/update_engine/prefs
[25364.084921] update_engine[917]: I0119 22:46:44.738667 917 prefs.cc:51] certificate-report-to-send-download not present in /var/lib/update_engine/prefs
[25364.085455] update_engine[917]: I0119 22:46:44.739190 917 omaha_request_params.cc:59] Current group set to stable
[25364.085853] update_engine[917]: I0119 22:46:44.739367 917 update_attempter.cc:483] Already updated boot flags. Skipping.
[25364.086601] update_engine[917]: I0119 22:46:44.739382 917 update_attempter.cc:626] Scheduling an action processor start.
[25364.086800] update_engine[917]: I0119 22:46:44.739411 917 action_processor.cc:36] ActionProcessor::StartProcessing: OmahaRequestAction
[25364.087102] update_engine[917]: I0119 22:46:44.741622 917 omaha_request_action.cc:245] Posting an Omaha request to https://public.update.core-os.net/v1/update/
[25364.087322] update_engine[917]: I0119 22:46:44.741648 917 omaha_request_action.cc:246] Request:
[25364.087557] update_engine[917]:
[25364.087811] update_engine[917]:
[25364.088249] update_engine[917]:
[25364.089329] update_engine[917]:
[25364.089564] update_engine[917]:
[25364.089827] update_engine[917]:
[25364.090042] update_engine[917]:
[25364.090233] update_engine[917]:
[25364.090399] update_engine[917]: I0119 22:46:44.741658 917 libcurl_http_fetcher.cc:48] Starting/Resuming transfer
[25364.090646] update_engine[917]: I0119 22:46:44.741770 917 libcurl_http_fetcher.cc:164] Setting up curl options for HTTPS
[25364.090862] update_engine[917]: I0119 22:46:44.744230 917 libcurl_http_fetcher.cc:427] Setting up timeout source: 1 seconds.
[25364.091320] locksmithd[1565]: LastCheckedTime=1484863015 Progress=0 CurrentOperation="UPDATE_STATUS_CHECKING_FOR_UPDATE" NewVersion=0.0.0 NewSize=0
[25364.232515] update_engine[917]: I0119 22:46:44.887931 917 libcurl_http_fetcher.cc:240] HTTP response code: 200
[25364.234875] update_engine[917]: I0119 22:46:44.890327 917 libcurl_http_fetcher.cc:297] Transfer completed (200), 267 bytes downloaded
[25364.235150] update_engine[917]: I0119 22:46:44.890619 917 omaha_request_action.cc:592] Omaha request response:
[25364.235430] update_engine[917]:
[25364.235591] update_engine[917]:
[25364.235730] update_engine[917]:
[25364.235867] update_engine[917]:
[25364.236049] update_engine[917]:
[25364.236250] update_engine[917]:
[25364.236529] update_engine[917]: I0119 22:46:44.891994 917 omaha_request_action.cc:386] No update.
[25364.236844] update_engine[917]: I0119 22:46:44.892313 917 action_processor.cc:82] ActionProcessor::ActionComplete: finished OmahaRequestAction, starting OmahaResponseHandlerAction
[25364.237070] update_engine[917]: I0119 22:46:44.892541 917 omaha_response_handler_action.cc:36] There are no updates. Aborting.
[25364.237269] update_engine[917]: I0119 22:46:44.892740 917 action_processor.cc:68] ActionProcessor::ActionComplete: OmahaResponseHandlerAction action failed. Aborting processing.
[25364.237457] update_engine[917]: I0119 22:46:44.892930 917 action_processor.cc:73] ActionProcessor::ActionComplete: finished last action of type OmahaResponseHandlerAction
[25364.238044] update_engine[917]: I0119 22:46:44.893112 917 update_attempter.cc:290] Processing Done.
[25364.238324] update_engine[917]: I0119 22:46:44.893137 917 update_attempter.cc:326] No update.
[25364.238526] update_engine[917]: I0119 22:46:44.893157 917 update_check_scheduler.cc:74] Next update check in 49m43s
[25364.238806] locksmithd[1565]: LastCheckedTime=1484866004 Progress=0 CurrentOperation="UPDATE_STATUS_IDLE" NewVersion=0.0.0 NewSize=0
[25531.558954] accounts-from-metadata[3014]: INFO Did not grant admin access to clive_boulton. /etc/sudoers not found.
[25540.004760] locksmithd[1565]: [etcd.service etcd2.service] are inactive
[25540.005372] locksmithd[1565]: Unlocking old locks failed: [etcd.service etcd2.service] are inactive. Retrying in 5m0s.
[25831.595066] accounts-from-metadata[3022]: INFO Did not grant admin access to clive_boulton. /etc/sudoers not found.
[25840.011079] locksmithd[1565]: [etcd.service etcd2.service] are inactive
[25840.011602] locksmithd[1565]: Unlocking old locks failed: [etcd.service etcd2.service] are inactive. Retrying in 5m0s.
[26131.629174] accounts-from-metadata[3029]: INFO Did not grant admin access to clive_boulton. /etc/sudoers not found.
[26140.019274] locksmithd[1565]: [etcd.service etcd2.service] are inactive
[26140.019865] locksmithd[1565]: Unlocking old locks failed: [etcd.service etcd2.service] are inactive. Retrying in 5m0s.
[26431.661205] accounts-from-metadata[3037]: INFO Did not grant admin access to clive_boulton. /etc/sudoers not found.
[26440.026493] locksmithd[1565]: [etcd.service etcd2.service] are inactive
[26440.027082] locksmithd[1565]: Unlocking old locks failed: [etcd.service etcd2.service] are inactive. Retrying in 5m0s.
[26574.623567] systemd[1]: Started OpenSSH per-connection server daemon (104.131.96.197:42031).
[26580.895257] sshd[3048]: Connection closed by 104.131.96.197 port 42031 [preauth]
[26731.693087] accounts-from-metadata[3045]: INFO Did not grant admin access to clive_boulton. /etc/sudoers not found.
[26740.034599] locksmithd[1565]: [etcd.service etcd2.service] are inactive
[26740.035173] locksmithd[1565]: Unlocking old locks failed: [etcd.service etcd2.service] are inactive. Retrying in 5m0s.

@cliveb
Copy link
Author

cliveb commented Jan 19, 2017

External IP
104.154.23.135 (ephemeral)

Internal IP
10.128.0.2

I cant explain 104.197.84.88 (is not shown in GC console)

@mpl
Copy link
Contributor

mpl commented Jan 19, 2017

ok, I don't know what's going on for you atm, but let's first check if at least your gpg key matches your hostname.

Go to the logs of your instance, which should be at

https://console.cloud.google.com/logs/viewer?project=YOURPROJECTID

if you scroll up a bit in the entries, to about the time your instance was created (although I think log times are in UTC, so you have to compensate for that), can you see the lines showing when camlistored started?

It should be something like:

2017/01/19 22:26:45 Starting camlistored version bb969d4; Go go1.8rc2 (linux/amd64)
23:26:46.089
2017/01/19 22:26:46 Re-using identity with keyID "09A2499A" found in file /gcs/YOURPROJECTID-camlistore/config/identity-secring.gpg
23:26:46.556
2017/01/19 22:26:46 TLS enabled, with Let's Encrypt for 09a2499a.camlistore.net

@cliveb
Copy link
Author

cliveb commented Jan 19, 2017 via email

@cliveb
Copy link
Author

cliveb commented Jan 20, 2017

My GCE Camlistore instance only has logs for the past 7 days (assume earlier logs have been purged by the GC system). Hence providing today's log for camlistore started not when my camlistore was created.

{
insertId: "1pbqztgg1g8nitu"
jsonPayload: {
user_agent: "Pantheon Google-API-Java-Client Google-HTTP-Java-Client/1.22.0-SNAPSHOT (gzip)"
ip_address: ""
request: {
url: "https://www.googleapis.com/compute/v1/projects/camli-2016/zones/us-central1-c/instances/camlistore-server/start?key=AIzaSyCgxnNGJFOtw9DF3eySks0uRxQ3SiQW2jA"
body: "null"
}
event_timestamp_us: "1484677348666373"
actor: {…}
resource: {
name: "camlistore-server"
type: "instance"
zone: "us-central1-c"
id: "31661401704746099"
}
trace_id: "operation-1484677348352-5464e61f46002-2984bcbe-2e658b3d"
event_type: "GCE_API_CALL"
operation: {
zone: "us-central1-c"
id: "6573401677323558411"
name: "operation-1484677348352-5464e61f46002-2984bcbe-2e658b3d"
type: "operation"
}
event_subtype: "compute.instances.start"
version: "1.2"
}
resource: {
type: "gce_instance"
labels: {
zone: "us-central1-c"
project_id: "camli-2016"
instance_id: "31661401704746099"
}
}
timestamp: "2017-01-17T18:22:28.666373Z"
severity: "INFO"
labels: {
compute.googleapis.com/resource_name: "camlistore-server"
compute.googleapis.com/resource_id: "31661401704746099"
compute.googleapis.com/resource_type: "instance"
compute.googleapis.com/resource_zone: "us-central1-c"
}
logName: "projects/camli-2016/logs/compute.googleapis.com%2Factivity_log"
}

13:22:28.418
{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","authenticationInfo":{"principalEmail":redacted@gmail.com"},"requestMetadata":{"callerIp":"10.158.10.36","callerSuppliedUserAgent":"Pantheon Google-API-Java-Client Google-HTTP-Java-Client/1.22.0-SNAPSHOT (gzip)"},"serviceName":"compute.googleapis.com","methodName":"v1.compute.instances.start","authorizationInfo":[{"permission":"compute.instances.start","granted":true}],"resourceName":"projects/camli-2016/zones/us-central1-c/instances/camlistore-server","response":{"id":"6573401677323558411","name":"operation-1484677348352-5464e61f46002-2984bcbe-2e658b3d","zone":"https://www.googleapis.com/compute/v1/projects/camli-2016/zones/us-central1-c","operationType":"start","targetLink":"https://www.googleapis.com/compute/v1/projects/camli-2016/zones/us-central1-c/instances/camlistore-server","targetId":"31661401704746099","status":"PENDING","user":"redacted@gmail.com","progress":"0","insertTime":"2017-01-17T10:22:28.527-08:00","selfLink":"https://www.googleapis.com/compute/v1/projects/camli-2016/zones/us-central1-c/operations/operation-1484677348352-5464e61f46002-2984bcbe-2e658b3d","@type":"compute.googleapis.com/operation"}}
{
protoPayload: {
@type: "type.googleapis.com/google.cloud.audit.AuditLog"
authenticationInfo: {
principalEmail: "redacted@gmail.com"
}
requestMetadata: {
callerIp: "10.158.10.36"
callerSuppliedUserAgent: "Pantheon Google-API-Java-Client Google-HTTP-Java-Client/1.22.0-SNAPSHOT (gzip)"
}
serviceName: "compute.googleapis.com"
methodName: "v1.compute.instances.start"
authorizationInfo: [1]
resourceName: "projects/camli-2016/zones/us-central1-c/instances/camlistore-server"
response: {
id: "6573401677323558411"
name: "operation-1484677348352-5464e61f46002-2984bcbe-2e658b3d"
zone: "https://www.googleapis.com/compute/v1/projects/camli-2016/zones/us-central1-c"
operationType: "start"
targetLink: "https://www.googleapis.com/compute/v1/projects/camli-2016/zones/us-central1-c/instances/camlistore-server"
targetId: "31661401704746099"
status: "PENDING"
user: "redacted@gmail.com"
progress: "0"
insertTime: "2017-01-17T10:22:28.527-08:00"
selfLink: "https://www.googleapis.com/compute/v1/projects/camli-2016/zones/us-central1-c/operations/operation-1484677348352-5464e61f46002-2984bcbe-2e658b3d"
@type: "compute.googleapis.com/operation"
}
}
insertId: "5464E61F9F999.A9E2B6C.DF0B39F8"
resource: {
type: "gce_instance"
labels: {
zone: "us-central1-c"
project_id: "camli-2016"
instance_id: "31661401704746099"
}
}
timestamp: "2017-01-17T18:22:28.418Z"
severity: "NOTICE"
logName: "projects/camli-2016/logs/cloudaudit.googleapis.com%2Factivity"
operation: {
id: "operation-1484677348352-5464e61f46002-2984bcbe-2e658b3d"
producer: "compute.googleapis.com"
first: true
}
}

@mpl
Copy link
Contributor

mpl commented Jan 20, 2017

those are GCE logs, not Camlistore logs. Sorry I should have specified. Looks like the interface changed again. In the selector below the filter bar that is on the top, the one on the left, you have to select "Global". At least, that is how it is on my interface now.

@cliveb
Copy link
Author

cliveb commented Jan 20, 2017 via email

@mpl
Copy link
Contributor

mpl commented Jan 20, 2017

ugh

@mpl
Copy link
Contributor

mpl commented Jan 20, 2017

Do you have the "gpg" command installed on your computer?

@cliveb
Copy link
Author

cliveb commented Jan 20, 2017 via email

@mpl
Copy link
Contributor

mpl commented Jan 20, 2017

Ok, I'll have to go soon, so here's something you can try out in the meantime if you manage to have access to a computer with gpg installed.

Go to your config bucket, at

https://console.cloud.google.com/storage/browser/PROJECTID-camlistore/config/?project=PROJECTID

And download your GPG key, which should be the file named identity-secring.gpg. Be super careful with tha t file. No one should ever get access to it except for you. So after we're done, remove it from the computer where you downloaded it if it's not totally secure.

Then, just run the gpg command on it:

$ gpg config%2Fidentity-secring.gpg

It should show something like that:

sec 2048R/1E966B1D 2017-01-03 (camlistore)
ssb 2048R/B6A1D103 2017-01-03

On the first line, for you we should see 09A2499A, as it's supposed to be your key id, according to the hostname (09a2499a.camlistore.net) that Camlistore obtained for you.

@cliveb
Copy link
Author

cliveb commented Jan 24, 2017

Keys seem to be locked down. Looks like requires installing GC Cloud SDK locally. (I needed to buy new machine, not use a Crouton Chromebook). I am work on getting a new Macbook set up.

@mpl
Copy link
Contributor

mpl commented Jan 25, 2017

Sorry, I don't understand?
You shouldn't need the cloud sdk for any of the above. You could use the sdk to fetch the keyring, but you don't need to, you can just do it with your browser, from the cloud console page I indicated above.

As for gpg, I'm not sure if you can do it on a chromebook, but you sure don't need the cloud sdk for that part. I don't know how chromebooks work and what can be done with them. But if you have a terminal and a way to install unix programs, then you should be able to do it.

@cliveb
Copy link
Author

cliveb commented Jan 25, 2017 via email

@mpl
Copy link
Contributor

mpl commented Jan 25, 2017

hmm I didn't actually say it before so, just to be sure, you did replace PROJECTID with your actual project ID, in that URL, didn't you?

Like, if your project ID is clive-gce, the URL would be:

https://console.cloud.google.com/storage/browser/clive-gce-camlistore/config/?project=clive-gce

If yes, and you don't see the keyring there, then it's pretty bad. It means camlistored didn't generate it for you, so it probably failed pretty early on startup.

@cliveb
Copy link
Author

cliveb commented Jan 25, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants