Every 5 minutes
Check suspicious links people forward to you
When someone forwards a suspicious email, the links in it are checked and the verdict is posted to your security channel.
- Runs
- Every 5 minutes
- Apps
- Gmail, Slack
- AI
- Not needed
- Access
- Gmail gmail.modify; Slack chat:write
Send this to your assistant
Create a ClickRuntime automation: every 5 minutes, check new emails sent to security@ for links and IP addresses, look each one up on VirusTotal, post the results to #security and reply to the person who reported it.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Employees who receive a suspicious link forward it to the security inbox, and then the waiting begins. An analyst opens the email, copies the URL into a reputation site, checks the sending IP, writes a reply and mentions it in chat. Each report takes ten minutes, and during a phishing wave dozens arrive, so the person who clicked and the colleagues who did not are left wondering which is safe.
Every 5 minutes new emails in the security inbox are fetched and any URLs, domains and IP addresses are extracted. Each indicator is checked against a reputation API, the verdict goes to Slack as a short summary, and a reply with the result is sent to the person who reported it.
Small security teams, IT generalists who also handle security and managed service providers will find it useful.
What you get out of it
Reporters get an answer fast
An employee who forwarded a link hears back within minutes whether it was malicious, which keeps them from guessing and encourages people to keep reporting. Quick feedback is what keeps staff reporting rather than ignoring the next suspicious email.
Analysts skip the copy and paste
Extracting indicators and querying the lookup is repetitive work, and having verdicts ready means analysts spend time on the cases that need judgment. Human attention is the scarcest resource in a small security team.
A wave of phishing is visible quickly
When several people report the same domain, the Slack posts show the pattern early, so the domain can be blocked before more people click. Early detection is the difference between one click and twenty.
Every report leaves a record
Verdicts posted to a channel create a searchable log of what was reported and found, which supports incident reviews and awareness training examples. Those examples also make good material for staff training sessions.
Consistent checks regardless of staffing
Lookups run the same way at 3am or during a holiday, so an unusually quiet team is not a reason for a suspicious link to go unchecked. Attackers do not keep office hours, so neither should the first check.
How it works
What happens, step by step
Every 5 minutes, ClickRuntime checks Gmail for suspicious emails your colleagues have forwarded, skipping any it has already handled.
It pulls out the links and IP addresses in each email.
It looks each one up on VirusTotal to see how many security vendors flag it as malicious or suspicious.
The verdict is posted to your #security Slack channel, and the person who reported it gets an email reply with the results.
Before it runs live
- Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
- Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Google Sheets
- Combine it with other Gmail and Slack steps into one automation
Under the hood
The code that runs this automation
import base64, re
from email.message import EmailMessage
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, state, notify, report_fetched
def vt(kind, value, key):
if kind == "urls":
value = base64.urlsafe_b64encode(value.encode()).decode().strip("=")
r = http.get(f"https://www.virustotal.com/api/v3/{kind}/{value}", headers={"x-apikey": key})
return r.json()["data"]["attributes"]["last_analysis_stats"] if r.ok else None
@on_trigger
def run(event):
gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
seen = set(state.get("seen") or [])
msgs = gmail.users().messages().list(userId="me", q="to:security@ newer_than:1d", maxResults=20).execute().get("messages", [])
new = [m for m in msgs if m["id"] not in seen]
report_fetched(len(new))
if not new:
return {"new": 0}
key = credentials.secret("VIRUSTOTAL_API_KEY")
for m in new:
msg = gmail.users().messages().get(userId="me", id=m["id"], format="full").execute()
h = {x["name"]: x["value"] for x in msg["payload"]["headers"]}
text = msg["snippet"] + " " + " ".join(base64.urlsafe_b64decode(p["body"].get("data", "") + "==").decode(errors="ignore")
for p in msg["payload"].get("parts", [msg["payload"]]))
found = [("urls", u) for u in set(re.findall(r"https?://[^\s<>\"']+", text))][:5]
found += [("ip_addresses", ip) for ip in set(re.findall(r"\b(?:\d{1,3}\.){3}\d{1,3}\b", text))][:5]
lines = [f"{v}: {s['malicious']} malicious, {s['suspicious']} suspicious" if s else f"{v}: not found"
for (k, v), s in ((f, vt(*f, key)) for f in found)]
report = "\n".join(lines) or "No links or IPs found."
notify.slack(f"🛡 Report from {h.get('From')}: {h.get('Subject')}\n{report}", channel="#security")
reply = EmailMessage()
reply["To"], reply["Subject"] = h.get("From"), "Re: " + h.get("Subject", "")
reply["In-Reply-To"] = reply["References"] = h.get("Message-ID", "")
reply.set_content(f"Thanks for reporting this. VirusTotal results:\n\n{report}")
gmail.users().messages().send(userId="me", body={"raw": base64.urlsafe_b64encode(reply.as_bytes()).decode(),
"threadId": msg["threadId"]}).execute()
state.set("seen", [m["id"] for m in msgs])
return {"reports": len(new)}FAQ
Common questions
Which reputation service does it use?
Does it open the links itself?
What does the reply to the reporter say?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Post new order emails to your fulfilment team
Every order confirmation email becomes a Slack post with the order number, items and customer.
See how it worksGet your important emails in Slack
New mail is sorted and labelled for you, and the urgent ones are posted to Slack with a one-line summary.
See how it worksDraft answers to RFP questionnaires
When an RFP arrives by email, answers are drafted from your company details and saved as a Gmail reply for you to check.
See how it worksKeep exploring
Set up “Check suspicious links people forward to you” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.