@@ -137,12 +137,70 @@ All notable changes to this project will be documented in this file.
137137 FEATURE_UNSUPPORTED`. The config file names no project, zone or key: every value comes from
138138 an environment variable. Images are baked with ` make gce-image ` ; the one-time cloud setup is
139139 printed by ` scripts/remote/gce-setup.sh --print ` . Not built yet: copying an agent into a VM
140- (` agent_install ` behaves as ` never ` ) and any firewall mode but ` static ` . See the [ Remote
140+ (` agent_install ` behaves as ` never ` ). See the [ Remote
141141 Backend reference] ( https://charliek.github.io/shed/reference/remote-backend/ ) .
142+ - ** Remote backend: the server checks its cloud firewall.** It reads the environment's rule
143+ (` shed-<env>-ssh ` ) and the network's other ingress rules at start-up, once a minute, and
144+ before a create or start. While the rule is missing, altered, admits the wrong sources, or
145+ another rule reaches the sheds, ` shed create ` and ` shed start ` answer the new
146+ ` 503 FIREWALL_CHECK_FAILED ` with what was expected and what was found; stop, delete, list and
147+ exec are unaffected and nothing is stopped or deleted. ` remote.firewall.mode: static ` now
148+ needs its expected sources: ` source_ranges ` , or ` source_ranges_env ` naming a variable
149+ (default ` SHED_REMOTE_SOURCE_RANGES ` ) so the config file holds no address. ** A remote server
150+ upgraded to this version does not start until one of them is set.** ` mode: auto ` is built:
151+ the server learns its public address from two agreeing ` echo_urls ` services and patches the
152+ rule's sources to that ` /32 ` , under two extra roles that
153+ ` gce-setup.sh --print --firewall-auto ` prints. Each ` echo_urls ` entry must be on a different
154+ host. A static source range in private space needs ` acknowledge_any: true ` , a network or
155+ subnet in another project (a Shared VPC) is refused, and a create or start that reaches the
156+ cloud while the check fails is not sent: the shed is left in ` error ` or ` stopped ` with the new
157+ reason ` firewall ` .
158+ - ** Remote backend: stricter config, and an abandoned create is destroyed.** An unknown key
159+ anywhere under ` remote: ` now stops the load (a misspelt limit or firewall setting used to
160+ fall back to its default). A static source range in ` 198.18.0.0/15 ` or ` 192.0.0.0/24 ` needs
161+ ` acknowledge_any: true ` , auto mode never believes an address in those ranges or in
162+ ` 240.0.0.0/4 ` , and an ` echo_urls ` host name outside ASCII must be written in its punycode
163+ form. A VM still labelled ` creating ` 15 minutes after the cloud made it, with no record on
164+ the server (a lost ` state_dir ` , or a server that died mid-create), is destroyed by the
165+ start-up and periodic passes; before, it ran to its run limit and its disk stayed. Every
166+ shed VM is made with ` enable-oslogin=FALSE ` . A streamed create refused by the firewall check
167+ inside its job ends with ` 503 FIREWALL_CHECK_FAILED ` , not a 500, and a service client's
168+ ` FIREWALL_CHECK_FAILED ` message no longer names the rule, its source ranges or the server's
169+ address.
170+ - ** Logs: URL credentials with shell punctuation are redacted.** A password holding a
171+ backslash, quote, backtick, brace, pipe, caret or angle bracket (` pa\$word ` in a raw SSH
172+ command) ended the scan early and reached the server, agent and audit logs whole; so did a
173+ URL whose scheme the shell glues on (` "https":// ` ). Both are redacted now. In text with no
174+ white space, an ` @ ` after a path-less URL's closing quote is hidden with it. A create whose
175+ ` repo ` URL does not parse gets a ` 400 INVALID_REPO_URL ` that repeats none of the URL (the
176+ parser's error used to quote it, password included).
177+ - ** Remote backend: a failed read of the cloud never destroys or stops a VM.** A create or start
178+ resumed after a server restart reads its VM first. When that read failed, the create was
179+ failed and its VM queued for destruction (a finished shed included, if the restart came
180+ between the create's last two writes), and a start was failed and its running VM stopped. Such
181+ a shed now stays ` starting ` with the new reason ` cloud_unreadable ` , nothing is changed, and
182+ the periodic pass looks again; a delete ends it at any time. A resumed create also leaves a VM
183+ whose labels are another shed version's untouched, where it used to connect, clone and
184+ provision before it noticed, and a start that finds such labels is kept the same way, where it
185+ used to record the shed ` stopped ` while its VM might be running. A delete whose marker was
186+ written but could not be flushed to disk is acknowledged and carried out; it used to answer
187+ 500 and destroy the VM two minutes later all the same. A streamed delete whose destroy failed
188+ is no longer reported as done when the server cannot read its delete markers; it ends in an
189+ error. A create or start that needs a new firewall check waits 10 s at most, the wait for a
190+ check already in progress included, and gives up at once when its client has gone.
191+ - ** Logs: three more ways a URL's credentials could reach a log are closed.** The second of
192+ two URLs with no white space between them (` ["https://u:p@one","https://v:q@two"] ` , as a
193+ JSON-encoded argv is written) kept its user and password in the exec log line and the audit
194+ record. Clone or hook output that stopped inside a URL, before its ` @ ` , was logged as it
195+ stood; the server log now shows ` scheme://REDACTED ` for a URL still open where a stream
196+ ends, host included. And one 16 MiB write with no space or line break was copied whole
197+ before it was dropped; the redacting writer now holds 128 KiB at most.
142198- ** Development: a remote-backend dev server and suite parameter.**
143199 ` make dev-server-up-remote ` (and ` -down- ` , ` -restart- ` , ` -status- ` , ` -logs-remote ` ) runs the
144200 dev build with ` default_backend: remote ` beside an installed server, reading the cloud
145- settings from a private env file. The integration suite gains an opt-in ` remote ` parameter
201+ settings from a private env file. The env file also picks the firewall mode
202+ (` SHED_REMOTE_FIREWALL_MODE=auto ` with ` SHED_REMOTE_ECHO_URLS ` ; static otherwise). The
203+ integration suite gains an opt-in ` remote ` parameter
146204 (` SHED_REMOTE_SERVER ` ; ` make test-integration-remote ` , manual only, since every shed is a
147205 billed VM). See [ Remote Backend
148206 Development] ( https://charliek.github.io/shed/development/remote-backend/ ) .
0 commit comments