View GCSBucketPolicyChecker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String bucketName = "company-block-log-fce65e82-a0cd-4f71-8693-381100d93c18"; | |
Policy p = Cache.GCSStorage.getIamPolicy(bucketName); | |
System.out.println(p); | |
List<Role> roleList = new ArrayList<>(); | |
List<Set<Identity>> identities = new ArrayList<>(); | |
// Print Roles and its identities | |
Set<Identity> wrongIdentities = new HashSet<Identity>(); | |
Role roler = null; | |
Map<Role, Set<Identity>> policyBindings = p.getBindings(); |
View ReportCollector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ReportCollector { | |
public static void main(String[] args) throws JsonParseException, JsonMappingException, IOException { | |
// ArrayList | |
Layers layers = new Layers(); | |
Layer layer = new Layer(); | |
// List<Layers> de.security.reports.ScanReport.getLayers() | |
File reportFile = new File("reports/json/analysis-postgres-latest.json"); |
View gist:ec5c32da58a3648f2dc4f84411787c13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.security.reports; | |
import java.io.Serializable; | |
import java.util.List; | |
import com.fasterxml.jackson.annotation.JsonInclude; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | |
@JsonInclude(JsonInclude.Include.NON_NULL) | |
@JsonPropertyOrder({ |