Got a git guardian warning about API_TOKEN_SALT by creating new strapi project

Ddreamingofsoy5/27/2023
Hi, I've never used railway before and was playing around deploying a strapi backend. I linked the correct repo on github but at some point it created a brand new repo in github for me called strapi (a self hosted starter or something like that) and then I got a git guardian warning email about an API_TOKEN_SALT secret exposed in a docker file that I have no idea about/where it came from. I quickly deleted the project and repo. But I was just wondering if this was anything to worry about/where I went wrong?
Ddreamingofsoy5/27/2023
N/A
Ddreamingofsoy5/27/2023
Hi, Brody, thanks! The repo was a totally fresh strapi project generated by railway and I'm not even sure what the salt was for or why it was there, do you know why this would be, it wasn't a repo I had made
Bbrody5/27/2023
well the railway strapi template doesn't have a dockerfile, so could you show me the email from git guardian?
Ddreamingofsoy5/27/2023
<my github>/strapi
Dockerfile

Generic High Entropy Secret

FROM node:16-alpine3.14

WORKDIR /app

COPY yarn.lock package.json /app/

RUN yarn install

COPY . /app

ARG PGDATABASE PGHOST PGPASSWORD PGPORT PGUSER PORT CLOUDINARY_KEY CLOUDINARY_NAME CLOUDINARY_SECRET NODE_ENV ADMIN_JWT_SECRET JWT_SECRET API_TOKEN_SALT=<this is where the exposed salt was>

ENV PGDATABASE=$PGDATABASE PGHOST=$PGHOST PGPASSWORD=$PGPASSWORD PGPORT=$PGPORT PGUSER=$PGUSER PORT=$PORT CLOUDINARY_KEY=$CLOUDINARY_KEY CLOUDINARY_NAME=$CLOUDINARY_NAME CLOUDINARY_SECRET=$CLOUDINARY_SECRET NODE_ENV=$NODE_ENV ADMIN_JWT_SECRET=$ADMIN_JWT_SECRET JWT_SECRET=$JWT_SECRET API_TOKEN_SALT=$API_TOKEN_SALT

RUN yarn build

EXPOSE $PORT

CMD yarn start

No newline at end of file
Ddreamingofsoy5/27/2023
this is the file
Ddreamingofsoy5/27/2023
the email just said '2 secrets detected!' with links to them
Bbrody5/27/2023
screenshot of email please, a picture is worth 1000 words
Ddreamingofsoy5/27/2023
Ddreamingofsoy5/27/2023
one of the warnings on git guardian was from percy@railway.app
Bbrody5/27/2023
the railway strapi template hasn't had a dockerfile since June 4th 2022
Bbrody5/27/2023
the dockerfile you sent does match the dockerfile that was deleted on June 5th 2022
Bbrody5/27/2023
so you must have tried to deploy a really old fork
Ddreamingofsoy5/27/2023
fairly new to hosting apps on the cloud and secrets being exposed freaks me out, especially when I have no idea where they came from
Ddreamingofsoy5/27/2023
ah, i just followed the instructions on railway
Bbrody5/27/2023
can you link those instructions here?
Ddreamingofsoy5/27/2023
I can't link them as they were just following page by page on railway
Ddreamingofsoy5/27/2023
but it was create a new project
Ddreamingofsoy5/27/2023
select strapi as a template, which it says 'This template includes 1 GitHub service and 1 database'
Ddreamingofsoy5/27/2023
it then says

Repository details

Where should we clone this repo?
Ddreamingofsoy5/27/2023
and lists my github, which I've just realised is where the repo came from
ADA Dumb5/27/2023
Can you link the page?
ADA Dumb5/27/2023
sounds like you’re reading off one
Bbrody5/27/2023
they just clicked the "+ new project" button in the dashboard
Ddreamingofsoy5/27/2023
at some point I gave access to my desired strapi backend (can't remember at what step), and I just assumed that would be used, I didn't realise I was cloning a repo
Ddreamingofsoy5/27/2023
after I clicked deploy and it had deployed, I got the email from git guardian
Bbrody5/27/2023
okay i think i have an idea, i will test and get back to you
Ddreamingofsoy5/27/2023
Just to ease my anxiety, if I've deleted both the github repo and the railway project/postgresql db completely, the salt that was exposed should be useless now, right?
Ddreamingofsoy5/27/2023
ps, thanks for your quick help regarding this, I've also never used discord before
Bbrody5/27/2023
did you put data into strapi?
Ddreamingofsoy5/27/2023
I created some environment variables on railway for cloud storage and the only thing I created on the strapi api was an admin user
Ddreamingofsoy5/27/2023
that's when I realised it wasn't the backend I thought was deployed as none of my tables were there that were supposed to be
Bbrody5/27/2023
then you're fine
Ddreamingofsoy5/27/2023
cool, so, what did I do wrong?
Bbrody5/27/2023
when did you sign up for a railway account
Ddreamingofsoy5/27/2023
yesterday I think
Bbrody5/27/2023
well then its not like you could have the strapi template from 2022 sitting in your github
Bbrody5/27/2023
so i dont actually know, i dont think you did do anything wrong, railway's systems might have just had a little hiccup
Ddreamingofsoy5/27/2023
I only started using strapi like 2 days ago too, and only created my own strapi repo an hour or so before I tried to deploy it on railway
Bbrody5/27/2023
i really dont know what could have gone wrong, but im confident it wasn't your fault
Bbrody5/27/2023
wanna try again?
Ddreamingofsoy5/27/2023
no worries, I've had one of those days tbh. I told myself to wait until tomorrow to try deploy it too, but was impatient.
Bbrody5/27/2023
i promise, it wasnt your fault
Ddreamingofsoy5/27/2023
I'll try again over the weekend, maybe. I mainly wanted to check I hadn't stupidly exposed some secret and my shiny new cloud account that I spent way too long setting up were doomed.
Ddreamingofsoy5/27/2023
Thanks for the reassurance.
Bbrody5/27/2023
they arent, all the secrets you entered into railway are still secure
Bbrody5/27/2023
once you try again, check if the comment on the deploy matches the latest comment on the repo, if it doesn't come back here and ping me
Ddreamingofsoy5/27/2023
Thanks! It was the confusion of the new strapi repo and git guardian/docker warning that totally threw my off as to what was going on - I thought I'd been super cautious.
Ddreamingofsoy5/27/2023
Okay, will do.
Ddreamingofsoy5/27/2023
Thanks for your help and reassurance, Brody!
Bbrody5/27/2023
no problem!
__al3xx5/27/2023
# hmm