Skip to content

Update the startServer.sh copy functionality to only chmod owned files #2046

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

Merged
merged 8 commits into from
Nov 12, 2020

Conversation

rjeberhard
Copy link
Member

This is part of making restrictive SCC work on OpenShift. In addition to the specific change to startServer.sh to only chmod when permitted, I noticed that many of the integration tests were initializing PV's with chown oracle:oracle rather than with oracle:root. I've updated those references too.

Copy link
Member

@bhavaniravichandran bhavaniravichandran left a comment

Choose a reason for hiding this comment

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

LGTM

if [ -O "$2" ]; then
chmod 770 $2
[ $? -ne 0 ] && trace SEVERE "failed chmod 770 $2" && exitOrLoop
fi

Choose a reason for hiding this comment

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

What file isn't owned? Note that there is similar logic in the liveness probe script.

Copy link
Member Author

Choose a reason for hiding this comment

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

On OpenShift, the containers will not be run as the "oracle" user, but instead will be run as a new user (large UID), but that is part of the "root" group. In the case of the boot.properties, or any file that already exists and is being copied over, the file will still be owned by "oracle" and so the script cannot chmod the file.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I'll change the liveness probe too

Choose a reason for hiding this comment

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

It's interesting that boot.properties is created and copied over by the operator at runtime (contains the WL credentials), but it still needs an unknown check and a chmod...

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not copied by the "operator". It's copied by the user principal inside the server instance running a script injected by the operator.

Copy link
Member

@ankedia ankedia left a comment

Choose a reason for hiding this comment

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

LGTM

@rjeberhard rjeberhard merged commit 9402a32 into develop Nov 12, 2020
@rjeberhard rjeberhard deleted the remove-chmod750 branch January 5, 2021 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants