This message was deleted.
# opal
s
This message was deleted.
o
Hi @arun Dsouza great question, I will check this out with my team and get back to you
o
You can control how the webhook OPAL expects would look like via
OPAL_POLICY_REPO_WEBHOOK_PARAMS
it doesn’t even have to be ‘x-api-key’ But you should have a header with a name as indicated by
event_header_name
in
OPAL_POLICY_REPO_WEBHOOK_PARAMS
contain a value equal to the secret passed to
OPAL_POLICY_REPO_WEBHOOK_SECRET
a
I tried sending post request but getting error status :ignored , event ; git.push so not sure what is wrong
o
@arun Dsouza can you share the full log you got, the post body and headers you’re sending ?
a
headers = {"Content-Type": "application/json", "Accept": "application/json", "x-api-key" : "xxxxxxx"}
o
And the error log?
Also the config for webhook params and secrets, and the configured repo url
We need to see that those match the webhook you're sending here.
For example the repository.url in the body needs to match the repo url you configured for opal
a
Iam not sure if this is coming from my call as I don't see the source address to really confirm
Please make sure you have the correct access rights and the repository exists. '←[0m ←[32m2023-02-27T191034.443859+0000←[0m | 8 | ←[34mopal_common.git.repo_cloner ←[0m|←[31m←[1mERROR | cannot clone policy repo: Cmd('git') failed due to: exit code(128) cmdline: git clone -v --branch=master -- git@ssh.dev.azure.com:v3/Alegeus-Technologies/ArchitectureCouncil/OPAL-Policy-Repo /opal/regoclone/opal_repo_clone stderr: '190825.163408 git.c:444 trace: built-in: git clone -v --branch=master -- git@ssh.dev.azure.com:v3/Alegeus-Technologies/ArchitectureCouncil/OPAL-Policy-Repo /opal/regoclone/opal_repo_clone Cloning into '/opal/regoclone/opal_repo_clone'... 190825.165271 run-command.c:664 trace: run_command: unset GIT_DIR; GIT_PROTOCOL=version=2 'ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i //opal/.ssh/opal_repo_ssh_key' -o SendEnv=GIT_PROTOCOL git@ssh.dev.azure.com 'git-upload-pack '\''v3/Alegeus-Technologies/ArchitectureCouncil/OPAL-Policy-Repo'\''' ssh: connect to host ssh.dev.azure.com port 22: Connection timed out fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. '←[0m
can direct me to sample configuration for azure devops how it should be
I thought x-api-key is the secret or token
o
Here the issue seems to be the SSH key (or otherwise repo configuration) to clone the repository for OPAL the x-api-key is a secret to check that the webhook source can be trusted.
To be clear: It looks like the webhook is not your problem but the basic configuration of the repository