gridy-admin-cli
All Gridy API Account settings are managed using the Gridy Admin CLI tool.
You will need your Gridy API Account User ID & API Secret key in order to use the CLI tool.
To get your Free Gridy API account signup here
Requirements
Using the CLI requires:
- Java 1.8+
Download
Usage
USAGE: java -jar gridy-admin-cli.jar [commands] <options> --data "{}"
COMMANDS:
account view View account information
account update Update account details
account delete Delete API account
settings view View account settings
settings update Update account settings
roles view View all created roles
roles add Create a new role
roles remove Remove a role
rules view View all blocked rules
rules add Add a blocked rule
rules remove Remove a blocked rule
rules update Update a blocked rule
admin view View administrator accounts
admin add Add new administrator account
admin remove Remvove an administrator account
users view View User activity
history view audit View all API activity history
stats view View all API activity statistics
service view <component> Show status of a Gridy ID service component(s)
service stop <component> Stop a Gridy ID service component
service start <component> Start a Gridy ID service component
OPTIONS:
-s --server=<url> Gridy server URLs:- live: https://api.gridy.io (default) staging: https://uat.gridy.io
custom: https://your.gridy.server
-p --period=N<m,h,d> Period in mins(m), hours(h), days (d) max: 7d
-f --format=<table,json,csv> Write output in csv, json, or table format (default: table)
-e --export Write output to file
-h --help View help
Display Name
Change the Name displayed to a User in a Gridy ID MFA challenge (default: none )
java -jar gridy-admin-cli.jar settings update --data '{ "display-name": "Your Display Name" }'
Display URL
Change the url displayed to a User in a Gridy ID MFA challenge (default: none )
java -jar gridy-admin-cli.jar settings update --data '{ "display-url": "Your Display Url" }'
Enable Auto Verify
Auto Verify Gridy ID MFA challenges
java -jar gridy-admin-cli.jar settings update --data '{ "autoverify": <true|false> }'
Accepted Challenge Types
Accepted Gridy MFA challenge types (default: all)
java -jar gridy-admin-cli.jar settings update --data '{ "challenge-types": [] }'
Default Challenge Type
Set a default Gridy ID MFA challenge type (default: none)
java -jar gridy-admin-cli.jar settings update all --data '{ "challenge-type": '' }'
Max Auth Attempts
Set max failed authentication attempts before blocking a User account (default 10)
java -jar gridy-admin-cli.jar settings update all --data '{ "max-attempts": 10 }'
Challenge QR code
Enable Gridy ID MFA challenge QR codes (default true)
java -jar gridy-admin-cli.jar settings update --data '{ "challenge-qrcode": true }'
Challenge Expiry
Set Gridy ID MFA challenge default expiry time (default: 30 mins )
java -jar gridy-admin-cli.jar settings update --data '{ "challenge-expiry": 30 }'
Default Role
Assign an authorization role & permissions to your Gridy ID users after successful authentication (default: none )
java -jar gridy-admin-cli.jar settings update --data '{ "default-role": "DEFAULT" }'
Time Zone
Set Time Zone (default: UTC )
java -jar gridy-admin-cli.jar settings update all --data '{ "timezone": "UTC" }'
Country
Set ISO Country code (default: None )
java -jar gridy-admin-cli.jar settings update --data '{ \"country-code\": 'NA' }'
Company Name
Set a Company Name (default: None )
java -jar gridy-admin-cli.jar account update --data '{ \"company-name\": 'Your Company Name' }'
Company Address
Set a Company Address (default: None )
java -jar gridy-admin-cli.jar account update --data '{ "company-address": 'Your Company Address' }'
Company Number
Set a Company Registered Number (default: None )
java -jar gridy-admin-cli.jar account update --data '{ "company-number": 'Company Number' }'
Enable Blocked Rules
Enable IPv4, GeoIPv4 & User Blocked rules
java -jar gridy-admin-cli.jar rules update --data '{ "rules-enable": true }'
View Blocked Rules
View all Blocked rules created
java -jar gridy-admin-cli.jar rules view
Block IPv4 Range
Block all requests from an IPv4 Range ( default: None )
IPv4 Range rules uses CIDR notation, see the wikipedia page below for more help:
CIDR notation help: https://en.m.wikipedia.org/Classless_Inter-Domain_Routing
Examples
19.151.100.14/32 - represents a single IPv4 address: 198.51.100.14
71.51.100.0/22 - represents 1024 IP addresses: 71.51.100.0 - 71.51.103.255
java -jar gridy-admin-cli.jar rules <add|remove> --data '{\"block-iprange\":\"'['198.51.100.14/32','71.51.100.0/22']'\"}'
Block IPv4 Address
Block all requests from a single IPv4 address ( default: None )
java -jar gridy-admin-cli.jar rules <add|remove> all --data '{\"block-ipaddress\":\"'['198.51.100.14']'\"}'
Block Country IPv4 Range
Block all requests from an allocated Country IPv4 Range ( default: None )
ISO 3166 Two-letter Country codes: https://en.m.wikipedia.org/ISO_3166-1_alpha-2
Example Rules
['RU'] - Block all allocated Russian IPv4 ranges
['RU','IR','KP'] - Block all allocated Russian, Iranian, North Korean IPv4 ranges
['ALL!GB'] - Block all but allocated UK IPv4 ranges
['ALL!GB!US!EU'] - Block all but UK,US,EU allocated IPv4 ranges
java -jar gridy-admin-cli.jar rules <add|remove> --data '{"block-country":"'[ 'RU','IR','KP' ]'" }'
Block Users
Block all requests from a specific user ( default: None )
java -jar gridy-admin-cli.jar rules <add|remove> --data '{"block-user":"'['user@domain.com','user@domain1.com']' "}'
Block TOR Exit Nodes
Block all requests from known Dark Web Tor Exit node IPv4 addresses ( default: false )
java -jar gridy-admin-cli.jar rules update --data '{"block-tor-node": true }'
Block Anonymous Proxies
Block all requests from known Anonymous Proxy IPv4 addresses ( default: false )
java -jar gridy-admin-cli.jar rules update --data '{"block-proxy-anonymous": true }'
Block Public Proxies
Block all requests from known Public Proxy IPv4 addresses ( default: false )
java -jar gridy-admin-cli.jar rules update --data '{\"block-proxy-public\": true }'
Block Hosting Providers
Block all requests from known Hosting Provider IPv4 addresses ( default: false )
java -jar gridy-admin-cli.jar rules update --data '{\"block-hosting-provider\": true }'
Enable Authorization Roles & Permissions
Create & Assign Authorization Roles & Permissions to Users ( default: true )
java -jar gridy-admin-cli.jar roles --data '{"roles-enable": true }'
View Authorization Roles & Permissions
View all authorization roles & permissions created
java -jar gridy-admin-cli.jar roles view
Add Authorization Role
Create a new autorization role & permissions ( default: None )
java -jar gridy-admin-cli.jar roles add --data '{
"name": "developer_1",
"role": "developer",
"group": "developer",
"permissions": "view_only"
}'
Remove Authorization Role
Remove an autorization role & permissions ( default: None )
java -jar gridy-admin-cli.jar roles remove --data '{ "name": "developer_1" } }'
Enable Alerting
Enable event alerting (default: false )
java -jar gridy-admin-cli.jar settings update --data '{ "alerting-enabled": true }'
Enable Email Alerts
Enable email alerting (default: false )
java -jar gridy-admin-cli.jar settings update --data '{ "email-alerts": true }'
Enable Webhook Alerts
Enable webhook alerting (default: false )
java -jar gridy-admin-cli.jar settings update --data '{ "webhook-alerts": true }'
Email Alerts - Primary Email Address
Send email alerts to this email address (default: None )
java -jar gridy-admin-cli.jar settings update --data '{ "email-primary": 'user@domain.tld' }'
Email Alerts - CC Address
Send a copy of all email alerts to this email address (default: None )
java -jar gridy-admin-cli.jar settings update --data '{ "email-cc": 'user@domain.tld' }'
Email Alerts - BCC Address
Send a blind copy of all email alerts to this email address (default: None )
java -jar gridy-admin-cli.jar settings update --data '{ "email-bcc": 'user@domain.tld' }'
Webhook Alerts - URL
Incoming Webhook URL (default: None )
java -jar gridy-admin-cli.jar settings update --data '{ "webhook-url": 'https://webhookdomain.tld/webhookpath'}'
Webhook Alerts - Security
Inbound Webhook Security (default: None )
Supported:
- None
- Basic - Base64 encoded username/password sent in HTTP Authorization header:
ie. Authorization: Basic base64(username:password)
java -jar gridy-admin-cli.jar settings update --data '{ "webhook-auth": 'Basic' }'
Webhook Basic Security - Username
Username required when publishing to Inbound Webhook secured with Basic authentication (default: None )
java -jar gridy-admin-cli.jar settings update --data '{ "webhook-username": '<your username>' }'
View all API History
View all API activity over the last 7 days ( default: 7d )
Output Formats
- table
- csv
- json
java -jar gridy-admin-cli.jar history view --period=N<m,h,d> --format=<table,json,csv> --export '/path/file'
View Administrator Accounts
View all adminsitrator accounts created (default: owner )
java -jar gridy-admin-cli.jar admin view
Add Administrator Account
Create a new administrator account with read-write or read-only permissions ( default: read-only )
Note: Only the primary administrator account can create new administrator accounts
Permissions
- read-only - View only access to all API account information via CLI.
- read-write - Read/Write access to all API account information via CLI
Total Adminstrators
Account type | No. of admins | ||
---|---|---|---|
Free | 3 | ||
Developers | 5 | ||
Business | 10 | ||
Community (onPremises) | 10 | ||
Managed | 10 | ||
White Label | 20 |
java -jar gridy-admin-cli.jar admin add --data '{ "admin-add": { "email": "user@domain.tld", "permissions":"read-only" } }'
Remove Adminsitrator Account
Remove an administrator account ( default: None )
java -jar gridy-admin-cli.jar admin remove --data '{ "admin-remove": { "email": "user@domain.tld" } }'