Giter VIP home page Giter VIP logo

selefra / selefra Goto Github PK

View Code? Open in Web Editor NEW
510.0 6.0 36.0 704 KB

The open-source policy-as-code software that provides analysis for Multi-Cloud and SaaS environments, you can get insight with natural language (powered by OpenAI).

Home Page: https://www.selefra.io

License: Mozilla Public License 2.0

Makefile 0.06% Go 98.10% Shell 1.78% Dockerfile 0.07%
gcp azure cspm infrastructure-as-code policy-as-code aws cloud golang kubernetes finops

selefra's Introduction

Steampipe Logo

Selefra is an open-source policy-as-code software that provides analytics for multi-cloud and SaaS.

go Total GitHub license

     

banner


About Selefra

Selefra means "select * from infrastructure". It is an open-source policy-as-code software that provides analysis for multi-cloud and SaaS environments, including over 30 services such as AWS, GCP, Azure, Alibaba Cloud, Kubernetes, Github, Cloudflare, and Slack.

For best practices and detailed instructions, refer to the Docs. Within the Docs, you will find information on installation, CLI usage, project workflow, and more guides on how to accomplish cloud inspection tasks.

With Selefra, you can engage in conversations with GPT models, which will analyze the information and provide relevant suggestions for security, cost, and architecture checks, helping you better manage their cloud resources, enhance security, reduce costs, and optimize architecture design.

img_code

🔥 Policy as Code

Custom analysis policies (security, compliance, cost) can be written through a combination of SQL and YAML.

💥 Configuration of Multi-Cloud, Multi-SaaS

Unified multi-cloud configuration data integration capabilities that can support analysis of configuration data from any cloud service via SQL.

🌟 Version Control

Analysis policies can be managed through VCS such as GitHub/Gitlab.

🥤 Automation

Policies can be automated to enforce compliance, security, and cost optimization rules through Scheduled tasks and cloud automation tools.

Getting started

Read detailed documentation for how to Get Started with Selefra.

For quick start, run this demo, it should take less than a few minutes:

  1. Install Selefra

    For non-macOS users, download packages to install Selefra.

    On macOS, tap Selefra with Homebrew:

    brew tap selefra/tap

    Next, install Selefra:

    brew install selefra/tap/selefra
  2. Initialization project

    mkdir selefra-demo && cd selefra-demo && selefra init
  3. Build code

    selefra apply 

🔥 Analyze cloud resources using GPT

You can refer to the documentation to configure your OPENAPI_API_KEY in advance and start analyzing your cloud resources

selefra gpt <"what you want to analyze"> --openai_mode=gpt-3.5 --openai_limit=5 --openai_api_key=<Your Openai Api Key>

Selefra Community Ecosystem

Provider Introduce Status
AWS The AWS Provider for Selefra can be used to extract data from many of the cloud services by AWS. The provider must be configured with credentials to extract and analyze infrastructure data from AWS. Stable
GCP The GCP Provider for Selefra can be used to extract data from many of the cloud services by GCP. The provider must be configured with credentials to extract and analyze infrastructure data from GCP. Stable
K8S The K8s Provider for Selefra can be used to extract data from many of the cloud services by K8s. The provider must be configured with credentials to extract and analyze infrastructure data from K8s. Stable
Azure The Azure Provider for Selefra can be used to extract data from many of the cloud services by Azure. The provider must be configured with credentials to extract and analyze infrastructure data from Azure. Stable
Slack The Slack Provider for Selefra can be used to extract data from many of the cloud services by Slack. The provider must be configured with credentials to extract and analyze infrastructure data from Slack. Stable
Cloudflare The Cloudflare Provider for Selefra can be used to extract data from many of the cloud services by Cloudflare. The provider must be configured with credentials to extract and analyze infrastructure data from Cloudflare. Stable
Datadog The Datadog Provider for Selefra can be used to extract data from many of the cloud services by Datadog. The provider must be configured with credentials to extract and analyze infrastructure data from Datadog. Stable
Microsoft365 The Microsoft365 Provider for Selefra can be used to extract data from many of the cloud services by Microsoft365. The provider must be configured with credentials to extract and analyze infrastructure data from Microsoft365. Stable
Vercel The Vercel Provider for Selefra can be used to extract data from many of the cloud services by Vercel. The provider must be configured with credentials to extract and analyze infrastructure data from Vercel. Stable
Github The Github Provider for Selefra can be used to extract data from many of the cloud services by Github. The provider must be configured with credentials to extract and analyze infrastructure data from Github. Stable
GoogleWorksplace The GoogleWorksplace Provider for Selefra can be used to extract data from many of the cloud services by GoogleWorksplace. The provider must be configured with credentials to extract and analyze infrastructure data from GoogleWorksplace. Stable
Auth0 The Auth0 Provider for Selefra can be used to extract data from many of the cloud services by Auth0. The provider must be configured with credentials to extract and analyze infrastructure data from Auth0. Stable
Zendesk The Zendesk Provider for Selefra can be used to extract data from many of the cloud services by Zendesk. The provider must be configured with credentials to extract and analyze infrastructure data from Zendesk. Stable
Consul The Consul Provider for Selefra can be used to extract data from many of the cloud services by Consul. The provider must be configured with credentials to extract and analyze infrastructure data from Consul. Stable
Zoom The Zoom Provider for Selefra can be used to extract data from many of the cloud services by Zoom. The provider must be configured with credentials to extract and analyze infrastructure data from Zoom. Stable
Gandi The Gandi Provider for Selefra can be used to extract data from many of the cloud services by Gandi. The provider must be configured with credentials to extract and analyze infrastructure data from Gandi. Stable
Heroku The Heroku Provider for Selefra can be used to extract data from many of the cloud services by Heroku. The provider must be configured with credentials to extract and analyze infrastructure data from Heroku. Stable
IBM The IBM Provider for Selefra can be used to extract data from many of the cloud services by IBM. The provider must be configured with credentials to extract and analyze infrastructure data from IBM. Stable
Pagerduty The Pagerduty Provider for Selefra can be used to extract data from many of the cloud services by Pagerduty. The provider must be configured with credentials to extract and analyze infrastructure data from Pagerduty. Stable
AliCloud The AliCloud Provider for Selefra can be used to extract data from many of the cloud services by AliCloud. The provider must be configured with credentials to extract and analyze infrastructure data from AliCloud. Stable
Okta The Okta Provider for Selefra can be used to extract data from many of the cloud services by Okta. The provider must be configured with credentials to extract and analyze infrastructure data from Okta. Stable
Oci The Oci Provider for Selefra can be used to extract data from many of the cloud services by Oci. The provider must be configured with credentials to extract and analyze infrastructure data from Oci. Stable
Boundary The Boundary Provider for Selefra can be used to extract data from many of the cloud services by Boundary. The provider must be configured with credentials to extract and analyze infrastructure data from Boundary. Stable
Stripe The Stripe Provider for Selefra can be used to extract data from many of the cloud services by Stripe. The provider must be configured with credentials to extract and analyze infrastructure data from Stripe. Stable
Planetscale The Planetscale Provider for Selefra can be used to extract data from many of the cloud services by Planetscale. The provider must be configured with credentials to extract and analyze infrastructure data from Planetscale. Stable
Snowflake The Snowflake Provider for Selefra can be used to extract data from many of the cloud services by Snowflake. The provider must be configured with credentials to extract and analyze infrastructure data from Snowflake. coming soon

Community

Selefra is a community-driven project, we welcome you to open a GitHub Issue to report a bug, suggest an improvement, or request new feature.

Contributing

For developers interested in building Selefra codebase, read through Contributing.md and Selefra Roadmap. Let us know what you would like to work on!

License

Mozilla Public License v2.0

selefra's People

Contributors

felixsjiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

selefra's Issues

[Bug]: Selefra GPT functionality informs me of a syntax error.

Contact Details

No response

Version

latest

What happened?

When I run the following command, I received an error message.

selefra gpt "Query S3 Buckets without MFA Delete Protection Enabled."

image

Relevant log output

No response

Proposed changes

No response

[Bug]: The GPT function will be invoked during the "apply" process

Contact Details

No response

Version

latest

What happened?

I noticed that Selefra invokes the GPT function when I use "apply," which should not be the case. Ideally, the "apply" and GPT functionalities should be separate.

Relevant log output

No response

Proposed changes

No response

[Feature]: Adding support for filtering policies.

Priority

Medium

Contact Details

No response

Summary

Adding support for filtering policies

Description

Since the number of Policies contained in the same Modules is too large, I want Selefra to support filtering the implemented Policies according to the Policy's Level, Tag, Providers, Name, etc. The specific requirements are described as follows:

  • selefra apply command line can support filtering by Policy's level, Tag, Providers, Name equal to, not equal to, include, etc.
  • selefra modules can support filtering by Policy level, Tag, Providers, Name equal to, not equal to, include, etc.

Benefit

Allows for more flexible use of policies in complex mods

[Bug]: selefra apply bug

Contact Details

[email protected]

Version

0.2.1

What happened?

I try to test selefra in centos8, I create selefra users, initialize services, selefra test is all right, but I encounter the following problems when selefra apply

Relevant log output

bash-4.4$ selefra apply 
panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
github.com/selefra/selefra/pkg/modules/parser.(*YamlFileToModuleParser).Parse(0xc0000e62b8)
       /home/runner/work/selefra/selefra/pkg/modules/parser/yaml_file_to_module_parser.go:58 +0x9ae
github.com/selefra/selefra/pkg/modules/module_loader.(*LocalDirectoryModuleLoader).Load(0xc0000121d0, {0x17e5558, 0xc000046088})
       /home/runner/work/selefra/selefra/pkg/modules/module_loader/local_directory_module_loader.go:103 +0x565
github.com/selefra/selefra/pkg/modules/executors.(*ProjectLocalLifeCycleExecutor).loadModule(0xc0000e61c8, {0x17e5558, 0xc000046088})
       /home/runner/work/selefra/selefra/pkg/modules/executors/project_local_life_cycle_executor.go:270 +0x34c
github.com/selefra/selefra/pkg/modules/executors.(*ProjectLocalLifeCycleExecutor).Execute(0xc0000e61c8, {0x17e5558, 0xc000046088})
       /home/runner/work/selefra/selefra/pkg/modules/executors/project_local_life_cycle_executor.go:128 +0xb1
github.com/selefra/selefra/cmd/apply.Apply({0x17e5558, 0xc000046088}, 0xc0000eea80, {0x14324c0, 0x2}, {0xc0000bc960, 0x20})
       /home/runner/work/selefra/selefra/cmd/apply/apply.go:66 +0x20b
github.com/selefra/selefra/cmd/apply.NewApplyCmd.func1(0xc0002aac00, {0x1433551?, 0x0?, 0x0?})
       /home/runner/work/selefra/selefra/cmd/apply/apply.go:31 +0xe5
github.com/spf13/cobra.(*Command).execute(0xc0002aac00, {0x21b27f8, 0x0, 0x0})
       /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0x216ca20)
       /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
       /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:968
github.com/selefra/selefra/cmd.Execute()
       /home/runner/work/selefra/selefra/cmd/root.go:76 +0x46
main.main()
       /home/runner/work/selefra/selefra/main.go:23 +0x17

Proposed changes

No response

[Feature]: Selefra rules language support for OpenAI prompt

Priority

Critical

Contact Details

[email protected]

Summary

Add support for OpenAI

Description

Selefra rules's query supports OpenAI prompt analysis of multi-cloud data, handing over the configuration data combination prompt to OpenAI for analysis and outputting the analysis results in the specified format.

Benefit

It is used to reduce the difficulty of Selefrapolicy development and improve the analysis ability quickly.

[Feature]: Selefra Apply result item increases output color.

Priority

Low

Contact Details

No response

Summary

The output results are marked with different colors according to different danger levels.

Description

The output results are marked with different colors according to different danger levels.

Benefit

More intuitively reflect the vulnerability level.

[Feature]: Addresses adding web proxies for special regions.

Priority

Low

Contact Details

[email protected]

Summary

Addresses adding web proxies for special regions.

Description

In some areas, the provider cannot be downloaded smoothly due to network problems, so adding a proxy allows it to run the project normally.

Benefit

In some areas, the provider cannot be downloaded smoothly due to network problems, so adding a proxy allows it to run the project normally.

[Bug]: Error returned when using gpt function, status code 429

Contact Details

No response

Version

latest

What happened?

When I use the gpt function an error is returned with the following message:

> selefra gpt -q "Help me query AWS EC2 instances that are not running"

Selefra Cloud init success
	Provider [email protected] has installed
Rule CloudChat begin exec...
ChatCompletion error: error, status code: 429, message: That model is currently overloaded with other requests. You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID xxxxxxxxxxxx in your message.)
error, status code: 429, message: That model is currently overloaded with other requests. You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID xxxxxxxxxxxx in your message.)
Selefra Exit

Relevant log output

No response

Proposed changes

No response

[Bug]: selefra gpt returns "mode not found"

Contact Details

[email protected]

Version

0.2.1

What happened?

The command selefra gpt 'some query' returns 'mode not found' with gpt3/3.5

Relevant log output

❮ selefra gpt "How many g5 ec2 instances are running in eu west 1?"
 _____        _         __              
/  ___|      | |       / _|             
\ `--.   ___ | |  ___ | |_  _ __   __ _ 
 `--. \ / _ \| | / _ \|  _|| '__| / _` |
/\__/ /|  __/| ||  __/| |  | |   | (_| |
\____/  \___||_| \___||_|  |_|    \__,_|

Selefra - Simplify Cloud and SaaS analysis with Selefra.


Initializing provider plugins...

	- [email protected] all ready updated!

Selefra has been successfully installed providers!

Checking Selefra provider updates...

	- [email protected] all ready updated!

Selefra has been finished update providers!

Testing Selefra operation environment...

	- Client verification completed
	- Providers verification completed
	- Profile verification completed

Complete the Selefra runtime environment test!

Selefra will start infrastructure data collection...
aws [email protected], pull infrastructure data:
Provider [email protected] resource fetch 363/477  finished task count 2081 ...

Complete Selefra infrastructure data collection!

Selefra will load and apply selefra policy with sql and prompt...

Loading and initializing Selefra policy...

	- "CloudChat" Rule Completed

Loaded: 1 policies to loaded, 0 Critical, 0 High, 0 Medium, 1 Low, 0 Informational.

mode not found
Summary: Total 0 Issues, 0 Critical, 0 High, 0 Medium, 0 Low, 0 Informational.

Selefra Exit

Proposed changes

Fix

[Bug]: If DNS pollution occurs

Contact Details

[email protected]

Version

0.1.0

What happened?

➜ selefra-demo (main) ✗ selefra apply
load module ./ @ /Users/admin/go/src/selefra-demo success
Login to selefra cloud main-grpc.selefra.io:1234
Selefra Cloud init success
Use built-in PostgreSQL database...
Start postgresql success
waiting for server to start.... done
server started
error[E827890]: get provider azure meta information from registry error: Get "https://raw.githubusercontent.com/selefra/registry/main/provider/azure/metadata.yaml": dial tcp 0.0.0.0:443: connect: connection refused
--> /Users/admin/go/src/selefra-demo/selefra.yaml:9:19 ( selefra.providers[0] )
| 4 project: selefra-demo
| 5 cli_version: 0.1.0
| 6 log_level: info
| 7 providers:
| 8 - name: azure
| 9 source: azure
| ^^^^^
| 10 version: v0.1.0
| 11
--> See our docs: http://selefra.io/docs

Relevant log output

No response

Proposed changes

  1. Query the real IP address
    Through IPAddress.com query raw.githubusercontent.com real IP
    185.199.108.133
    185.199.109.133
    185.199.110.133
    185.199.111.133
  2. Modify hosts
    CentOS and macOS input directly from terminals
    sudo vi /etc/hosts
    Edit the hosts file and add the following content
    (You can configure the same domain name and different ip addresses. The resolution sequence is from the first IP address. If the first IP address fails to be resolved, the next IP address will be resolved.)
    185.199.110.133 raw.githubusercontent.com
    185.199.111.133 raw.githubusercontent.com

[Feature]: Add formatted output to specified file

Priority

Medium

Contact Details

No response

Summary

Format the final output result to the specified file.

Description

Format the final output result to the specified file.

Benefit

It is convenient for other three parties to integrate and use, or to analyze the data directly.

[Feature]: Provide a sandbox operating environment

Priority

Low

Contact Details

No response

Summary

Provide a sandbox operating environment

Description

Provide a sandbox operating environment,It is convenient for users to quickly experience.

Benefit

It allows users to experience the features of the product more quickly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.