-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(formsg): clone repo on webhook trigger from forms #947
Conversation
const { responses } = res.locals.submission | ||
// NOTE: This is validated by formsg to be of domain `@open.gov.sg`; | ||
// hence, not revalidating here | ||
const requesterEmail = getField(responses, "Email") as string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we just allow whitelisted emails?
our admin email perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear, you want to stricten from allowing @open.gov.sg
to only [email protected]
? I don't see too much of an issue here but what's the extra benefit ah cos this only prevents against internal attacks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just suggesting least privilege principle. Not too much issue, since this is all internal, will let it up to you to decide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^not doing, the experience of having prod ops enter their own email then receive a rejection email saying it must be [email protected] seems less than ideal given that this is all internal users anyway (validation of @open.gov.sg
domain)
ea58fda
to
abe7b67
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR has quite a number of infra moving parts -
eg.
- formsg
- efs
- be
Could we do a quick sanity check testing on stg before release?
since this is internal use using post deploy testing is also fine, thoughts?
tbh, i think the only difference between testing on staging vs not, is that the clone step takes place in a different environment (with all of the annoyances that entails); i think i'll just do post-deploy cos it's not open to public anyway. |
Problem
See here
Solution
/formsg/clone-repo
.open.gov.sg
and must verify email + repo is a required field)New env vars
SITE_CLONE_FORM_KEY
: used to decrypt the form sg submissions (already added to 1PW on bothstaging
andprod
env vars; not yet added tostaging
EB yet)Notes
this was tested locally through updating the
EFS_VOL_PATH
+originUrl
(usehttps
instead ofssh
as i was facing auth issues) and found working