Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
Jupyter Docker Stacks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Jupyter Docker Stacks
Commits
59904dd7
Commit
59904dd7
authored
Jun 07, 2018
by
Min RK
Committed by
GitHub
Jun 07, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #654 from jupyter-on-openshift/remove-writable-group
Lock down ability to run su command.
parents
cf57ef14
47e120db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
base-notebook/Dockerfile
base-notebook/Dockerfile
+4
-2
base-notebook/start.sh
base-notebook/start.sh
+1
-7
No files found.
base-notebook/Dockerfile
View file @
59904dd7
...
...
@@ -47,10 +47,12 @@ ENV PATH=$CONDA_DIR/bin:$PATH \
ADD
fix-permissions /usr/local/bin/fix-permissions
# Create jovyan user with UID=1000 and in the 'users' group
# and make sure these dirs are writable by the `users` group.
RUN
useradd
-m
-s
/bin/bash
-N
-u
$NB_UID
$NB_USER
&&
\
RUN
groupadd wheel
-g
11
&&
\
echo
"auth required pam_wheel.so use_uid"
>>
/etc/pam.d/su
&&
\
useradd
-m
-s
/bin/bash
-N
-u
$NB_UID
$NB_USER
&&
\
mkdir
-p
$CONDA_DIR
&&
\
chown
$NB_USER
:
$NB_GID
$CONDA_DIR
&&
\
chmod
g+w /etc/passwd
/etc/group
&&
\
chmod
g+w /etc/passwd
&&
\
fix-permissions
$HOME
&&
\
fix-permissions
$CONDA_DIR
...
...
base-notebook/start.sh
View file @
59904dd7
...
...
@@ -94,8 +94,7 @@ else
# User is not attempting to override user/group via environment
# variables, but they could still have overridden the uid/gid that
# container runs as. Check that the user has an entry in the passwd
# file and if not add an entry. Also add a group file entry if the
# uid has its own distinct group but there is no entry.
# file and if not add an entry.
whoami
&> /dev/null
||
STATUS
=
$?
&&
true
if
[[
"
$STATUS
"
!=
"0"
]]
;
then
if
[[
-w
/etc/passwd
]]
;
then
...
...
@@ -104,11 +103,6 @@ else
echo
"jovyan:x:
$(
id
-u
)
:
$(
id
-g
)
:,,,:/home/jovyan:/bin/bash"
>>
/tmp/passwd
cat
/tmp/passwd
>
/etc/passwd
rm
/tmp/passwd
id
-G
-n
2>/dev/null |
grep
-q
-w
$(
id
-u
)
||
STATUS
=
$?
&&
true
if
[[
"
$STATUS
"
!=
"0"
&&
"
$(
id
-g
)
"
==
"0"
]]
;
then
echo
"Adding group file entry for
$(
id
-u
)
"
echo
"jovyan:x:
$(
id
-u
)
:"
>>
/etc/group
fi
else
echo
'Container must be run with group "root" to update passwd file'
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment