Skip to content

Commit

Permalink
chore: added image
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Jones <[email protected]>
  • Loading branch information
AlexsJones committed Oct 28, 2023
1 parent 3cd4ff1 commit 67f26f2
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 8 deletions.
Binary file added .DS_Store
Binary file not shown.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./images/logo-light.png" width="300px;">
<img alt="Text changing depending on mode. Light: 'So light!' Dark: 'So dark!'" src="./images/logo-dark.png" width="300px;">
</picture>
<br/>

# Isotope

Isotope scans AWS services and makes suggestions on how to improve them using Artificial Intelligence.
Expand Down
Binary file removed images/ferrus.png
Binary file not shown.
Binary file added images/logo-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/logo-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/analyzer/analyzer_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ use async_trait::async_trait;
#[async_trait]
pub trait Analyzer: Sync + Send {
async fn run(&self) -> Option<Vec<AnalysisResults>>;
fn get_name(&self) -> &str;
fn get_name(&self) -> String;
}
11 changes: 7 additions & 4 deletions src/analyzer/s3_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ impl analyzer_trait::Analyzer for S3Analyzer {
);
let mut results = vec![AnalysisResults {
message: "".to_string(),
analyzer_name: self.get_name().
}];

let s3 = aws_sdk_s3::Client::new(&self.config);
Expand All @@ -87,7 +88,8 @@ impl analyzer_trait::Analyzer for S3Analyzer {
== Some("http://acs.amazonaws.com/groups/global/AllUsers".to_string())
{
results.push(AnalysisResults{
message: format!("Publicly accessible S3 bucket {}", &bucket_name)
message: format!("Publicly accessible S3 bucket {}", &bucket_name),
analyzer_name: self.get_name()
});
}
}
Expand All @@ -105,7 +107,8 @@ impl analyzer_trait::Analyzer for S3Analyzer {
for s in data.statement {
if s.principal == "*" {
results.push(AnalysisResults{
message: format!("Publicly accessible S3 bucket {}", &bucket_name)
message: format!("Publicly accessible S3 bucket {}", &bucket_name),
analyzer_name: self.get_name()
});
}
}
Expand All @@ -121,7 +124,7 @@ impl analyzer_trait::Analyzer for S3Analyzer {
Some(results)
}

fn get_name(&self) -> &str {
"s3"
fn get_name(&self) -> String {
"s3".to_string()
}
}
8 changes: 5 additions & 3 deletions src/analyzer/sts_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ impl analyzer_trait::Analyzer for STSAnalyzer {

let mut results = vec![AnalysisResults {
message: "".to_string(),
analyzer_name: "".to_string()
}];
let iam = aws_sdk_iam::Client::new(&self.config.clone());
let list_users_response = iam.list_users().send().await;
Expand All @@ -33,15 +34,16 @@ impl analyzer_trait::Analyzer for STSAnalyzer {

if mfa_devices.is_empty() {
results.push(AnalysisResults{
message: format!("MFA is not enabled for user {}", username)
message: format!("MFA is not enabled for user {}", username),
analyzer_name: self.get_name()
});
}
}

Some(results)
}

fn get_name(&self) -> &str {
"sts"
fn get_name(&self) -> String {
"sts".to_string()
}
}
2 changes: 2 additions & 0 deletions src/analyzer/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AnalysisResults {
pub message: String,
pub analyzer_name: String
}

impl AnalysisResults {
pub fn new() -> AnalysisResults {
Self {
message: "".to_string(),
analyzer_name: "".to_string(),
}
}
}

0 comments on commit 67f26f2

Please sign in to comment.