Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user table name update #91

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hawkscripts/active/fuzzer.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fun alert(activeScanner: ScriptsActiveScanner, msg: HttpMessage, evidence: Strin
val solution = "Handle bad input and never throw a 5xx error"
val reference = ""
val otherInfo = "fuzzed param: $param=$fuzzedParam"
val pluginId = 10_00_063; //Custom Plugin ID
val pluginId = 1000000; //Custom Plugin ID

activeScanner.newAlert()
.setPluginId(pluginId)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hawk/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public CommandLineRunner commandLineRunner(ApplicationContext ctx, ItemRepo repo
});


System.out.println(String.format("Items in DB %d", userRepo.count()));
System.out.println(String.format("Users in DB %d", userRepo.count()));
userRepo.findAll().forEach(item -> System.out.println(String.format("user: %s", item.getName())));
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/hawk/entity/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
import java.io.Serializable;

@Entity
@Table(name = "user", schema = "public")
@Table(name = "usertb", schema = "public")
@FilterDef(name = "tenantFilter", parameters = {@ParamDef(name = "tenantId", type = "string")})
@Filter(name = "tenantFilter", condition = "tenant_id = :tenantId")
public class User implements TenantSupport, Serializable {
private static final long serialVersionUID = -6986746375915710855L;
@Id
@GeneratedValue(strategy= GenerationType.AUTO)
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
private String name;
private String description;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hawk/service/UserSearchService.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public List<User> search(Search search) {
return session.doReturningWork(connection -> {
List<User> users1 = new ArrayList<>();
// The wrong way
String query = "select id, name, description, tenant_id from public.user where name like '%" +
String query = "select id, name, description, tenant_id from public.usertb where name like '%" +
search.getSearchText() + "%'";

LOGGER.log(Level.INFO, "SQL Query {0}", query);
Expand Down
8 changes: 4 additions & 4 deletions stackhawk.d/stackhawk-fuzzer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ app:
urlQuery: true
urlQueryParam: true
# httpHeaders: true
hawk:
scan:
policyName: CUSTOM_SCRIPTS
#hawk:
# scan:
# policyName: CUSTOM_SCRIPTS

hawkAddOn:
scripts:
- name: fuzzer.kts
type: active
path: hawkscripts
id: 1000063 # Replace with your own registered plugin ID
id: 1000000 # Replace with your own registered plugin ID
language: KOTLIN
vars:
- name: iterations
Expand Down
Loading