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

Misc security related fixes for AWS and Azure #2141

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

bpradipt
Copy link
Member

@bpradipt bpradipt commented Nov 4, 2024

aws: Avoid integer overflow when processing RootVolumeSize
azure: Verify the SSH key to ensure the file is using a supported public key format

AWS expects VolumeSize to be int32, however the Golang flags package
only provides IntVar. So add checks to prevent overflow

Signed-off-by: Pradipta Banerjee <pradipta.banerjee@gmail.com>
@bpradipt bpradipt marked this pull request as ready for review November 4, 2024 10:35
@bpradipt bpradipt requested a review from a team as a code owner November 4, 2024 10:35
Ensure to clean the SSH key path and also verify to ensure
the file has proper permission and the public key is in the
proper format, avoiding any spurious entries via the key file.

Signed-off-by: Pradipta Banerjee <pradipta.banerjee@gmail.com>
Copy link
Member

@stevenhorsman stevenhorsman left a comment

Choose a reason for hiding this comment

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

LGTM


// Verify SSH public key file
// Check the permissions and the content of the file to ensure it is a valid SSH public key
func VerifySSHKeyFile(sshKeyFile string) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

with the change to mkosi images, we won't have the option to provision SSH keys anymore, since this functionality relies on cloud-init and writeable root filesystems

Copy link
Member Author

Choose a reason for hiding this comment

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

True for CoCo and that's why I added it to the ConfigVerifier method which is disabled by default. For non CoCo (regular peer-pods) this at least gives an option to ensure using valid public key. Is that acceptable ?

@bpradipt bpradipt merged commit b25b5c7 into confidential-containers:main Nov 4, 2024
19 checks passed
@bpradipt bpradipt deleted the misc-fixes branch November 4, 2024 13:56
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.

3 participants