surf

command module
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

SURF

Free Text Search across your infrastructure platforms via CLI.

It's like ... | grep but for your entire infrastructure!

S.U.R.F is an acronym for: Search-Unified-Recursive-Fast

image info

Supported Platforms

Table of Contents

Table of contents generated with markdown-toc

Overview

SURF is built for Infrastructure Engineers as a CLI tool that enables searching any pattern across different platforms. Usually, the results are returned with a direct web URL.

The search process depends on the context, for example: if you're searching in Vault it'll pattern match against keys. Instead, if you're searching in Route53 AWS a DNS address it'll return links to the targets behind it (e.g Load balancer).

Usage Examples

AWS Route53 Usage

Based on AWS Route53: Search what's behind domain api.my-corp.com:

surf r53 -q api.my-corp.com

AWS ACM Usage

Search inside ACM Certificates in AWS.

Example search: containing a domain:

surf acm -q my-domain.com

Example search: certificate attached to a loab balancer:

surf acm -q 's:elasticloadbalancing:us-west-2:123:loadbalancer/app/alb' --filter-used-by

AWS S3 Usage

Search inside S3 Buckets and Keys in AWS.

Example: Find all keys containing logs in all buckets containing the name prod-bucket:

surf s3  -q 'logs' -b 'prod-bucket'

Example: find all keys containng house with prefix key my

surf s3 --prefix my -q house -b my-bucket

Example: find all keys ending with .json and use non-default AWS profile:

surf s3 -q '\.json$' -b bucket-prefix -p my-aws-profile 

Optional: Configure a default bucket name (same as --bucket flag) to start search from (any regex pattern):

export SURF_S3_DEFAULT_MOUNT=<my-bucket-pattern>

Hashicorp Vault Usage

Search the query aws in Vault:

surf vault -q aws 

Configure a default mount to start search from in Vault:

export SURF_VAULT_DEFAULT_MOUNT=<my-default-mount>

Store LDAP auth on your OS keychain:

surf config

Hashicorp Consul Usage

Search all keys containing the substring server

surf consul -q "server"

Search under the scripts path for keys ending with .sh

surf consul --prefix scripts --query "\.sh$"

Install

Brew

MacOS (and ubuntu supported) installation via Brew:

brew tap isan-rivkin/toolbox
brew install surf
Download Binary
  1. from releases

  2. Move the binary to global dir and change name to surf:

cd <downloaded zip dir>
mv surf /usr/local/bin
Install from Source
git clone git@github.com:Isan-Rivkin/surf.git
cd surf
go run main.go

Authentication

Please open a PR and request additional methods if you need.

Supported Authentication Methods

  • Vault - LDAP (run $surf config )
  • AWS - via profile on ~/.aws/credentials file
  • Consul - None

Version check

The CLI will query github.com to check if there is a newer version and print out a message to the terminal.

If you wish to opt out set the environment variable SURF_VERSION_CHECK=false.

No Data is collected it is purely github.com query.

How it Works

image info

Contributors

  • @AliRamberg
  • @Isan-Rivkin

Documentation

Overview

Copyright © 2022 Isan Rivkin isanrivkin@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
lib

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL