
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
A node app which converts JSON BD schemas into Firebase Firestore Rules. FKA 'firebase-rule-generator'
An app which converts JSON DB schemas into Firebase Firestore Rules.
$ npm install -g frug
$ frug ./schema.json ./destination.js
{
"users": {
"__frug": {
"comments": ["You can add comments to stuff"]
},
"uid": {
"uid": {
"type": "string",
"path_value": "uid"
},
"given_name": "",
"favorite_color": {
"type": "string",
"regex": "(?i)^#\\d{3,6}$",
"__frug": {
"comments": ["Can even be made-up colors"]
}
}
}
}
}
rules_version = "2";
service cloud.firestore {
match /databases/{database}/documents {
function signedIn() {
return request.auth.uid != null;
}
function inData() {
return request.resource.data;
}
// You can add comments to stuff
match /users/{uid} {
function isUsers(data) {
return data.uid is string && data.uid == uid &&
data.given_name is string &&
// Can even be made-up colors
data.favorite_color is string && data.favorite_color.matches('(?i)^#\\d{3,6}$') && data.favorite_color == undefined;
}
allow read: if false;
allow write: if isUsers(request.resource.data);
}
}
}
const { build } = require("frug");
const schema = {
"users": {
"__frug": {
"comments": ["You can add comments to stuff"]
},
"uid": {
"uid": {
"type": "string",
"path_value": "uid"
},
"given_name": "",
"favorite_color": {
"type": "string",
"regex": "(?i)^#\\d{3,6}$",
"__frug": {
"comments": ["Can even be made-up colors"]
}
}
}
}
};
const output = build(schema);
console.log(output);
$ node ./index.js
> rules_version = "2";
service cloud.firestore {
match /databases/{database}/documents {
function signedIn() {
return request.auth.uid != null;
}
function inData() {
return request.resource.data;
}
// You can add comments to stuff
match /users/{uid} {
function isUsers(data) {
return data.uid is string && data.uid == uid &&
data.given_name is string &&
// Can even be made-up colors
data.favorite_color is string && data.favorite_color.matches('(?i)^#\\d{3,6}$') && data.favorite_color == undefined;
}
allow read: if false;
allow write: if isUsers(request.resource.data);
}
}
}
MVP:
description:
Builds collection-level data validation functions
details:
Missing-Details:
- bytes
- latlang/geo
- reference path
__frug-metadata:
...
PMVP:
description:
Builds query rules based on meta fields in schema,
using data validation and role-based authentication.
details:
- Namespace usage (math, etc)
- Preexisting-data checks
FAQs
A node app which converts JSON BD schemas into Firebase Firestore Rules. FKA 'firebase-rule-generator'
We found that frug 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.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.