<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Felix</title>
    <description>The latest articles on DEV Community by Felix (@bineshsamal).</description>
    <link>https://dev.to/bineshsamal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1034657%2F8ec61f63-fa05-4320-8c20-1da5c7de34ba.jpeg</url>
      <title>DEV Community: Felix</title>
      <link>https://dev.to/bineshsamal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bineshsamal"/>
    <language>en</language>
    <item>
      <title>Introduction to EC2 instance metadata and risk prevention</title>
      <dc:creator>Felix</dc:creator>
      <pubDate>Sun, 09 Jul 2023 15:40:47 +0000</pubDate>
      <link>https://dev.to/bineshsamal/introduction-to-ec2-instance-metadata-and-risk-prevention-5a2p</link>
      <guid>https://dev.to/bineshsamal/introduction-to-ec2-instance-metadata-and-risk-prevention-5a2p</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fESICc_Z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mtb30y4cxr3pctef3zfv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fESICc_Z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mtb30y4cxr3pctef3zfv.png" alt="Image description" width="800" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Amazon EC2 Instance Metadata Service (IMDS) can help users obtain information about the instance itself. With IMDS, you can access various information about the instance, such as hostname, host IP, temporary access credentials, user data, and more. While this information is convenient for users, it also introduces new risks.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Risks&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A common attack scenario is when an instance has an SSRF vulnerability, attackers can retrieve information from the metadata. If temporary access credentials exist in the metadata, attackers can use these credentials for lateral attacks.&lt;/p&gt;

&lt;p&gt;!&lt;a href="https://superblog.supercdn.cloud/site_cuid_cldhcpt7a1506291jkdhe6vl2sc/images/untitled-11-1688916597258-compressed.png"&gt;https://superblog.supercdn.cloud/site_cuid_cldhcpt7a1506291jkdhe6vl2sc/images/untitled-11-1688916597258-compressed.png&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Furthermore, if sensitive information is present in user data, attackers can retrieve this data through the metadata, resulting in information leakage and facilitating the next steps of attack and exploitation by the attackers.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Risk Detection&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Manual Assessment&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;There are three main ways to assess the risks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Access &lt;a href="http://169.254.169.254/latest/meta-data/%C2%A0within"&gt;http://169.254.169.254/latest/meta-data/ within&lt;/a&gt; the instance to check if the returned result is normal. If it is, it indicates that the instance's metadata is enabled and accessible without authorization.&lt;/li&gt;
&lt;li&gt;In the instance's Action → Instance settings → Modify instance metadata options, if the Instance metadata service is in an "Enable" state and IMDSv2 is in an "Optional" state, it means the metadata is at risk.&lt;/li&gt;
&lt;li&gt;You can also use the AWS CLI to obtain the current instance's state:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DDgn4Z33--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7hzf000y9f8c77wgki6p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DDgn4Z33--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7hzf000y9f8c77wgki6p.png" alt="Image description" width="800" height="611"&gt;&lt;/a&gt;&lt;br&gt;
F!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ec2 describe-instances --instance-ids &amp;lt;instance_id&amp;gt; --query 'Reservations[*].Instances[*].MetadataOptions'

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the HttpTokens in the returned content is "optional," it indicates that the metadata service of the current instance is at risk.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[
    [
        {
            "State": "applied",
            "HttpTokens": "optional",
            "HttpPutResponseHopLimit": 1,
            "HttpEndpoint": "enabled",
            "HttpProtocolIpv6": "disabled",
            "InstanceMetadataTagsF!": "disabled"
        }
    ]
]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Using Selefra for Assessment&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Manual discovery of these issues can be time-consuming and cannot be done in bulk. Using Selefra can help you quickly identify these risks. Selefra is a tool for rapidly discovering multi-cloud and SaaS risks. The Selefra project can be found at &lt;a href="https://github.com/selefra/selefra"&gt;github.com/selefra/selefra&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let's start by installing Selefra:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew tap selefra/tap
brew install selefra/tap/selefra
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, create a project folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir selefra-test
cd selefra-test

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the following YAML file to this folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;selefra:
    name: selefra-test
    connection:
      type: postgres
      username: your_username
      password: your_password
      host: 127.0.0.1
      port: 5432
      database: postgres
      sslmode: disable
    log_level: info
    providers:
        - name: aws
          source: aws
          version: v0.1.0
providers:
    - name: aws
      provider: aws
      cache: 7d
rules:
  - name: ec2_metadata_unlimited_access
    metadata:
      title: EC2 metadata unlimited access
      severity: High
    query: |-
      SELECT
                *
            FROM
                aws_ec2_instances
            WHERE
                metadata_options -&amp;gt;&amp;gt; 'HttpTokens' = 'optional';
    output: "EC2 metadata unlimited access, arn: { {.arn} }"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, it is divided into three modules: selefra, provider, and rules.&lt;/p&gt;

&lt;p&gt;In the selefra module, configure your own PostgreSQL database connection address, username, and password in the connection block. The cache block in the provider module can set the cache time for fetching data. The rules module is for configuring the detection issues. The title block represents the title of the detection strategy, and the SQL statement in the query block is used to execute the detection strategy by querying the vulnerable resources in the database.&lt;/p&gt;

&lt;p&gt;Before starting the detection, configure your AWS credentials by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws configure

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run the following command to run Selefra:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;selefra apply

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now Selefra will start the detection process. Below is an example of the result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uTCew5Bc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uagtow25llu7s7s2rbyx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uTCew5Bc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uagtow25llu7s7s2rbyx.png" alt="Image description" width="800" height="543"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the result, we can see that there are 3 instances with metadata risks.&lt;/p&gt;

&lt;p&gt;In addition to the above method, Selefra also integrates GPT functionality. This feature allows you to discover risk points by directly querying Selefra.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Using Selefra GPT for Assessment&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Similar to the previous steps, create a new folder and copy the following YAML file into it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;selefra:
    name: selefra-test
    connection:
      type: postgres
      username: yourusername
      password: yourpassword
      host: 127.0.0.1
      port: 5432
      database: postgres
      sslmode: disable
    log_level: info
        openai_api_key: your_openai_api_key
    openai_mode: gpt-4
    openai_limit: 10
    providers:
        - name: aws
          source: aws
          version: v0.1.0
providers:
    - name: aws
      provider: aws
      cache: 30d
rules:

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The difference here is that you need to provide your own OpenAI API Key. You can also set whether to use GPT-4 or GPT-3.5 in the openai_mode. Furthermore, leave the rules block empty, as AI will generate the content for this section.&lt;/p&gt;

&lt;p&gt;Before starting the detection, configure your AWS credentials as before. Then you can use the GPT functionality:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;selefra gpt "Query instances with unrestricted access to metadata."

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;**&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MfX2uARY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ie7b4edyj8xm5340ar25.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MfX2uARY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ie7b4edyj8xm5340ar25.png" alt="Image description" width="800" height="1125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;p&gt;As you can see, with just a single sentence, you can discover instances where the metadata service is at risk. It's very convenient.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prevention&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To mitigate the risks associated with the AWS EC2 Instance Metadata Service, there are two main methods. First, if you don't need metadata, you can disable it directly. Second, if you need to use the metadata service, you can enable token-based access to prevent direct access to metadata.&lt;/p&gt;

&lt;p&gt;To disable the metadata service, there are three common methods:&lt;/p&gt;

&lt;p&gt;1.Disable metadata during instance creation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HIZx31tY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/naqd5nv725rlgy5zstsl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HIZx31tY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/naqd5nv725rlgy5zstsl.png" alt="Image description" width="800" height="635"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.After creating the instance, go to the console's Action → Instance settings → Modify instance metadata options and disable it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZOykrK7g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/feym5q95e7gumug8vq7b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZOykrK7g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/feym5q95e7gumug8vq7b.png" alt="Image description" width="800" height="648"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After creating the instance, you can also use AWS CLI to disable it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ec2 modify-instance-metadata-options --instance-id &amp;lt;instance_id&amp;gt; --http-endpoint disabled
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To enable token-based access, there are also three common methods:&lt;/p&gt;

&lt;p&gt;1.During instance creation, select "V2 only" in the Metadata version.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EjR1BEJ4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jsyzurkms2qus7tkj5u0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EjR1BEJ4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jsyzurkms2qus7tkj5u0.png" alt="Image description" width="800" height="469"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.After creating the instance, go to the console's Action → Instance settings → Modify instance metadata options, and check "Required" for IMDSv2.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WICHAIym--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/37hp72phumy8lq11uoq0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WICHAIym--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/37hp72phumy8lq11uoq0.png" alt="Image description" width="800" height="667"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After creating the instance, you can also use the command line to modify it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ec2 modify-instance-metadata-options --instance-id &amp;lt;instance_id&amp;gt; --http-tokens required

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In this article, we introduced the risks associated with metadata and how to mitigate these risks. By using Selefra, you can quickly and efficiently identify instances that have metadata risks. We hope this article has been helpful to you and that Selefra can make your cloud environment more secure.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/selefra/selefra"&gt;https://github.com/selefra/selefra&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Slack: &lt;a href="https://selefra.io/community/join"&gt;https://selefra.io/community/join&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recommended reading&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.selefra.io/blog/how-to-spot-and-fix-issues-with-publicly-accessible-aws-s3-buckets-cljl5t7ng11971413tqwzdeuzfvm"&gt;How to spot and fix issues with publicly accessible AWS S3 buckets&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.selefra.io/blog/why-choose-pgsql-as-the-database-for-resource-storage-cljv8ln4a738313tp9502hzi9q"&gt;Why Choose PGSQL as the Database for Resource Storage&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>opensource</category>
      <category>gpt3</category>
      <category>devops</category>
    </item>
    <item>
      <title>Why Choose PGSQL as the Database for Resource Storage</title>
      <dc:creator>Felix</dc:creator>
      <pubDate>Sun, 09 Jul 2023 10:38:19 +0000</pubDate>
      <link>https://dev.to/bineshsamal/why-choose-pgsql-as-the-database-for-resource-storage-1nk</link>
      <guid>https://dev.to/bineshsamal/why-choose-pgsql-as-the-database-for-resource-storage-1nk</guid>
      <description>&lt;h3&gt;
  
  
  Analyzing the Ideal Database Choice for Selefra's Policy-as-Code Tool
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F89y61j8sfdrus80y3zx0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F89y61j8sfdrus80y3zx0.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In today's cloud computing environment, the demand for Policy-as-Code (PaC) tools is increasing to achieve tasks such as multi-cloud security, cost analysis, and organizational structure analysis. Selefra is an excellent PaC tool that uses YAML to read policies and relies on PGSQL database for storing cloud service resources. This article will explore why PGSQL is chosen as the database for resource storage and highlight its advantages for such query analysis PaC tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scalability
&lt;/h3&gt;

&lt;p&gt;PGSQL is a mature open-source Relational Database Management System (RDBMS) with excellent scalability. In the cloud environment, the number and scale of resources can grow over time. PGSQL's scalability allows it to handle large volumes of data and supports horizontal and vertical scaling, meeting the storage requirements of Selefra in different-scale environments.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data Consistency
&lt;/h3&gt;

&lt;p&gt;As a relational database, PGSQL provides robust transaction support, ensuring data consistency. Selefra needs to read and analyze data from cloud service resources and perform policy checks based on it. PGSQL's transaction mechanism guarantees the integrity and consistency of data across multiple queries and analysis operations, enhancing the tool's reliability and accuracy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Powerful Query Capabilities
&lt;/h3&gt;

&lt;p&gt;Selefra requires flexible and efficient querying and analysis of cloud service resources. PGSQL offers rich query capabilities, supporting complex SQL queries, aggregation operations, and window functions, among others. By leveraging PGSQL's powerful querying capabilities, Selefra can easily perform in-depth analysis of resources in multi-cloud environments, providing valuable insights to users.&lt;/p&gt;

&lt;p&gt;Such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;
  &lt;span class="k"&gt;DISTINCT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;
  &lt;span class="n"&gt;aws_s3_buckets&lt;/span&gt; &lt;span class="n"&gt;a1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;aws_s3_bucket_grants&lt;/span&gt; &lt;span class="n"&gt;a2&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt;
 &lt;span class="n"&gt;a1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;selefra_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;aws_s3_buckets_selefra_id&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;a2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;grantee&lt;/span&gt; &lt;span class="p"&gt;::&lt;/span&gt; &lt;span class="n"&gt;jsonb&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'URI'&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'http://acs.amazonaws.com/groups/global/AllUsers'&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;a2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;permission&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'WRITE_ACP'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'FULL_CONTROL'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Security
&lt;/h3&gt;

&lt;p&gt;In PaC tools, security is a crucial concern, especially when dealing with sensitive data. PGSQL provides multi-level security features, including role-based access control, SSL/TLS encryption, and transparent encryption storage of data. By using PGSQL as the database for resource storage, Selefra can leverage these security features to protect user data, ensuring that sensitive information remains inaccessible to unauthorized parties.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mature Ecosystem
&lt;/h3&gt;

&lt;p&gt;PGSQL, as a popular database management system, has a large and active community and ecosystem. This means that support and advice on performance tuning, security best practices, and bug fixes are readily available. Selefra can benefit from the knowledge and resources of the PGSQL community, staying up-to-date with the latest developments in database technology and obtaining support when needed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffyss6y20wxmvpsciapz0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffyss6y20wxmvpsciapz0.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Choosing PGSQL as the database for resource storage in Selefra is a wise decision. PGSQL's scalability, data consistency, powerful query capabilities, security features, and mature ecosystem make it an ideal choice for query analysis-based Policy-as-Code tools. By harnessing the advantages of PGSQL, Selefra can provide efficient, reliable, and secure analysis of cloud service resources, offering users a better experience in multi-cloud management.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/selefra/selefra" rel="noopener noreferrer"&gt;https://github.com/selefra/selefra&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Slack: &lt;a href="https://selefra.io/community/join" rel="noopener noreferrer"&gt;https://selefra.io/community/join&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;recommended reading&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.selefra.io/blog/how-to-spot-and-fix-issues-with-publicly-accessible-aws-s3-buckets-cljl5t7ng11971413tqwzdeuzfvm" rel="noopener noreferrer"&gt;How to spot and fix issues with publicly accessible AWS S3 buckets&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.selefra.io/blog/how-selefra-combines-gpt-for-multi-cloud-security-scanning-clji608k39978973tqwvuerzhnu" rel="noopener noreferrer"&gt;How Selefra Combines GPT for Multi-Cloud Security Scanning&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>opensource</category>
      <category>postgres</category>
    </item>
    <item>
      <title>A Better Version Is Released - Selefra v0.2.3</title>
      <dc:creator>Felix</dc:creator>
      <pubDate>Tue, 04 Jul 2023 04:17:25 +0000</pubDate>
      <link>https://dev.to/bineshsamal/a-better-version-is-released-selefra-v023-2797</link>
      <guid>https://dev.to/bineshsamal/a-better-version-is-released-selefra-v023-2797</guid>
      <description>&lt;h2&gt;
  
  
  Release Note - Selefra v0.2.3
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Date: June 30, 2023
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AFmVVR6f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yh4dshirulec9s31fke9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AFmVVR6f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yh4dshirulec9s31fke9.png" alt="Image description" width="800" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are excited to announce the release of Selefra v0.2.3, an open-source Policy-as-Code (PaC) product. This version introduces several bug fixes and enhancements to improve your experience with Selefra. &lt;/p&gt;

&lt;p&gt;Here are some key updates:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;[Feature]Modules support filtering, while labels support customization of any format. by &lt;a href="https://github.com/FelixsJiang"&gt;@FelixsJiang&lt;/a&gt; in &lt;a href="https://github.com/selefra/selefra/pull/30"&gt;#30&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[Fixed]Change the uses to string. by &lt;a href="https://github.com/FelixsJiang"&gt;@FelixsJiang&lt;/a&gt; in &lt;a href="https://github.com/selefra/selefra/pull/30"&gt;#30&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[Feature]Add output error handling. by &lt;a href="https://github.com/FelixsJiang"&gt;@FelixsJiang&lt;/a&gt; in &lt;a href="https://github.com/selefra/selefra/pull/30"&gt;#30&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;In the new version, you can filter out unnecessary policies by configuring a filter in modules to streamline the results.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Specifically, you can configure it as follows：&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;modules:
  - name: aws-misconfiguration-s3
    uses: ./rules
    filter:
      - name: ebs_encryption_is_disabled_by_default
        severity: Low
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example will filter out the policy with name is ebs_encryption_is_disabled_by_default or the Policy with low severity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summarize
&lt;/h2&gt;

&lt;p&gt;To get started with Selefra v0.2.3, please visit our official repository (Github: &lt;a href="https://github.com/selefra/selefra"&gt;https://github.com/selefra/selefra&lt;/a&gt;) and follow the installation instructions. Remember to update your current version to benefit from the latest enhancements.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JO2aLjld--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jb87hbb086hoxdawqhjz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JO2aLjld--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jb87hbb086hoxdawqhjz.png" alt="Image description" width="800" height="769"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for your continued support, and we hope you find Selefra v0.2.3 to be a valuable PaC implementing tool in your projects.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;

&lt;p&gt;The Selefra Team&lt;/p&gt;

&lt;p&gt;Github: &lt;a href="https://github.com/selefra/selefra"&gt;https://github.com/selefra/selefra&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;recommended reading&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.selefra.io/blog/how-to-spot-and-fix-issues-with-publicly-accessible-aws-s3-buckets-cljl5t7ng11971413tqwzdeuzfvm"&gt;How to spot and fix issues with publicly accessible AWS S3 buckets&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.selefra.io/blog/how-selefra-combines-gpt-for-multi-cloud-security-scanning-clji608k39978973tqwvuerzhnu"&gt;How Selefra Combines GPT for Multi-Cloud Security Scanning&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>chatgpt</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How to spot and fix issues with publicly accessible AWS S3 buckets</title>
      <dc:creator>Felix</dc:creator>
      <pubDate>Sun, 02 Jul 2023 08:35:21 +0000</pubDate>
      <link>https://dev.to/bineshsamal/how-to-spot-and-fix-issues-with-publicly-accessible-aws-s3-buckets-2jop</link>
      <guid>https://dev.to/bineshsamal/how-to-spot-and-fix-issues-with-publicly-accessible-aws-s3-buckets-2jop</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mWdxaeEI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7r4413jyjsda6ks5krai.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mWdxaeEI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7r4413jyjsda6ks5krai.png" alt="Image description" width="800" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;The issue of public access to AWS S3 buckets is one of the most common problems encountered with AWS S3 services. This can lead to sensitive data stored in S3 being exposed. The presence of this problem is due to the configuration of public access policies for the storage bucket. In this article, we will discuss how to detect and prevent this issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Problem
&lt;/h2&gt;

&lt;p&gt;When we can directly access files in a storage bucket, it indicates that the bucket has a public access issue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WM955-mk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e6r7luk69lg6ryw89w09.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WM955-mk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e6r7luk69lg6ryw89w09.png" alt="Image description" width="800" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As seen in the image above, we can directly access files in the storage bucket. Now let's understand why this is happening.&lt;/p&gt;

&lt;p&gt;If we examine the policy for this bucket, we might see a configuration similar to the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "Version": "2012-10-17",
    "Id": "test",
    "Statement": [
        {
            "Sid": "test",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::selefra-test-omkqt/*"
        }
    ]
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this policy, everyone is granted the &lt;code&gt;s3:GetObject&lt;/code&gt; permission for the &lt;code&gt;selefra-test-xxxx&lt;/code&gt; bucket, resulting in public access to objects in the bucket.&lt;/p&gt;

&lt;h2&gt;
  
  
  Remediation
&lt;/h2&gt;

&lt;p&gt;We should follow the principle of least privilege, which means allowing only specific users to have specific permissions instead of granting access to all users.&lt;/p&gt;

&lt;p&gt;For storage buckets that require public access due to business requirements, sensitive data should be avoided in those buckets.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Selefra for Quick Discovery
&lt;/h2&gt;

&lt;p&gt;Manually discovering these issues can be time-consuming and cannot be done in bulk. Using Selefra can help you quickly identify these risks.&lt;/p&gt;

&lt;p&gt;Selefra project repository: &lt;a href="https://github.com/selefra/selefra"&gt;github.com/selefra/selefra&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Typical Usage of Selefra
&lt;/h3&gt;

&lt;p&gt;First, let's install Selefra:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew tap selefra/tap
brew install selefra/tap/selefra

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, create a new project folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir selefra-test
cd selefra-test

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the following YAML file into this folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;selefra:
    name: selefra-test
    connection:
      type: postgres
      username: your_username
      password: your_password
      host: 127.0.0.1
      port: 5432
      database: postgres
      sslmode: disable
    log_level: info
    providers:
        - name: aws
          source: aws
          version: v0.1.0
providers:
    - name: aws
      provider: aws
      cache: 7d
rules:
    - name: bucket_publicly_readable
        metadata:
      title: S3 bucket public readable
    query: |-
      SELECT
        DISTINCT(a1.*)
      FROM
        aws_s3_buckets a1,
        json_array_elements (a1.policy :: json -&amp;gt; 'Statement') a2
      WHERE
        (
          a2 -&amp;gt;&amp;gt; 'Action' = 's3:GetObject'
          OR a2 -&amp;gt;&amp;gt; 'Action' = 's3:Get*'
          OR a2 -&amp;gt;&amp;gt; 'Action' = 's3:*'
        )
        AND a2 -&amp;gt;&amp;gt; 'Effect' = 'Allow'
        AND (
          a2 -&amp;gt;&amp;gt; 'Principal' = '*'
          OR a2 -&amp;gt; 'Principal'

 -&amp;gt;&amp;gt; 'AWS' = '*'
        );
        output: "S3 bucket public readable, arn: {{.arn}}"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the Selefra module, configure your own PostgreSQL database connection address, username, and password in the &lt;code&gt;connection&lt;/code&gt; block. The &lt;code&gt;cache&lt;/code&gt; block in the &lt;code&gt;providers&lt;/code&gt; module sets the data retrieval cache time. The &lt;code&gt;rules&lt;/code&gt; module is related to the configuration for detecting issues. The &lt;code&gt;title&lt;/code&gt; block represents the title of the detection policy, and the SQL query block is used to execute the detection policy. It executes this SQL query in the database to search for resources with risks.&lt;/p&gt;

&lt;p&gt;Before starting the detection, configure your AWS credentials using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws configure

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run the following command to start Selefra:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;selefra apply

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Selefra will start the detection process. Here is an example of the result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IOrtm3nM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uj8eqhooiyeixfr6av77.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IOrtm3nM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uj8eqhooiyeixfr6av77.png" alt="Image description" width="800" height="1118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the result, we can see the at-risk buckets. Apart from the above method, Selefra also integrates a ChatGPT feature that allows you to discover risk points by directly asking Selefra.&lt;/p&gt;

&lt;h3&gt;
  
  
  Selefra GPT Feature
&lt;/h3&gt;

&lt;p&gt;Similar to the previous steps, create a new folder and copy the following YAML file into the folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;selefra:
    name: selefra-test
    connection:
      type: postgres
      username: yourusername
      password: yourpassword
      host: 127.0.0.1
      port: 5432
      database: postgres
      sslmode: disable
    log_level: info
        openai_api_key: your_openai_api_key
    openai_mode: gpt-4
    openai_limit: 10
    providers:
        - name: aws
          source: aws
          version: v0.1.0
providers:
    - name: aws
      provider: aws
      cache: 7d
rules:

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, you need to provide your OpenAI API key and choose whether to use GPT-4 or GPT-3.5 in the &lt;code&gt;openai_mode&lt;/code&gt; field. Additionally, keep the &lt;code&gt;rules&lt;/code&gt; block empty as the AI will generate it automatically.&lt;/p&gt;

&lt;p&gt;Before starting the detection, configure your AWS credentials, and then you can use the GPT feature:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;selefra gpt "Query publicly accessible S3 buckets."

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zPBOObNd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2i9mf1iplzxw9sgvisix.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zPBOObNd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2i9mf1iplzxw9sgvisix.png" alt="Image description" width="800" height="769"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As seen in the example above, with a simple sentence, you can find publicly accessible buckets. It's very convenient.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Public access to S3 buckets is a frequent and pressing issue. We hope this article has helped you understand and address the problem of public access to storage buckets in AWS S3. Selefra makes the cloud more secure.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>s3</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How Selefra Combines GPT for Multi-Cloud Security Scanning</title>
      <dc:creator>Felix</dc:creator>
      <pubDate>Fri, 30 Jun 2023 06:17:11 +0000</pubDate>
      <link>https://dev.to/bineshsamal/how-selefra-combines-gpt-for-multi-cloud-security-scanning-3m5l</link>
      <guid>https://dev.to/bineshsamal/how-selefra-combines-gpt-for-multi-cloud-security-scanning-3m5l</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Vu27JNsk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c6fzs6uga9l36gjfolxo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Vu27JNsk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c6fzs6uga9l36gjfolxo.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;When combining GPT with risk scanning, Selefra adopts an innovative approach by integrating the powerful capabilities of PolicyAsCode and GPT to enhance the efficiency and accuracy of multi-cloud security compliance detection. While PolicyAsCode has been widely used for internal team collaboration and external open-source project collaboration, as well as facilitating version tracking and audit tracing, it can present challenges due to its high learning curve and lengthy and complex code.&lt;/p&gt;

&lt;p&gt;To overcome these challenges, Selefra introduces GPT (Generative Pre-trained Transformer) technology to reduce the complexity and provide a more professional risk scanning solution. GPT is a deep learning-based natural language processing model known for its strong semantic understanding and generation capabilities. By combining GPT with PolicyAsCode, Selefra enables an intelligent security compliance analysis workflow.&lt;/p&gt;

&lt;p&gt;Within Selefra, specific GPT prompts are designed for security compliance, cost calculation, and architecture design. Users can trigger automated analysis by inputting GPT statements and select appropriate pre-defined prompts based on their inputs. This flexible mechanism ensures customized risk analysis tailored to different requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Expert Simulation
&lt;/h3&gt;

&lt;p&gt;In Selefra, we have designed dedicated GPT prompts for security compliance, cost calculation, and architecture design. By analyzing the user's input GPT statements, Selefra automatically determines which pre-defined prompt to utilize for the analysis. Let's briefly explain how GPT is used for security compliance project analysis.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resource Acquisition
&lt;/h3&gt;

&lt;p&gt;Before conducting the analysis with GPT, we still need to acquire resources through Selefra's provider, with some differences in the policy invocation process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resource Analysis
&lt;/h3&gt;

&lt;p&gt;In the regular mode, policies typically consist of user-configured SQL statements that query the acquired database to identify risky data and assess the risk level of resources. However, when utilizing GPT, Selefra first submits all the tables to GPT for analysis to determine which tables require analysis. Then, based on the results returned by GPT, Selefra organizes the corresponding table's resource content and sequentially submits it to GPT for analysis. GPT compiles the analysis results into a predefined output format, which is rendered by Selefra to present the structured output to the user.&lt;/p&gt;

&lt;p&gt;For the specific code implementation, you can refer to the following four methods in the &lt;code&gt;/pkg/modules/executors/module_query_executor.go&lt;/code&gt; file: &lt;code&gt;filterTables&lt;/code&gt;, &lt;code&gt;filterColumns&lt;/code&gt;, &lt;code&gt;getRows&lt;/code&gt;, and &lt;code&gt;getIssue&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;In summary, leveraging GPT for multi-cloud product risk scanning significantly reduces the complexity of using PolicyAsCode products and enhances the accuracy of the analysis. However, it is essential to note that the accuracy of the GPT analysis depends on the quality of its training data and models. Therefore, this approach is ideal for beginners and serves as an introductory method for risk scanning, while becoming proficient in risk scanning techniques still requires learning the specialized analysis syntax of PolicyAsCode.&lt;/p&gt;

&lt;p&gt;Thank you for reading.&lt;/p&gt;

&lt;p&gt;Selefra GitHub: &lt;a href="https://github.com/selefra/selefra"&gt;https://github.com/selefra/selefra&lt;/a&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>gpt3</category>
      <category>devops</category>
      <category>aws</category>
    </item>
    <item>
      <title>Selefra-How to Read Code to Provide for Rule Use</title>
      <dc:creator>Felix</dc:creator>
      <pubDate>Thu, 29 Jun 2023 02:30:58 +0000</pubDate>
      <link>https://dev.to/bineshsamal/selefra-how-to-read-code-to-provide-for-rule-use-40c2</link>
      <guid>https://dev.to/bineshsamal/selefra-how-to-read-code-to-provide-for-rule-use-40c2</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4ukbCabs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ardqzipi4uw8w22yaufn.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4ukbCabs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ardqzipi4uw8w22yaufn.jpeg" alt="Image description" width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Selefra Code Reading
&lt;/h2&gt;

&lt;p&gt;In the previous article, we discussed how Selefra utilizes Provider to fetch data. Now, let's delve into the details of how Selefra reads YAML code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Code Block Reading Methods
&lt;/h3&gt;

&lt;p&gt;As a Policy-as-Code tool, Selefra plays a crucial role in code reading. Simple YAML parsing is not sufficient due to the interdependencies and associations between code blocks. We need to read different sections of code separately, establish connections based on keywords, and merge them accordingly. Additionally, it's essential to perform validity checks on the code and report any errors in location and content. Therefore, we need to handle this functionality with special treatment.&lt;/p&gt;

&lt;p&gt;Let's first understand the basic methods for reading code blocks and performing validity checks during the reading process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Selefra and Provider Modules
&lt;/h3&gt;

&lt;p&gt;Selefra and Provider modules are relatively straightforward, with no complex compliance relationships. We only need to define the structure and perform checks. Here's an example code snippet showcasing the Provider module:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Insert code model here
type SelefraBlock struct {

    // Name of project
    Name string `yaml:"name,omitempty" mapstructure:"name,omitempty"`

    // selefra CloudBlock-related configuration
    CloudBlock *CloudBlock `yaml:"cloud,omitempty" mapstructure:"cloud,omitempty"`

    OpenaiApiKey string `yaml:"openai_api_key,omitempty" mapstructure:"openai_api_key,omitempty"`
    OpenaiMode   string `yaml:"openai_mode,omitempty" mapstructure:"openai_mode,omitempty"`
    OpenaiLimit  uint64 `yaml:"openai_limit,omitempty" mapstructure:"openai_limit,omitempty"`

    // The version of the cli used by the project
    CliVersion string `yaml:"cli_version,omitempty" mapstructure:"cli_version,omitempty"`

    // Global log level. This level is used when the provider does not specify a log level
    LogLevel string `yaml:"log_level,omitempty" mapstructure:"log_level,omitempty"`

    //What are the providers required for operation
    RequireProvidersBlock RequireProvidersBlock `yaml:"providers,omitempty" mapstructure:"providers,omitempty"`

    // The configuration required to connect to the database
    ConnectionBlock *ConnectionBlock `yaml:"connection,omitempty" mapstructure:"connection,omitempty"`

    *LocatableImpl `yaml:"-"`
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We have defined the structure, and for each code block, we have defined the &lt;code&gt;parseSelefraBlock&lt;/code&gt; method within the &lt;code&gt;YamlFileToModuleParser&lt;/code&gt; structure to load and validate the Selefra code blocks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func (x *YamlFileToModuleParser) parseSelefraBlock(selefraBlockKeyNode, selefraBlockValueNode *yaml.Node, diagnostics *schema.Diagnostics) *module.SelefraBlock {

    blockPath := SelefraBlockFieldName

    // Type check
    if selefraBlockValueNode.Kind != yaml.MappingNode {
        diagnostics.AddDiagnostics(x.buildNodeErrorMsgForMappingType(selefraBlockValueNode, blockPath))
        return nil
    }

    toMap, d := x.toMap(selefraBlockValueNode, blockPath)
    diagnostics.AddDiagnostics(d)
    if utils.HasError(d) {
        return nil
    }

    selefraBlock := module.NewSelefraBlock()
    for key, entry := range toMap {
        switch key {

        case SelefraBlockNameFieldName:
            selefraBlock.Name = x.parseStringValueWithDiagnosticsAndSetLocation(selefraBlock, SelefraBlockNameFieldName, entry, blockPath, diagnostics)

        // Omit some code
        default:
            diagnostics.AddDiagnostics(x.buildNodeErrorMsgForUnSupport(entry.key, entry.value, fmt.Sprintf("%s.%s", blockPath, key)))
        }
    }

    if selefraBlock.IsEmpty() {
        return nil

    }

    // Set code location
    x.setLocationKVWithDiagnostics(selefraBlock, "", blockPath, newNodeEntry(selefraBlockKeyNode, selefraBlockValueNode), diagnostics)

    return selefraBlock
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;During the parsing of each data, we use predefined validation methods. Taking the &lt;code&gt;parseStringValueWithDiagnosticsAndSetLocation&lt;/code&gt; method as an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func (x *YamlFileToModuleParser) parseStringValueWithDiagnosticsAndSetLocation(block module.Block, fieldName string, entry *nodeEntry, blockBasePath string, diagnostics *schema.Diagnostics) string {
    valueString := x.parseStringWithDiagnostics(entry.value, blockBasePath+"."+fieldName, diagnostics)

    if entry.key != nil {
        x.setLocationWithDiagnostics(block, fieldName+module.NodeLocationSelfKey, blockBasePath, entry.key, diagnostics)
    }

    x.setLocationWithDiagnostics(block, fieldName+module.NodeLocationSelfValue, blockBasePath, entry.value, diagnostics)

    return valueString
}

func (x *YamlFileToModuleParser) setLocationWithDiagnostics(block module.Block, relativeYamlSelectorPath, fullYamlSelectorPath string, node *yaml.Node, diagnostics *schema.Diagnostics) {
    location := module.BuildLocationFromYamlNode(x.yamlFilePath, fullYamlSelectorPath, node)
    err := block.SetNodeLocation(relativeYamlSelectorPath, location)
    if err != nil {
        diagnostics.AddErrorMsg("YamlFileToModuleParser error, build location for file %s %s error: %s", x.yamlFilePath, fullYamlSelectorPath, err.Error())
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this method, we validate the code value's validity and report any errors and modification suggestions to the user when it's invalid.&lt;/p&gt;

&lt;h3&gt;
  
  
  Complex Code Block: Module Block
&lt;/h3&gt;

&lt;p&gt;In the Module block, we require additional method invocations for loading. We load sub-modules based on the &lt;code&gt;uses&lt;/code&gt; field within the code block and establish associations using names and parent-child module pointers for subsequent code execution.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Load sub-modules
subModuleSlice, loadSuccess := x.loadSubModules(ctx, finalModule.ModulesBlock)
if !loadSuccess {
    return nil, false
}
finalModule.SubModules = subModuleSlice
finalModule.Source = x.options.Source
finalModule.ModuleLocalDirectory = x.options.ModuleDirectory
finalModule.DependenciesPath = x.options.DependenciesTree

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are the key operations involved in reading Selefra code. In the next article, we will explore how Selefra executes rules, queries non-compliant entries, and delivers the expected results to the user.&lt;/p&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

&lt;p&gt;Please follow our project and provide your star: &lt;a href="https://github.com/selefra/selefra"&gt;https://github.com/selefra/selefra&lt;/a&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>aws</category>
      <category>devops</category>
      <category>policyascode</category>
    </item>
    <item>
      <title>How to spot and troubleshoot AWS S3 bucket object traversal issues</title>
      <dc:creator>Felix</dc:creator>
      <pubDate>Sun, 25 Jun 2023 14:17:26 +0000</pubDate>
      <link>https://dev.to/bineshsamal/how-to-spot-and-troubleshoot-aws-s3-bucket-object-traversal-issues-265j</link>
      <guid>https://dev.to/bineshsamal/how-to-spot-and-troubleshoot-aws-s3-bucket-object-traversal-issues-265j</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yTTEQr3h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/774rga8vyk84acmcmaoc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yTTEQr3h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/774rga8vyk84acmcmaoc.jpg" alt="Image description" width="800" height="444"&gt;&lt;/a&gt;&lt;br&gt;
The object traversal issue in AWS S3 buckets is a common problem that can be caused by two main reasons: incorrect ACL (Access Control List) configurations and incorrect policy configurations. In the following sections, we will provide a detailed explanation of how to detect and prevent these misconfigurations.&lt;/p&gt;

&lt;p&gt;Introduction to Object Traversal Issue&lt;br&gt;
Let's consider a storage bucket where, upon opening it, we can see the following content:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_g1Vv-xJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w5ay7po8hkpldh6nim4q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_g1Vv-xJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w5ay7po8hkpldh6nim4q.png" alt="Image description" width="800" height="624"&gt;&lt;/a&gt;&lt;br&gt;
As we can observe, the bucket directly lists the files it contains, indicating the presence of an object traversal issue. Now, let's delve into why this issue occurs.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Incorrect ACL Configuration
When the ACL of a storage bucket is configured to provide "List" permissions to everyone, it results in an object traversal problem.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wtfWoGeE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2dzpr7znscg3e2pp8qoy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wtfWoGeE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2dzpr7znscg3e2pp8qoy.png" alt="Image description" width="800" height="659"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Incorrect Policy Configuration
In addition to ACL misconfigurations, incorrect policy configurations can also lead to the same problem. Here's an example of a policy with an erroneous configuration:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "Version": "2012-10-17",
    "Id": "test",
    "Statement": [
        {
            "Sid": "test",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:ListBucket",
            "Resource": "arn:aws:s3:::selefra-test-xxxx"
        }
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In this policy, all users are granted "s3:ListBucket" permissions for the "selefra-test-xxxx" bucket, which also leads to object traversal issues.&lt;/p&gt;

&lt;p&gt;Fixing the Object Traversal Issue&lt;br&gt;
To fix the issue caused by ACL misconfiguration, it is sufficient to uncheck the "List" option for "Everyone." For incorrect policy configurations, it is recommended to follow the principle of least privilege, granting specific permissions to designated users instead of providing access to all users.&lt;/p&gt;

&lt;p&gt;Quickly Discovering Object Traversal Issues Using Selefra&lt;br&gt;
Manually identifying these problems can be time-consuming and difficult to perform in bulk. Selefra can assist in quickly detecting these risks.&lt;/p&gt;

&lt;p&gt;Selefra Project Repository: github.com/selefra/selefra&lt;/p&gt;

&lt;p&gt;Regular Usage of Selefra&lt;br&gt;
Let's start by installing Selefra:&lt;/p&gt;

&lt;p&gt;brew tap selefra/tap&lt;br&gt;
brew install selefra/tap/selefra&lt;br&gt;
Next, create a new project folder:&lt;/p&gt;

&lt;p&gt;mkdir selefra-test&lt;br&gt;
cd selefra-test&lt;br&gt;
Copy the following YAML file into this folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;selefra:
    name: selefra-test
    connection:
      type: postgres
      username: your_username
      password: your_password
      host: 127.0.0.1
      port: 5432
      database: postgres
      sslmode: disable
    log_level: info
    providers:
        - name: aws
          source: aws
          version: v0.1.0
providers:
    - name: aws
      provider: aws
      cache: 7d
rules:
  - name: bucket_object_traversal_by_policy
    metadata:
      title: S3 bucket object traversal by policy
    query: |-
      SELECT
        DISTINCT(a1.*)
      FROM
        aws_s

3_buckets a1,
        json_array_elements(a1.policy :: json -&amp;gt; 'Statement') a2
      WHERE
      (
        a2 -&amp;gt;&amp;gt; 'Action' = 's3:ListBucket'
        OR a2 -&amp;gt;&amp;gt; 'Action' = 's3:List*'
        OR a2 -&amp;gt;&amp;gt; 'Action' = 's3:*'
      )
      AND a2 -&amp;gt;&amp;gt; 'Effect' = 'Allow'
      AND (
        a2 -&amp;gt;&amp;gt; 'Principal' = '*'
        OR a2 -&amp;gt; 'Principal' -&amp;gt;&amp;gt; 'AWS' = '*'
      )
      AND right(substring(a2 -&amp;gt;&amp;gt; 'Resource', -2), 2) &amp;lt;&amp;gt; '/*' ;
    output: "S3 bucket object traversal by policy, arn: { {.arn} }"
  - name: bucket_object_traversal_by_acl
    metadata:
      title: S3 bucket object traversal by acl
    query: |-
      SELECT
        DISTINCT(a1.*)
      FROM
        aws_s3_buckets a1,
        aws_s3_bucket_grants a2
      WHERE
       a1.selefra_id = a2.aws_s3_buckets_selefra_id
        AND a2.grantee :: jsonb -&amp;gt;&amp;gt; 'URI' = '&amp;lt;http://acs.amazonaws.com/groups/global/AllUsers&amp;gt;'
        AND a2.permission IN ('READ', 'FULL_CONTROL');
    output: "S3 bucket object traversal by acl, arn: { {.arn} }"
This configuration consists of three modules: "selefra," "providers," and "rules." Under the "selefra" module, configure your PostgreSQL database connection details in the "connection" block. The "providers" module includes the AWS provider and its cache duration. The "rules" module contains the configurations related to the detection rules. The "title" field represents the title of the detection strategy, and the "query" field contains the SQL query used to execute the detection strategy by querying the database for at-risk resources.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before starting the detection, configure your AWS credentials using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws configure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, run the following command to execute Selefra:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;selefra apply
Selefra will initiate the detection process, and you will receive results similar to the example below:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fTnyynWU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g560rp9vegtmecq6wex0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fTnyynWU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g560rp9vegtmecq6wex0.png" alt="Image description" width="800" height="1092"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the results, you can identify the at-risk storage buckets. In addition to the above method, Selefra also integrates the chatGPT feature, allowing you to discover risk points by directly querying Selefra.&lt;/p&gt;

&lt;h2&gt;
  
  
  Selefra's GPT Feature
&lt;/h2&gt;

&lt;p&gt;Similar to the previous steps, create a new folder and copy the following YAML file into it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;selefra:
    name: selefra-test
    connection:
      type: postgres
      username: yourusername
      password: yourpassword
      host: 127.0.0.1
      port: 5432
      database: postgres
      sslmode: disable
    log_level: info
        openai_api_key: your_openai_api_key
    openai_mode: gpt-4
    openai_limit: 10
    providers:
        - name: aws
          source: aws
          version: v0.1.0
providers:
    - name: aws
      provider: aws
      cache: 7d
rules:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this configuration, you need to provide your own OpenAI API key and specify whether to use GPT-4 or GPT-&lt;/p&gt;

&lt;p&gt;3.5. The "rules" block can be left empty as it will be automatically generated by AI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iQbPI8zu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kqyowxn9lpxl1gk2pujc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iQbPI8zu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kqyowxn9lpxl1gk2pujc.png" alt="Image description" width="800" height="782"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before starting the detection, configure your AWS credentials, and then you can use the GPT feature as follows:&lt;/p&gt;

&lt;p&gt;selefra gpt "Query S3 Buckets that allow list objects"&lt;br&gt;
The output will provide you with the discovered risks in your cloud environment using just a simple query.&lt;/p&gt;

&lt;p&gt;As shown above, you can easily identify risks in your cloud environment with just a single query, making it very convenient.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;Object traversal issues in S3 storage buckets are common and important to address. Through this article, I hope to help you understand and mitigate the object traversal issues in AWS S3 storage. With the help of Selefra, we can make the cloud more secure.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>devops</category>
      <category>policyascode</category>
      <category>aws</category>
    </item>
    <item>
      <title>Selefra-How Provider pulls data to Selefra</title>
      <dc:creator>Felix</dc:creator>
      <pubDate>Sun, 25 Jun 2023 04:55:35 +0000</pubDate>
      <link>https://dev.to/bineshsamal/selefra-how-provider-pulls-data-to-selefra-nd1</link>
      <guid>https://dev.to/bineshsamal/selefra-how-provider-pulls-data-to-selefra-nd1</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K6bgcXS_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v0x55gwflttwaistywxe.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K6bgcXS_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v0x55gwflttwaistywxe.jpg" alt="Image description" width="800" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduce
&lt;/h2&gt;

&lt;p&gt;In Selefra, we use providers to collect data for Policy as Code. Providers are code snippets written based on the official API documentation provided by cloud services or Software as a Service (SaaS) providers. When using Selefra, users write provider code that is executed to send requests to the cloud and retrieve data. The returned data is then stored in PostgreSQL databases in the predefined format.&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS Provider Get Resource
&lt;/h2&gt;

&lt;p&gt;Taking AWS resources as an example, users can choose specific AWS services for data collection. Here's an example of using the AWS SDK ("github.com/aws/aws-sdk-go-v2/aws/service/s3") for data collection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func (x *TableAwsS3BucketsGenerator) GetDataSource() *schema.DataSource {
    return &amp;amp;schema.DataSource{
        Pull: func(ctx context.Context, clientMeta *schema.ClientMeta, client any, task *schema.DataSourcePullTask, resultChannel chan&amp;lt;- any) *schema.Diagnostics {

            diagnostics := schema.NewDiagnostics()

            cl := client.(*aws_client.Client)
            svc := cl.AwsServices().S3
            response, err := svc.ListBuckets(ctx, nil, func(options *s3.Options) {
                options.Region = listBucketRegion(cl)
            })
            if err != nil {
                return schema.NewDiagnosticsErrorPullTable(task.Table, err)
            }

            var wg sync.WaitGroup
            buckets := make(chan types.Bucket)
            errs := make(chan error)
            for i := 0; i &amp;lt; fetchS3BucketsPoolSize; i++ {
                wg.Add(1)
                go fetchS3BucketsWorker(ctx, client, buckets, errs, resultChannel, &amp;amp;wg)
            }
            go func() {
                defer close(buckets)
                for _, bucket := range response.Buckets {
                    select {
                    case &amp;lt;-ctx.Done():
                        return
                    case buckets &amp;lt;- bucket:
                    }
                }
            }()
            done := make(chan struct{})

            go func() {
                for err = range errs {
                    diagnostics.AddErrorPullTable(task.Table, err)
                }
                close(done)
            }()
            wg.Wait()
            close(errs)
            &amp;lt;-done

            return diagnostics
        },
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we use the AWS S3 SDK to retrieve the list of AWS S3 buckets. We leverage the ListBuckets method and use goroutines to concurrently fetch detailed information for each bucket. The obtained information is then stored in our predefined data structure. The function returns a pointer to the schema.DataSource type, which contains the method for retrieving the bucket list.&lt;/p&gt;

&lt;p&gt;AWS Provider creates a local data storage structure&lt;br&gt;
Of course, you need to have some understanding of the API for the data you want to collect. You need to define the table structure where you want to store your data in advance.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func GenTables() []*schema.Table {
    return []*schema.Table{
        table_schema_generator.GenTableSchema(&amp;amp;amp.TableAwsAmpWorkspacesGenerator{}),
        table_schema_generator.GenTableSchema(&amp;amp;eks.TableAwsEksClustersGenerator{}),
        // Omitted 430 lines of code
        table_schema_generator.GenTableSchema(&amp;amp;kinesis.TableAwsKinesisStreamsGenerator{}),
        table_schema_generator.GenTableSchema(&amp;amp;cloudfront.TableAwsCloudfrontCachePoliciesGenerator{})
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The table structure could be quite large, but we can use GPT to handle it. On top of that, we only need to do some manual auditing.&lt;/p&gt;

&lt;p&gt;You can write provider code according to your needs to retrieve data for other AWS resources, such as S3 buckets, RDS databases, Lambda functions, etc. Refer to the AWS official API documentation to understand the API methods and parameters for each service and write the provider code accordingly.&lt;/p&gt;

&lt;p&gt;By using provider code, Selefra sends requests to AWS services and&lt;/p&gt;

&lt;p&gt;retrieves the required data. This data is then stored in the PostgreSQL database in the predefined format for subsequent policy analysis and decision support.&lt;/p&gt;

&lt;p&gt;Please note that the provided example code is for demonstration purposes only, and the actual provider code may vary depending on the AWS service and API used. We recommend referring to the AWS official documentation for writing provider code specific to the desired service.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This is a detailed explanation of how data is retrieved from cloud resources using providers in Policy as Code products like Selefra. There are many details involved, such as retry mechanisms and error handling, which are specific to the business logic and can be addressed accordingly. You can also visit our official repository to view the open-source provider code. If you would like to stay updated with our team and experience our open-source product Selefra:&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/selefra/selefra"&gt;https://github.com/selefra/selefra&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Slack: &lt;a href="https://selefra.io/community/join"&gt;https://selefra.io/community/join&lt;/a&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>devops</category>
      <category>policyascode</category>
      <category>aws</category>
    </item>
    <item>
      <title>Selefra Release Note v0.2.2</title>
      <dc:creator>Felix</dc:creator>
      <pubDate>Tue, 20 Jun 2023 02:47:46 +0000</pubDate>
      <link>https://dev.to/bineshsamal/selefra-release-note-v022-7ni</link>
      <guid>https://dev.to/bineshsamal/selefra-release-note-v022-7ni</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5_hkG21q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m7iw7oo9jn6mg3f8t2b3.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5_hkG21q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m7iw7oo9jn6mg3f8t2b3.jpeg" alt="Image description" width="800" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Date: June 11, 2023&lt;/p&gt;

&lt;p&gt;We are excited to announce the release of Selefra v0.2.2, an open-source Policy-as-Code (PaC) product. This version introduces several bug fixes and enhancements to improve your experience with Selefra.&lt;/p&gt;

&lt;p&gt;Here are some key updates:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Added the "--dit" option to define the result output directory.&lt;/li&gt;
&lt;li&gt;Addressed bug &lt;a href="https://github.com/selefra/selefra"&gt;#19&lt;/a&gt;, where Selefra GPT returned a "mode not found" error.&lt;/li&gt;
&lt;li&gt;Remediation in rules now supports plain text input and is no longer enforced to be a file path.&lt;/li&gt;
&lt;li&gt;Adjusted output colors for improved readability.&lt;/li&gt;
&lt;li&gt;Where Selefra GPT functionality informed users of a syntax error.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We appreciate your feedback and contributions to the Selefra community. Your input in identifying and resolving these issues is invaluable. If you encounter any further bugs or have suggestions for future updates, please do not hesitate to reach out to us.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Qd6qfaEE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://superblog.supercdn.cloud/site_cuid_cldhcpt7a1506291jkdhe6vl2sc/images/untitled-4-1687228115873-compressed.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qd6qfaEE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://superblog.supercdn.cloud/site_cuid_cldhcpt7a1506291jkdhe6vl2sc/images/untitled-4-1687228115873-compressed.png" alt="Image description" width="800" height="221"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To get started with Selefra v0.2.2, please visit our official repository (Github: &lt;a href="https://github.com/selefra/selefra"&gt;https://github.com/selefra/selefra&lt;/a&gt;) and follow the installation instructions. Remember to update your current version to benefit from the latest enhancements.&lt;/p&gt;

&lt;p&gt;Thanks for your continued support, and we hope you find Selefra v0.2.2 to be a valuable PaC implementing tool in your projects.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;

&lt;p&gt;The Selefra Team&lt;/p&gt;

&lt;p&gt;Github:&lt;a href="https://github.com/selefra/selefra"&gt;https://github.com/selefra/selefra&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>opensource</category>
      <category>devops</category>
      <category>aws</category>
    </item>
    <item>
      <title>How does policy as code work</title>
      <dc:creator>Felix</dc:creator>
      <pubDate>Thu, 15 Jun 2023 04:48:05 +0000</pubDate>
      <link>https://dev.to/bineshsamal/how-does-policy-as-code-work-304d</link>
      <guid>https://dev.to/bineshsamal/how-does-policy-as-code-work-304d</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mYMtf0sd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rrwb0uqkt3qnsl68a5fr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mYMtf0sd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rrwb0uqkt3qnsl68a5fr.png" alt="Image description" width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Policy as Code?
&lt;/h2&gt;

&lt;p&gt;Policy as Code is a method of writing security and compliance policies as executable code. These policies can be used alongside an organization's applications and infrastructure to ensure they meet security and compliance requirements.&lt;/p&gt;

&lt;p&gt;Compared to traditional security and compliance approaches, Policy as Code offers a more efficient and precise way of enforcement. It also enables organizations to automate security and compliance policies within their development and deployment processes, improving efficiency and reducing operational risks.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does Policy as Code work?
&lt;/h2&gt;

&lt;p&gt;Policy as Code relies on three key components:&lt;/p&gt;

&lt;h3&gt;
  
  
  Data
&lt;/h3&gt;

&lt;p&gt;To analyze existing cloud, SaaS, or infrastructure environments, it's necessary to obtain the underlying data. In the context of Policy as Code tools, data is typically fetched using providers. In the case of Selefra, providers are used to retrieve data from various cloud service providers. During the initial stage of running Selefra, open-source (or user-defined) providers are used to fetch and store the cloud resources' data in a designated PostgreSQL database. This data serves as the basis for policy writing and analysis in subsequent steps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Policies
&lt;/h3&gt;

&lt;p&gt;Policies are written as code that simulates decision-making behavior. These rules describe security, compliance, or best practice requirements. Policies can be based on industry standards (such as CIS Benchmarks) or internal organizational policies. They can be expressed using natural language, domain-specific languages (DSLs), or code. In Selefra, policies are defined in a YAML format with placeholders and SQL statements.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
rules:
  - name: bucket_acl_publicly_writeable
    query: |-
      SELECT
        DISTINCT(a1.*)
      FROM
        aws_s3_buckets a1,
        aws_s3_bucket_grants a2
      WHERE
       a1.selefra_id = a2.aws_s3_buckets_selefra_id
        AND a2.grantee :: jsonb -&amp;gt;&amp;gt; 'URI' = '&amp;lt;http://acs.amazonaws.com/groups/global/AllUsers&amp;gt;'
        AND a2.permission IN ('WRITE_ACP', 'FULL_CONTROL');
    output: "S3 bucket ACL publicly writable, ARN: { {.arn} }"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, Selefra retrieves the AWS data based on the user's configuration and stores it in a specified format. Then, it applies the defined rules to identify non-compliant items.&lt;/p&gt;

&lt;h2&gt;
  
  
  Execution
&lt;/h2&gt;

&lt;p&gt;Once the data and policies are in place, a tool is needed to execute the policies and query for potential security risks or compliance violations. In the case of Selefra, the policies are interpreted as executable code. The query section of the policy is executed, and the results are formatted and outputted using the output section. Users can view the identified issues with their cloud resources in the console.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;That concludes a brief explanation of how a Policy-as-Code product works. Each step of implementation requires significant code design. In our upcoming articles, our team will provide detailed explanations of the architecture design and code implementation for each step. If you're interested in following our team and experiencing our open-source product, Selefra, please visit:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub: &lt;a href="https://github.com/selefra/selefra"&gt;https://github.com/selefra/selefra&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Slack: &lt;a href="https://selefra.io/community/join"&gt;https://selefra.io/community/join&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thank you very much for reading!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>opensource</category>
      <category>policyascode</category>
    </item>
    <item>
      <title>Policy-as-Code: Enhancing Security and Compliance in a New Trend</title>
      <dc:creator>Felix</dc:creator>
      <pubDate>Mon, 12 Jun 2023 06:45:05 +0000</pubDate>
      <link>https://dev.to/bineshsamal/policy-as-code-enhancing-security-and-compliance-in-a-new-trend-3fn0</link>
      <guid>https://dev.to/bineshsamal/policy-as-code-enhancing-security-and-compliance-in-a-new-trend-3fn0</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7aiScKIj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://superblog.supercdn.cloud/site_cuid_cldhcpt7a1506291jkdhe6vl2sc/images/untitled-1686542214405-compressed.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7aiScKIj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://superblog.supercdn.cloud/site_cuid_cldhcpt7a1506291jkdhe6vl2sc/images/untitled-1686542214405-compressed.png" alt="Banner" width="800" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction:
&lt;/h2&gt;

&lt;p&gt;In the ever-evolving landscape of cybersecurity and regulatory compliance, organizations are constantly seeking innovative approaches to bolster their security posture and ensure adherence to industry regulations. One such emerging trend is the implementation of Policy-as-Code, a powerful methodology that combines policy enforcement with the flexibility and scalability of code. By embracing Policy-as-Code, organizations can enhance their security and compliance measures while adapting to the dynamic nature of the modern digital environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Here are two scenarios in below:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Scenario 1 - PolicyAsCode：
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rules:
  - name: bucket_acl_publicly_readable
    query: |-
      SELECT
        DISTINCT(a1.*)
      FROM
        aws_s3_buckets a1,
        aws_s3_bucket_grants a2
      WHERE
        a1.selefra_id = a2.aws_s3_buckets_selefra_id
        AND a2.grantee :: jsonb -&amp;gt;&amp;gt; 'URI' = '&amp;lt;http://acs.amazonaws.com/groups/global/AllUsers&amp;gt;'
        AND a2.permission IN ('READ_ACP', 'FULL_CONTROL');
    output: "S3 bucket acl public readable, arn: { {.arn} }"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the assistance of the PolicyAsCode tool and its provided basic configuration documentation, we can define the query criteria we need. The PolicyAsCode tool will automatically retrieve the resources and conduct an analysis, enabling us to quickly identify any problematic cloud assets and receive recommendations for remediation.​&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scenario 2 - Traditional Approach
In the traditional approach, addressing the same issue would involve manually inspecting the S3 configurations across multiple cloud assets in AWS. This process would require logging into different AWS accounts and performing repetitive manual tasks, making it cumbersome and time-consuming.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Enhancing Security:
&lt;/h2&gt;

&lt;p&gt;Policy-as-Code serves as a robust framework for enforcing security policies throughout an organization's software systems. By translating policies into executable code, it enables automated enforcement, reducing the risk of human error and ensuring consistent application of security measures. With Policy-as-Code, organizations can define and enforce access controls, authentication mechanisms, encryption standards, and other security policies across their entire infrastructure, providing a comprehensive and proactive security approach.&lt;/p&gt;

&lt;h2&gt;
  
  
  Streamlining Compliance:
&lt;/h2&gt;

&lt;p&gt;Compliance with industry regulations and standards is a critical aspect of business operations. Policy-as-Code simplifies the compliance process by codifying regulatory requirements into executable policies. This ensures that compliance checks are automated and consistently applied, reducing the burden of manual audits and minimizing the risk of non-compliance. With Policy-as-Code, organizations can easily track and demonstrate compliance with regulations such as GDPR, HIPAA, PCI-DSS, and others. This facilitates smoother audits, mitigates penalties, and ensures a robust compliance framework.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0-7ADni3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3m1qg16jju0xnts5s6lk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0-7ADni3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3m1qg16jju0xnts5s6lk.png" alt="Image description" width="800" height="558"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Agility and Scalability:
&lt;/h2&gt;

&lt;p&gt;In today's fast-paced digital landscape, organizations need agile and scalable solutions to keep up with evolving threats and changing compliance requirements. Policy-as-Code offers the flexibility to adapt policies quickly and efficiently. Code-based policies can be version controlled, tested, and easily modified, allowing organizations to respond rapidly to emerging security risks and compliance updates. This agility and scalability enable organizations to maintain robust security and compliance measures in dynamic environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Collaboration and Transparency:
&lt;/h2&gt;

&lt;p&gt;Policy-as-Code fosters collaboration among teams responsible for security and compliance. By representing policies as code, it promotes transparency and enables collaborative development and review processes. Different stakeholders can contribute to policy development, ensuring a collective understanding and ownership of security and compliance requirements. This collaborative approach facilitates knowledge sharing, promotes best practices, and empowers teams to continuously improve security and compliance measures.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;As security threats and regulatory complexities continue to evolve, organizations must adopt innovative approaches to strengthen their security and compliance posture. Policy-as-Code emerges as a powerful tool, enabling automated policy enforcement, streamlining compliance processes, and providing agility in an ever-changing landscape. By embracing Policy-as-Code, organizations can enhance their security measures, ensure regulatory compliance, and stay ahead in the face of emerging security challenges. The future of security and compliance lies in the fusion of policy enforcement and code, making Policy-as-Code an essential component of any modern organization's security strategy.&lt;/p&gt;

&lt;p&gt;Thanks for your reading!&lt;/p&gt;

&lt;p&gt;Selefra: &lt;a href="https://github.com/selefra/selefra"&gt;https://github.com/selefra/selefra&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>policyascode</category>
      <category>developer</category>
    </item>
    <item>
      <title>SelefraTeam - Revolutionizing Security and Resource Management with PolicyAsCode</title>
      <dc:creator>Felix</dc:creator>
      <pubDate>Fri, 02 Jun 2023 03:41:26 +0000</pubDate>
      <link>https://dev.to/bineshsamal/selefrateam-revolutionizing-security-and-resource-management-with-policyascode-466n</link>
      <guid>https://dev.to/bineshsamal/selefrateam-revolutionizing-security-and-resource-management-with-policyascode-466n</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2fTiP4gA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e164tq534etnfo3iduke.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2fTiP4gA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e164tq534etnfo3iduke.png" alt="Banner" width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
SelefraTeam is a dynamic team of dedicated professionals driven by a shared passion for innovation and excellence. We specialize in developing cutting-edge solutions to address the ever-evolving challenges of security and resource management in the complex landscape of cloud services and Software-as-a-Service (SaaS).&lt;/p&gt;

&lt;p&gt;At the heart of our offerings lies PolicyAsCode, a groundbreaking tool that seamlessly integrates security and flexibility. Powered by the efficient and robust Go programming language, our open-source project on GitHub (&lt;a href="https://github.com/selefra/selefra"&gt;https://github.com/selefra/selefra&lt;/a&gt;) fosters a vibrant and inclusive community, encouraging active participation and collaboration.&lt;/p&gt;

&lt;p&gt;Transparency, trustworthiness, and collaboration are the cornerstones of our philosophy. We take pride in hosting over 30 providers, offering users a diverse range of options. We also foster an environment where users are empowered to develop and contribute their own providers, enriching the open-source ecosystem for the benefit of all.&lt;/p&gt;

&lt;p&gt;What sets our PolicyAsCode tool apart is its ability to express rules in a concise and clear YAML format, enabling their seamless application across different cloud services. Whether it's performing security checks, optimizing cost configurations, or conducting architectural reviews, our tool provides robust and flexible functionalities to meet the ever-changing demands of users.&lt;/p&gt;

&lt;p&gt;However, our vision extends beyond delivering a simple solution. We strive to empower each user, enabling them to independently craft policies that align with their unique cloud service requirements. In addition to utilizing our comprehensive library of open-source policies for detection and review, users have the freedom to customize policies to suit their specific needs, ensuring personalized security management and resource optimization.&lt;/p&gt;

&lt;p&gt;As SelefraTeam, we are committed to fostering collaboration and actively listening to our users. By understanding their needs and continuously iterating and improving our tool's performance and features, we aim to deliver exceptional products and services. Through strong partnerships with our users and the wider open-source community, we believe in collective success and aim to redefine the landscape of cloud services and SaaS security.&lt;/p&gt;

&lt;p&gt;When you choose SelefraTeam, you choose industry-leading expertise, unwavering professionalism, and a commitment to delivering secure, efficient, and flexible solutions. Whether you are a large-scale organization or an individual developer, we are here to be your trusted partner in navigating the realms of cloud services and SaaS security in the digital era. Join us on this exciting journey as we shape the future of security and resource management with PolicyAsCode.&lt;/p&gt;

&lt;p&gt;GitHub:&lt;a href="https://github.com/selefra/selefra"&gt;https://github.com/selefra/selefra&lt;/a&gt;&lt;/p&gt;

</description>
      <category>policyascode</category>
      <category>devops</category>
      <category>gpt3</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
