Specify working directory of imagebuilder to avoid executing in /tmp - #7515
Conversation
42106e3 to
699b311
Compare
| Cookbook: | ||
| ExtraChefAttributes: | | ||
| {"cluster": {"dcv": {"install_enabled": false}}} | ||
| {% endif %} |
There was a problem hiding this comment.
DCV knob is removed because the code is dead
81032f4 to
6bd5942
Compare
noexec on /tmp for some testsaed8e9e to
9e68425
Compare
88046b1 to
e2ea64e
Compare
| @@ -0,0 +1,288 @@ | |||
| AWSTemplateFormatVersion: 2010-09-09 | |||
There was a problem hiding this comment.
Please refrain from using words like hardened, STIG,etc which can cause confusion with the scope of this feature. So I suggest you remove the mention of these words from this PR.
d946601 to
9f5e5d3
Compare
1. The ARN of EBS snapshot should't contain account id. 2. The tagging of EBS snapshots inside the Lambda function is not necessary because imagebuilder propagates the tags to snapshots
This commit also set `noexec` on `/tmp` for some tests to monitor ParallelCluster compliance of `noexec` on `/tmp`: 1. test_essential_features: now `noexec` is set on `/tmp` by default. This commit fixes the `gpu_job.sh` to not execute on `/tmp` 2. test_multiple_nics: now `noexec` is set on `/tmp` by default. This test is added because multi-nics configuration script was executed in `/tmp` before pcluster 3.16.0 3. test_build_image: If the test is run on a non-GPU instance, where Nvidia is not installed, create a custom AMI with `noexec` persisted on `/tmp` and run `build-image` on top of this custom AMI. Using the custom AMI has better coverage than (1) and (2), because the `noexec` persisted on `/tmp` in the custom AMI covers the whole workflow of `build-image` and `create-cluster`.
| WorkingDirectory: /opt/parallelcluster/tmp | ||
| Components: | ||
| - ComponentArn: !Ref PatchComponent | ||
| - ComponentArn: !If [BuildNoExecTmpImage, !Ref NoExecTmpComponent, !Ref PatchComponent] |
There was a problem hiding this comment.
Why do we need a separate gate? Can;t we just go with a patch component that does not make use of exec in tmp?
There was a problem hiding this comment.
This template is reused for two purposes. One is to create an patched AMI, the other one is to create an AMI with noexec on tmp. Depending on the input parameters, we choose one component
| DevSettings: | ||
| EfaInterfaceType: efa | ||
| Cookbook: | ||
| ExtraChefAttributes: '{"cluster": {"tmp_noexec": "true"}}' No newline at end of file |
There was a problem hiding this comment.
future improvement: we can make this a test flag thta is injected via test config rather than hard wiring
Description of changes
noexecon/tmpSee commits descriptions for details
Tests
The following tests have passed
References
Checklist
developadd the branch name as prefix in the PR title (e.g.[release-3.6]).Please review the guidelines for contributing and Pull Request Instructions.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.