Skip to content

Conversation

@Redent0r
Copy link

@Redent0r Redent0r commented Feb 27, 2025

Merge Checklist
Summary

JOB_COMPLETION_INDEX might be empty, so the regex should be changed to match the empty string

Test Methodology

https://dev.azure.com/mariner-org/mariner/_build/results?buildId=747821&view=ms.vss-test-web.build-test-results-tab [pass]

JOB_COMPLETION_INDEX might be empty, so the regex should be changed to match the empty string.

Signed-off-by: Saul Paredes <[email protected]>
Update samples

Signed-off-by: Saul Paredes <[email protected]>
@Redent0r Redent0r added the upstream/not-needed PRs that will not be upstreamed (e.g. internal) label Feb 27, 2025
@Redent0r Redent0r requested review from a team as code owners February 27, 2025 17:31
@sprt
Copy link

sprt commented Feb 27, 2025

FYI this is after witnessing the below policy failure internally:

695:	allow_env: i_var = JOB_COMPLETION_INDEX=
714:	allow_var 2: p_var2 = PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
714:	allow_var 2: p_var2 = HOSTNAME=$(host-name)
714:	allow_var 2: p_var2 = JOB_COMPLETION_INDEX=$(validate-from-settings)
728:	allow_var 3: p_regex5 = ^HOSTNAME=[a-zA-Z0-9_.-]+$
728:	allow_var 3: p_regex5 = ^[A-Z0-9_.-]+_PORT_[0-9]{1,5}_TCP=tcp://((25[0-5]|(2[0-4]|1d|[1-9]|)d).?b){4}:[0-9]{1,5}$
728:	allow_var 3: p_regex5 = ^[A-Z0-9_.-]+_PORT_[0-9]{1,5}_TCP_PROTO=tcp$
728:	allow_var 3: p_regex5 = ^[A-Z0-9_.-]+_PORT_[0-9]{1,5}_TCP_PORT=[0-9]{1,5}$
728:	allow_var 3: p_regex5 = ^[A-Z0-9_.-]+_PORT_[0-9]{1,5}_TCP_ADDR=((25[0-5]|(2[0-4]|1d|[1-9]|)d).?b){4}$
728:	allow_var 3: p_regex5 = ^[A-Z0-9_.-]+_SERVICE_HOST=((25[0-5]|(2[0-4]|1d|[1-9]|)d).?b){4}$
728:	allow_var 3: p_regex5 = ^[A-Z0-9_.-]+_SERVICE_PORT=[0-9]{1,5}$
728:	allow_var 3: p_regex5 = ^[A-Z0-9_.-]+_SERVICE_PORT_[a-zA-Z0-9_.-]+=[0-9]{1,5}$
728:	allow_var 3: p_regex5 = ^[A-Z0-9_.-]+_PORT=tcp://((25[0-5]|(2[0-4]|1d|[1-9]|)d).?b){4}:[0-9]{1,5}$
728:	allow_var 3: p_regex5 = ^AZURE_CLIENT_ID=[A-Fa-f0-9-]*$
728:	allow_var 3: p_regex5 = ^AZURE_TENANT_ID=[A-Fa-f0-9-]*$
728:	allow_var 3: p_regex5 = ^AZURE_FEDERATED_TOKEN_FILE=/var/run/secrets/azure/tokens/azure-identity-token$
728:	allow_var 3: p_regex5 = ^AZURE_AUTHORITY_HOST=https://login.microsoftonline.com/$
728:	allow_var 3: p_regex5 = ^TERM=xterm$
793:	allow_var 7: val = 
794:	allow_var 7: regex_val = ^[0-9]+$
805:	allow_var 8: p_var2 = PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
805:	allow_var 8: p_var2 = HOSTNAME=$(host-name)
805:	allow_var 8: p_var2 = JOB_COMPLETION_INDEX=$(validate-from-settings)
255:	allow_by_anno 2: start

Copy link

@sprt sprt left a comment

Choose a reason for hiding this comment

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

Do we know why JOB_COMPLETION_INDEX is sometimes empty? The PR that introduced the original regex passed validation.

@sprt sprt mentioned this pull request Feb 27, 2025
4 tasks
@sprt sprt merged commit 07e3205 into msft-main Feb 27, 2025
102 of 155 checks passed
@Redent0r Redent0r deleted the saulparedes/fix_regex_for_test branch February 27, 2025 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream/not-needed PRs that will not be upstreamed (e.g. internal)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants