aws-samples / aws-samples/aws-security-reference-architecture-examples
[FEATURE] Amazon Inspector ECR re-scan settings - allow for more options
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 303
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 1
Description
### Is your feature request related to a problem? Please describe
Currently only able to set the re-scan duration for inspector to LIFETIME|DAYS_30|DAYS_180
```
params.update(parameter_pattern_validator("ECR_SCAN_DURATION", os.environ.get("ECR_SCAN_DURATION"), pattern=r"^(LIFETIME|DAYS_30|DAYS_180){1}$"))
```
### Describe the solution you'd like
Allow all the selections that the API accepts i.e.
```
response = client.update_configuration(
ec2Configuration={
'scanMode': 'EC2_SSM_AGENT_BASED'|'EC2_HYBRID'
},
ecrConfiguration={
'pullDateRescanDuration': 'DAYS_14'|'DAYS_30'|'DAYS_60'|'DAYS_90'|'DAYS_180',
'rescanDuration': 'LIFETIME'|'DAYS_30'|'DAYS_180'|'DAYS_14'|'DAYS_60'|'DAYS_90'
}
)
```
### Describe alternatives you've considered
we have set to 30 for now while we await the ability to set lower
### Additional context
Parameter setting in sra-inspector-org-main-ssm.json
{
"ParameterKey": "pEcrRescanDuration",
"ParameterValue": "LIFETIME"
}
Contributor guide
Research direction
Start by locating the ECR_SCAN_DURATION validation shown in the issue and the pEcrRescanDuration setting in sra-inspector-org-main-ssm.json. Compare both with the Amazon Inspector API options listed in the request, then verify that each requested duration is accepted and that the parameter can pass through the configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- cloud, security
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100