[build_templates] [hostcfgd] Keep containers hostname up to date#2924
Conversation
| {%- endif %} | ||
| --tmpfs /tmp \ | ||
| --tmpfs /var/tmp \ | ||
| --hostname $HOSTNAME \ |
There was a problem hiding this comment.
$HOSTNAME [](start = 19, length = 9)
Possible input injection #Closed
There was a problem hiding this comment.
Still possible. For example:
sonichost"; rm -rf /; echo "
In reply to: 286279985 [](ancestors = 286279985)
There was a problem hiding this comment.
Bash did not process metacharacters from variables only metacharacters directly present in a script or interpreter line.
It is easy to check by the next commands:
print_args() {
while (( "$#" )); do
echo $1
shift
done
}
X="hostName"
Y='sonic"; echo injection; echo "'
print_args --hostname "$X" --name cname
#output
>>> --hostname
hostName
--name
cname
print_args --hostname "$Y" --name cname
#output
>>> --hostname
sonic"; echo injection; echo "
--name
cnameI thought that CVE-2016-0634 can be exploited there. But sonic use bash 4.4
So, for any case added validation for allowed characters in a hostname. #Closed
There was a problem hiding this comment.
@qiluo-msft Could we close this conversation?
There was a problem hiding this comment.
Nice comments! Really appreciate the clarification and reference.
In reply to: 286898693 [](ancestors = 286898693)
a1ac6f2 to
07ddbb8
Compare
|
Review comments fixed |
8778f17 to
95dcf85
Compare
|
Please use a standard commit message format:
e.g. [image config] Keep containers hostname up to date |
95dcf85 to
1856544
Compare
* Add updateHostName function to docker_image_ctl.j2 * Add hostname specification on container creating step * Add listener for hostname changes in hostcfgd Signed-off-by: Myron Sosyak <msosyak@barefootnetworks.com>
1856544 to
5ff6ca3
Compare
5ff6ca3 to
fbbe144
Compare
jleveque
left a comment
There was a problem hiding this comment.
Please fix typo in log message per comment above.
Signed-off-by: Myron Sosyak <msosyak@barefootnetworks.com>
fbbe144 to
574f237
Compare
|
Retest this please |
…lly (#16785) #### Why I did it src/sonic-swss ``` * b9313df - (HEAD -> master, origin/master, origin/HEAD) Reducing the severity of oper fec attribute get failure (#2924) (89 minutes ago) [Sudharsan Dhamal Gopalarathnam] * cb98893 - Add support for SEND_TO_INGRESS port table. (#2816) (19 hours ago) [Yilan Ji] * 966c5bb - [Dash] Fix wrong table name for acl_out_table (#2911) (2 days ago) [Ze Gan] * 3599635 - [FEC]Auto FEC initial changes (#2893) (8 days ago) [Sudharsan Dhamal Gopalarathnam] ``` #### How I did it #### How to verify it #### Description for the changelog
- What I did
Implemented logic to keep containers hostname up to date
- How I did it
- How to verify it
Change hostname in config_db.json
Load new configuration
Check hostname in containers
- Description for the changelog
Added logic to keep containers hostname up to date
@akokhan @pyadvichuk @vsenchyshyn @qiluo-msft @jleveque @lguohan