Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@e2fyi/firebase-admin
Advanced tools
cli
for firebase-admin.
Available Features
fb-admin project
)fb-admin users
)fb-admin claims
)# npm
npm install -g @e2fyi/firebase-admin
# yarn
yarn global add @e2fyi/firebase-admin
The cli
connects to a firebase project by loading the environment variable FIREBASE_SERVICE_ACCOUNT
from .env
. The .env
can be automatically generate with the fb-admin project <PATH_TO_PROJECT_CRED>
command.
Creating a service account and getting the project credentials
Service Accounts tab
in your project's settings page.Generate New Private Key
button at the bottom of the Firebase Admin SDK section of the Service Accounts tab.Example
# setup current project to
# `~/.firebase/firebase_service_account.json`
fb-admin project ~/.firebase/firebase_service_account.json
Additional resources:
# run cli and see help
fb-admin -h
usage: fb-admin [-h] [-v] {project,claims,users} ...
cli command to manage custom claims for firebase users.
Optional arguments:
-h, --help Show this help message and exit.
-v, --version Show program's version number and exit.
subcommands:
{project,claims,users}
project Setup credential for a firebase project.
claims Update the custom claims of a firebase user.
users List firebase users.
PROJECT
Select a project by providing the path to the service account credentials.
usage: fb-admin project [-h] cred
Positional arguments:
cred Path to the JSON credential for firebase project.
Optional arguments:
-h, --help Show this help message and exit.
Example
fb-admin project ~/.firebase/firebase_service_account.json
CLAIMS
Update the customClaims of a user.
usage: fb-admin claims [-h] [-d DATA] [-f FLAGS] email
Positional arguments:
email ptnet user email
Optional arguments:
-h, --help Show this help message and exit.
-d DATA, --data DATA Set the custom claims with the JSON string. e.g.
'{"admin":1}'
-f FLAGS, --flags FLAGS
Set a flag in custom claims with semicolon-delimited
<field=value> pairs. e.g. -f admin=1;scope=all;
Examples
# equivalent to -d {"admin": 1, "scope": "all"}
fb-admin claims someone@email.com -f admin=1;scope=all;
# equivalent to -f admin=1
fb-admin claims someone@email.com -d '{"admin":1}';
USERS
List or search users based on email.
usage: fb-admin users [-h] [-m MATCH]
Optional arguments:
-h, --help Show this help message and exit.
-m MATCH, --match MATCH
List only users with email matching the provided
minimatch pattern. e.g. *@email.com
Examples
# list all users
fb-admin users
# list all users with email domain "email.com"
fb-admin users -m *@email.com;
FAQs
CLI for firebase admin sdk
We found that @e2fyi/firebase-admin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.