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

Add security.protection.start to optionally prevent instance start up #13824

Merged
merged 8 commits into from
Jul 31, 2024

Conversation

qianzhangxa
Copy link
Contributor

This PR adds a new instance configuration option security.protection.start, and throws an error if a given instance with this option set to true is started.

Closes #12110.

@github-actions github-actions bot added Documentation Documentation needs updating API Changes to the REST API labels Jul 26, 2024
Copy link

Heads up @ru-fu - the "Documentation" label was applied to this issue.

@tomponline
Copy link
Member

Hi please can you rebase to fix conflicts

@qianzhangxa
Copy link
Contributor Author

Hi please can you rebase to fix conflicts

@tomponline Done, thanks.

shared/version/api.go Outdated Show resolved Hide resolved
test/suites/security.sh Outdated Show resolved Hide resolved
Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

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

I think instanceShouldAutoStart should be updated to take into account this new setting to avoid repeated start up tries and errors.

@tomponline
Copy link
Member

Please can you sign the Canonical CLA too. https://ubuntu.com/legal/contributors Thanks

@qianzhangxa
Copy link
Contributor Author

Please can you sign the Canonical CLA too. https://ubuntu.com/legal/contributors Thanks

I have signed it just now. Can we rerun the CLA check job to verify?

image

@tomponline
Copy link
Member

Please can you sign the Canonical CLA too. https://ubuntu.com/legal/contributors Thanks

I have signed it just now. Can we rerun the CLA check job to verify?

image

Thanks will ask for a CLA list refresh internally....

Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

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

I think instanceShouldAutoStart should be updated to take into account this new setting to avoid repeated start up tries and errors.

@qianzhangxa
Copy link
Contributor Author

I think instanceShouldAutoStart should be updated to take into account this new setting to avoid repeated start up tries and errors.

@tomponline I have updated instanceShouldAutoStart in the latest push, my solution is to check security.protection.start first and then boot.autostart (i.e. the former has higher priority than the latter), please let me know if you have a different idea, thanks!

@qianzhangxa
Copy link
Contributor Author

@tomponline I am thinking about this case: If we set security.protection.start to true for a running instance, do we need to automatically stop the instance?

@tomponline
Copy link
Member

@tomponline I have updated instanceShouldAutoStart in the latest push, my solution is to check security.protection.start first and then boot.autostart (i.e. the former has higher priority than the latter), please let me know if you have a different idea, thanks!

Sounds good! Thanks

@tomponline
Copy link
Member

@tomponline I am thinking about this case: If we set security.protection.start to true for a running instance, do we need to automatically stop the instance?

Hrm i dont think we should do that. Just prevent subsequent starts.

@qianzhangxa
Copy link
Contributor Author

@tomponline I am thinking about this case: If we set security.protection.start to true for a running instance, do we need to automatically stop the instance?

Hrm i dont think we should do that. Just prevent subsequent starts.

Agree. The reason that I asked this question is that we may run into this case: A running instance with security.protection.start set to true which is a bit weird, but I guess it should be OK since that config option is just for preventing subsequent starts.

tomponline
tomponline previously approved these changes Jul 29, 2024
Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

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

Thanks!

@qianzhangxa
Copy link
Contributor Author

Ah please can you sign your commits

https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification#ssh-commit-signature-verification

Done :)

Copy link
Contributor

@ru-fu ru-fu left a comment

Choose a reason for hiding this comment

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

The documentation update looks good, just two small nitpicks.

doc/howto/instances_manage.md Outdated Show resolved Hide resolved
lxd/instance/instancetype/instance.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ru-fu ru-fu left a comment

Choose a reason for hiding this comment

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

Can you update the metadata again?

@qianzhangxa
Copy link
Contributor Author

Can you update the metadata again?

Done.

Copy link
Contributor

@ru-fu ru-fu left a comment

Choose a reason for hiding this comment

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

Thanks! The docs look good now. :)

@tomponline tomponline merged commit d371eb7 into canonical:main Jul 31, 2024
29 checks passed
@tomponline
Copy link
Member

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes to the REST API Documentation Documentation needs updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Protect/Lock VMs or Containers from starting
3 participants